/* ============================================================
   SHAMAL GRID — ops-console portal shell
   Styled to match the Shamal Remote ID Monitor console:
   near-black canvas, slim icon rail, full-bleed content,
   micro-labels, telemetry cards. Dark only.
   Chart tokens keep the validated dark palette.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root, body {
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page:      #0a0a0b;
  --rail:      #060607;
  --surface:   #131316;
  --surface-2: #1c1c20;
  --ink-1:     #f4f4f2;
  --ink-2:     #b8b7b1;
  --ink-3:     #7c7b76;
  --grid:      #232326;
  --baseline:  #333338;
  --border:      rgba(255,255,255,0.14);
  --border-soft: rgba(255,255,255,0.07);
  --delta-good: #0ca30c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -16px rgba(0,0,0,.6);
  --accent: #3987e5;
}

/* ---------- light theme ---------- */
body[data-theme="light"] {
  --page:      #f6f5f2;
  --rail:      #fcfcfb;
  --surface:   #fcfcfb;
  --surface-2: #efeeea;
  --ink-1:     #0b0b0b;
  --ink-2:     #52514e;
  --ink-3:     #898781;
  --grid:      #e1e0d9;
  --baseline:  #c3c2b7;
  --border:      rgba(11,11,11,0.14);
  --border-soft: rgba(11,11,11,0.08);
  --delta-good: #006300;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --shadow: 0 1px 2px rgba(11,11,11,.04), 0 10px 26px -14px rgba(11,11,11,.12);
}
body[data-theme="light"] .chip.good     { color: #0a7a2f; background: rgba(12,163,12,.10); }
body[data-theme="light"] .chip.warning  { color: #8a6200; background: rgba(250,178,25,.14); }
body[data-theme="light"] .chip.serious  { color: #a34f2c; background: rgba(236,131,90,.14); }
body[data-theme="light"] .chip.critical { color: #b32e2e; background: rgba(208,59,59,.10); }
body[data-theme="light"] .tbl tbody tr:hover td { background: rgba(11,11,11,.02); }
body[data-theme="light"] .rail .logo { background: linear-gradient(135deg, #2a78d6, #1c5cab); }
body[data-theme="light"] .drone-tag { background: rgba(252,252,251,.9); }
body[data-theme="light"] .map-label { background: rgba(252,252,251,.75); color: #52514e; }
body[data-theme="light"] .map-label.restricted { color: #b32e2e; }
body[data-theme="light"] .map-label.fence { color: #0a7a2f; }
body[data-theme="light"] .geo-map { background: #eceae5; }
body[data-theme="light"] .geo-map .maplibregl-ctrl-attrib { background: rgba(252,252,251,.7) !important; }
body[data-theme="light"] .geo-map .maplibregl-ctrl-group button span { filter: none; }
body[data-theme="light"] .bcol.win { background: rgba(42,120,214,.06); border-color: rgba(42,120,214,.3); }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
}

/* ============ shell ============ */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.content { flex: 1; padding: 20px 22px 48px; }

/* ============ rail ============ */
.rail {
  width: 76px; flex: none;
  background: var(--rail);
  border-inline-end: 1px solid var(--border-soft);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 16px; gap: 4px;
  position: sticky; top: 0; height: 100vh; z-index: 60;
}
.rail .logo {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, #2a78d6, #184f95);
  margin-bottom: 14px; flex: none; text-decoration: none;
}
.rail a.nav {
  width: 62px; padding: 9px 0 7px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-3); text-decoration: none;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 9.5px; font-weight: 600;
}
.rail a.nav svg { width: 19px; height: 19px; }
.rail a.nav:hover { color: var(--ink-1); background: var(--surface); }
.rail a.nav.active {
  color: var(--ink-1);
  background: color-mix(in srgb, var(--rc, var(--accent)) 14%, transparent);
  border-color: color-mix(in srgb, var(--rc, var(--accent)) 35%, transparent);
}
.rail .push { flex: 1; }

/* ============ topbar ============ */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; height: 58px; flex: none;
  background: var(--rail);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 50;
}
.wordmark {
  font-weight: 700; font-size: 15px; letter-spacing: .35em;
  color: var(--ink-1); white-space: nowrap;
}
.wordmark small { display: block; font-size: 7.5px; letter-spacing: .52em; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.topbar .sep { width: 1px; height: 24px; background: var(--border-soft); }
.page-title { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.clock { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.live-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--status-good);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .live-dot i, .blip, .sweep { animation: none !important; }
}
.demo-badge {
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  border: 1px dashed var(--baseline); border-radius: 99px;
  padding: 4px 10px; white-space: nowrap;
}
.lang-toggle {
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; min-width: 42px;
}
.lang-toggle:hover { color: var(--ink-1); border-color: var(--border); }

/* ============ page head ============ */
.page-head { margin: 2px 0 16px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; font-weight: 700; }
.page-head p  { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* ============ micro label ============ */
.micro {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  color: var(--ink-3); text-transform: uppercase;
}

/* ============ layout ============ */
.grid { display: grid; gap: 14px; }
.kpis {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  margin-bottom: 14px;
}
.row-map { grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr)); }
.cols-2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.cols-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1080px) { .row-map, .cols-2-3, .cols-3-2 { grid-template-columns: 1fr; } }

/* ============ panels ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-head .t { font-size: 13.5px; font-weight: 700; }
.card-head .s { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.card-head .spacer { flex: 1; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 14px 18px 0; }

/* ============ KPI tiles ============ */
.kpi { padding: 13px 15px; }
.kpi .label { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.kpi .value { font-size: 25px; font-weight: 650; margin-top: 5px; line-height: 1.05; letter-spacing: -0.01em; }
.kpi .value small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-inline-start: 3px; }
.kpi .delta { font-size: 11px; margin-top: 6px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi .delta b { font-weight: 600; }
.kpi .delta .up   { color: var(--delta-good); }
.kpi .delta .down { color: var(--status-critical); }
.kpi .spark { margin-top: 8px; }

/* ============ chips ============ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip svg { flex: none; }
.chip.good     { color: #35c26e; background: rgba(12,163,12,.12); }
.chip.warning  { color: var(--status-warning); background: rgba(250,178,25,.10); }
.chip.serious  { color: var(--status-serious); background: rgba(236,131,90,.10); }
.chip.critical { color: #ef6b6b; background: rgba(208,59,59,.13); }

/* ============ filters ============ */
.filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filters .flabel { font-size: 11.5px; color: var(--ink-3); margin-inline-end: 3px; }
.fbtn {
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
}
.fbtn:hover { background: var(--surface-2); }
.fbtn[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: transparent; }

/* ============ tables ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: start; font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 7px 10px; border-bottom: 1px solid var(--grid);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.015); }
.tbl td.num, .tbl th.num { font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; }

.viz-table { display: none; margin-top: 8px; }
.viz-table.open { display: block; }
.tbl-toggle {
  font-family: var(--font); font-size: 10.5px; font-weight: 700;
  color: var(--ink-3); background: none; border: 1px solid var(--border-soft);
  border-radius: 7px; padding: 4px 10px; cursor: pointer;
}
.tbl-toggle:hover, .tbl-toggle[aria-pressed="true"] { color: var(--ink-1); background: var(--surface-2); }

/* ============ charts ============ */
.viz { direction: ltr; position: relative; }
.viz svg { display: block; width: 100%; height: auto; }
.viz text { font-family: var(--font); }
.legend { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 10px; direction: rtl; }
html[dir="ltr"] .legend { direction: ltr; }
.legend .li { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); }
.legend .sw-line { width: 15px; height: 2.5px; border-radius: 2px; }
.legend .sw-rect { width: 10px; height: 10px; border-radius: 3px; }

#viz-tip {
  position: fixed; z-index: 200; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; box-shadow: var(--shadow);
  padding: 8px 11px; font-size: 11.5px; color: var(--ink-2);
  min-width: 120px; opacity: 0; transition: opacity .1s; direction: rtl;
}
html[dir="ltr"] #viz-tip { direction: ltr; }
#viz-tip.on { opacity: 1; }
#viz-tip .tt { font-weight: 700; font-size: 10.5px; color: var(--ink-3); margin-bottom: 5px; }
#viz-tip .tr { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
#viz-tip .tk { width: 11px; height: 2.5px; border-radius: 2px; flex: none; }
#viz-tip .tv { font-weight: 700; color: var(--ink-1); margin-inline-start: auto; font-variant-numeric: tabular-nums; }

/* ============ meters ============ */
.meter { height: 5px; border-radius: 99px; overflow: hidden; display: flex; }
.meter i { border-radius: 99px; }

/* ============ alerts ============ */
.alerts-strip { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.alert-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 8px 13px; font-size: 12px; color: var(--ink-2);
}
.alert-row.crit { border-inline-start: 3px solid var(--status-critical); }
.alert-row time { margin-inline-start: auto; color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ============ weather strip ============ */
.wx {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 14px; margin-bottom: 14px;
  font-size: 12px; color: var(--ink-2);
}
.wx .wxi { display: inline-flex; align-items: center; gap: 6px; }
.wx .wxi b { color: var(--ink-1); font-variant-numeric: tabular-nums; }
.wx .spacer { flex: 1; }

/* ============ telemetry cards (drone panel) ============ */
.tele-list { display: flex; flex-direction: column; gap: 10px; }
.tele {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 11px 13px;
}
.tele .th { display: flex; align-items: center; gap: 8px; }
.tele .th .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tele .th b { font-size: 13px; letter-spacing: .02em; }
.tele .th .type { font-size: 10.5px; font-weight: 700; }
.tele .th .bat { margin-inline-start: auto; display: flex; align-items: center; gap: 7px; min-width: 86px; }
.tele .th .bat .meter { flex: 1; }
.tele .th .bat span { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tele .who { font-size: 12px; color: var(--ink-1); margin-top: 7px; }
.tele .mission { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.tele .tm { display: flex; gap: 14px; margin-top: 8px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.tele .tm b { color: var(--ink-2); font-weight: 600; }

/* ============ custody chain ============ */
.chain { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; direction: rtl; }
html[dir="ltr"] .chain { direction: ltr; }
.chain-node {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 6px 11px; font-size: 11.5px;
}
.chain-node b { font-weight: 600; font-size: 12px; }
.chain-node i { font-style: normal; color: var(--ink-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chain-node.bad { border-color: var(--status-critical); background: rgba(208,59,59,.10); }
.chain-arrow { color: var(--ink-3); font-size: 13px; flex: none; }

/* ============ real map (MapLibre) ============ */
.geo-map {
  height: 520px; width: 100%;
  background: #0d0d10;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  position: relative;
}
@media (max-width: 1080px) { .geo-map { height: 420px; } }
.geo-map .maplibregl-ctrl-attrib {
  background: rgba(10,10,11,.7) !important; font-size: 9px;
}
.geo-map .maplibregl-ctrl-attrib a { color: var(--ink-3) !important; }
.geo-map .maplibregl-ctrl-group {
  background: var(--surface-2) !important; border: 1px solid var(--border-soft);
}
.geo-map .maplibregl-ctrl-group button { background: transparent !important; }
.geo-map .maplibregl-ctrl-group button span { filter: invert(.8); }

.drone-marker { position: relative; width: 34px; height: 34px; cursor: default; }
.drone-marker .ping {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--mc, #3987e5); opacity: .5;
  animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.35); opacity: .55; } 70% { transform: scale(1.15); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drone-marker .ping { animation: none; opacity: 0; } }
.drone-marker svg { position: absolute; inset: 7px; width: 20px; height: 20px; }
.drone-tag {
  position: absolute; top: 1px; inset-inline-start: 38px;
  background: rgba(10,10,11,.82); border: 1px solid var(--border-soft);
  border-radius: 7px; padding: 4px 9px; white-space: nowrap; direction: rtl;
}
html[dir="ltr"] .drone-tag { direction: ltr; }
.drone-tag b { display: block; font-size: 11px; color: var(--ink-1); letter-spacing: .02em; }
.drone-tag span { display: block; font-size: 9.5px; color: var(--ink-3); margin-top: 1px; }
.map-label {
  background: rgba(10,10,11,.6); border-radius: 6px;
  padding: 2.5px 8px; font-size: 10px; font-weight: 600; color: #9a9aa2;
  white-space: nowrap; pointer-events: none;
}
.map-label.restricted { color: #ef6b6b; border: 1px dashed rgba(208,59,59,.6); }
.map-label.fence { color: #35c26e; }
.map-label.base { color: #9a9aa2; border: 1px solid var(--border-soft); }

/* ============ national map dots ============ */
.nat-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--nc, #0ca30c);
  border: 2px solid var(--surface);
  cursor: pointer; position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.nat-dot.sel { transform: scale(1.7); z-index: 5; }
.nat-dot i {
  position: absolute; inset: -6px; border-radius: 50%;
  background: var(--nc); opacity: .4;
  animation: ping 2.4s ease-out infinite; pointer-events: none;
}
.map-label.city { font-size: 10.5px; background: transparent; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; }

/* ============ drill-down panel ============ */
.drill { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.drill-back {
  font-family: var(--font); font-size: 11.5px; font-weight: 700; cursor: pointer;
  color: var(--ink-3); background: none; border: none; text-align: start; padding: 2px 0;
}
.drill-back:hover { color: var(--ink-1); }
.drill-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 470px; }
.drill-row {
  font-family: var(--font); text-align: start; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 9px; padding: 8px 11px; font-size: 12px; color: var(--ink-2);
}
.drill-row:hover { border-color: var(--border); }
.drill-row b { color: var(--ink-1); font-size: 12.5px; }
.drill-row .m { font-size: 10.5px; color: var(--ink-3); }
.drill-row .spacer { flex: 1; }
.drill-head { border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; }
.drill-head b { font-size: 16px; }
.drill-head .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.drill-head .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drill-kv { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); }
.drill-kv b { color: var(--ink-2); font-weight: 600; }
.drill-link {
  font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  direction: ltr; text-align: end; user-select: all; word-break: break-all;
}

/* ============ custody network map ============ */
.net-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; }
@media (max-width: 1080px) { .net-grid { grid-template-columns: 1fr; } }
.net-list { display: flex; flex-direction: column; gap: 5px; }
.net-flight, .net-ds, .net-clear {
  font-family: var(--font); text-align: start; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink-2); display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 12px;
}
.net-flight { font-weight: 700; color: var(--ink-1); margin-top: 4px; }
.net-flight span { font-weight: 400; font-size: 10.5px; color: var(--ink-3); }
.net-ds { margin-inline-start: 14px; }
.net-ds i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.net-ds span { font-size: 10.5px; color: var(--ink-3); }
.net-flight:hover, .net-ds:hover { background: var(--surface-2); }
.net-flight.on, .net-ds.on { background: var(--surface-2); border-color: var(--border); }
.net-clear { color: var(--ink-3); font-size: 11px; margin-top: 6px; justify-content: center; border: 1px dashed var(--baseline); }
.net-svg { max-width: 660px; margin-inline: auto; }
.net-svg svg { width: 100%; height: auto; }
.net-edge { transition: opacity .15s; }
.net-node { transition: opacity .15s; }
.net-hint { font-size: 12px; color: var(--ink-3); padding: 8px 2px; }
.net-detail { border-top: 1px solid var(--border-soft); padding: 11px 0; }
.net-detail:first-child { border-top: none; }
.net-detail .ndh { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.net-detail .ndh b { font-size: 12.5px; }
.net-detail .ndh span { font-size: 11px; color: var(--ink-3); }
.net-detail .ndl { font-size: 11.5px; color: var(--ink-2); margin-bottom: 9px; font-weight: 600; }

/* ============ misc ============ */
.map-panel { position: relative; }
.blip { animation: blip 2.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes blip { 0% { opacity: .7; transform: scale(.5); } 70% { opacity: 0; transform: scale(2.8); } 100% { opacity: 0; } }

.foot {
  margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border-soft);
  font-size: 11px; color: var(--ink-3);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}

/* ============ responsive shell ============ */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%; height: auto; position: sticky; top: 0;
    flex-direction: row; padding: 6px 10px; gap: 2px;
    border-inline-end: none; border-bottom: 1px solid var(--border-soft);
    overflow-x: auto;
  }
  .rail .logo { width: 34px; height: 34px; margin: 0 6px 0 0; font-size: 15px; }
  .rail a.nav { width: auto; min-width: 58px; padding: 5px 8px; }
  .rail .push { display: none; }
  .topbar { position: static; height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .wordmark { display: none; }
  .topbar .sep { display: none; }
  .clock { display: none; }
  .content { padding: 14px 14px 40px; }
}
