/* One full-bleed 3D stage. The HUD floats on top: brand + search top left, the seven section
   chips top right, the date filter top centre, the timeline strip and view tools at the bottom,
   and the detail panel docked right (a bottom sheet on phones). Powerline brand tokens. */
:root {
  --bg: #e9ebed;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --chip: rgba(255, 255, 255, 0.84);
  --fg: #111111;
  --logo-ink: #111111; --logo-track: #CCCCCC;
  --muted: #5d616a;
  --line: rgba(32, 34, 38, 0.12);
  --accent: #e85c1a;
  --accent-ink: #b5470f;
  --accent-soft: rgba(232, 92, 26, 0.12);
  --blue: #2f6fae;
  --good: #23824f;
  --warn: #b26b07;
  --bad: #b83b26;
  --shadow: 0 10px 34px rgba(20, 22, 28, 0.16);
  --c-opp: #7d5bd0; --c-qtn: #2f7fcf; --c-so: #e85c1a; --c-wo: #c98a0c; --c-dn: #23824f; --c-po: #148f8c; --c-pr: #c0457e;
  --font-display: "Archivo", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "Poppins", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f15; --panel: rgba(21, 24, 31, 0.92); --panel-solid: #161a21; --chip: rgba(23, 27, 34, 0.86);
    --fg: #eceef2; --muted: #9ba0ab; --line: rgba(255, 255, 255, 0.1);
    --logo-ink: #FFFFFF; --logo-track: #5C5C58;
    --accent: #e85c1a; --accent-ink: #ffb084; --accent-soft: rgba(232, 92, 26, 0.18);
    --blue: #74aee6; --good: #5cc28c; --warn: #e7a84a; --bad: #f07a63; --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
    --c-opp: #a88cf0; --c-qtn: #74aee6; --c-so: #e85c1a; --c-wo: #e7b04a; --c-dn: #5cc28c; --c-po: #4fc9c5; --c-pr: #ec7bb0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f15; --panel: rgba(21, 24, 31, 0.92); --panel-solid: #161a21; --chip: rgba(23, 27, 34, 0.86);
  --fg: #eceef2; --muted: #9ba0ab; --line: rgba(255, 255, 255, 0.1);
  --logo-ink: #FFFFFF; --logo-track: #5C5C58;
  --accent: #e85c1a; --accent-ink: #ffb084; --accent-soft: rgba(232, 92, 26, 0.18);
  --blue: #74aee6; --good: #5cc28c; --warn: #e7a84a; --bad: #f07a63; --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --c-opp: #a88cf0; --c-qtn: #74aee6; --c-so: #e85c1a; --c-wo: #e7b04a; --c-dn: #5cc28c; --c-po: #4fc9c5; --c-pr: #ec7bb0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font-body); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
.labels { position: absolute; inset: 0; pointer-events: none; }

.glass {
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-radius: var(--r);
}

/* ── top left: brand + search ─────────────────────────────────────────────── */
.hud-top {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 10px; width: min(330px, calc(100vw - 32px)); z-index: 7;
}
.brand { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 10px; }
.brand-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* the logo keeps its track at this size (Brand Book: track only at 40 mm wide or more) */
.logo { display: block; width: 168px; height: auto; overflow: visible; }
.logo.big { width: 280px; margin: 0 auto 22px; }
.brand h1 { margin: 0; display: flex; align-items: flex-end; gap: 9px; }
.brand h1 .world { font: 300 21px/1 var(--font-display); color: var(--muted); letter-spacing: -0.01em; margin-bottom: 7px; }
.brand p { margin: 0; min-width: 0; color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.dot.stale { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.brand .who { flex: none; font-size: 11px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.brand .who:hover { color: var(--fg); border-color: var(--accent); }
.search { position: relative; }
.search input {
  width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  font-size: 13px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.search input::placeholder { color: var(--muted); }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 360px; overflow: auto; padding: 6px; }
.results button { display: grid; grid-template-columns: auto 1fr auto; gap: 1px 10px; width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.results button:hover, .results button.on { background: var(--accent-soft); }
.results .k { grid-row: span 2; align-self: center; width: 10px; height: 10px; border-radius: 3px; }
.results .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; }
.results .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; grid-column: 2; }
.results .v { grid-row: span 2; grid-column: 3; align-self: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.results .none { padding: 10px; color: var(--muted); font-size: 13px; }

/* ── top centre: the date filter ──────────────────────────────────────────── */
.when {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px; flex-wrap: wrap; justify-content: center; max-width: min(720px, calc(100vw - 32px));
}
.seg { display: flex; background: var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel-solid); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.when input[type="date"] {
  border: 1px solid var(--line); background: var(--panel-solid); border-radius: 8px; padding: 5px 8px; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 0;
}
.when .ib { border: 1px solid var(--line); background: var(--panel-solid); border-radius: 8px; width: 31px; height: 31px; display: grid; place-items: center; cursor: pointer; }
.when .ib:hover, .when .chip:hover { border-color: var(--accent); }
.when .chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.when .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.when .sep { color: var(--muted); }
.when .busy { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; visibility: hidden; }
.when .busy.on { visibility: visible; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── top right: the seven sections ────────────────────────────────────────── */
.secs {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 320px; z-index: 5;
}
.sec {
  display: grid; grid-template-columns: 4px auto 1fr; gap: 0 8px; align-items: baseline; text-align: left;
  padding: 7px 10px 7px 7px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); min-width: 0;
  background: var(--chip); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sec:hover, .sec.on { transform: translateY(-1px); border-color: var(--sc); }
.sec i { grid-row: span 2; align-self: stretch; border-radius: 4px; background: var(--sc); }
.sec .l { grid-column: 2 / -1; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec .v { font: 700 15px/1.2 var(--font-display); font-variant-numeric: tabular-nums; grid-column: 2; }
.sec .m { grid-column: 3; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sec.all { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; }
.sec.all .l { color: var(--fg); font-weight: 600; }

/* ── detail panel ─────────────────────────────────────────────────────────── */
.panel {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(112px + env(safe-area-inset-bottom, 0px)); width: 410px; overflow: auto; z-index: 8; padding: 18px 18px 14px; overscroll-behavior: contain;
}
.panel .ptools { position: sticky; top: -12px; z-index: 2; display: flex; justify-content: space-between; align-items: center; margin: -10px -8px 4px; padding: 0; height: 32px; pointer-events: none; }
.panel .ptools button { pointer-events: auto; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-solid); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.panel .close { width: 30px; margin-left: auto; }
.panel .back { gap: 6px; padding: 0 11px 0 9px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.panel .back:hover, .panel .close:hover { border-color: var(--accent); }
.eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--sc, var(--accent-ink)); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.panel h2 { margin: 4px 0 2px; font: 700 20px/1.2 var(--font-display); text-wrap: balance; word-break: break-word; }
.panel h2.code { font: 500 19px/1.25 var(--font-mono); }
.panel .sub { color: var(--muted); margin: 0 0 12px; word-break: break-word; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 12px; border-radius: 10px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--panel-solid); padding: 8px 11px; min-width: 0; }
.stat dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; }
.stat dd.big { font: 700 18px var(--font-display); }
.stat.wide { grid-column: 1 / -1; }
.block h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 16px 0 6px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.rows { display: flex; flex-direction: column; gap: 2px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 0; background: transparent; text-align: left; width: 100%; }
button.row { cursor: pointer; }
button.row:hover { background: var(--accent-soft); }
.row .a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row .b { color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1; }
.row .v { grid-row: span 2; grid-column: 2; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; font-size: 13px; }
.row.self { background: color-mix(in srgb, var(--sc) 12%, transparent); }
.mono { font-family: var(--font-mono); font-size: 0.94em; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); text-transform: none; letter-spacing: 0; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pill.blue { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.pill.neutral { background: var(--line); color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--sc, var(--accent)); border-radius: inherit; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 6px 0 4px; background: var(--line); }
.stack i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend b { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.insights { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; }
.insight { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; background: var(--line); }
.insight.good { background: color-mix(in srgb, var(--good) 12%, transparent); }
.insight.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); }
.insight.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.insight svg { width: 16px; height: 16px; margin-top: 1px; }
.journey { display: flex; flex-direction: column; gap: 0; margin: 6px 0 0; position: relative; }
.jstep { display: grid; grid-template-columns: 22px 1fr auto; gap: 0 9px; align-items: start; padding: 0 0 10px; position: relative; }
.jstep::before { content: ""; position: absolute; left: 10px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.jstep:last-child::before { display: none; }
.jstep .n { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--jc); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--jc); z-index: 1; }
.jstep.empty .n { border-style: dashed; opacity: 0.45; }
.jstep .t { font-weight: 600; font-size: 13px; }
.jstep .t small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.jstep .gap { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.jstep .docs { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 1px; margin-top: 3px; }
.jstep .docs button { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-align: left; border: 0; background: transparent; padding: 4px 6px; margin-left: -6px; border-radius: 7px; cursor: pointer; font-size: 12.5px; }
.jstep .docs button:hover { background: var(--accent-soft); }
.jstep .docs button.self { background: color-mix(in srgb, var(--jc) 14%, transparent); }
.jstep .docs .id { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jstep .docs .w { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jstep .docs .more { color: var(--muted); font-size: 12px; padding: 2px 0; }
table.lines { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.lines th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.lines td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lines td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lines td .c { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.note { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--line); color: var(--muted); font-size: 12px; }
.foot { margin-top: 16px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.foot a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin: 6px 0 2px; }
.spark i { flex: 1; background: var(--sc, var(--accent)); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.85; }
.spark-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; }
.skel { height: 12px; border-radius: 6px; background: var(--line); margin: 8px 0; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.filter-in { width: 100%; border: 1px solid var(--line); background: var(--panel-solid); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; margin: 2px 0 6px; }

/* ── bottom: timeline strip + tools ───────────────────────────────────────── */
.dock {
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; gap: 10px; align-items: flex-end; pointer-events: none; z-index: 5;
}
.dock > * { pointer-events: auto; }
.strip { flex: 1; min-width: 0; padding: 8px 10px 6px; }
.strip .head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.strip .head b { color: var(--fg); font-weight: 600; }
.strip canvas { display: block; width: 100%; height: 54px; cursor: crosshair; touch-action: none; }
.tools { display: flex; gap: 4px; padding: 5px; }
.tools button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; }
.tools button:hover { color: var(--fg); background: var(--line); }
.tools button[aria-pressed="true"] { color: var(--fg); background: var(--accent-soft); }

.tip { position: fixed; z-index: 9; pointer-events: none; max-width: 300px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tip .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.tip .t { font-weight: 600; word-break: break-word; }
.tip .s { color: var(--muted); }

.gate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; background: var(--bg); transition: opacity 0.6s ease; padding: 16px; }
.gate.gone { opacity: 0; pointer-events: none; }
.gate .box { text-align: center; max-width: 440px; }
.gate strong { font: 800 19px/1.3 var(--font-display); display: block; }
.gate p { color: var(--muted); }
.gate .go { display: inline-block; margin-top: 8px; background: var(--accent); color: #fff; border-radius: 10px; padding: 10px 18px; text-decoration: none; font-weight: 600; }
.gate .flow { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.gate .flow span { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }

/* labels drawn in the 3D scene */
.lbl { font: 600 11.5px/1.25 var(--font-body); color: #fff; background: rgba(28, 30, 36, 0.8); padding: 3px 8px; border-radius: 7px; white-space: nowrap; border: 1px solid rgba(255,255,255,0.14); transform: translateY(-6px); max-width: 230px; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.3s ease; }
.lbl small { display: block; font-weight: 500; opacity: 0.8; font-size: 10.5px; }
.lbl.hid, .labels.off .lbl:not(.sign) { opacity: 0 !important; pointer-events: none !important; }
.lbl.click { pointer-events: auto; cursor: pointer; }
.lbl.click:hover { border-color: #e85c1a; }
.lbl.sign { font: 800 13px/1.15 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 12px; border-radius: 9px; background: var(--sc); border-color: rgba(255,255,255,0.35); text-align: center; max-width: none; }
.lbl.sign small { letter-spacing: 0.02em; text-transform: none; font: 600 12px/1.3 var(--font-body); opacity: 0.95; }
.lbl.doc { border-left: 3px solid var(--sc); }
.lbl.ghost { background: rgba(28, 30, 36, 0.62); border-style: dashed; font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; }
.lbl.day { font: 500 10px/1 var(--font-mono); background: rgba(28,30,36,0.55); padding: 2px 5px; border-radius: 5px; }

@media (max-width: 1180px) {
  .secs { top: auto; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); width: auto; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
    display: flex; overflow-x: auto; scrollbar-width: none; }
  .secs::-webkit-scrollbar { display: none; }
  .sec { flex: none; min-width: 140px; }
  .sec.all { display: none; }
  .when { top: calc(204px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); transform: none; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .hud-top { width: calc(100vw - 32px); }
  .when { top: calc(204px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); max-width: none; }
  .when .chips { display: none; }
  #stripHover { display: none; }
  .secs { bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
  .when input[type="date"] { padding: 4px 6px; }
  .logo { width: 150px; }
  .panel { top: auto; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 62%; }
  .tools { flex-direction: row; }
  .dock { flex-direction: column; align-items: stretch; }
  .lbl { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .sec, .gate, .lbl { transition: none; } .when .busy { animation: none; } }

/* ── the two views ────────────────────────────────────────────────────────── */
.views { display: flex; background: var(--line); border-radius: 9px; padding: 2px; }
.views a { flex: 1; text-align: center; padding: 5px 8px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.views a:hover { color: var(--fg); }
.views a[aria-current="page"] { background: var(--panel-solid); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sitebar { grid-column: 1 / -1; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--chip); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sitebar button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 7px; cursor: pointer; font: 700 12px var(--font-display); color: var(--sc); letter-spacing: 0.04em; }
.sitebar button:hover { background: color-mix(in srgb, var(--sc) 12%, transparent); }
.sitebar button.on { background: var(--sc); color: #fff; }
@media (max-width: 1180px) { .sitebar { flex: none; } .sitebar button { padding: 6px 10px; } }

/* ── stock: filter by warehouse type ──────────────────────────────────────── */
.types { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; margin: 0 0 7px; padding-bottom: 1px; align-items: center; }
.types::-webkit-scrollbar { display: none; }
.types button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-solid); border-radius: 99px; padding: 3px 10px 3px 8px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.types button i { width: 9px; height: 9px; border-radius: 3px; background: var(--tc); }
.types button b { font-weight: 600; }
.types button span { color: var(--muted); font-variant-numeric: tabular-nums; }
.types button:hover { border-color: var(--tc, var(--accent)); }
.types button.on { background: color-mix(in srgb, var(--tc, var(--accent)) 16%, var(--panel-solid)); border-color: var(--tc, var(--accent)); }
.types button.on span { color: var(--fg); }
.types .tsum { flex: none; font-size: 12px; color: var(--muted); padding-left: 6px; white-space: nowrap; }
.types .tsum b { color: var(--fg); }
.stockpage .panel { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1180px) { .stockpage .secs { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 760px) {
  .stockpage .secs { bottom: calc(194px + env(safe-area-inset-bottom, 0px)); }
  .stockpage .panel { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
