/* Code-native operations UI. Kept versioned for cached production templates. */
:root{--ink:#183841;--mut:#526c75;--line:#dce6e9;--accent:#146e78;--in:#007d68;--out:#91591d;--surface:#fff}
body{background:var(--ui-surface-f3f6f7,#f3f6f7);color:var(--ink)}
button,input,select,summary,a{-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--ui-line-248ea7,#248ea7);outline-offset:3px}
button:disabled{opacity:.48;cursor:not-allowed}
header.top{background:var(--ui-surface-132d38,#132d38);border:0;overflow:visible;padding:0;z-index:60}
header.top .header-lines{display:none}
header.top .brand-row{min-height:78px;padding:12px 30px;max-width:1740px;margin:auto;gap:20px}
header.top .brand-mark{width:46px;height:46px}
.brand-word{font-size:22px;letter-spacing:1.1px}.brand-caption{font-size:11px;line-height:1.6;color:var(--ui-text-b7ccd1,#b7ccd1)}
.header-tools{display:flex;align-items:center;gap:28px;margin-left:auto;min-width:0;z-index:70}
.header-source{display:flex;flex-direction:column;gap:5px;text-align:right;font-size:12px;color:var(--ui-text-b4cdd2,#b4cdd2)}
.header-source #status{color:var(--ui-text-b4cdd2,#b4cdd2);font-size:11px}.direction-card h2::before{content:none}
#source-status{font-size:12px;color:var(--ui-text-cae0e4,#cae0e4)}#source-status:before{content:'';display:inline-block;width:6px;height:6px;background:var(--ui-surface-94aab0,#94aab0);border-radius:50%;margin-right:7px}
#source-status[data-state=ready]:before{background:var(--ui-surface-68d6b4,#68d6b4)}#source-status[data-state=partial]:before{background:var(--ui-surface-e3b762,#e3b762)}#source-status[data-state=error]:before{background:var(--ui-surface-ff8593,#ff8593)}
.header-clock{font-size:12px;color:var(--ui-text-c0d2d8,#c0d2d8)}.user-menu{position:relative}.user-menu summary{display:flex;align-items:center;gap:9px;cursor:pointer;font-size:13px;list-style:none;color:var(--ui-text-f1f8f9,#f1f8f9)}
.user-menu summary::-webkit-details-marker{display:none}.user-avatar{background:var(--ui-surface-294955,#294955);border:1px solid var(--ui-line-48646e,#48646e);border-radius:50%;display:grid;place-items:center;width:32px;height:32px;font-size:13px}
.user-popover{position:absolute;right:0;top:43px;width:210px;background:var(--ui-surface-fff,#fff);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:18px;box-shadow:0 12px 36px #142d3826}
.user-popover p{font-size:12px;color:var(--mut)}.user-popover button{width:100%;background:var(--ui-surface-f0f5f6,#f0f5f6);color:var(--ink);border:1px solid var(--line)}
nav.tabs{background:var(--ui-surface-fff,#fff);border-bottom:1px solid var(--line);padding:0 30px;gap:6px;min-height:46px;align-items:stretch}
nav.tabs a{font-size:13px;color:var(--mut);padding:14px 12px 12px;border-bottom:3px solid transparent}
nav.tabs a.on{background:transparent;border-color:var(--accent);color:var(--accent)}nav.tabs a:hover{background:var(--ui-surface-f2f7f7,#f2f7f7);color:var(--accent)}
main{padding:24px 30px;max-width:1740px;margin:auto}.page-heading{margin:0 0 22px;gap:18px}.page-heading h1{font-size:27px;letter-spacing:-.4px;margin:6px 0}.page-heading p{margin:0}.eyebrow{font-size:10px;letter-spacing:.12em;color:var(--ui-text-487f88,#487f88)}
.secondary,.icon-button{background:var(--ui-surface-fff,#fff);color:var(--accent);border:1px solid var(--ui-line-cadcdf,#cadcdf);border-radius:8px}.secondary:hover,.icon-button:hover{background:var(--ui-surface-ecf5f5,#ecf5f5)}.secondary{font-size:13px;font-weight:600;white-space:nowrap}.icon-button{height:34px;min-width:34px;padding:3px 9px;font-size:22px;line-height:1}
.muted{font-size:13px;line-height:1.65;color:var(--mut)}
#filter-dock{position:sticky;top:0;z-index:55;background:var(--ui-surface-fff,#fff);border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 15px #163d4808;margin:0 0 16px}
.dock-summary{display:flex;align-items:center;gap:12px;padding:11px 16px;min-width:0}.filter-toggle{background:var(--ui-surface-f0f5f6,#f0f5f6);color:var(--ink);border-radius:7px;font-size:13px;padding:7px 10px;white-space:nowrap}.filter-toggle span{margin-left:12px}
#filter-chips{display:flex;gap:6px;min-width:0;overflow-x:auto;scrollbar-width:thin;padding:2px 0}.filter-chip{font-size:12px;padding:5px 9px;border:1px solid var(--ui-line-d5e7e8,#d5e7e8);border-radius:5px;background:var(--ui-surface-eff7f6,#eff7f6);color:var(--ui-text-2e6866,#2e6866);white-space:nowrap}.class-chip{background:var(--ui-surface-f4f6f7,#f4f6f7);color:var(--ui-text-526871,#526871);border-color:var(--ui-line-e0e6e8,#e0e6e8)}
#draft-state{font-size:12px;color:var(--ui-text-986022,#986022);margin-left:auto;white-space:nowrap}.has-draft{border-color:var(--ui-line-cbaf75,#cbaf75)!important}
#filter-dock .bar.filter-bar{border:0;border-radius:0;box-shadow:none;margin:0;padding:6px 16px 10px;gap:12px;align-items:end}
.filter-bar .filter-field{min-width:120px;flex:1}.filter-bar .filter-field.group-field{flex:1.35}.filter-bar .multi{min-width:0;width:100%}.filter-bar select,.filter-bar .multi summary{height:40px;border-color:var(--ui-line-cfdee1,#cfdee1);border-radius:7px;font-size:13px;background:var(--ui-surface-fff,#fff)}.filter-bar label,.filter-label{font-size:12px;color:var(--ui-text-47626c,#47626c)}
#reload{padding:11px 23px;height:40px;background:var(--accent);font-size:13px;font-weight:650;border-radius:7px}#reload:hover{background:var(--ui-surface-105b64,#105b64)}
#refresh-help{margin:0 16px 10px;font-size:12px}.scope-note{font-size:13px;line-height:1.6}#pending-note{margin:0 16px 10px;border-radius:7px;background:var(--ui-surface-fff7e8,#fff7e8);color:var(--ui-text-895a1c,#895a1c);padding:8px 12px}
.dashboard-tabs{display:flex;gap:6px;border-top:1px solid var(--ui-line-e5edef,#e5edef);padding:0 12px;overflow-x:auto;scrollbar-width:thin}.dashboard-tabs button{border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:var(--ui-text-5d7279,#5d7279);font-size:13px;white-space:nowrap;padding:13px 12px 11px}.dashboard-tabs button[aria-selected=true]{color:var(--accent);border-color:var(--accent);font-weight:700}.dashboard-tabs button:hover{background:var(--ui-surface-f2f7f7,#f2f7f7)}
.range-context{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 2px;font-size:12px;color:var(--ui-text-5a737c,#5a737c);flex-wrap:wrap}
.dashboard-panel{min-height:360px;scroll-margin-top:240px}.dashboard-panel:focus{outline:none}.grid{gap:16px}.grid>*{min-width:0}.direction-overview{margin:0 0 16px}
.direction-card{padding:22px;border:1px solid var(--line);border-top:3px solid var(--in);border-radius:12px;box-shadow:none}.out-card{border-top-color:var(--ui-line-bc8c4a,#bc8c4a)}.direction-card h2{display:flex;align-items:center;font-size:19px;margin:0 0 22px;gap:8px}.direction-card h2 small{margin-left:auto;font-size:11px;letter-spacing:.1em;font-weight:500;color:var(--mut)}.direction-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:6px;background:var(--ui-surface-e8f4ee,#e8f4ee);font-size:18px}.out-card .direction-icon{background:var(--ui-surface-fbf0dd,#fbf0dd)}.out-card h2{color:var(--out)}.in-card h2{color:var(--in)}
.direction-card .g3{gap:18px}.direction-card .g3>div:not(:first-child){padding-left:16px;border-left:1px solid var(--ui-line-e5ecee,#e5ecee)}.metric{font-size:32px;letter-spacing:-1px;line-height:1.3;font-weight:650;margin:10px 0 4px;font-variant-numeric:tabular-nums}.direction-card .muted{font-size:12px;line-height:1.6}.metric+.muted{white-space:nowrap;display:inline-block}
.card{padding:20px;border:1px solid var(--line);border-radius:12px;box-shadow:none;margin-bottom:16px;background:var(--ui-surface-fff,#fff)}.card h3{font-size:14px;line-height:1.6;margin:0 0 14px;font-weight:650;color:var(--ink)}.card-heading{display:flex;align-items:start;justify-content:space-between;gap:14px}.card-heading h3{margin:3px 0 12px}.chart{height:300px;width:100%;min-width:0}.chart-card>.evidence{margin-bottom:5px}.card-heading .icon-button{flex-shrink:0}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0 16px;flex-wrap:wrap}.section-heading h2,.section-title{font-size:19px;margin:0;line-height:1.6}.section-heading p{margin:4px 0 0}.section-title{margin:24px 0 16px}.unit-tag{font-size:13px;background:var(--ui-surface-eaf2f4,#eaf2f4);padding:5px 9px;border-radius:6px}
.evidence{font-size:12px;position:relative;line-height:1.6;max-width:100%;margin:6px 0 0;text-align:left}.evidence summary{display:inline-flex;gap:4px;align-items:center;border:1px solid var(--ui-line-e6d5ad,#e6d5ad);background:var(--ui-surface-fff8e8,#fff8e8);color:var(--ui-text-765117,#765117);padding:3px 7px;border-radius:5px;cursor:pointer;font-size:11px;font-weight:500;list-style:none;white-space:normal}.evidence summary::before{content:'ⓘ';font-size:12px}.evidence[open] summary{background:var(--ui-surface-fff0cd,#fff0cd)}.evidence>div{padding:10px 0 0;color:var(--ui-text-6b573b,#6b573b);max-width:600px;line-height:1.8;font-weight:400}.section-heading>.evidence{max-width:520px}
table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}table th,table td{font-size:13px;padding:12px 10px;line-height:1.6;white-space:normal;text-align:right;border-bottom:1px solid var(--ui-line-e9eff1,#e9eff1)}table th:first-child,table td:first-child{text-align:left}table thead th{font-weight:600;color:var(--ui-text-4e6871,#4e6871);background:var(--ui-surface-f5f8f9,#f5f8f9)}table tbody th[scope=row]{font-weight:500;color:var(--ui-text-294954,#294954);min-width:155px}table tbody tr:nth-child(even){background:var(--ui-surface-f7f9fa,#f7f9fa)}table tbody tr:hover{background:var(--ui-surface-edf5f5,#edf5f5)}.grouped-table thead tr:first-child th:not(:first-child){text-align:center}.grouped-table th.in-group{background:var(--ui-surface-edf7f3,#edf7f3);color:var(--ui-text-236e5c,#236e5c)}.grouped-table th.out-group{background:var(--ui-surface-fbf4e8,#fbf4e8);color:var(--ui-text-8c662c,#8c662c)}.grouped-table tbody td:nth-child(5){border-left:1px solid var(--ui-line-dce6e9,#dce6e9)}.grouped-table td{min-width:65px}.table-scroll{overflow-x:auto}.table-target{min-width:0}.empty-message{padding:24px!important;text-align:center!important;color:var(--mut)}
.state-target{position:relative}.data-state{font-size:12px;line-height:1.6;color:var(--ui-text-60727a,#60727a);border-radius:7px;background:var(--ui-surface-f0f4f5,#f0f4f5);padding:9px 12px;margin:10px 0}.state-error{background:var(--ui-surface-fff0f1,#fff0f1);color:var(--ui-text-a13243,#a13243)}.state-unverified,.state-unavailable{background:var(--ui-surface-fff8e8,#fff8e8);color:var(--ui-text-806025,#806025)}.chart>.data-state{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;margin:0;background:#f7fafbed;z-index:2}.state-target[data-state=loading]>.data-state{position:absolute;inset:0;min-height:60px;display:flex;align-items:center;justify-content:center;background:#f4f8f9f5;z-index:3;margin:0}.state-loading:before{content:'';border:2px solid var(--ui-line-c5d8dc,#c5d8dc);border-top-color:var(--ui-line-248395,#248395);width:12px;height:12px;border-radius:50%;margin-right:9px;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
#in-kpi,#out-kpi{min-height:120px}#quality{margin-bottom:0}.metric-unavailable{font-size:13px;color:var(--ui-text-765a2d,#765a2d)}
.lane-point{margin:0 0 22px}.lane-point>h3{font-size:13px;color:var(--ui-text-5b747d,#5b747d);font-weight:600;margin:0 0 12px}.lane-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.lane-card{display:block;text-align:left;color:var(--ink);background:var(--ui-surface-fff,#fff);border:1px solid var(--line);border-radius:12px;padding:0;overflow:hidden;box-shadow:none}.lane-card:hover{border-color:var(--ui-line-77acb1,#77acb1);box-shadow:0 6px 20px #173d4910}.lane-name{display:flex;justify-content:space-between;align-items:center;font-size:14px;font-weight:650;padding:14px 18px;border-bottom:1px solid var(--ui-line-e5ecee,#e5ecee)}.lane-name span{font-size:18px;color:var(--ui-text-7b969c,#7b969c)}.lane-road{display:grid;grid-template-columns:1fr 1fr;margin:0 18px}.lane-direction{display:flex;flex-direction:column;align-items:center;padding:18px 8px;gap:8px;font-size:12px}.lane-direction+span{border-left:2px dashed var(--ui-line-d2dfe3,#d2dfe3)}.in-tone{color:var(--in)}.out-tone{color:var(--out)}.road-arrow{font-size:30px;line-height:1.2}.lane-direction strong{font-size:22px;font-weight:650;font-variant-numeric:tabular-nums}.lane-direction small{font-size:11px;font-weight:400}.lane-caption{display:block;padding:10px 18px;font-size:11px;background:var(--ui-surface-f6f9fa,#f6f9fa);color:var(--mut);border-top:1px solid var(--ui-line-eaf0f2,#eaf0f2)}
dialog{color:var(--ink);background:var(--ui-surface-fff,#fff);border:1px solid var(--ui-line-d7e3e7,#d7e3e7);border-radius:16px;padding:26px;width:min(1100px,calc(100vw - 48px));max-width:calc(100vw - 24px);max-height:90vh;box-sizing:border-box;box-shadow:0 30px 100px #091f4650;overflow:auto}dialog::backdrop{background:#142e3b99;backdrop-filter:blur(3px)}.dialog-heading{display:flex;justify-content:space-between;align-items:start;gap:16px}.dialog-heading h2{font-size:21px;margin:5px 0 10px;line-height:1.5}.dialog-heading .icon-button{flex-shrink:0}.dialog-heading .eyebrow{font-size:10px}#detail-context,.export-context{white-space:pre-line;line-height:1.8;font-size:12px}.lane-camera-context{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;padding:12px;background:var(--ui-surface-f2f7f8,#f2f7f8);border-radius:8px;font-size:12px;margin-bottom:14px}#enlarged-chart{width:100%;height:54vh;min-height:280px}#export-dialog{width:640px}#export-dialog label{display:block;font-size:13px;font-weight:600;margin:22px 0 8px}#export-dataset{width:100%;height:44px;background:var(--ui-surface-fff,#fff);border:1px solid var(--ui-line-c9dce1,#c9dce1);border-radius:7px;padding:8px;font-size:13px;color:var(--ink)}.export-context{padding:16px;background:var(--ui-surface-f1f6f7,#f1f6f7);border:1px solid var(--line);border-radius:8px}.export-actions{display:flex;gap:10px;margin:22px 0 10px}.export-actions button{font-size:13px;border-radius:7px}.err{font-family:inherit;margin:15px 0;font-size:13px}
@media(max-width:1200px){.filter-bar .filter-field{min-width:145px}.direction-card .g3{gap:12px}.direction-card{padding:18px}.metric{font-size:28px}.direction-card .g3>div:not(:first-child){padding-left:12px}.header-tools{gap:16px}.lane-direction strong{font-size:20px}}
@media(max-width:1000px){.direction-card .g3{grid-template-columns:1fr}.direction-card .g3>div:not(:first-child){padding:13px 0 0;border-left:0;border-top:1px solid var(--ui-line-e5ecee,#e5ecee)}.direction-card .g3>div{display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:10px}.direction-card .metric{margin:0;grid-column:2;grid-row:1}.direction-card .metric+.muted{grid-column:2;text-align:right}.direction-card .evidence{grid-column:1;grid-row:2;margin:0}}
@media(max-width:800px){header.top .brand-row{min-height:72px;padding:12px 16px;flex-wrap:wrap;gap:10px}header.top .brand-mark{width:38px;height:38px}.brand-link{gap:10px}.brand-word{font-size:19px}.brand-caption{font-size:10px}.header-tools{gap:12px}.header-source{font-size:10px}#source-status{font-size:10px}.user-menu summary{font-size:12px}.user-menu summary>span:not(.user-avatar){display:none}nav.tabs{padding:0 10px;gap:0;flex-wrap:nowrap;overflow-x:auto;min-height:43px}nav.tabs a{font-size:12px;padding:13px 10px 10px;white-space:nowrap}main{padding:18px 16px}.page-heading h1{font-size:23px}.page-heading{margin-bottom:18px}.page-heading .eyebrow{font-size:9px}.page-heading .muted{font-size:12px}.page-heading>.secondary{padding:9px 11px;font-size:12px}#filter-dock{border-radius:9px}.dock-summary{padding:10px;gap:8px;flex-wrap:wrap}#filter-chips{flex:1}#draft-state{flex-basis:100%;margin-left:0}.filter-toggle{font-size:12px}#filter-fields{max-height:55vh;overflow:auto}#filter-dock .bar.filter-bar{padding:4px 10px 10px;gap:10px}.filter-bar .filter-field,.filter-bar .filter-field.group-field{min-width:160px;flex:1}#reload{flex-basis:100%}.multi-options{position:static;margin-top:5px;max-height:230px;overflow:auto}.dashboard-tabs{gap:0;padding:0 5px}.dashboard-tabs button{font-size:12px;padding:12px 10px 10px}.range-context{font-size:11px;gap:5px}.grid{gap:12px}.card{padding:16px}.card h3{font-size:13px}.chart{height:300px}.lane-grid{gap:10px}.lane-name{padding:12px;font-size:13px}.lane-road{margin:0 10px}.lane-direction{padding:14px 4px;font-size:11px}.lane-direction strong{font-size:18px}.lane-caption{padding:8px 10px;font-size:10px}table th,table td{font-size:12px;padding:10px 8px}.section-heading h2{font-size:18px}.section-heading{margin:20px 0 12px}}
@media(max-width:600px){.header-tools{width:100%;justify-content:space-between;flex-direction:row-reverse;margin:0}.header-source{text-align:left;flex-direction:row;flex-wrap:wrap;gap:5px 16px;align-items:center}.brand-caption{display:none}.user-menu summary>span:not(.user-avatar){display:inline}.user-popover{right:0}.header-tools{flex-direction:row}.page-heading{align-items:flex-start}.page-heading h1{font-size:21px}.page-heading .eyebrow{font-size:8px}.page-heading>.secondary{padding:8px;font-size:11px}.grid.g2,.grid.g3{grid-template-columns:1fr}.direction-card h2{margin-bottom:14px}.direction-card .g3{gap:12px}.direction-card .metric{font-size:27px}.lane-grid{grid-template-columns:1fr}.lane-road{margin:0 20px}.lane-direction{display:grid;grid-template-columns:30px 1fr;column-gap:10px;text-align:left}.lane-direction .road-arrow{grid-row:span 2;grid-column:1}.lane-direction strong{grid-column:2;font-size:21px}.lane-caption{font-size:11px}.card h3{font-size:13px}.card-heading{gap:8px}.icon-button{height:30px;min-width:30px;font-size:20px}dialog{padding:17px;width:calc(100vw - 24px)}.dialog-heading h2{font-size:18px}#detail-context,.export-context{font-size:11px}#enlarged-chart{height:48vh}.export-actions{flex-wrap:wrap}.export-actions button{flex:1}.evidence>div{font-size:12px}#custom .datetime-group{flex-wrap:wrap;gap:5px}#custom input{max-width:155px}#filter-dock .filter-bar .filter-field{min-width:140px}.range-context{line-height:1.7}table tbody th[scope=row]{min-width:130px}}
@media(prefers-reduced-motion:reduce){:where(html:not([data-motion-system-override="true"])) *,:where(html:not([data-motion-system-override="true"])) *::before,:where(html:not([data-motion-system-override="true"])) *::after{animation:none!important;scroll-behavior:auto!important}}
