/*
 * Medusa panel — component styles.
 * Direction: Sounding Chart. See ../../../DESIGN.md for the token
 * contract and `docs/design/mocks/live.html` for the design mock
 * these styles implement.
 */

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

/*
 * Global hidden-attribute reset. Author rules like `.gate { display: flex }`
 * and `.frame { display: grid }` override the UA stylesheet's
 * `[hidden] { display: none }`, which silently breaks every view toggle
 * driven by the `hidden` property (gate vs frame, view switching).
 * This reset restores the contract: `hidden` always wins.
 */
[hidden] { display: none !important; }

/* Browser surfaces — drawn from the palette, not left to UA defaults:
 * selection, caret, scrollbars, and a focus ring for every control
 * that doesn't swap outline for a border-color affordance. */
::selection { background: var(--live-veil-strong); color: var(--fg); }
input, textarea, [contenteditable] { caret-color: var(--live); }
:focus-visible { outline: 1.5px solid var(--live); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--edge-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--edge-strong);
  border: 3px solid var(--bg);
  border-radius: 4px;
}
*::-webkit-scrollbar-track { background: transparent; }

html, body { background: var(--shell-outer); min-height: 100vh; }
body {
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
}

/* ─── sign-in gate ───────────────────────────────────────────────── */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.gate-card {
  width: 420px;
  padding: 40px;
  background: var(--bg-2);
  border: 1px solid var(--edge);
}
.gate-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.gate-mark img {
  width: 64px; height: 64px; flex: none;
  border-radius: 4px;
}
.gate-word {
  font-family: var(--f-display);
  font-size: 34px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg);
  line-height: 1;
}
.gate-sub {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 28px;
}
.gate-field {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--edge-strong);
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.gate-field:focus {
  outline: none;
  border-color: var(--live);
}
.gate-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 20px;
  background: var(--capture);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.gate-btn:hover { filter: brightness(1.08); }
.gate-err {
  margin-top: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fail);
  min-height: 16px;
}
.gate-code { display: block; }
.gate-code-field {
  font-family: var(--f-mono);
  font-size: 20px;
  letter-spacing: 0.5em;
  text-align: center;
}
.gate-hint {
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.gate-resend {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--live);
  font: inherit;
  cursor: pointer;
}
.gate-resend:hover { text-decoration: underline; }

/* ─── shell ──────────────────────────────────────────────────────── */
/* Fixed app-shell: the frame is exactly the viewport, the overview
 * and chart views scroll internally, and the rail column is pinned
 * — its footer (sign out) never rides the document bottom. */
.frame {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 220px 1fr;
}
.frame.rail-hidden { grid-template-columns: 0 1fr; }
/* visibility, not display:none — removing the rail from the grid
 * would auto-place the stage into the collapsed 0-width column. */
.frame.rail-hidden .rail { visibility: hidden; }

/* top strip */
.top {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--edge);
  padding: 0 16px;
}
.topleft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.rail-toggle {
  width: 28px; height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--edge-strong);
  color: var(--fg-dim);
  cursor: pointer;
  padding: 0;
}
.rail-toggle:hover { color: var(--fg); border-color: var(--fg-dim); }
.rail-toggle svg { width: 14px; height: 14px; }
.rail-scrim { display: none; }
.mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mark img {
  width: 26px; height: 26px; flex: none;
  border-radius: 3px;
}
.mark-word {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg);
  line-height: 1;
}
.mark-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  border-left: 1px solid var(--edge-strong);
  padding-left: 10px;
  white-space: nowrap;
}
/* Theme toggle — sun in night watch (switch to daylight), moon in
   daylight chart (switch back to night). */
.theme-toggle {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--edge-strong);
  color: var(--fg-dim);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-dim); }
.theme-toggle svg { width: 14px; height: 14px; }
:root[data-theme="night"] .ic-moon { display: none; }
:root[data-theme="day"] .ic-sun { display: none; }
.topright {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
}
.topright .pill {
  padding: 3px 10px;
  border: 1px solid var(--edge-strong);
  color: var(--fg);
}
.topright .pill.ok { color: var(--live); border-color: var(--live-ring); }
.topright .pill.err { color: var(--fail); border-color: var(--fail-ring); }
.topright .live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--live);
}
.topright .live-indicator .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.4s ease-in-out infinite;
}
.topright .live-indicator.off {
  color: var(--fg-faint);
}
.topright .live-indicator.off .pulse {
  background: var(--fg-faint);
  box-shadow: none;
  animation: none;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .topright .live-indicator .pulse { animation: none; }
}

/* nav rail — a viewport-height column split in two: the nav groups
 * scroll internally when the window is short; the footer (sign out)
 * is pinned above the bottom edge and never scrolls out of view. */
.rail {
  border-right: 1px solid var(--edge);
  padding: 16px 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.rail-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.rail-group {
  padding: 0 20px;
  margin-bottom: 18px;
}
.rail-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}
/* Rules do the separating — the group label carries a hairline. */
.rail-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--edge);
}
.rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
  margin-left: -10px;
  margin-right: -10px;
  /* The display voice at nav scale — condensed caps read commanding
     without widening the rail. */
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  width: calc(100% + 20px);
  text-align: left;
  cursor: pointer;
}
.rail-item.active {
  color: var(--fg);
  font-weight: 700;
  border-left-color: var(--capture);
  background: var(--ribbon);
}
.rail-item:hover { color: var(--fg); background: var(--ribbon); }
.rail-item .count {
  font-family: var(--f-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
  border: 1px solid var(--edge);
  padding: 1px 6px;
  min-width: 24px;
  text-align: center;
}
.rail-item.active .count { color: var(--live); border-color: var(--live-ring); }
.rail-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--edge);
  font-size: 12px;
  color: var(--fg-faint);
}
.rail-ver { white-space: nowrap; }
.rail-foot button {
  display: block;
  flex: 1;
  min-height: 36px;
  padding: 8px 0;
  background: transparent;
  border: 1px solid var(--edge-strong);
  color: var(--fg-dim);
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.rail-foot button:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}

/* ─── stage + views ──────────────────────────────────────────────── */
.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
/* Each top-level page is a .view section; the global [hidden] reset
   handles switching. Views are flex columns so an inner .chart can
   scroll while the header stays put. Overview scrolls as a whole. */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#overview-view { overflow-y: auto; }
/* Settings + Deploy scroll as whole pages — the fixed shell clips
 * anything that doesn't scroll internally, which left these views
 * unreachable below the fold. Chart views keep their inner .chart
 * scroller so the toolbar stays pinned. */
#settings-view,
#deploy-view,
#docs-view {
  overflow-y: auto;
}

/* ─── overview — KPI soundings ───────────────────────────────────── */
.kpi {
  border-bottom: 1px solid var(--edge);
}
.kpi-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px 32px;
  border-bottom: 1px solid var(--edge);
}
.kpi-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-label .marker {
  width: 4px; height: 4px;
  background: var(--edge-strong);
  transform: rotate(45deg);
}
.kpi-label.hero .marker { background: var(--capture); }
.kpi-label.live .marker { background: var(--live); }
.kpi-label.gold .marker { background: var(--brand); }
.kpi-label.amber .marker { background: var(--warn); }
.kpi-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 14px 32px 8px;
}
.kpi-num {
  font-family: var(--f-display);
  font-size: 96px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg);
  font-feature-settings: "tnum" 1, "lnum" 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.kpi-num.hero { color: var(--capture); }
.kpi-num.live { color: var(--live); }
.kpi-num.gold { color: var(--brand); }
.kpi-num.amber { color: var(--warn); }
.kpi-num .suffix {
  font-size: 22px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  font-family: var(--f-display);
  font-weight: 600;
  text-transform: uppercase;
}
.kpi-sub {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 32px 16px;
}
.kpi-sub-cell {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 13px;
  color: var(--fg-dim);
}

/* ─── overview — soundings chart ─────────────────────────────────── */
/* The capture map: an engraved dot-field world under a 30° graticule,
 * capture clusters plotted as bronze soundings (ring + numbered
 * depth). A framed plate, not a card — hairline border, inset ground,
 * no shadow. */
.ov-map {
  padding: 18px 32px 16px;
  border-bottom: 1px solid var(--edge);
}
.ov-map .ov-lane-head {
  display: flex;
  align-items: baseline;
}
.ov-map-count {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--capture);
}
.ov-map-frame {
  position: relative;
  border: 1px solid var(--edge);
  background: var(--bg-2);
  padding: 10px 14px;
}
#ov-map-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
}
.map-ocean { fill: var(--map-ocean); }
.map-land path {
  fill: var(--map-land);
  stroke: var(--map-coast);
  stroke-width: 0.9;
  stroke-linejoin: round;
}
.map-borders path {
  fill: none;
  stroke: var(--map-coast);
  stroke-width: 0.5;
  stroke-opacity: 0.5;
  vector-effect: non-scaling-stroke;
}
.map-hit-halo {
  fill: none;
  stroke: var(--capture-glow);
  stroke-width: 1;
}
.map-hit-ring {
  fill: var(--capture-veil);
  stroke: var(--capture);
  stroke-width: 1.4;
}
.map-hit-core { fill: var(--capture); }
.map-hit-num {
  fill: var(--capture);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  text-anchor: middle;
}
.ov-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-faint);
}
.ov-map-league {
  display: flex;
  flex-wrap: wrap;
  column-gap: 22px;
  row-gap: 4px;
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
}
.map-league-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.map-league-rank { color: var(--fg-faint); font-size: 10.5px; }
.map-league-n { color: var(--capture); font-weight: 500; }

/* ─── overview — in-flight / captures band ───────────────────────── */
.ov-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--edge);
}
.ov-col { padding: 20px 32px 22px; min-width: 0; }
.ov-col + .ov-col { border-left: 1px solid var(--edge); }
.ov-col-head, .ov-lane-head {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 10px;
}
/* Lists cap at ~8 rows and scroll internally — a busy relay must not
 * stretch the overview into a mile-long page. */
.ov-list {
  display: flex;
  flex-direction: column;
  max-height: 330px;
  overflow-y: auto;
}
.ov-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 0;
  border-bottom: 1px solid var(--edge-soft);
  font-size: 13px;
  color: var(--fg-dim);
  min-width: 0;
}
.ov-row:last-child { border-bottom: 0; }
button.ov-row {
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
button.ov-row:hover, .ov-main:hover { color: var(--fg); }
.ov-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ov-time {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
  width: 56px;
  flex: none;
}
.ov-target {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 84px;
  flex: none;
}
.ov-state {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  flex: none;
}
.ov-state.live { color: var(--live); }
.ov-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
  flex: none;
}
.ov-copy, .ov-open {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--capture-edge);
  color: var(--capture);
  background: transparent;
  cursor: pointer;
  flex: none;
}
.ov-copy:hover { color: var(--capture-hover); border-color: var(--capture); background: var(--capture-veil); }
.ov-copy.copied { color: var(--live); border-color: var(--live-ring); }
.ov-open { border-color: var(--capture); }
.ov-open:hover { background: var(--capture); color: var(--bg); }
.ov-empty {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-faint);
  padding: 12px 0;
}

/* parked lane — takeover contexts, bronze edge */
.ov-lane {
  padding: 18px 32px 20px;
  border-bottom: 1px solid var(--edge);
}
.ov-row.parked { box-shadow: inset 2px 0 0 var(--capture); padding-left: 10px; }

/* coverage strip — one chip per sight */
.ov-cover {
  padding: 18px 32px 20px;
  border-bottom: 1px solid var(--edge);
}
.ov-cover-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cov-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--edge-strong);
  background: transparent;
  color: var(--fg-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cov-chip:hover { border-color: var(--fg-dim); color: var(--fg); }
.cov-chip.dim { opacity: 0.45; }
.cov-num { font-family: var(--f-mono); font-size: 12px; color: var(--fg); }
.cov-cap {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--capture);
}

/* ops strip */
.ov-ops {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 32px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.ov-ops-item.right { margin-left: auto; }
.ov-ops-item.warn { color: var(--warn); }

/* ─── view head — title + the page's own toolbar ─────────────────── */
.view-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 8px 32px;
  min-height: 48px;
  border-bottom: 1px solid var(--edge);
  gap: 32px;
}
.chart-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chart-title .orient {
  color: var(--capture);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.chart-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-size: 13px;
}
.pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-dim);
}
.filter-pill {
  padding: 5px 12px;
  border: 1px solid var(--edge-strong);
  color: var(--fg-dim);
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  background: transparent;
  font-family: inherit;
}
.filter-pill:hover { color: var(--fg); }
.filter-pill.active {
  color: var(--live-soft);
  border-color: var(--live-ring);
  background: var(--live-veil);
}
.filter-pill .n {
  font-family: var(--f-mono);
  color: var(--fg-faint);
  margin-left: 6px;
  font-size: 12px;
}
.filter-pill.active .n { color: var(--live); }
/* Segmented range pills — joined, no gaps. */
.pill-group.seg { gap: 0; }
.pill-group.seg .filter-pill + .filter-pill { margin-left: -1px; }
.pill-group.seg .filter-pill.active {
  position: relative;
  z-index: 1;
  border-color: var(--fg-dim);
}
/* Styled selects — same edge/box language as the search field. */
.sel { position: relative; display: flex; align-items: center; }
.sel select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-2);
  border: 1px solid var(--edge-strong);
  color: var(--fg-dim);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 5px 26px 5px 10px;
  cursor: pointer;
  max-width: 168px;
}
.sel select:hover, .sel select:focus {
  color: var(--fg);
  border-color: var(--fg-dim);
  outline: none;
}
.sel::after {
  content: "▾";
  position: absolute;
  right: 9px;
  font-size: 10.5px;
  color: var(--fg-faint);
  pointer-events: none;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-faint);
  padding: 5px 10px;
  background: var(--bg-2);
  border: 1px solid var(--edge-strong);
  width: 240px;
}
.search input {
  all: unset;
  flex: 1;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg);
}
.search input::placeholder { color: var(--fg-faint); }
.search kbd {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 1px 5px;
  color: var(--fg-faint);
  border: 1px solid var(--edge-strong);
}
.compass {
  width: 52px; height: 52px;
  flex: none;
}
/* SVG internals read the palette through these classes so the
   compass themes with everything else. */
.compass .c-edge-strong { stroke: var(--edge-strong); fill: none; }
.compass .c-edge { stroke: var(--edge); fill: none; }
.compass .c-fg-dim { fill: var(--fg-dim); }
.compass .f-live { fill: var(--live); }
.compass .f-fg { fill: var(--fg); }
.compass .q25 { opacity: 0.25; }

/* Live status line — the compact soundings that stayed behind when
   the monumental KPIs moved to Overview. */
.live-strip {
  padding: 7px 32px;
  border-bottom: 1px solid var(--edge);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

/* ─── chart (session rows) ───────────────────────────────────────── */
.chart {
  flex: 1;
  overflow-y: auto;
  position: relative;
}
.row {
  display: grid;
  /* Email caps at 320px — it was the only flex track and ballooned
     to ~30% of the row. Actions take the flex instead so the button
     group centers in the remaining space rather than hugging the
     right edge. */
  grid-template-columns: 28px 72px 108px 116px minmax(160px, 320px) 96px 104px 128px minmax(250px, 1fr);
  align-items: center;
  padding: 6px 32px 6px 24px;
  border-bottom: 1px solid var(--edge-soft);
  min-height: 34px;
  font-size: 13px;
  position: relative;
  color: var(--fg-dim);
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.row.head {
  min-height: 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--edge);
  cursor: default;
}
.row .cell { color: inherit; }
.row .time {
  font-family: var(--f-mono);
  color: var(--fg);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.row .target {
  color: var(--fg);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.row .state {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Parked-session marker — a live cyan pip before the label. */
.row .state .parked-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 5px;
  vertical-align: 1px;
}
.row .email {
  color: var(--fg);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .email .host { color: var(--fg-dim); }
.row .password {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .ip {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
}
.row .loc {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .mark-glyph {
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.row .mark-glyph span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-faint);
}
.row .act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--fg-faint);
  font-family: var(--f-mono);
  font-size: 12px;
}

.row.live { color: var(--fg); }
.row.live .state { color: var(--live); }
.row.live .mark-glyph span {
  background: var(--live);
}

.row.degraded .state { color: var(--warn); }
.row.degraded .mark-glyph span { background: var(--warn); }

.row.failed { opacity: 0.78; }
.row.failed .state { color: var(--fail); }
.row.failed .mark-glyph span { background: var(--fail); }

.row.closed { opacity: 0.6; }
.row.closed .mark-glyph span { background: var(--fg-faint); }

.row.captured {
  background: var(--capture-veil);
  border-bottom: 1px solid var(--capture-edge);
  color: var(--fg);
}
.row.captured .target { color: var(--capture); }
.row.captured .state { color: var(--capture); }
.row.captured .mark-glyph span {
  width: 0; height: 0;
  background: transparent;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--capture);
  border-radius: 0;
}
/* ─── button system ─────────────────────────────────────────────────
   One base, four tonal variants. Bronze is reserved for the capture
   action (per DESIGN.md); cyan = inspect/export, red = destructive,
   ghost = neutral utility. Real states: hover, active, focus-visible,
   disabled, copied. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 120ms,
    border-color 120ms,
    color 120ms,
    box-shadow 120ms,
    filter 120ms;
}
.btn svg { width: 11px; height: 11px; flex: none; }
.btn:focus-visible { outline: 1px solid var(--live); outline-offset: 1px; }
.btn:active { filter: brightness(0.9); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* capture — the only filled action on the panel: lime, flat */
.btn-bronze {
  background: var(--capture-fill);
  border-color: transparent;
  color: var(--capture-ink);
}
.btn-bronze:hover:not(:disabled) { background: var(--capture-fill-hi); }
.btn-bronze.copied { background: var(--live); color: var(--capture-ink); }
.btn-bronze:disabled {
  background: transparent;
  border-color: var(--edge);
  color: var(--fg-faint);
}

/* inspect / export */
.btn-cyan {
  border-color: var(--live-ring);
  background: var(--live-veil);
  color: var(--live);
}
.btn-cyan:hover:not(:disabled) {
  border-color: var(--live);
  background: var(--live-veil-strong);
  color: var(--live-soft);
}
.btn-cyan:active { background: var(--live-veil-strong); }
.btn-cyan.copied { border-color: var(--live); color: var(--live); }

/* destructive */
.btn-red {
  border-color: var(--fail-ring);
  color: var(--fail-soft);
}
.btn-red:hover:not(:disabled) {
  border-color: var(--fail-soft);
  background: var(--fail-veil);
  color: var(--fail-soft-hi);
}
.btn-red:active { background: var(--fail-veil-strong); }
.btn-red:disabled { border-color: var(--edge); color: var(--fg-faint); }

/* neutral utility */
.btn-ghost { border-color: var(--edge); color: var(--fg-dim); }
.btn-ghost:hover:not(:disabled) {
  border-color: var(--edge-strong);
  color: var(--fg);
}
.btn-ghost.copied { border-color: var(--live-ring); color: var(--live); }

/* form-scale variant — integration/deploy forms get a taller button */
.btn.int-save,
.btn.int-remove { height: auto; min-height: 30px; padding: 7px 16px; font-size: 12px; }

/* ─── target favicons ─── */
.ticon { display: block; flex: none; }
.cell.target { display: flex; align-items: center; gap: 7px; }
.deploy-col-target { display: flex; align-items: center; gap: 8px; }
.filter-pill .ticon { display: inline-block; vertical-align: -2px; margin-right: 5px; }
.rail-item .ticon { margin-right: 8px; }
.detail-title .ticon { display: inline-block; vertical-align: -2px; margin: 0 3px; }

.row .act .row-state {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  margin-left: 8px;
  text-transform: lowercase;
}

.row.focus,
.row:hover:not(.head) {
  background: var(--ribbon);
}
.row.focus::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--live);
}
.row.captured.focus::before { background: var(--capture); }

.row.newest .mark-glyph span { animation: arrive 1.6s ease-out 1; }
/* Flat sonar ring — no blur, just an expanding hairline that fades. */
@keyframes arrive {
  0%   { box-shadow: 0 0 0 0 var(--live-ring); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .row.newest .mark-glyph span { animation: none; }
}

/* empty state */
.chart .empty {
  padding: 80px 32px;
  text-align: center;
  color: var(--fg-faint);
}
.chart .empty .title {
  font-family: var(--f-display);
  font-size: 24px;
  color: var(--fg-dim);
  margin-bottom: 10px;
}
.chart .empty .sub {
  font-size: 13px;
  color: var(--fg-faint);
}

/* ─── session view modal ─────────────────────────────────────────── */
.detail-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--veil);
  overflow-y: auto;
  padding: 4vh 16px;
}
.detail-sheet.open { display: flex; align-items: flex-start; justify-content: center; }

.detail-modal {
  width: 100%;
  max-width: 1080px;
  background: var(--bg);
  border: 1px solid var(--edge-strong);
  border-radius: 4px;
  overflow: hidden;
}

/* ─── import capture modal ───────────────────────────────────────── */
.import-modal { max-width: 640px; }
.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 0;
}
.import-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--capture);
}
.import-body { padding: 12px 24px 4px; }
.import-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
}
.import-hint code { font-size: 12px; color: var(--fg); }
.import-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.import-file-name {
  font-size: 12px;
  color: var(--fg-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#import-payload {
  width: 100%;
  height: 180px;
  resize: vertical;
  font: 11px/1.5 var(--mono, monospace);
  color: var(--fg);
  background: var(--bg-2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 10px 12px;
}
#import-payload:focus { outline: none; border-color: var(--edge-strong); }
.import-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.import-fields input,
.import-fields select {
  font-size: 13px;
  color: var(--fg);
  background: var(--bg-2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 7px 10px;
}
.import-fields input:focus,
.import-fields select:focus { outline: none; border-color: var(--edge-strong); }
.import-status {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.import-status.err { color: var(--fail); background: var(--fail-veil, rgba(200,80,80,.12)); }
.import-status.ok { color: var(--live); background: var(--live-veil, rgba(80,180,120,.12)); }
.import-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px 18px;
}

.detail-replay {
  border-top: 1px solid var(--edge);
  padding: 14px 32px 20px;
}
.replay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.replay-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--capture);
}
.replay-frame {
  width: 100%;
  height: 68vh;
  min-height: 420px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  /* Literal on purpose: the mirrored victim page often has a
     transparent ground — the iframe's own page chrome stays white
     in both themes, same as a real browser would render it. */
  background: #fff;
}

.detail-plate {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 20px 32px 16px;
  gap: 24px;
  border-bottom: 1px solid var(--edge);
}
.detail-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--capture);
}
.detail-tag.live { color: var(--live); }
.detail-tag.failed { color: var(--fail); }
.detail-tag.closed { color: var(--fg-dim); }
.detail-tag .tri {
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid currentColor;
}
.detail-reason {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-dim);
  opacity: 0.8;
  overflow-wrap: anywhere;
}
.detail-title {
  font-family: var(--f-display);
  font-size: 28px;
  line-height: 1.1;
  color: var(--fg);
  margin-top: 2px;
}
.detail-title .target { color: var(--capture); }
.detail-sub {
  margin-top: 8px;
  display: flex;
  gap: 20px;
  align-items: baseline;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
  flex-wrap: wrap;
}
.detail-sub .k {
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  margin-right: 6px;
}
.detail-sub .v { color: var(--fg); }
.detail-sound {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 24px;
  align-items: baseline;
}
.detail-sound .n {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--fg);
  line-height: 1;
}
.detail-sound .n .u {
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--fg-dim);
  margin-left: 4px;
}
.detail-sound .lbl {
  display: block;
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 4px;
}
.detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.btn-primary {
  padding: 10px 18px;
  background: var(--capture);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary.copied { background: var(--live); }
.btn-primary:disabled {
  background: var(--edge-strong);
  color: var(--fg-faint);
  cursor: default;
}
.btn-secondary {
  background: transparent;
  color: var(--fg-dim);
  padding: 6px 10px;
  border: 1px solid var(--edge-strong);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.btn-secondary:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}
/* Phase 8.4 — operator-initiated session terminate action. */
.btn-danger {
  background: transparent;
  color: var(--fail-soft);
  padding: 6px 10px;
  border: 1px solid var(--fail-ring);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.btn-danger:hover {
  color: var(--fail-soft-hi);
  border-color: var(--fail-soft);
  background: var(--fail-veil);
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* clear-* buttons use .btn .btn-red — shared destructive variant. */

.detail-split {
  display: grid;
  grid-template-columns: 340px 1fr;
}
.detail-timeline {
  border-right: 1px solid var(--edge);
  padding: 20px 24px 24px;
  max-height: 420px;
  overflow-y: auto;
}
.tl-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 14px;
}
.tl-list {
  position: relative;
  padding-left: 20px;
}
.tl-list::before {
  content: "";
  position: absolute;
  left: 5px; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--edge);
}
.tl-ev {
  position: relative;
  padding: 0 0 16px 0;
}
.tl-ev::before {
  content: "";
  position: absolute;
  left: -20px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--edge-strong);
}
.tl-ev.state::before { border-color: var(--live); }
.tl-ev.capture::before {
  border: 0;
  width: 0; height: 0;
  top: 3px; left: -21px;
  background: transparent;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid var(--capture);
}
.tl-ev.error::before {
  border-color: var(--warn);
  background: var(--warn);
}
.tl-ev.close::before {
  border-color: var(--fg-faint);
  background: var(--fg-faint);
}
.tl-ev .at {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}
.tl-ev .name {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg);
  margin-top: 1px;
}
.tl-ev.state .name { color: var(--live); }
.tl-ev.capture .name { color: var(--capture); font-weight: 500; }
.tl-ev.error .name { color: var(--warn); }
.tl-ev .note {
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 3px;
}

.detail-right {
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
}
.detail-section {
  padding: 18px 32px;
  border-bottom: 1px solid var(--edge);
}
.detail-section:last-child { border-bottom: 0; }
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.sec-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.sec-note {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}

.creds {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  row-gap: 8px;
  column-gap: 16px;
  align-items: center;
}
.creds .k {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.creds .v {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
}
.creds .mfa-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.creds .mfa-tag {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  background: var(--live-veil);
  color: var(--live);
  border: 1px solid var(--live-ring);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* Per-code copy icon inside the mfa-tag chip */
.creds .mfa-copy-btn {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.creds .mfa-copy-btn:hover { opacity: 1; color: var(--live); }
.creds .act {
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 4px 8px;
  border: 1px solid var(--edge-strong);
  cursor: pointer;
  background: transparent;
}
.creds .act:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}
.creds .act.copied {
  color: var(--live);
  border-color: var(--live-ring);
}

.cookies-tbl {
  width: 100%;
  border-collapse: collapse;
}
.cookies-tbl thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 400;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--edge);
}
.cookies-tbl tbody td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--edge-soft);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg);
  vertical-align: top;
}
.cookies-tbl tbody tr:hover td { background: var(--ribbon); }
.cookies-tbl .name { color: var(--capture); }
.cookies-tbl .domain { color: var(--fg-dim); }
.cookies-tbl .flags { color: var(--fg-faint); }
.cookies-tbl .val {
  color: var(--fg-dim);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cookies-tbl .flag {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 3px;
  color: var(--fg-dim);
  border: 1px solid var(--edge-strong);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cookies-tbl .flag.on {
  color: var(--live);
  border-color: var(--live-ring);
}

/* toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--capture);
  color: var(--capture);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 100;
  transition: opacity 220ms ease, transform 220ms ease;
  opacity: 0;
  transform: translateY(6px);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.err {
  border-color: var(--fail);
  color: var(--fail);
}


/* ──────────────────────────────────────────────────────────────────
   Phase 6A — Settings + Deploy views
   ────────────────────────────────────────────────────────────────── */

.settings-view,
.deploy-view {
  padding: 24px 32px 48px;
}

.settings-head,
.deploy-head {
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--edge);
}

.settings-title,
.deploy-title {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 6px;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.settings-sub,
.deploy-sub {
  color: var(--fg-faint);
  font-size: 14px;
  line-height: 1.5;
  max-width: 68ch;
  margin: 0;
}

.settings-sub a,
.deploy-sub a {
  color: var(--live);
  text-decoration: none;
  border-bottom: 1px dotted var(--live);
}

/* ─── section headers ─── */

.settings-section {
  margin: 32px 0 0;
}

.settings-section:first-of-type {
  margin-top: 0;
}

.section-title {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--edge);
}

/* ─── integration grid ─── */

.integrations-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Phase 11 / ADR-0017 — sectioned integrations: "Deploy
   integrations" and "Visitor gates". */
.int-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.int-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0;
  padding: 0 0 2px;
  border-bottom: 1px solid var(--edge);
}

.int-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.int-loading {
  color: var(--fg-faint);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px solid var(--edge);
  border-radius: 2px;
  grid-column: 1 / -1;
}

.int-loading.err {
  color: var(--fail);
}

.integration-card {
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.int-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.int-name {
  font-family: var(--f-display);
  font-size: 18px;
  color: var(--fg);
}

.int-chip {
  font-size: 12px;
  padding: 4px 10px;
  background: color-mix(in oklab, var(--edge) 50%, var(--bg) 50%);
  color: var(--fg-faint);
  border-radius: 2px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.int-chip.ok {
  background: color-mix(in oklab, var(--live) 24%, var(--bg) 76%);
  color: var(--live);
}

.int-chip.err {
  background: color-mix(in oklab, var(--fail) 24%, var(--bg) 76%);
  color: var(--fail);
}

.int-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.int-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.int-field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}

.int-field-input {
  background: var(--bg);
  border: 1px solid var(--edge);
  color: var(--fg);
  padding: 8px 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  border-radius: 2px;
  outline: none;
}

.int-field-input:focus {
  border-color: var(--live);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--live) 50%, transparent);
}

.int-field-input::placeholder {
  color: color-mix(in oklab, var(--fg-faint) 60%, transparent);
}

.int-field-hint {
  align-self: end;
  padding-bottom: 8px;
  font-size: 11.5px;
  color: var(--fg-faint);
}

.int-feedback {
  min-height: 20px;
  display: flex;
  align-items: center;
}

.int-feedback:empty {
  display: none;
}

.int-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* int-save / int-remove hook classes stay for JS targeting — visual
   treatment comes from .btn + variant (btn-cyan / btn-red). */

/* ─── security posture ─── */

.posture {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 2px;
}

.posture-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 10px 16px;
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  align-items: center;
}

.posture-row dt {
  color: var(--fg-faint);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.posture-row dd {
  margin: 0;
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 13px;
}

.posture-row dd.ok {
  color: var(--live);
}

/* ─── panel password change ─── */

.pw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin-top: 18px;
}

.pw-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pw-msg {
  font-family: var(--f-mono);
  font-size: 12px;
  min-height: 14px;
}

.pw-msg.ok { color: var(--live); }
.pw-msg.err { color: var(--fail); }

.twofa-note {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
}

/* ─── deploy placeholder ─── */

.deploy-empty {
  text-align: center;
  padding: 80px 24px;
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px dashed var(--edge);
  border-radius: 2px;
}

.empty-mark {
  color: var(--fg-faint);
  opacity: 0.6;
  margin-bottom: 16px;
}
.empty-mark svg { width: 44px; height: 44px; display: block; margin: 0 auto; }

.empty-title {
  font-size: 16px;
  color: var(--fg);
  font-family: var(--f-display);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px;
  color: var(--fg-faint);
  max-width: 48ch;
  margin: 0 auto;
}

/* ─── keep view-switch toggles clean ─── */

#deploy-view[hidden],
#settings-view[hidden] {
  display: none !important;
}


/* ──────────────────────────────────────────────────────────────────
   Phase 6B — Deploy view
   ────────────────────────────────────────────────────────────────── */

.deploy-section {
  margin: 32px 0 0;
}
.deploy-section:first-of-type {
  margin-top: 0;
}
.deploy-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--edge);
}
.deploy-section-head .section-title {
  margin: 0;
  padding: 0;
  border: 0;
}

.deploy-form {
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.deploy-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.deploy-feedback {
  min-height: 20px;
}
.deploy-feedback:empty {
  display: none;
}

.deployments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.worker-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 10px 18px;
}

.worker-id {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.worker-name {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-tag {
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--live);
  border: 1px solid color-mix(in oklab, var(--live) 40%, var(--edge) 60%);
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
}

.worker-meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}

.dep-row {
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border: 1px solid var(--edge);
  border-radius: 2px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 120ms;
}
.dep-row:hover {
  border-color: color-mix(in oklab, var(--live) 30%, var(--edge) 70%);
}

.dep-row-head {
  display: grid;
  grid-template-columns: 1fr auto auto 2fr;
  gap: 14px;
  align-items: center;
}

.dep-name {
  font-family: var(--f-display);
  font-size: 15px;
  color: var(--fg);
}

.dep-url {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--fg-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.dep-url a {
  color: var(--live);
  text-decoration: none;
  border-bottom: 1px dotted var(--live);
}

.dep-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--edge);
}
.dep-detail .posture {
  margin-bottom: 14px;
}
.dep-detail .posture-row dd .err {
  color: var(--fail);
}

/* Phase 17 — Deploy table (replaces collapsible dep-row) */
.deploy-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--edge);
  border-radius: 2px;
  overflow: hidden;
}

.deploy-table-head {
  display: grid;
  grid-template-columns: 100px 90px 120px 1fr 110px 200px;
  gap: 12px;
  padding: 10px 16px;
  background: color-mix(in oklab, var(--bg) 88%, white 12%);
  border-bottom: 1px solid var(--edge);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  font-weight: 500;
}

.deploy-table-row {
  display: grid;
  grid-template-columns: 100px 90px 120px 1fr 110px 200px;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  border-bottom: 1px solid var(--edge-soft);
  align-items: center;
  font-size: 13px;
  color: var(--fg);
}

.deploy-table-row:hover {
  background: color-mix(in oklab, var(--bg) 88%, white 12%);
}

.deploy-col-target {
  color: var(--fg);
  font-size: 13px;
  text-transform: capitalize;
}

.deploy-col-status {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-dim);
}

.deploy-col-status.ok {
  color: var(--live);
}

.deploy-col-status.err {
  color: var(--fail);
}

.deploy-col-provider {
  color: var(--fg-dim);
  font-size: 12px;
  text-transform: capitalize;
}

.deploy-col-url {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--live);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deploy-domain-note {
  color: var(--fg-faint);
  font-size: 12px;
}
.deploy-domain-note.err {
  color: var(--fail);
}

.deploy-col-date {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-faint);
}

.deploy-col-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* deploy action buttons use .btn variants — deploy-copy-btn /
   deploy-html-btn / deploy-delete-btn remain as JS hooks only. */


/* ──────────────────────────────────────────────────────────────────
   Phase 7A — Activity (audit log)
   ────────────────────────────────────────────────────────────────── */

.activity-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 2px;
  max-height: 480px;
  overflow-y: auto;
}

.activity-row {
  background: color-mix(in oklab, var(--bg) 92%, white 8%);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 170px 220px 1fr 90px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.activity-time {
  color: var(--fg-faint);
  font-family: var(--f-mono);
}

.activity-event {
  color: var(--fg);
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
}

.activity-event.err {
  color: var(--fail);
}

.activity-resource {
  color: var(--fg-faint);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-fingerprint {
  text-align: right;
  color: var(--fg-faint);
  font-family: var(--f-mono);
  font-size: 12px;
}

.search-glyph { width: 12px; height: 12px; flex: none; }

/* ─── responsive ─────────────────────────────────────────────────── */
/* The shell is a fixed viewport grid; below 900px the rail becomes an
 * off-canvas drawer over the stage, toggled by the header button. */
@media (max-width: 1100px) {
  .kpi-num { font-size: 64px; }
  .kpi-num .suffix { font-size: 16px; }
}

@media (max-width: 900px) {
  .frame { grid-template-columns: 1fr; }
  .frame.rail-hidden .rail { visibility: visible; }
  .rail {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 264px;
    z-index: 80;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    border-right: 1px solid var(--edge-strong);
  }
  .frame.rail-open .rail { transform: none; }
  .rail-scrim {
    display: block;
    position: fixed;
    inset: 56px 0 0;
    background: var(--veil);
    z-index: 70;
  }
  .ov-band { grid-template-columns: 1fr; }
  .kpi-labels, .kpi-numbers, .kpi-sub { padding-left: 20px; padding-right: 20px; }
  .ov-map, .ov-lane, .ov-cover { padding-left: 20px; padding-right: 20px; }
  .ov-col { padding-left: 20px; padding-right: 20px; }
  /* Wide data tables scroll sideways instead of crushing columns. */
  .chart { overflow-x: auto; }
  .chart .row { min-width: 1000px; }
  .detail-split { grid-template-columns: 1fr; }
  .import-fields { grid-template-columns: 1fr; }
  .posture-row { grid-template-columns: 1fr; }
  .int-section-grid { grid-template-columns: 1fr; }
  .deploy-table-head, .deploy-table-row { min-width: 640px; }
}

@media (max-width: 640px) {
  .top { gap: 12px; padding: 0 12px; }
  .mark-tag { display: none; }
  .mark-word { font-size: 20px; }
  .topright { gap: 10px; font-size: 11px; }
  /* KPI band folds to 2×2 — labels, numbers, and sub-cells keep the
   * same cell order so the three grids stay aligned. */
  .kpi-labels, .kpi-numbers, .kpi-sub {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 6px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .kpi-num { font-size: 48px; gap: 8px; }
  .kpi-num .suffix { font-size: 13px; }
  .kpi-sub-cell { font-size: 12px; }
  .ov-map, .ov-lane, .ov-cover, .ov-col { padding-left: 16px; padding-right: 16px; }
  .ov-map-league { column-gap: 14px; }
  .ov-ops { flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; }
  .chart-tools { flex-wrap: wrap; gap: 8px; }
  .detail-sheet { padding: 0; }
  .detail-modal { max-width: 100%; border-left: 0; border-right: 0; }
  .detail-plate { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
}

/* ─── Docs — in-app operator guide ─────────────────────────────────
   Sticky filterable index on the left (desktop), native <details>
   accordions on the right. Figures are inline SVG line-diagrams in
   panel tokens; .fig-hi marks the highlighted control. */
.docs-view { padding: 24px 32px 48px; }
.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.docs-index {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
}
#docs-filter {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--edge);
  color: var(--fg);
  padding: 8px 10px;
  font: 12px var(--f-mono);
  margin-bottom: 12px;
}
#docs-filter:focus { outline: none; border-color: var(--edge-strong); }
.docs-index-group {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.docs-index-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  padding: 5px 0 5px 10px;
  color: var(--fg-dim);
  font-size: 13px;
  cursor: pointer;
}
.docs-index-link:hover { color: var(--fg); }
.docs-index-link.active { color: var(--live); border-left-color: var(--live); }
.docs-index-link[hidden] { display: none; }

.doc-sec {
  border: 1px solid var(--edge);
  margin-bottom: 12px;
  background: color-mix(in oklab, var(--bg-2) 55%, transparent);
}
.doc-sec > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--fg);
}
.doc-sec > summary::-webkit-details-marker { display: none; }
.doc-sec > summary:hover { color: var(--live); }
.doc-sec > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 16px;
  color: var(--fg-faint);
}
.doc-sec[open] > summary::after { content: "–"; }
.doc-tag {
  font: 10px var(--f-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--capture);
  border: 1px solid var(--edge);
  padding: 2px 6px;
  white-space: nowrap;
}
.doc-body {
  padding: 0 20px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-dim);
  max-width: 78ch;
}
.doc-body p { margin: 0 0 12px; }
.doc-body strong { color: var(--fg); font-weight: 600; }
.doc-body a {
  color: var(--live);
  text-decoration: none;
  border-bottom: 1px dotted var(--live);
}
.doc-body code,
.doc-body kbd {
  font-family: var(--f-mono);
  font-size: 12.5px;
  background: var(--bg-2);
  border: 1px solid var(--edge);
  padding: 1px 5px;
}
.doc-steps { margin: 0 0 14px 20px; }
.doc-steps li { margin-bottom: 8px; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 13px;
}
.doc-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 500;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--edge-strong);
}
.doc-table td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--edge);
  vertical-align: top;
}
.doc-note {
  border-left: 2px solid var(--capture);
  padding: 6px 0 6px 12px;
  font-size: 13px;
}
.doc-fig {
  margin: 4px 0 16px;
  border: 1px solid var(--edge);
  background: var(--bg);
  padding: 14px 16px 8px;
}
.doc-fig svg { display: block; width: 100%; height: auto; color: var(--edge-strong); }
.doc-fig .fig-text { fill: var(--fg-dim); font-family: var(--f-mono); font-size: 11px; }
.doc-fig .fig-hi { stroke: var(--live); }
.doc-fig figcaption { font-size: 12px; color: var(--fg-faint); padding: 8px 0 6px; }
.doc-shot { width: 100%; border: 1px solid var(--edge); }
.doc-snippet-wrap { position: relative; margin: 0 0 14px; }
.doc-snippet {
  background: var(--bg);
  border: 1px solid var(--edge);
  padding: 12px 44px 12px 14px;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--fg-dim);
  white-space: pre;
}
.doc-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--bg-2);
  border: 1px solid var(--edge);
  color: var(--fg-dim);
  font: 10px var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  cursor: pointer;
}
.doc-copy:hover { color: var(--live); border-color: var(--live); }
.docs-empty { color: var(--fg-faint); font-size: 14px; padding: 20px 0; }

@media (max-width: 900px) {
  /* minmax(0,1fr), not 1fr — a bare 1fr track sizes to the widest
     table's min-content and pushes the whole column off-viewport. */
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-index { position: static; margin-bottom: 20px; }
  .docs-view { padding: 20px 20px 40px; }
  .doc-table { display: block; overflow-x: auto; }
}
