/* JAVLIN OS prototype — shared base. Uses only tokens from tokens.css.
   Rules of the approved direction: radius <= 6px, no gradients, no emoji icons,
   body >= 14px, data >= 13px, full-width tables with sticky headers. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--fs-body)/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
small { font-size: var(--fs-small); }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.ic { flex: none; }
.mono { font-family: var(--mono); font-size: var(--fs-data); font-variant-numeric: tabular-nums; }
.dim { color: var(--steel); }
.strong { font-weight: 600; }
.block { display: block; }
.grow { flex: 1 1 auto; }
.t-ok { color: var(--green); } .t-warn { color: var(--amber); } .t-bad { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--navy-200); border-radius: var(--r); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--navy-50); color: var(--ink); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-danger { color: var(--red); border-color: #E3B5B7; }
.btn-danger:hover { background: var(--red-tint); color: var(--red); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
td.act .btn + .btn, .page-actions .btn + .btn { margin-left: 6px; }

/* status stamps: text + color, never color alone */
.stamp { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: var(--r); font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--muted-tint); color: var(--steel); }
.stamp-ok { background: var(--green-tint); color: var(--green); }
.stamp-warn { background: var(--amber-tint); color: var(--amber); }
.stamp-bad { background: var(--red-tint); color: var(--red); }
.stamp-info { background: var(--blue-tint); color: var(--blue-dark); }
.src { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--steel); border: 1px solid var(--line); border-radius: var(--r); padding: 1px 8px; background: var(--panel); white-space: nowrap; }

/* page */
.content { padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.eyebrow { font-size: 13px; color: var(--steel); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.page-sub { color: var(--steel); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions .btn + .btn { margin-left: 0; }

/* sub navigation (second level) */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--steel); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); text-decoration: none; background: var(--navy-50); }
.subnav a.on { color: var(--ink); border-bottom-color: var(--blue); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r); background: var(--red); color: #fff; font: 600 13px var(--mono); }

/* metric strip: one band, not five cards */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.metric { padding: 16px 20px; border-right: 1px solid var(--line-soft); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric-l { font-size: 13px; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: .04em; }
.metric-v { font: 600 30px/1.15 var(--mono); margin-top: 6px; letter-spacing: -0.02em; }
.metric-v small { font: 500 14px var(--sans); color: var(--steel); margin-left: 6px; letter-spacing: 0; }
.metric-c { font-size: 13px; color: var(--steel); margin-top: 4px; }
.metric-c.t-ok { color: var(--green); } .metric-c.t-warn { color: var(--amber); } .metric-c.t-bad { color: var(--red); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-h .bar { width: 120px; }
.panel-note { padding: 10px 20px; font-size: 13px; color: var(--steel); background: var(--ground); border-bottom: 1px solid var(--line-soft); }
.panel-foot { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line-soft); }
.more { font-size: 14px; font-weight: 600; }
.empty { padding: 28px 20px; color: var(--steel); }
.cols { display: grid; gap: 20px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.cols-2 > .panel, .cols-2-1 > .panel { overflow-x: auto; }
.pl { display: inline-block; min-width: 150px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kv-row { display: flex; gap: 24px; align-items: center; padding: 20px; }
.kv-row .bar { width: 100%; margin-bottom: 8px; }
.big { font-size: 34px; font-weight: 600; line-height: 1; }

/* tables: full width, sticky header */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-data); }
.tbl th { position: sticky; top: var(--sticky-top); z-index: 2; background: var(--navy-50); color: var(--steel); text-align: left; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #F8F9FC; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .num { text-align: right; }
.tbl .act { text-align: right; white-space: nowrap; }
.tbl td .bar { width: 72px; vertical-align: middle; }

/* toolbar + fields */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--steel); }
.field select, .field input, .search-box { height: 40px; border: 1px solid var(--navy-200); border-radius: var(--r); background: var(--panel); padding: 0 12px; font-size: 14px; font-weight: 400; color: var(--ink); }
.field-search { flex: 1 1 280px; max-width: 420px; }
.search-box { display: flex; align-items: center; gap: 8px; color: var(--steel); }
.search-box input { border: 0; height: 36px; padding: 0; flex: 1; min-width: 0; outline: 0; background: transparent; }
.search-box:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.result-count { align-self: center; font-size: 14px; }

/* row lists */
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.rows li:last-child { border-bottom: 0; }
.rows-main { flex: 1; min-width: 0; }
.rows-main small { display: block; color: var(--steel); }
.rows-tight li { padding: 10px 20px; align-items: baseline; }
.rows .when { width: 84px; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: var(--r); background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--mono); flex: none; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.callout-bad { background: var(--red-tint); border-color: #E3B5B7; color: #7d2327; }
.callout-warn { background: var(--amber-tint); border-color: #E2CC9C; color: #5f3b00; }
.callout-ok { background: var(--green-tint); border-color: #B4D8C3; color: #0f5730; }
.callout-info { background: var(--blue-tint); border-color: #B9CDF3; color: var(--navy); align-items: center; }
.grid-wrap { overflow: auto; max-height: 70vh; }
.grid-wrap .tbl th { top: 0; }
.grid-wrap .tbl th, .grid-wrap .tbl td { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.cell-in { height: 34px; border: 1px solid var(--navy-200); border-radius: var(--r); background: var(--panel); padding: 0 6px; }
.track li small { font-weight: 400; }
.panel > .callout { margin: 16px 20px 4px; }

.dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; }
.dl dt, .dl dd { padding: 11px 20px; border-bottom: 1px solid var(--line-soft); }
.dl dt { color: var(--steel); font-size: 14px; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }
.dl-wide { grid-template-columns: minmax(140px, 220px) 1fr; }

.bar { display: inline-block; width: 96px; height: 8px; background: var(--navy-100); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.steps { display: inline-flex; gap: 3px; vertical-align: middle; }
.steps i { width: 14px; height: 8px; background: var(--navy-100); border-radius: 1px; }
.steps i.on { background: var(--green); }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.quick .btn { min-height: 48px; padding: 0 20px; font-size: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* kiosk preview (paper ground, as the real tablet screen) */
.kiosk { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); background: var(--paper); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.kiosk-main { padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.kiosk-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--steel); border-bottom: 2px solid var(--orange); padding-bottom: 4px; }
.kiosk-name { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.kiosk-qr { width: min(300px, 70vw); background: #fff; padding: 6px; border-radius: var(--r); margin: 8px 0; }
.kiosk-qr svg { display: block; width: 100%; height: auto; }
.kiosk-sim { font-family: var(--mono); font-size: 13px; }
.kiosk-side { border-left: 1px solid var(--line); padding: 20px 0; }
.kiosk-count { display: flex; justify-content: space-between; align-items: baseline; padding: 0 20px 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; color: var(--steel); }
.kiosk-count strong { font-size: 30px; color: var(--ink); }
.kiosk-side .rows li { border-color: var(--line); }

/* survey tree: building → floor → unit */
.tree-row { display: flex; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.tree-row:last-child { border-bottom: 0; }
.tree-floor { width: 96px; flex: none; display: flex; flex-direction: column; }
.tree-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; flex: 1; }
.unit { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13px; font-weight: 600; min-height: 52px; }
.unit:hover { text-decoration: none; border-color: var(--blue); }
.unit .mono { font-size: 15px; color: var(--ink); }
.unit-ok { background: var(--green-tint); color: var(--green); border-color: #B4D8C3; }
.unit-warn { background: var(--amber-tint); color: var(--amber); border-color: #E2CC9C; }
.unit-muted { background: var(--panel); color: var(--steel); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 16px 20px; }
.photo { aspect-ratio: 4 / 3; background: var(--navy-50); border: 1px dashed var(--navy-200); border-radius: var(--r); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--steel); font-size: 13px; }

.track { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.track li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px 20px; color: var(--steel); font-weight: 600; border-right: 1px solid var(--line-soft); }
.track li:last-child { border-right: 0; }
.track li .mono { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); background: var(--muted-tint); }
.track li.on { color: var(--ink); background: var(--blue-tint); }
.track li.on .mono { background: var(--blue); color: #fff; }

/* charts (plain CSS, no library) */
.hbars { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 150px) 1fr minmax(96px, auto); gap: 12px; align-items: center; font-size: 14px; }
.hbar-l { color: var(--ink); }
.hbar-t { display: block; height: 14px; background: transparent; }
.hbar-budget { background: var(--navy-100); border-radius: 2px; }
.hbar-f { display: block; height: 100%; background: var(--blue); border-radius: 0 3px 3px 0; min-width: 2px; }
.hbar-f2 { background: var(--navy-300); }
.hbar-t2 { display: flex; flex-direction: column; gap: 2px; }
.hbar-t2 .hbar-t { height: 10px; }
.hbar-v small { font-family: var(--sans); font-size: 13px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 14px 20px 0; font-size: 13px; color: var(--steel); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw-a { background: var(--blue); } .sw-b { background: var(--navy-300); }
.cols-chart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 220px; margin: 28px 20px 0; border-bottom: 1px solid var(--navy-200); }
.cols-chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.col-b { display: block; width: min(56px, 60%); background: var(--blue); border-radius: 3px 3px 0 0; }
.col-v { font-size: 13px; }
.target { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--steel); }
.target span { position: absolute; left: 0; top: -20px; font-size: 13px; color: var(--steel); background: var(--panel); padding-right: 6px; }
.cols-axis { display: flex; gap: 2px; margin: 6px 20px 16px; font-size: 13px; color: var(--steel); }
.cols-axis span { flex: 1; text-align: center; }
.as-table { border-top: 1px solid var(--line-soft); }
.as-table summary { padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--blue); cursor: pointer; }
.as-table .tbl th { position: static; }

/* toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--navy); color: #fff; border-radius: var(--r); border-left: 4px solid var(--green); font-size: 14px; font-weight: 500; transition: opacity .4s; }
.toast small { margin-left: auto; padding-left: 12px; font-family: var(--mono); color: var(--navy-200); }
.toast-warn { border-left-color: #E0A21B; } .toast-bad { border-left-color: var(--red); }
.toast-out { opacity: 0; }

/* shared chrome bits */
.proto-tag { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border: 1px dashed currentColor; border-radius: var(--r); font: 500 13px var(--mono); white-space: nowrap; }
.role-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.role-switch select { height: 36px; border-radius: var(--r); border: 1px solid var(--navy-200); background: var(--panel); color: var(--ink); padding: 0 8px; font-size: 14px; font-weight: 600; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--r); font-weight: 600; font-size: 14px; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 280px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(16, 26, 53, .18); padding: 6px; }
.menu-pop.right { left: auto; right: 0; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: var(--r); color: var(--ink); font-size: 14px; font-weight: 500; background: none; border: 0; text-align: left; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--navy-50); text-decoration: none; }
.menu-pop a.on { background: var(--blue-tint); font-weight: 600; }
.menu-pop .menu-l { padding: 8px 10px 4px; font-size: 13px; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: .05em; }
.menu-pop .stamp { margin-left: auto; }

/* ───── sidebar shells (A and C) ───── */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--navy); color: var(--navy-200); display: flex; flex-direction: column; z-index: 50; overflow-y: auto; }
.side-logo { display: flex; align-items: center; height: var(--top-h); padding: 0 18px; flex: none; }
.side-logo img { height: 26px; width: auto; }
.side-co { margin: 4px 14px 10px; padding: 8px 10px; border: 1px solid var(--navy-400); border-radius: var(--r); color: #fff; font-size: 13px; line-height: 1.3; }
.side-co small { display: block; color: var(--navy-300); }
.side-group { padding: 14px 18px 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--navy-300); }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 1px 8px; padding: 0 10px; border-radius: var(--r); color: var(--navy-200); font-size: 14.5px; font-weight: 500; border-left: 3px solid transparent; }
.side-nav a:hover { background: var(--navy-600); color: #fff; text-decoration: none; }
.side-nav a.on { background: var(--navy-rail); color: #fff; font-weight: 600; border-left-color: var(--orange); }
.side-nav a .count { margin-left: auto; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--navy-rail); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.side-foot .role-switch { color: var(--navy-200); justify-content: space-between; }
.side-foot a { color: var(--navy-200); }
.main { margin-left: var(--side-w); min-width: 0; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 32px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top .field { flex-direction: row; align-items: center; gap: 8px; }
.top .field select { height: 36px; max-width: 260px; }
.top-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; background: none; border-radius: var(--r); cursor: pointer; color: inherit; }
.kbd-btn { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--navy-200); border-radius: var(--r); background: var(--ground); color: var(--steel); font-size: 14px; cursor: pointer; min-width: 220px; }
.kbd-btn kbd { margin-left: auto; font: 500 13px var(--mono); border: 1px solid var(--navy-200); border-radius: 3px; padding: 0 6px; background: var(--panel); }
.who { display: inline-flex; flex-direction: column; line-height: 1.2; font-size: 14px; font-weight: 600; text-align: right; }
.who small { font-weight: 400; color: var(--steel); }
.tabbar, .scrim { display: none; }

/* command palette (A) */
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(16, 26, 53, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.palette-box { width: min(640px, 100%); background: var(--panel); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 16px 48px rgba(16, 26, 53, .3); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--steel); }
.palette-in input { flex: 1; height: 54px; border: 0; outline: 0; font-size: 17px; background: transparent; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: var(--r); color: var(--ink); font-size: 15px; }
.palette-list a small { margin-left: auto; color: var(--steel); }
.palette-list a.sel, .palette-list a:hover { background: var(--blue-tint); text-decoration: none; }
.palette-foot { padding: 8px 16px; border-top: 1px solid var(--line-soft); font: 400 13px var(--mono); color: var(--steel); }

/* ───── B: project-centric top navigation ───── */
.btop { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; }
.btop-row { display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 32px; }
.btop-row > a img { height: 26px; }
.btop details.menu > summary { color: #fff; border: 1px solid var(--navy-400); }
.btop details.menu > summary:hover { background: var(--navy-rail); }
.btop .switcher > summary { min-width: 280px; justify-content: space-between; background: var(--navy-600); }
.btop .switcher small { color: var(--navy-300); font-weight: 500; }
.btop .role-switch { color: var(--navy-200); }
.btop .proto-tag { color: var(--navy-200); }
.btabs { display: flex; gap: 2px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; height: 48px; scrollbar-width: thin; }
.btabs a { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--steel); font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; white-space: nowrap; }
.btabs a:hover { color: var(--ink); background: var(--navy-50); text-decoration: none; }
.btabs a.on { color: var(--ink); border-bottom-color: var(--blue); }
.btabs .btabs-l { display: inline-flex; align-items: center; padding: 0 14px 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); border-right: 1px solid var(--line); margin-right: 8px; white-space: nowrap; }
.chooser-list a { display: grid; grid-template-columns: minmax(0, 2.2fr) auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.chooser-list a:hover { background: var(--blue-tint); text-decoration: none; }
.chooser-list a:last-child { border-bottom: 0; }
.chooser-list .name { font-size: 17px; font-weight: 700; }
.chooser-list small { display: block; color: var(--steel); }
.chooser-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.chooser-head img { height: 64px; width: auto; }

/* ───── C: hybrid (navy top bar + light sidebar) ───── */
.shell-c .side { background: var(--panel); color: var(--ink); border-right: 1px solid var(--line); top: var(--top-h); }
.shell-c .side-group { color: var(--steel); }
.shell-c .side-nav a { color: var(--ink); }
.shell-c .side-nav a:hover { background: var(--navy-50); color: var(--ink); }
.shell-c .side-nav a.on { background: var(--navy); color: #fff; border-left-color: var(--orange); }
.shell-c .side-foot { border-top-color: var(--line); color: var(--steel); }
.shell-c .side-foot a { color: var(--blue); }
.ctop { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--top-h); background: var(--navy); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 20px 0 18px; }
.ctop > a img { height: 26px; }
.ctop .chip > summary { background: #fff; color: var(--ink); min-height: 38px; min-width: 250px; justify-content: space-between; }
.ctop .chip > summary small { color: var(--steel); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }
.ctop .role-switch, .ctop .proto-tag { color: var(--navy-200); }
.ctop .qa { display: flex; gap: 8px; }
.ctop .qa .btn { border-color: var(--navy-400); background: transparent; color: #fff; min-height: 38px; }
.ctop .qa .btn:hover { background: var(--navy-rail); }
.ctop .qa .btn-primary { background: var(--blue); border-color: var(--blue); }
.shell-c .main { padding-top: var(--top-h); }
.pin-proj small { margin-left: auto; font-size: 13px; color: var(--steel); white-space: nowrap; }
.pin-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a.on small { color: var(--navy-200); }

/* ───── worker phone experience ───── */
.wstage-top { display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 20px; background: var(--navy); color: #fff; }
.wstage-top img { height: 26px; }
.wstage-top .role-switch, .wstage-top .proto-tag { color: var(--navy-200); }
.wstage { display: flex; justify-content: center; gap: 40px; padding: 28px 16px 48px; align-items: flex-start; }
.wstage-note { max-width: 320px; display: flex; flex-direction: column; gap: 12px; color: var(--steel); padding-top: 12px; }
.wstage-note h2 { color: var(--ink); font-size: 20px; }
.wstage-note ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.phone { width: 390px; flex: none; border: 1px solid var(--navy-200); border-radius: var(--r-lg); background: var(--ground); overflow: hidden; box-shadow: 0 8px 28px rgba(16, 26, 53, .14); }
.phone-screen { min-height: 760px; display: flex; flex-direction: column; }
.whead { background: var(--navy); color: #fff; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.whead-top { display: flex; align-items: center; gap: 12px; }
.wmark { height: 34px; width: auto; }
.wback { width: 48px; height: 48px; margin-left: -12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; border-radius: var(--r); }
.wback:hover { background: var(--navy-rail); color: #fff; }
.whead-t { display: flex; flex-direction: column; line-height: 1.25; font-size: 15px; }
.whead-t span { color: var(--navy-200); font-size: 13px; }
.whead-step { font: 500 13px var(--mono); color: var(--navy-200); text-transform: uppercase; letter-spacing: .08em; }
.whead h1 { font-size: 26px; }
.whead p { color: var(--navy-200); font-size: 15px; }
.wprog { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.wprog i { height: 6px; border-radius: 2px; background: var(--navy-400); }
.wprog i.done { background: #3CCB7F; } .wprog i.now { background: #fff; }
.wbody { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.wfoot { padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border-top: 1px solid var(--line); }
.wbtn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 18px; border-radius: var(--r-lg); border: 2px solid var(--blue); background: var(--blue); color: #fff; font-size: 20px; font-weight: 700; text-align: left; cursor: pointer; line-height: 1.2; }
.wbtn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; text-decoration: none; }
.wbtn small { display: block; font-size: 14px; font-weight: 500; opacity: .9; margin-top: 2px; }
.wbtn-ghost { background: var(--panel); color: var(--ink); border-color: var(--navy-200); font-size: 17px; min-height: 60px; }
.wbtn-ghost:hover { background: var(--navy-50); color: var(--ink); border-color: var(--navy-300); }
.wbtn[disabled] { background: var(--muted-tint); border-color: var(--line); color: var(--steel); cursor: not-allowed; }
.wgrid { display: flex; flex-direction: column; gap: 10px; }
.wh2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); margin-top: 8px; }
.wsteps, .wlist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.wsteps li, .wlist li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); color: var(--steel); font-size: 15px; }
.wsteps li:last-child, .wlist li:last-child { border-bottom: 0; }
.wsteps-n { flex: 1; color: inherit; }
.wsteps-n small { display: block; color: var(--steel); font-weight: 400; }
.wsteps-s { font: 500 13px var(--mono); }
.wdot { width: 28px; height: 28px; border-radius: var(--r); border: 2px solid var(--navy-200); display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--mono); flex: none; }
.wsteps li.done { color: var(--ink); } .wsteps li.done .wdot { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.wsteps li.now { color: var(--ink); font-weight: 700; } .wsteps li.now .wdot { border-color: var(--blue); color: var(--blue); } .wsteps li.now .wsteps-s { color: var(--blue); }
.wlist li { color: var(--ink); } .wlist li strong { font-family: var(--mono); }
.whelp-list li { align-items: flex-start; }
.wlink { background: none; border: 0; color: var(--blue); font-weight: 600; font-size: 15px; min-height: 48px; cursor: pointer; align-self: center; padding: 0 12px; }
.wnote { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-lg); font-size: 16px; align-items: flex-start; }
.wnote-ok { background: var(--green-tint); color: #0f5730; } .wnote-warn { background: var(--amber-tint); color: #5f3b00; } .wnote-bad { background: var(--red-tint); color: #7d2327; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.wcard strong { font-size: 19px; }
.wcard-l { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); margin-top: 8px; }
.wcard-l:first-child { margin-top: 0; }
.wcard-row { flex-direction: row; justify-content: space-between; gap: 12px; }
.wcard-row > div { display: flex; flex-direction: column; }
.wbig { font-size: 30px !important; font-family: var(--mono); }
.wselfie, .wscan { flex: 1; min-height: 280px; border: 2px dashed var(--navy-200); border-radius: var(--r-lg); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--steel); font-size: 16px; }
.wselfie.ok { border-style: solid; border-color: var(--green); background: var(--green-tint); color: var(--green); font-weight: 600; }
.wscan { background: var(--navy-dark); border-color: var(--navy-400); color: var(--navy-200); }
.wscan-frame { padding: 28px; border: 3px solid #fff; border-radius: var(--r-lg); color: #fff; }
.whelp { color: var(--steel); font-size: 15px; }
.wsig { width: 100%; height: 260px; background: var(--panel); border: 2px dashed var(--navy-300); border-radius: var(--r-lg); touch-action: none; cursor: crosshair; }
.wsig-row { display: flex; justify-content: space-between; align-items: center; color: var(--steel); font-size: 15px; }
.wdone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--green); text-align: center; min-height: 300px; }
.wdone strong { font: 600 30px var(--mono); color: var(--ink); } .wdone span { color: var(--steel); font-size: 16px; }
.wcheck { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; background: var(--panel); border: 2px solid var(--navy-200); border-radius: var(--r-lg); font-size: 18px; font-weight: 700; cursor: pointer; text-align: left; }
.wcheck.on { border-color: var(--green); background: var(--green-tint); }
.wbox { width: 34px; height: 34px; border: 2px solid var(--navy-300); border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--green); flex: none; }
.wtrades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wchip { min-height: 60px; border: 2px solid var(--navy-200); background: var(--panel); border-radius: var(--r-lg); font-size: 18px; font-weight: 700; cursor: pointer; }
.wchip.on { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-dark); }
.wstepper { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; background: var(--panel); border: 2px solid var(--navy-200); border-radius: var(--r-lg); overflow: hidden; }
.wstepper button { height: 72px; border: 0; background: var(--navy-50); font-size: 32px; font-weight: 600; cursor: pointer; }
.wstepper strong { text-align: center; font: 600 34px var(--mono); }

/* ───── launcher ───── */
.launch { max-width: 1280px; margin: 0 auto; padding: 0 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.launch-top { background: var(--navy); color: #fff; }
.launch-top > div { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 16px; }
.launch-top img { height: 30px; }
.launch-top .proto-tag { color: var(--navy-200); margin-left: auto; }
.launch-intro { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; padding-top: 32px; }
.launch-intro > div { flex: 1 1 520px; max-width: 760px; }
.launch-intro h1 { font-size: 34px; margin-bottom: 12px; }
.launch-intro p { font-size: 17px; color: var(--steel); }
.launch-intro img { height: 96px; width: auto; }
.options a { display: grid; grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 20px; align-items: center; padding: 20px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.options a:last-child { border-bottom: 0; }
.options a:hover { background: var(--blue-tint); text-decoration: none; }
.options .letter { width: 56px; height: 56px; background: var(--navy); color: #fff; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font: 700 26px var(--sans); }
.options .name { font-size: 19px; font-weight: 700; }
.options .go { display: inline-flex; align-items: center; gap: 8px; }
.launch .tbl td { vertical-align: top; }
.launch .tbl th { top: 0; }

/* ───── responsive ───── */
@media (max-width: 1100px) {
  .cols-2, .cols-2-1 { grid-template-columns: minmax(0, 1fr); }
  .kbd-btn { min-width: 0; } .kbd-btn .lbl { display: none; }
  .ctop .qa { display: none; }
}
@media (max-width: 768px) {
  :root { --sticky-top: 0px; }
  .content { padding: 20px 16px 96px; gap: 16px; }
  h1 { font-size: 23px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .callout-info { flex-wrap: wrap; } .pl { min-width: 0; }
  .metric { border-bottom: 1px solid var(--line-soft); padding: 14px 16px; }
  .metric-v { font-size: 25px; }
  .btn { min-height: 48px; } .btn-sm { min-height: 44px; }
  /* tables become stacked rows */
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td, .tbl td:first-child, .tbl td:last-child { display: flex; justify-content: space-between; gap: 16px; padding: 5px 16px; border: 0; text-align: right; align-items: baseline; flex-wrap: wrap; }
  .tbl td::before { content: attr(data-label); color: var(--steel); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .tbl td:first-child { font-size: 16px; }
  .tbl td.act { justify-content: flex-end; gap: 8px; padding-top: 8px; }
  .tbl td.act::before { display: none; }
  .tbl tbody tr:hover td { background: none; }
  .grid-wrap { max-height: none; overflow: visible; } .grid-wrap .tbl th, .grid-wrap .tbl td { white-space: normal; }
  .toolbar { padding: 12px 16px; } .field, .field-search { flex: 1 1 100%; max-width: none; }
  .panel-h, .rows li, .tree-row { padding-left: 16px; padding-right: 16px; }
  .tree-row { flex-direction: column; align-items: stretch; gap: 8px; } .tree-floor { flex-direction: row; gap: 10px; width: auto; }
  .kiosk { grid-template-columns: 1fr; } .kiosk-side { border-left: 0; border-top: 1px solid var(--line); }
  .dl, .dl-wide { grid-template-columns: 1fr; } .dl dt { border-bottom: 0; padding-bottom: 0; font-size: 13px; }
  .hbar { grid-template-columns: 1fr auto; } .hbar-l { grid-column: 1 / -1; font-weight: 600; }
  .track { flex-direction: column; } .track li { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .quick .btn { flex: 1 1 100%; }
  #toasts { left: 16px; right: 16px; bottom: 76px; }

  /* A: sidebar → bottom tab bar (+ drawer under "More") */
  .main { margin-left: 0; }
  .side { transform: translateX(-100%); transition: transform .18s; width: min(300px, 86vw); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 26, 53, .5); z-index: 45; }
  .top { padding: 0 12px; gap: 8px; } .top .who, .top .proto-tag, .top .field > span { display: none; }
  .top .field select { max-width: 150px; }
  /* phone top bar must fit 375 px: the title and the locked project label shrink, the jump button keeps only its icon */
  .top-title { min-width: 0; }
  .top .src { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .kbd-btn { flex: none; } .kbd-btn kbd { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--navy); border-top: 1px solid var(--navy-rail); padding-bottom: env(safe-area-inset-bottom, 0); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; color: var(--navy-200); font-size: 13px; font-weight: 600; background: none; border: 0; border-top: 3px solid transparent; cursor: pointer; }
  .tabbar a.on { color: #fff; border-top-color: var(--orange); } .tabbar a:hover { text-decoration: none; color: #fff; }
  /* C: sidebar → drawer from the hamburger */
  .icon-btn { display: inline-flex; }
  .shell-c .side { top: 0; z-index: 70; }
  .shell-c.nav-open .scrim { z-index: 65; }
  .ctop { padding: 0 8px; gap: 6px; } .ctop > a img { height: 22px; } .ctop .proto-tag, .ctop .role-switch span { display: none; }
  .ctop .chip > summary { min-width: 0; max-width: 46vw; } .ctop .chip > summary small { display: none; }
  .ctop .chip > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell-c .content { padding-bottom: 48px; }
  /* B */
  .btop-row { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; } .btop .proto-tag, .btop .role-switch span { display: none; }
  .btop .switcher { flex: 1 1 100%; order: 5; } .btop .switcher > summary { min-width: 0; width: 100%; }
  .btabs { padding: 0 8px; }
  .shell-b .content { padding-bottom: 48px; }
  .chooser-list a { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; } .chooser-list a > .hide-s { display: none; }
  .menu-pop { min-width: min(300px, 92vw); }
  /* worker: the phone IS the screen */
  .wstage { padding: 0; } .wstage-note { display: none; }
  .phone { width: 100%; border: 0; border-radius: 0; box-shadow: none; } .phone-screen { min-height: calc(100vh - var(--top-h)); }
  .wstage-top .proto-tag, .wstage-top .role-switch span { display: none; }
  .launch { padding: 0 16px 48px; } .launch-top > div { padding: 0 16px; } .launch-top .proto-tag { display: none; }
  .options a { grid-template-columns: 48px 1fr; } .options .letter { width: 48px; height: 48px; } .options a > .desc, .options a > .go { grid-column: 1 / -1; }
}
