/* ==========================================================================================================
   v1.4 OSINT console layout (ADR 0004). Loads last; holds the v1.4 regions only: command bar (omnibox, status
   strip, clocks), activity bar, rail position, map legend, map tools, selection reticle, hover card, activity
   feed, dossier provenance, generated help, density and high-contrast themes, and the 4K (DPR 1) ladder.
   Every value is a token from css/tokens.css or one defined at the top of this file.
   ========================================================================================================== */
:root {
  --actbar-w: 56px; /* activity bar: 40 px targets + 8 px padding */
  --act-btn: 40px;
  --credit-h: 24px; /* strip above the timeline: imagery credits, camera read-out, date */
  --legend-w: 272px;
  --hc-focus: #ffe14d;
}
/* density: comfortable (default) lifts every small control to the 32 px desktop target; compact keeps 24 px */
body.density-comfortable {
  --ctl-sm: 32px;
}
body.density-compact {
  --ctl-sm: 24px;
  --act-btn: 36px;
  --legend-w: 248px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono,
time,
.n,
kbd {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ---------------------------------------------------------------- command bar */
#topbar {
  gap: var(--s-2);
  padding: 0 var(--s-2) 0 var(--s-1);
}
#topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-width: calc(var(--actbar-w) - var(--s-1));
}
#topbar .brand .logo {
  width: var(--ctl);
  text-align: center;
}
#topbar .brand small {
  margin: 0;
  font-size: var(--fs-1);
  letter-spacing: var(--track-caps);
}
.omnibox {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 440px;
  min-width: 240px;
  max-width: 560px;
}
.omnibox .omni-ico {
  position: absolute;
  left: var(--s-1);
  display: inline-grid;
  color: var(--fg-dim);
  pointer-events: none;
}
.omnibox #search {
  height: var(--ctl-lg);
  padding: 0 64px 0 var(--s-5);
  font-size: var(--fs-2);
  background: var(--bg-1);
  border-color: var(--line-strong);
}
.omnibox #search:focus {
  border-color: var(--accent);
}
.omni-kbd {
  position: absolute;
  right: var(--s-1);
  pointer-events: none;
}
.omnibox #search-results {
  top: calc(var(--ctl-lg) + var(--s-h));
  max-height: min(64vh, 640px);
  min-width: 100%;
  width: max(100%, 560px);
}
#search-results li {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--ctl);
}
#search-results li .ri {
  display: inline-grid;
  place-items: center;
  grid-row: span 2;
  color: var(--fg-muted);
}
#search-results li b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#search-results li small {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#search-results li kbd {
  grid-column: 3;
  grid-row: 1 / span 2;
}
#search-results li.grp {
  display: block;
  min-height: 0;
  padding: var(--s-1) var(--s-1) var(--s-h);
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-dim);
  cursor: default;
  background: none !important;
}

/* status strip: filtered rows by grade, data freshness, live feeds. Not a classification banner. */
.statusbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  min-width: 0;
  font-size: var(--fs-1);
  color: var(--fg-muted);
  white-space: nowrap;
}
.statusbar > span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-h);
}
.st-total b {
  color: var(--fg);
}
.st-grades {
  gap: var(--s-1) !important;
}
.gchip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-h);
  height: var(--ctl-sm);
  padding: 0 2px;
  cursor: help;
}
.gchip i,
.lg-grades i,
.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--fg-dim));
  flex: none;
}
.gchip b {
  color: var(--fg);
  font-weight: 600;
}
.st-fresh {
  cursor: help;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: var(--s-h);
}
.live-off i {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fg-dim);
}
.live-loading i {
  background: var(--warn);
}
.live-ok i {
  background: var(--ok);
}
.live-error i {
  background: var(--danger);
}
.clocks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  font-size: var(--fs-1);
  line-height: 1.25;
  color: var(--fg-muted);
  white-space: nowrap;
}
.clocks .clk b {
  display: inline-block;
  min-width: 3.4ch;
  font-weight: 600;
  color: var(--fg-dim);
}
.clocks time {
  color: var(--fg);
  font-family: var(--font-mono);
}
#topbar .tools {
  margin-left: 0;
  gap: var(--s-h);
}

/* ---------------------------------------------------------------- activity bar */
#actbar {
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: var(--timeline-h);
  width: var(--actbar-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) 0;
  background: rgba(3, 6, 12, 0.88);
  border-right: 1px solid var(--line);
  z-index: var(--z-chrome);
  overflow: hidden;
}
.act-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-h);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--line);
}
.act-group:last-child {
  border-bottom: 0;
}
.act {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--act-btn);
  height: var(--act-btn);
  padding: 0;
  color: var(--fg-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  cursor: pointer;
  transition:
    background var(--dur-1),
    color var(--dur-1);
}
.act svg {
  width: 20px;
  height: 20px;
}
.act:hover {
  color: var(--fg);
  background: var(--hover);
}
.act[aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(56, 232, 255, 0.35);
}
.act[aria-pressed='true']::before {
  content: '';
  position: absolute;
  left: calc((var(--actbar-w) - var(--act-btn)) / -2);
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.act-key {
  position: absolute;
  right: 2px;
  bottom: 0;
  font: 600 var(--fs-1) / 1 var(--font-mono);
  color: var(--fg-dim);
  pointer-events: none;
}

/* ---------------------------------------------------------------- rail beside the activity bar */
#rail {
  left: calc(var(--actbar-w) + var(--s-1));
}
@media (width < 1440px) {
  :root {
    --rail-w: 288px;
  }
}
body.rail-collapsed #rail {
  display: none;
}

/* ---------------------------------------------------------------- free-area overlays */
#credits {
  bottom: calc(var(--timeline-h) + var(--s-h));
  line-height: 16px;
}
#status {
  top: calc(var(--topbar-h) + var(--s-2));
  bottom: auto;
  max-width: calc(100vw - var(--occ-left, 0px) - var(--occ-right, 0px) - 160px);
  padding: var(--s-h) var(--s-2);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#status:empty {
  display: none;
}
#maptools {
  position: fixed;
  top: calc(var(--topbar-h) + var(--s-1));
  right: calc(var(--occ-right, 0px) + var(--s-1));
  display: flex;
  flex-direction: column;
  gap: var(--s-h);
  padding: var(--s-h);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  z-index: var(--z-rail);
}
#maptools .btn {
  background: transparent;
  border-color: transparent;
}
#maptools .btn:hover,
#maptools .btn[aria-pressed='true'] {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}
#maptools .btn[aria-pressed='true'] {
  color: var(--accent);
}
/* v1.5: separator between navigation tools and the globe reference toggles (grid, terminator, heat) */
#maptools .mt-sep {
  height: 1px;
  margin: var(--s-h) var(--s-h);
  background: var(--line);
}
body.win-max-open #maptools,
body.win-max-open #legend {
  visibility: hidden;
}

/* legend: bottom-left of the free globe area, above the credit strip and any bottom dock */
#legend {
  position: fixed;
  left: calc(var(--occ-left, 0px) + var(--s-1));
  bottom: calc(var(--timeline-h) + var(--credit-h) + var(--occ-bottom, 0px) + var(--s-h));
  width: var(--legend-w);
  max-height: calc(100vh - var(--topbar-h) - var(--timeline-h) - var(--credit-h) - var(--occ-bottom, 0px) - var(--s-6));
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  z-index: var(--z-rail);
  font-size: var(--fs-1);
}
#legend[hidden] {
  display: none;
}
.lg-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-h) var(--s-h) var(--s-h) var(--s-2);
  border-bottom: 1px solid var(--line);
}
.lg-head h2 {
  margin: 0;
  font-size: var(--fs-2);
  font-weight: 600;
}
.lg-head span {
  flex: 1;
  text-align: right;
}
.lg-body {
  overflow-y: auto;
  padding: var(--s-1) var(--s-2) var(--s-2);
  scrollbar-width: thin;
}
.lg-h {
  margin: var(--s-1) 0 var(--s-h);
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-dim);
}
details > summary.lg-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--ctl-sm);
  margin: var(--s-h) 0 0;
  border-top: 1px solid var(--line);
  list-style-position: inside;
}
details > summary.lg-h::-webkit-details-marker {
  display: none;
}
details > summary.lg-h::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: var(--s-1);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur-1);
}
details[open] > summary.lg-h::after {
  transform: rotate(45deg);
}
details > summary.lg-h span {
  margin-left: auto;
}
.lg-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lg-marks li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: var(--s-1);
  padding: 2px 0;
  line-height: 1.3;
}
.lg-cats li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-1);
  min-height: 22px;
}
.lg-cats .ci {
  display: inline-grid;
  color: var(--c);
}
.lg-cats .cn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-body .n {
  color: var(--fg);
  font-weight: 600;
}
.lg-grades {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-h) var(--s-1);
}
.lg-grades li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-h);
}

/* selection reticle: follows the open case each frame (src/ui/console.js); sized to the uncertainty circle */
#sel-reticle {
  position: fixed;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: var(--z-hud);
  will-change: transform;
}
#sel-reticle i {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--warn);
  filter: drop-shadow(0 0 2px #000);
}
#sel-reticle i:nth-child(1) {
  left: 0;
  top: 0;
  border-right: 0;
  border-bottom: 0;
}
#sel-reticle i:nth-child(2) {
  right: 0;
  top: 0;
  border-left: 0;
  border-bottom: 0;
}
#sel-reticle i:nth-child(3) {
  left: 0;
  bottom: 0;
  border-right: 0;
  border-top: 0;
}
#sel-reticle i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}
@media (prefers-reduced-motion: no-preference) {
  body:not(.reduced-motion) #sel-reticle {
    animation: reticle-in var(--dur-2) var(--ease-out);
  }
}
@keyframes reticle-in {
  from {
    opacity: 0;
  }
}
/* the camera-aim reticle at screen centre is quieter than the selection reticle */
.reticle i {
  border-color: rgba(56, 232, 255, 0.35);
}

/* hover card */
.tooltip.hovercard {
  width: 300px;
  max-width: 300px;
  padding: var(--s-1) var(--s-2) var(--s-1);
  border-radius: var(--radius-2);
  font-size: var(--fs-1);
  line-height: 1.4;
}
.hc-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-1);
  padding-bottom: var(--s-h);
  margin-bottom: var(--s-h);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-2);
}
.hc-head .ci {
  display: inline-grid;
  padding-top: 2px;
  color: var(--c, var(--accent));
}
.hc-head b {
  font-weight: 600;
}
.hc-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-h) var(--s-1);
  align-items: center;
  margin: 2px 0;
}
.hc-src {
  margin-top: var(--s-h);
  overflow-wrap: anywhere;
}
.hc-foot {
  margin-top: var(--s-h);
}

/* ---------------------------------------------------------------- activity feed window */
.feed-top {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.feed-top .tabbar {
  flex: 1;
}
.feed-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-1);
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.feed-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.feed-list li {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.feed-row {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: var(--s-1);
  align-items: center;
  min-height: var(--ctl);
  padding: var(--s-h) var(--s-1);
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.feed-row.static {
  cursor: default;
}
.feed-row:hover {
  background: var(--hover);
}
.feed-row .fi {
  grid-row: span 2;
  display: inline-grid;
  color: var(--fg-muted);
}
.feed-row .ft {
  font-size: var(--fs-1);
  color: var(--fg-muted);
}
.feed-row .fn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-row .fk {
  grid-column: 2 / span 2;
  font-size: var(--fs-1);
  overflow-wrap: anywhere;
}
.fsrc {
  display: grid;
  place-items: center;
  width: var(--ctl);
  color: var(--fg-muted);
}
.feed-src {
  margin-top: var(--s-2);
  padding-left: var(--s-2);
}

/* ---------------------------------------------------------------- dossier: identity, chips, provenance */
.dz-head {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
}
.dz-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--ctl-lg);
  height: var(--ctl-lg);
  border-radius: var(--radius-2);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.dz-id {
  min-width: 0;
}
.dz-id .kicker {
  margin: 0;
}
.dz-id h2 {
  margin: var(--s-h) 0 0;
}
.dz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-h) var(--s-1);
  margin: var(--s-2) 0 var(--s-1);
}
.dz-prov {
  margin: var(--s-1) 0 var(--s-2);
  padding: var(--s-1) var(--s-2);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-1);
}
.dz-prov h4 {
  margin-top: var(--s-h);
}
.dz-prov table.kv th {
  width: 9.5em;
}

/* ---------------------------------------------------------------- generated keyboard overlay */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--s-1) var(--s-3);
}
.help-grid .hk h4 {
  margin: var(--s-1) 0 var(--s-h);
}
.help-grid table.kv th {
  width: 7.5em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- responsive command bar */
@media (width < 1760px) {
  #topbar .brand small,
  .st-total {
    display: none !important;
  }
  .gchip .gl,
  .st-fresh .mono {
    display: none;
  }
}
@media (width < 1440px) {
  #topbar {
    gap: var(--s-1);
  }
  .st-total {
    display: none !important;
  }
  .omni-kbd {
    display: none;
  }
  .omnibox #search {
    padding-right: var(--s-1);
  }
  .clocks .sec {
    display: none;
  }
}
@media (width < 1100px) {
  #topbar .brand .display {
    display: none;
  }
  .st-fresh {
    display: none !important;
  }
}

/* ---------------------------------------------------------------- high contrast */
body.theme-hc {
  --bg-0: #000;
  --bg-1: #000;
  --bg-2: #0a0a0a;
  --bg-3: #1a1a1a;
  --bg-4: #262626;
  --glass: #000;
  --glass-head: #0a0a0a;
  --line: #8a8a8a;
  --line-strong: #ffffff;
  --fg: #ffffff;
  --fg-muted: #e6e6e6;
  --fg-dim: #cccccc;
  --accent: #ffe14d;
  --accent-soft: rgba(255, 225, 77, 0.18);
  --hover: rgba(255, 255, 255, 0.14);
  --zebra: rgba(255, 255, 255, 0.06);
  --focus: 0 0 0 2px #000, 0 0 0 4px var(--hc-focus);
  --chart-axis: #ffffff;
}
body.theme-hc #topbar,
body.theme-hc #timeline,
body.theme-hc #actbar {
  background: #000;
  backdrop-filter: none;
}
body.theme-hc .win,
body.theme-hc #rail,
body.theme-hc #legend,
body.theme-hc #maptools,
body.theme-hc .tooltip {
  backdrop-filter: none;
  border-width: 2px;
}
body.theme-hc a {
  color: #8fd8ff;
  text-decoration: underline;
}

/* ---------------------------------------------------------------- 4K at DPR 1: the 1.25x ladder (ADR 0004 §13) */
@media (width >= 2560px) {
  :root {
    --fs-1: 15px;
    --fs-2: 18px;
    --fs-3: 21px;
    --fs-4: 25px;
    --fs-5: 30px;
    --fs-6: 36px;
    --s-h: 5px;
    --s-1: 10px;
    --s-2: 20px;
    --s-3: 30px;
    --s-4: 40px;
    --s-5: 50px;
    --s-6: 60px;
    --s-8: 80px;
    --ctl: 40px;
    --ctl-lg: 50px;
    --rail-w: 400px;
    --dossier-w: 525px;
    --timeline-h: 200px;
    --topbar-h: 70px;
    --actbar-w: 70px;
    --act-btn: 50px;
    --credit-h: 30px;
    --legend-w: 340px;
  }
  body.density-comfortable {
    --ctl-sm: 40px;
  }
  body.density-compact {
    --ctl-sm: 30px;
    --act-btn: 44px;
  }
  .act svg {
    width: 24px;
    height: 24px;
  }
  .win-head {
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .win-btn {
    width: 40px;
    height: 40px;
  }
  .tooltip.hovercard {
    width: 380px;
    max-width: 380px;
  }
}

/* ---------------------------------------------------------------- timeline dock: grouped controls */
.tl-controls {
  gap: var(--s-1);
}
.tl-steps {
  gap: 0;
}
.tl-steps .btn.sm {
  min-width: var(--ctl);
  border-radius: 0;
  margin-left: -1px;
}
.tl-steps .btn.sm:first-child {
  border-radius: var(--radius-1) 0 0 var(--radius-1);
  margin-left: 0;
}
.tl-steps .btn.sm:last-child {
  border-radius: 0 var(--radius-1) var(--radius-1) 0;
}
.tl-controls select,
.tl-date input {
  height: var(--ctl-sm);
  font-size: var(--fs-1);
}
#tl-label,
.tl-date input,
#tl-hour-v {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ==========================================================================================================
   v1.4 polish pass (second front-end review): layer rail rows, legend chip, timeline dock (transport row,
   overview + detail track, focus and read-out row), status strip filters, tooltips, panel hierarchy.
   ========================================================================================================== */
:root {
  --rail-w: 336px;
  --glass: rgba(8, 14, 25, 0.9);
  --glass-head: rgba(16, 27, 45, 0.97);
}
@media (width < 1440px) {
  :root {
    --rail-w: 304px;
  }
}
@media (width >= 2560px) {
  :root {
    --rail-w: 420px;
  }
}
body.density-compact {
  --timeline-h: 140px;
}

/* ---- layer rail: name wraps to two lines, count, details button; opacity lives in the details row */
.lrow {
  grid-template-columns: minmax(0, 1fr) auto var(--ctl-sm);
  column-gap: var(--s-1);
  padding: 0;
  border-radius: var(--radius-1);
}
.lrow:hover {
  background: var(--hover);
}
.lrow .lname {
  align-items: center;
  gap: var(--s-1);
  padding: 2px 0 2px var(--s-h);
  line-height: var(--lh-tight);
}
.lrow .lname .lt {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.sw {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c, var(--fg-dim));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.lrow .n {
  min-width: 4ch;
  text-align: right;
  font-size: var(--fs-1);
  color: var(--fg-dim);
}
.lrow .info {
  width: var(--ctl-sm);
  height: var(--ctl-sm);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-1);
  color: var(--fg-dim);
}
.lrow .info:hover,
.lrow .info[aria-expanded='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}
.lrow.dis .lname {
  color: var(--fg-dim);
  cursor: default;
}
.lsrc {
  padding: var(--s-h) var(--s-1) var(--s-1) calc(var(--s-h) + 34px);
  border-left: 2px solid var(--line-strong);
  margin: 0 0 var(--s-1) calc(var(--s-h) + 8px);
  line-height: var(--lh);
}
.lnote {
  color: var(--fg-muted);
  margin-bottom: var(--s-h);
}
.lop {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-height: var(--ctl-sm);
  color: var(--fg-muted);
}
.lop input {
  flex: 1;
  width: auto;
  min-height: var(--ctl-sm); /* v1.5 audit: the range track was a 16 px target (WCAG 2.5.8 needs 24) */
  accent-color: var(--accent);
}
.lop output {
  min-width: 4ch;
  text-align: right;
  color: var(--fg);
}
.lgds {
  margin: var(--s-h) 0;
}
.pane .lg {
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--line);
}
.pane .lg:last-child {
  border-bottom: 0;
}
.xfiles {
  margin-left: calc(var(--s-h) + 26px);
}
.xfiles summary {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.xfiles summary .n {
  margin-left: auto;
}
.xlist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--s-2);
}
.xlist li {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  min-height: var(--ctl-sm);
  color: var(--fg-muted);
}
.xlist li span:last-child {
  margin-left: auto;
  font-size: var(--fs-1);
}
.count {
  padding: var(--s-1) var(--s-2);
  font-size: var(--fs-2);
}
.count b {
  font-size: var(--fs-3);
}

/* ---- legend: a chip docked bottom-left of the free globe area; expands upward */
#legend {
  width: auto;
  min-width: 0;
  max-width: var(--legend-w);
  bottom: calc(var(--timeline-h) + var(--credit-h) + var(--occ-bottom, 0px) + var(--s-1));
}
#legend:not(.collapsed) {
  width: var(--legend-w);
}
#legend.collapsed .lg-body {
  display: none;
}
#legend .lg-head {
  padding: 0;
  border-bottom: 0;
}
#legend:not(.collapsed) .lg-head {
  border-bottom: 1px solid var(--line);
  background: var(--glass-head);
  border-radius: var(--radius-2) var(--radius-2) 0 0;
}
.lg-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  width: 100%;
  min-height: var(--ctl);
  padding: 0 var(--s-1) 0 var(--s-2);
  background: none;
  border: 0;
  border-radius: inherit;
  color: var(--fg);
  font: 600 var(--fs-2) var(--font-ui);
  cursor: pointer;
  text-align: left;
}
.lg-toggle:hover {
  background: var(--hover);
}
.lg-ico {
  display: inline-grid;
  color: var(--accent);
}
.lg-title {
  flex: none;
}
.lg-sum {
  display: inline-flex;
  gap: var(--s-1);
  margin-left: auto;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--fg-muted);
}
.lg-sum span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.lg-sum svg {
  width: 14px;
  height: 14px;
}
.lg-chev {
  display: inline-grid;
  color: var(--fg-dim);
  transform: rotate(180deg);
  transition: transform var(--dur-1);
}
#legend:not(.collapsed) .lg-chev {
  transform: none;
}

/* ---- timeline dock: transport row, overview strip + detail track (one canvas), focus + read-out row */
#timeline {
  padding: var(--s-1) var(--s-2) var(--s-h);
  gap: var(--s-h);
}
.tl-controls {
  gap: var(--s-2);
  overflow: visible;
}
.tl-group {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
}
.tl-cap {
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-dim);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  overflow: hidden;
  background: var(--bg-1);
}
.seg-b {
  min-width: var(--ctl-sm);
  height: var(--ctl-sm);
  padding: 0 var(--s-1);
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--fg-muted);
  font: 500 var(--fs-1) var(--font-mono);
  cursor: pointer;
  white-space: nowrap;
}
.seg-b:first-child {
  border-left: 0;
}
.seg-b:hover {
  background: var(--hover);
  color: var(--fg);
}
.seg-b[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
#tl-mode .seg-b,
#tl-era .seg-b {
  font-family: var(--font-ui);
}
.tl-play {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  width: auto !important;
  min-width: 96px;
  height: var(--ctl);
  padding: 0 var(--s-2) 0 var(--s-1);
  font: 600 var(--fs-2) var(--font-ui);
}
.tl-spacer {
  flex: 1;
}
.tl-date {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
}
#tl-canvas {
  margin-top: 0;
}
.tl-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}
.tl-win {
  font-size: var(--fs-1);
  color: var(--accent);
}
.tl-readout {
  margin-left: auto;
  display: flex;
  gap: var(--s-2);
  font-size: var(--fs-1);
  color: var(--fg-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums slashed-zero;
}
.tl-readout .hud-coord,
.tl-readout .hud-date {
  position: static;
  width: auto;
  left: auto;
  right: auto;
  bottom: auto;
  font: 500 var(--fs-1) var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  text-shadow: none;
  overflow: visible;
}
.tl-readout .hud-date {
  color: var(--accent);
}
@media (width < 1440px) {
  .tl-controls .tl-cap,
  #tl-label,
  .tl-play-t {
    display: none;
  }
  .tl-play {
    min-width: var(--ctl);
    padding: 0 var(--s-1);
    justify-content: center;
  }
  .tl-controls {
    gap: var(--s-1);
  }
  .tl-win {
    display: none;
  }
}

/* ---- status strip: one count ('cases'); grade chips are filter toggles */
button.gchip {
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  background: none;
  color: var(--fg-muted);
  font: inherit;
  padding: 0 var(--s-1);
  cursor: pointer;
}
button.gchip:hover {
  background: var(--hover);
  color: var(--fg);
}
button.gchip[aria-pressed='true'] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--fg);
}

/* ---- tooltips for icon-only controls (src/ui/tips.js) */
.act-key {
  display: none;
}
.uitip {
  position: fixed;
  z-index: var(--z-tour);
  display: flex;
  align-items: center;
  gap: var(--s-1);
  max-width: 320px;
  padding: var(--s-h) var(--s-1);
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-1);
  color: var(--fg);
  font: 500 var(--fs-1) / var(--lh-tight) var(--font-ui);
  pointer-events: none;
}
.uitip[hidden] {
  display: none;
}
.uitip kbd {
  padding: 0 var(--s-h);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font: 600 var(--fs-1) var(--font-mono);
  color: var(--fg-muted);
}

/* ---- panel hierarchy: one strong header style, fewer inner borders */
.win-head,
.panel > header {
  background: var(--glass-head);
  border-bottom: 1px solid var(--line-strong);
}
.win-title,
.panel > header h3 {
  font-weight: 650;
  letter-spacing: 0.01em;
}
.win.top {
  box-shadow:
    var(--shadow),
    0 0 0 1px var(--line-strong);
}
.panel h4,
.pane h4 {
  color: var(--fg-muted);
}
body.theme-hc .uitip {
  background: #000;
  border-color: #fff;
}
@media (width >= 2560px) {
  body.density-compact {
    --timeline-h: 176px;
  }
}

/* ---------------------------------------------------------------- polish pass: --check fixes (targets, clipping) */
/* related-case links, the UTC hour slider and the credit expander meet the 24 px target / 12 px text floor */
.rel a {
  min-height: 24px;
}
.tl-hour input {
  height: 24px;
}
#credits .cesium-credit-expand-link {
  font-size: var(--fs-1);
}
/* the settings window never grows wider than its dock: long select options and notes wrap or shrink */
#set-body {
  grid-template-columns: minmax(0, 1fr);
}
#set-body label {
  min-width: 0;
  min-height: 24px;
  flex-wrap: wrap;
}
#set-body input[type='range'] {
  height: 24px;
}
#set-body select {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 160px;
}
/* chart cards wrap below ~300 px instead of shrinking the bar rows under the 24 px target */
.cgrid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.cgrid svg.bars {
  max-width: 420px;
}
/* short screens (1280x800): the activity bar keeps every button visible */
@media (height < 900px) {
  :root {
    --act-btn: 34px;
  }
  #actbar {
    gap: var(--s-h);
  }
  .act-group {
    gap: 2px;
    padding-bottom: var(--s-h);
  }
}
/* narrow command bar: live-feed names collapse to their dots (name stays in the tooltip and for screen readers) */
@media (width < 1440px) {
  #topbar .live .lv-n {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
