.device-view-toggle{white-space:nowrap;min-height:44px}
.phone-board-picker,.phone-tools-toggle{display:none}
.mobile-view{--phone-gap:14px}
.mobile-view body{overscroll-behavior:none}
.mobile-view .shell{height:100dvh;grid-template-columns:minmax(0,1fr);grid-template-rows:calc(56px + env(safe-area-inset-top)) 62px minmax(0,1fr)}
.mobile-view .topbar{padding:env(safe-area-inset-top) 14px 0;gap:8px;background:var(--bg)}
.mobile-view .brand span{display:none}
.mobile-view .topbar .btn{min-height:44px}
.mobile-view .side{display:block;padding:8px 14px;border:0;border-bottom:1px solid var(--border-soft);background:var(--bg);overflow:hidden}
.mobile-view .side>*:not(.phone-board-picker){display:none}
.mobile-view .phone-board-picker{display:flex;align-items:center;gap:12px;width:100%;height:44px}
.mobile-view .phone-board-picker span{color:var(--text-dim);font-size:12px}
.mobile-view .phone-board-picker select{flex:1;min-width:0;height:44px;padding:0 12px;font-size:16px;font-weight:600;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text-strong)}
.mobile-view .main{overflow:hidden}
.mobile-view .bhead{padding:12px 14px 0;background:var(--bg)}
.mobile-view .btitle{gap:4px}
.mobile-view .btitle h1{font-size:18px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.mobile-view .btitle>.spacer{display:none}
.mobile-view .btitle>a{display:none}
.mobile-view .btitle>button{min-width:44px;min-height:44px}
.mobile-view .tabs{margin-top:4px;overflow-x:auto;scrollbar-width:none}
.mobile-view .tab{flex:none;min-height:44px;padding:0 12px;font-size:14px}
.mobile-view .toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px 0}
.mobile-view .toolbar>.btn:not(.primary):not(.phone-tools-toggle){display:none}
.mobile-view .toolbar>.primary{grid-column:2;grid-row:1;min-height:44px;padding:0 12px}
.mobile-view .toolbar>.search{grid-column:1;grid-row:1;width:100%;min-width:0;height:44px;border:1px solid var(--border);background:var(--surface);border-radius:10px}
.mobile-view .search input,.mobile-view .search:focus-within input,.mobile-view .search.has input{width:100%;min-width:0;font-size:16px}
.mobile-view .phone-tools-toggle{display:inline-flex;justify-content:center;grid-column:2;min-height:36px;border:1px solid var(--border-soft);border-radius:8px}
.mobile-view .toolbar.phone-tools-open>.btn:not(.primary){display:inline-flex;min-height:44px}
.mobile-view .count-note{grid-row:2;grid-column:1;font-size:12px;margin:0;align-self:center}
.mobile-view .grid{padding:14px!important;overflow-x:hidden}
.mobile-view .scroll{margin-left:0;padding:0 14px calc(24px + env(safe-area-inset-bottom));overflow-x:hidden;scroll-padding-top:10px}
.mobile-view .group{width:100%!important;min-width:0!important;margin-bottom:22px}
.mobile-view .ghead{width:100%;height:48px;gap:2px}
.mobile-view .ghead .chev{width:36px;height:44px;flex:none}
.mobile-view .gtitle{font-size:15px;font-weight:600;padding:0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mobile-view .gcount{margin-left:auto;font-size:12px;white-space:nowrap;flex:none}
.mobile-view .gmenu{display:none}
.mobile-view .row.hrow,.mobile-view .row.foot{display:none}
.mobile-view .row.item{display:flex;flex-direction:column;height:auto;margin:0 0 12px;border:1px solid var(--border);border-radius:14px;overflow:hidden;background:var(--surface)}
.mobile-view .row.item .left{position:static;width:100%;min-height:82px;z-index:auto}
.mobile-view .row.item .bar{width:4px}
.mobile-view .row.item .chk{width:34px;border:0;background:var(--surface)}
.mobile-view .row.item .chk input{width:18px;height:18px}
.mobile-view .row.item .name{height:auto;min-height:82px;white-space:normal;padding:12px 8px 12px 0;border:0;gap:4px}
.mobile-view .row.item .name .txt{white-space:normal;overflow:visible;flex:1;font-size:15px;line-height:1.45;color:var(--text-strong);border:0;cursor:pointer}
.mobile-view .row.item .name .open{display:inline-flex;width:48px;min-height:44px;margin:0;padding:0 4px;justify-content:center;color:var(--link);font-size:12px}
.mobile-view .row.item .grip,.mobile-view .row.item .bubble{display:none}
.mobile-view .row.item>.cell{display:none}
.mobile-view .row.item>.cell.t-status{display:flex;order:1;width:100%!important;height:auto;min-height:44px;border:0;font-size:14px}
.mobile-view .row.item>.cell[data-phone-field="true"]{display:flex;order:2;width:100%!important;height:auto;min-height:48px;justify-content:space-between;gap:12px;padding:12px 14px;border:0;border-top:1px solid var(--border-soft);font-size:14px;white-space:normal}
.mobile-view .row.item>.cell[data-phone-field="true"]:before{content:attr(data-field-label);color:var(--text-dim);font-size:12px;flex:none}
.mobile-view .row.item>.cell[data-phone-field="true"] .clip{white-space:normal;text-align:right;line-height:1.4}
.mobile-view .row.item>.cell.t-status[data-field-label]:not([data-field-label="Status"]):before{content:attr(data-field-label) ': ';margin-right:6px;font-size:12px}
.mobile-view .row.add{height:48px}
.mobile-view .row.add .left{width:100%}
.mobile-view .row.add .cell{height:48px;border-radius:8px}
.mobile-view .row.add input{font-size:16px}
.mobile-view .row.add>.cell{display:none}
.mobile-view .cbox{width:100%;height:54px;overflow:hidden;border-radius:10px}
.mobile-view .cbox .left{width:100%;height:54px}
.mobile-view .cbox .ccell{display:none}
.mobile-view .panel{width:100vw;height:100dvh;border:0}
.mobile-view .panel header{padding:calc(12px + env(safe-area-inset-top)) 14px 0}
.mobile-view .panel header .top{gap:8px}
.mobile-view .panel header button{min-height:44px;min-width:44px}
.mobile-view .panel h2{font-size:18px;line-height:1.4;padding:4px 0}
.mobile-view .panel .body{padding:16px 14px calc(30px + env(safe-area-inset-bottom));overscroll-behavior:contain}
.mobile-view .detail{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;overflow:visible}
.mobile-view .detail label{margin-top:12px;font-size:13px;font-weight:500;white-space:normal}
.mobile-view .detail .cell{min-height:48px;height:auto;padding:12px;border-radius:8px;white-space:normal;justify-content:flex-start}
.mobile-view .detail .cell .clip{white-space:normal;word-break:break-word}
.mobile-view input,.mobile-view textarea,.mobile-view select{font-size:16px}
.mobile-view .pop{max-width:calc(100vw - 24px);max-height:70dvh;overflow:auto}
.mobile-view .mi{min-height:44px}
.mobile-view .dash{padding:16px 14px 40px}
.mobile-view .dgrid{grid-template-columns:minmax(0,1fr)}
.mobile-view .w.s2,.mobile-view .w.s1{grid-column:span 1}
.mobile-view .process-view{padding:12px 14px;overflow-x:hidden}
.mobile-view .process-card summary{padding:16px}
.mobile-view .bulk{max-width:calc(100vw - 24px);flex-wrap:wrap}
@media(prefers-reduced-motion:reduce){.mobile-view *{scroll-behavior:auto!important;transition:none!important}}
.mobile-view .status-fill{min-height:44px;height:auto}
.mobile-view .detail .t-status{padding:0;overflow:hidden}
.mobile-view .detail .t-status .status-fill{min-height:48px}
.mobile-view .process-stages{max-width:100%;overflow-x:auto}
@media(max-height:500px){
 .mobile-view .shell{grid-template-rows:48px 52px minmax(0,1fr)}
 .mobile-view .topbar{padding-top:0}
 .mobile-view .side{padding-top:4px;padding-bottom:4px}
 .mobile-view .bhead{padding-top:0}
 .mobile-view .toolbar{padding:6px 0;grid-template-columns:minmax(0,1fr) auto auto}
 .mobile-view .toolbar>.primary{grid-column:2}
 .mobile-view .phone-tools-toggle{grid-column:3;grid-row:1;min-height:44px}
 .mobile-view .count-note:empty{display:none}
}
.mobile-view .group.closed .ghead{display:flex;flex:1;height:54px;padding:0 8px 0 0;gap:2px;min-width:0}
.mobile-view .group.closed .gcount{grid-column:auto;margin-left:auto}
.mobile-view .row.item>.cell.t-status:not([data-field-label="Status"]){display:none}
.mobile-view .panel .body article{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.mobile-view .panel .body textarea{min-height:48px}
.mobile-view .dgrid>.s2{grid-column:span 1!important;min-width:0}
.mobile-view .dgrid>div.s2{grid-template-columns:minmax(0,1fr)!important}
.mobile-view .dash .toolbar{display:flex;justify-content:space-between}
.mobile-view .dash .w h3{padding:14px;font-size:13px}
.mobile-view .dash .w .wb{padding:14px}
.mobile-view .dash .bars{gap:8px}
.mobile-view .dash .barlabels{gap:8px}

/* Phone review: compact navigation/cards, readable filenames and touch actions. */
.mobile-view .shell{grid-template-rows:calc(48px + env(safe-area-inset-top)) 54px minmax(0,1fr)}
.mobile-view .side{padding:5px 14px}
.mobile-view .bhead{padding-top:8px}
.mobile-view .tabs{margin-top:0}
.mobile-view .toolbar{padding:8px 0}
.mobile-view .row.item{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.mobile-view .row.item .left{grid-column:1/-1;min-height:64px}
.mobile-view .row.item .name{min-height:64px;padding-top:8px;padding-bottom:8px}
.mobile-view .row.item>.cell.t-status{grid-column:1/-1}
.mobile-view .row.item>.cell[data-phone-field="true"]{min-width:0;min-height:48px;flex-wrap:wrap;gap:4px 8px;padding:10px 12px}
.mobile-view .row.item>.cell[data-phone-field="true"] .clip{min-width:0;overflow-wrap:anywhere}
.mobile-view .panel .frow{display:grid;grid-template-columns:28px minmax(0,1fr) 44px 44px;gap:8px;padding:10px}
.mobile-view .panel .frow .fname b{white-space:normal;overflow-wrap:anywhere;line-height:1.4}
.mobile-view .panel .frow .x{width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.mobile-view .detail label{margin-top:8px}
.mobile-view .detail .cell{min-height:44px;padding:10px 12px}
.mobile-view .panel .body{-webkit-overflow-scrolling:touch}
.mobile-view .scroll{touch-action:pan-y;-webkit-overflow-scrolling:touch}
@media(max-width:359px){.mobile-view .row.item{grid-template-columns:minmax(0,1fr)}}
@media(max-height:500px){.mobile-view .shell{grid-template-rows:48px 52px minmax(0,1fr)}}

/* Mobile v4: one navigation row, concise cards, organised details. */
.phone-item-name,.phone-empty-toggle{display:none}
.mobile-view .shell{grid-template-rows:calc(52px + env(safe-area-inset-top)) minmax(0,1fr)}
.mobile-view .side{display:none}
.mobile-view .topbar{padding-left:12px;padding-right:12px;gap:6px}
.mobile-view .topbar>.spacer{display:none}
.mobile-view .topbar .brand{order:0;flex:none}
.mobile-view .topbar .brand img{width:28px;height:28px}
.mobile-view .topbar .phone-board-picker{order:1;display:flex;flex:1;min-width:0;height:44px;gap:0}
.mobile-view .phone-board-picker>span{display:none}
.mobile-view .phone-board-picker select{border:0;background:transparent;border-radius:8px;padding:0 6px;height:44px;font-size:15px;width:100%;font-weight:600}
.mobile-view .device-view-toggle{order:2;padding:0 6px;font-size:12px;min-width:44px}
.mobile-view .topbar>.bell{order:3;min-width:44px;min-height:44px}
.mobile-view .topbar>button:not(.device-view-toggle):not(.bell){order:4;width:36px;min-height:44px;padding:0}
.mobile-view .bhead{padding:0 12px}
.mobile-view .btitle{height:0;position:relative}
.mobile-view .btitle h1{display:none}
.mobile-view .btitle>button{position:absolute;right:0;top:0;z-index:1}
.mobile-view .bhead>.tabs{padding-right:44px;gap:0;margin-top:0}
.mobile-view .bhead>.tabs>.tab{min-height:44px;font-size:13px;padding:0 10px}
.mobile-view .toolbar{grid-template-columns:minmax(0,1fr) 44px 52px;gap:6px;padding:8px 0}
.mobile-view .toolbar>.primary{grid-column:2;grid-row:1;width:44px;padding:0;justify-content:center;font-size:24px}
.mobile-view .phone-tools-toggle{grid-column:3;grid-row:1;min-height:44px;padding:0 8px}
.mobile-view .count-note{grid-column:1/-1;grid-row:2}
.mobile-view .count-note:empty{display:none}
.mobile-view .toolbar.phone-tools-open>.btn:not(.primary):not(.phone-tools-toggle){grid-column:auto;grid-row:auto;justify-content:center;font-size:13px}
.mobile-view .toolbar.phone-tools-open{grid-template-columns:minmax(0,1fr) 44px 52px}
.mobile-view .toolbar.phone-tools-open>.btn:not(.primary):not(.phone-tools-toggle){grid-column:1/-1;min-height:44px}
.mobile-view:not(.phone-show-empty) .phone-empty-group{display:none}
.mobile-view .scroll{padding:0 12px calc(16px + env(safe-area-inset-bottom))}
.mobile-view .ghead{height:44px}
.mobile-view .gtitle{font-size:13px}
.mobile-view .group{margin-bottom:12px}
.mobile-view .group.closed .ghead{height:44px}
.mobile-view .cbox,.mobile-view .cbox .left{height:44px}
.mobile-view .row.add{display:none}
.mobile-view .scroll>.btn.outline{display:none}
.mobile-view .row.item{border-radius:10px;margin-bottom:8px}
.mobile-view .row.item .left{min-height:60px}
.mobile-view .row.item .name{min-height:60px;padding:8px 8px 4px 0;gap:4px}
.mobile-view .row.item .chk{width:30px}
.mobile-view .row.item .name .open{width:44px;font-size:0}
.mobile-view .row.item .name .open .ico{font-size:14px}
.mobile-view .row.item .name .txt{font-size:15px;line-height:1.35;padding:0 4px}
.mobile-view .desktop-item-name{display:none}
.mobile-view .phone-item-name{display:flex;flex-direction:column;gap:2px}
.mobile-view .phone-item-ref{font-size:11px;font-weight:600;color:var(--text-dim);letter-spacing:.04em}
.mobile-view .phone-item-title{font-weight:500;overflow-wrap:anywhere}
.mobile-view .row.item>.cell.t-status{justify-content:flex-start;min-height:38px;padding:0 12px 4px 38px;background:var(--surface)}
.mobile-view .row.item .status-fill{width:auto;max-width:100%;height:auto;min-height:28px;border-radius:6px;padding:4px 9px;display:inline-flex;align-items:center;font-size:12px;line-height:1.3;white-space:normal;text-align:left}
.mobile-view .row.item>.cell[data-phone-field="true"]{min-height:40px;padding:8px 10px;font-size:13px;gap:3px 6px}
.mobile-view .row.item>.cell[data-phone-field="true"]:before{font-size:11px}
.mobile-view .panel header{padding-left:12px;padding-right:12px;padding-top:calc(6px + env(safe-area-inset-top))}
.mobile-view .panel h2{font-size:16px;line-height:1.35}
.mobile-view .panel header .tabs{gap:0}
.mobile-view .panel header .tab{padding:0 10px;font-size:13px}
.mobile-view .panel .body{padding:12px 12px calc(20px + env(safe-area-inset-bottom))}
.mobile-view .phone-detail-section{border:1px solid var(--border-soft);border-radius:10px;margin-bottom:10px;background:var(--surface)}
.mobile-view .phone-detail-section>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 12px;font-size:14px;font-weight:600;cursor:pointer;list-style:none}
.mobile-view .phone-detail-section>summary::-webkit-details-marker{display:none}
.mobile-view .phone-detail-section>summary:after{content:'+';font-size:18px;color:var(--text-dim)}
.mobile-view .phone-detail-section[open]>summary:after{content:'−'}
.mobile-view .section-count{margin-left:auto;margin-right:14px;font-size:11px;font-weight:400;color:var(--text-dim)}
.mobile-view .phone-detail-section>.detail{grid-template-columns:105px minmax(0,1fr);gap:0;padding:0 10px 8px;align-items:stretch}
.mobile-view .phone-detail-section .detail>label{display:flex;align-items:center;margin:0;padding:8px 4px;font-size:12px;border-top:1px solid var(--border-soft);white-space:normal;line-height:1.35}
.mobile-view .phone-detail-section .detail>.cell{min-width:0;border-radius:0;border:0;border-top:1px solid var(--border-soft);min-height:44px;padding:8px;background:transparent;overflow-wrap:anywhere;font-size:14px}
.mobile-view .phone-detail-section .detail>.t-status{padding:6px 8px}
.mobile-view .phone-detail-section .status-fill{width:auto;min-height:32px;border-radius:6px;padding:4px 8px;white-space:normal}
.mobile-view .phone-detail-section .detail .clip{min-width:0}
@media(max-width:359px){.mobile-view .topbar .brand{display:none}.mobile-view .phone-detail-section>.detail{grid-template-columns:88px minmax(0,1fr)}}

/* Keep key information on the same card row, with selection only when requested. */
.phone-select-toggle{display:none}
.mobile-view .row.item{position:relative}
.mobile-view .row.item .chk{display:none}
.mobile-view.phone-select-mode .row.item .chk,.mobile-view .row.item.sel .chk{display:grid}
.mobile-view .row.item .name{padding:8px 12px;min-height:68px}
.mobile-view .row.item .name .open{display:none}
.mobile-view .row.item .name .txt{padding:0;width:100%}
.mobile-view .row.item .phone-item-ref{padding-right:190px;min-height:20px}
.mobile-view .row.item>.cell.t-status{position:absolute;top:8px;right:12px;width:auto!important;max-width:65%;min-height:28px;padding:0;background:transparent}
.mobile-view .row.item .status-fill{max-width:100%;min-height:26px;font-size:11px;line-height:1.25;padding:4px 8px}
.mobile-view .section-count{display:none}
.mobile-view .phone-detail-section .detail .t-status .status-fill{min-height:28px;font-size:12px}
@media(display-mode:standalone){
 .mobile-view .shell{grid-template-rows:calc(52px + max(env(safe-area-inset-top),44px)) minmax(0,1fr)}
 .mobile-view .topbar{padding-top:max(env(safe-area-inset-top),44px)}
 .mobile-view .panel header{padding-top:calc(6px + max(env(safe-area-inset-top),44px))}
}
@media(max-width:359px){
 .mobile-view .row.item>.cell.t-status{max-width:58%;right:10px}
 .mobile-view .row.item .phone-item-ref{padding-right:165px}
}

.phone-tools-panel{display:contents}
.mobile-view .phone-tools-panel{display:none}
.mobile-view .toolbar.phone-tools-open>.phone-tools-panel{display:grid;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:8px;border:1px solid var(--border-soft);border-radius:10px;background:var(--surface)}
.mobile-view .phone-tools-panel>.btn{display:inline-flex;justify-content:flex-start;min-width:0;min-height:44px;font-size:13px;padding:0 8px}
.mobile-view .phone-tools-panel>.phone-empty-toggle,.mobile-view .phone-tools-panel>.phone-select-toggle{display:inline-flex}
.mobile-view .btitle>button .ico{display:none}
.mobile-view .btitle>button:before{content:'⋯';font-size:22px}
.mobile-view .row.item .name .txt:focus-visible{outline:2px solid var(--primary);outline-offset:3px;border-radius:4px}

/* Dashboard overview: compact charts and a fully readable year selector. */
.mobile-view .toolbar:has(.sel-year){display:flex;justify-content:space-between;align-items:center}
.mobile-view .sel-year{width:100px!important;min-width:100px;min-height:44px;font-size:16px;padding:0 10px}
.mobile-view .dash{padding:8px 12px 24px}
.mobile-view .dash .donut{display:grid;grid-template-columns:128px minmax(0,1fr);gap:12px;min-height:150px}
.mobile-view .dash .donut>svg{width:128px;height:128px}
.mobile-view .dash .legend{gap:8px;min-width:0}
.mobile-view .dash .legend div{display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:5px;font-size:11px;align-items:center}
.mobile-view .dash .legend i{width:8px;height:8px}
.mobile-view .dash .legend span{margin:0;padding:0;font-size:10px}
.mobile-view .dash .w .wb{padding:10px}
.mobile-view .dash .bars{height:150px}
.mobile-view .dash .barcol .v,.mobile-view .dash .barlabels{font-size:11px}
.mobile-view .dgrid>div.s2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.mobile-view .dash .bignum{font-size:23px;padding:16px 10px}
@media(max-width:359px){.mobile-view .dash .donut{grid-template-columns:96px minmax(0,1fr);gap:8px}.mobile-view .dash .donut>svg{width:96px;height:96px}.mobile-view .dash .bignum{font-size:19px}}
