/*
 * Design tokens and components, extracted from design/reference.html.
 * Every color, radius and font in the app traces back to a token here.
 * Nothing below hard-codes a state color: distributions set --accent or use a
 * b-* / rail class, both of which are derived from state in src/shared/domain.ts.
 *
 * Atomic age. The loud parts of Googie — hard offset shadows, heavy outlines,
 * angled cuts, the starburst — are spent on chrome: panels, buttons, the nav,
 * empty states. Tables and feeds stay quiet, because this is an operations tool
 * and a boomerang behind a row of live state helps nobody read it.
 */

:root {
  /* Warm paper, the way period print sat on uncoated stock. */
  --bg: #EFE4CE;
  --nav: #241E18;
  --s1: #FFFBF937;
  --s2: #E9DCC0;
  --s3: #DCCCA8;
  --paper: #FFFBF2;

  /* Outlines are drawn, not implied: ink at full strength, two weights. */
  --line: #241E18;
  --line-2: #241E18;
  --hair: rgba(36, 30, 24, .14);

  --tx: #241E18;
  /* Measured against both grounds — paper and the darker sand of the rails —
     so secondary and tertiary text clear 4.5:1 rather than merely looking
     period. Warm greys go washed on cream far sooner than they do on black. */
  --tx-2: #4E4536;
  --tx-3: #675C4B;

  /* Atomic palette. Turquoise leads, coral answers, gold warns. */
  --cyan: #007A8C;
  --blue: #0E6E8C;
  --violet: #8C4A6B;
  --green: #4F7A2E;
  --amber: #C97B12;
  --red: #C43B22;

  --r: 3px;
  --r-sm: 2px;
  /* The signature: a hard, unblurred drop shadow, like ink over ink. */
  --pop: 3px 3px 0 var(--line);
  --pop-sm: 2px 2px 0 var(--line);
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100% }
/* Component classes below set `display`, which outranks the browser's own
   [hidden] rule. Progressive enhancement relies on hidden staying hidden. */
[hidden] { display: none !important }

body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: 'Space Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums }

/* Display face, for anything that behaves like signage. Deliberately not the
   numbers: Righteous is proportional, so a metric ticking 9 to 10 would shift
   width on every poll. Figures stay mono and tabular. */
h1, h2, h3, .brand-tx b { font-family: 'Righteous', 'Poppins', sans-serif; font-weight: 400 }
.metric .m-n, .job-pct b { font-family: 'Space Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 700 }
svg.i { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer }
a { color: inherit }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 0 }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ---------- top bar ---------- */
.top {
  height: 52px; display: flex; align-items: center; gap: 20px;
  padding: 0 16px; background: var(--nav); color: var(--paper);
  border-bottom: 3px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding-right: 20px; border-right: 1px solid rgba(255,251,242,.18); height: 100%; text-decoration: none }
.mark {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: var(--nav);
  border: 2px solid var(--paper);
  position: relative;
}
/* Starburst: the one piece of pure Googie ornament, on the mark alone. */
.mark::before {
  content: ""; position: absolute; inset: -7px; pointer-events: none;
  background:
    conic-gradient(from 0deg, var(--amber) 0 3deg, transparent 3deg 45deg,
      var(--amber) 45deg 48deg, transparent 48deg 90deg,
      var(--amber) 90deg 93deg, transparent 93deg 135deg,
      var(--amber) 135deg 138deg, transparent 138deg 180deg,
      var(--amber) 180deg 183deg, transparent 183deg 225deg,
      var(--amber) 225deg 228deg, transparent 228deg 270deg,
      var(--amber) 270deg 273deg, transparent 273deg 315deg,
      var(--amber) 315deg 318deg, transparent 318deg 360deg);
  opacity: .85;
}
/* The reference leaves the brand glyph unstroked, which renders it as black
   fill on a near-black gradient. Same geometry, stroked like every other icon. */
.mark svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round }
.brand-tx b { display: block; font-size: 14px; letter-spacing: .01em; color: var(--tx) }
.brand-tx span { display: block; font-size: 9.5px; color: var(--tx-2); letter-spacing: .16em; text-transform: uppercase }
/* On the dark bar the same mark is inverted; the sign-in card keeps it in ink. */
.top .brand-tx b { color: var(--paper) }
.top .brand-tx span { color: var(--amber) }

.tabs { display: flex; gap: 2px }
.tabs a {
  color: rgba(255, 251, 242, .72); text-decoration: none; font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: 20px; letter-spacing: .02em;
}
.tabs a:hover { color: var(--paper); background: rgba(255, 251, 242, .10) }
.tabs a[aria-current] { color: var(--nav); background: var(--amber); font-weight: 600 }

/* Search hits. Not the browser's yellow, which fights the paper. */
mark { background: rgba(201, 123, 18, .30); color: var(--tx); border-radius: 2px; padding: 0 2px }

.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  width: 260px; height: 32px; padding: 0 10px;
  background: rgba(255, 251, 242, .10); border: 1px solid rgba(255, 251, 242, .22); border-radius: 20px;
  color: rgba(255, 251, 242, .55);
}
.search:focus-within { border-color: var(--amber) }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--paper); font: inherit; min-width: 0 }
.search input::placeholder { color: rgba(255, 251, 242, .45) }
.search kbd {
  font-family: 'Space Mono', monospace; font-size: 10px; color: rgba(255, 251, 242, .55);
  border: 1px solid rgba(255, 251, 242, .22); border-radius: 3px; padding: 1px 4px;
}
.ico-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--tx-2); position: relative; flex: none;
}
.ico-btn { color: rgba(255, 251, 242, .72) }
.ico-btn:hover { background: rgba(255, 251, 242, .12); color: var(--paper) }
.dot-badge {
  position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 2px var(--nav);
}
.me {
  display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 251, 242, .22); text-decoration: none; border-radius: 20px;
}
.me:hover { background: rgba(255, 251, 242, .10) }
.av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; flex: none;
}
.av-c { background: var(--cyan); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line) }
.av-v { background: var(--violet); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line) }
.av-g { background: var(--green); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line) }
.av-a { background: var(--amber); color: var(--nav); box-shadow: inset 0 0 0 1px var(--line) }
.me-tx b { display: block; font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--paper) }
.me-tx span { display: block; font-size: 9.5px; color: var(--amber); letter-spacing: .12em; text-transform: uppercase }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 214px minmax(0, 1fr) 312px; min-height: calc(100vh - 52px) }
.shell.nav-collapsed { grid-template-columns: 60px minmax(0, 1fr) 312px }
.shell.panel-collapsed { grid-template-columns: 214px minmax(0, 1fr) 0 }
.shell.nav-collapsed.panel-collapsed { grid-template-columns: 60px minmax(0, 1fr) 0 }
.shell { transition: grid-template-columns .22s cubic-bezier(.4, 0, .2, 1) }

/* ---------- sidebar ---------- */
.side {
  background: var(--s2); border-right: 3px solid var(--line);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.side-lbl {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--tx-3);
  font-family: 'Righteous', sans-serif;
  padding: 10px 8px 6px; white-space: nowrap;
}
.nav-i {
  display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 9px;
  border-radius: 20px; color: var(--tx-2); text-decoration: none;
  font-size: 12.5px; font-weight: 500; white-space: nowrap; position: relative;
  transition: background .13s, color .13s;
}
.nav-i:hover { background: var(--s3); color: var(--tx) }
/* The selected item is a capsule, the way a period control panel lit one up. */
.nav-i[aria-current] {
  color: var(--paper); background: var(--cyan);
  border: 2px solid var(--line); box-shadow: var(--pop-sm); font-weight: 600;
}
.nav-i[aria-current] svg { color: var(--paper) }
.nav-i .ct {
  margin-left: auto; font-family: 'Space Mono', monospace; font-size: 10px;
  padding: 0 6px; border-radius: 20px; background: var(--paper); color: var(--tx-2);
  border: 1px solid var(--line);
}
.nav-i[aria-current] .ct { background: var(--paper); color: var(--cyan) }
.nav-i .ct.warn { background: var(--amber); color: var(--nav); border-color: var(--line) }
.nav-i .ct.bad { background: var(--red); color: var(--paper); border-color: var(--line) }
.nav-collapsed .side-lbl,
.nav-collapsed .nav-i span,
.nav-collapsed .nav-i .ct,
.nav-collapsed .side-foot-tx { display: none }
.nav-collapsed .nav-i { justify-content: center; padding: 0 }
.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 9px;
  border-top: 2px solid var(--line); color: var(--tx-2); font-size: 11px; white-space: nowrap;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); border: 1px solid var(--line); flex: none; animation: bl 2.4s infinite }
/* Queue held: same dot, amber, and no blink — nothing is moving. */
.side-foot.held .pulse { background: var(--amber); animation: none }
.side-foot.held { color: var(--amber) }
@keyframes bl { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------- workspace ---------- */
.work { padding: 18px 20px 40px; min-width: 0 }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap }
h1 { font-size: 21px; letter-spacing: .01em }
.head p { font-size: 12px; color: var(--tx-2); margin-top: 3px }
.head-act { margin-left: auto; display: flex; gap: 8px }

.btn {
  height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px;
  border-radius: 20px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  border: 2px solid var(--line); background: var(--paper); color: var(--tx);
  text-decoration: none; box-shadow: var(--pop-sm);
  transition: transform .1s, box-shadow .1s, background .13s;
}
.btn:hover { background: var(--s2) }
/* Pressed: the button sinks onto its own shadow. */
.btn:active { transform: translate(2px, 2px); box-shadow: none }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn svg { width: 14px; height: 14px }
.btn-p { background: var(--amber); color: var(--nav); font-weight: 600; box-shadow: var(--pop) }
.btn-p:hover { background: #E5A836 }
.btn-p:active { transform: translate(3px, 3px); box-shadow: none }
.btn-xs { height: 25px; padding: 0 10px; font-size: 11px }
.btn-ok { background: var(--green); color: var(--paper) }
.btn-ok:hover { background: #5C8C36 }
.btn-bad { background: var(--red); color: var(--paper) }
.btn-bad:hover { background: #D24528 }
.btn-cy { background: var(--cyan); color: var(--paper) }
.btn-cy:hover { background: #039AB1 }
.inline-form { display: inline-flex }

/* metric strip */
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px }
.metric {
  background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--r); padding: 11px 12px;
  position: relative; overflow: hidden; box-shadow: var(--pop-sm);
  transition: transform .15s, box-shadow .15s;
}
.metric:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line) }
/* A colour bar across the top, the way a period instrument panel labelled a dial. */
.metric::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: var(--accent, var(--cyan));
}
.metric .m-top { display: flex; align-items: center; gap: 7px; color: var(--accent, var(--cyan)) }
.metric .m-top svg { width: 14px; height: 14px }
.metric .m-lbl { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); font-weight: 600 }
.metric .m-n { font-size: 25px; letter-spacing: .01em; margin: 8px 0 3px; line-height: 1 }
.metric .m-d { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--tx-3) }
.metric .m-d b { font-weight: 500; font-family: 'Space Mono', monospace }
.up b { color: var(--green) }
.dn b { color: var(--red) }

/* panels */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; box-shadow: var(--pop) }
.panel:last-child { margin-bottom: 0 }
.p-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-bottom: 2px solid var(--line); background: var(--s2);
  position: relative;
}
/* The angled cut: a slanted swatch running off the right of every panel header. */
.p-head::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 46px;
  background: var(--cyan); clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .9; pointer-events: none;
}
.p-head h2 { font-size: 13px; letter-spacing: .02em }
.p-head .sub { font-size: 10.5px; color: var(--tx-3) }
.p-head .r { margin-left: auto; display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; margin-right: 34px }
.live {
  display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--paper);
  background: var(--green); border: 1px solid var(--line);
  border-radius: 20px; padding: 2px 9px 2px 7px;
}
.live.paused { color: var(--nav); background: var(--amber) }
.live.paused .pulse { background: var(--nav); animation: none }
.p-body { padding: 12px 13px }

/* publishing queue job */
.job { border: 2px solid var(--line); border-radius: var(--r); background: var(--s1); padding: 12px; margin-bottom: 10px; box-shadow: var(--pop-sm) }
.job:last-child { margin-bottom: 0 }
.job-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 11px }
.job-top h3 { font-size: 13.5px; font-weight: 500; letter-spacing: -.01em; line-height: 1.35 }
.job-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 10.5px; color: var(--tx-3); flex-wrap: wrap }
.job-meta i { width: 1px; height: 9px; background: var(--hair) }
.job-pct { text-align: right; flex: none; margin-left: auto }
.job-pct b { font-size: 19px; letter-spacing: .01em }
.job-pct span { display: block; font-size: 10px; color: var(--tx-3) }
.job-act { display: flex; gap: 6px; margin-top: 10px }

/* signature: segmented rail, one cell per company */
.rail { display: flex; gap: 3px; margin-bottom: 11px }
.rail i { height: 7px; flex: 1; border: 1px solid var(--line); background: var(--s3) }
.rail i.ok { background: var(--green) }
.rail i.run { background: var(--cyan); animation: bl 1.5s infinite }
.rail i.wait { background: var(--amber) }
.rail i.bad { background: var(--red) }

.dist { width: 100%; border-collapse: collapse }
.dist th {
  text-align: left; font-size: 9.5px; letter-spacing: .10em; text-transform: uppercase;
  color: var(--tx-3); font-weight: 600; padding: 0 8px 7px; border-bottom: 2px solid var(--line);
}
.dist th:last-child, .dist td:last-child { text-align: right }
.dist td { padding: 7px 8px; border-bottom: 1px solid var(--hair); font-size: 12px }
.dist tr:last-child td { border-bottom: none }
.dist tbody tr:hover { background: var(--s2) }
.co { display: flex; align-items: center; gap: 9px }
.co-l {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none;
  font-size: 9.5px; font-weight: 600; background: var(--s3); color: var(--tx);
  border: 1px solid var(--line);
}
.co b { font-weight: 400 }
.co span { display: block; font-size: 10px; color: var(--tx-3) }
.co-err { color: var(--red); font-size: 10px }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none }
.b-ok { background: var(--green); color: var(--paper); border: 1px solid var(--line) }
.b-run { background: var(--cyan); color: var(--paper); border: 1px solid var(--line) }
.b-wait { background: var(--amber); color: var(--nav); border: 1px solid var(--line) }
.b-bad { background: var(--red); color: var(--paper); border: 1px solid var(--line) }
.b-draft { background: var(--s3); color: var(--tx-2); border: 1px solid var(--line) }
.b-run::before { animation: bl 1.4s infinite }

/* company cards */
.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.co-grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) }
.co-card {
  border: 2px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 11px;
  box-shadow: var(--pop-sm);
  transition: transform .15s, box-shadow .15s;
}
.co-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line) }
/* Cards sit on a grid row, so a name that wraps would stagger its neighbours. */
.co-card { display: flex; flex-direction: column }
.co-card .ch { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; min-width: 0 }
.co-card .ch > span:last-child { min-width: 0 }
.co-card .ch b,
.co-card .ch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block }
.co-card .ch b { font-size: 12.5px; font-weight: 500; color: var(--tx) }
.co-card .ch > span:last-child > span { font-size: 10px; color: var(--tx-3) }
.co-card .ch .co-l { color: var(--tx) }
.co-card .co-stats { margin-top: auto }
.co-stats { display: flex; gap: 14px; padding-top: 9px; border-top: 1px solid var(--hair) }
.co-stats div { font-size: 10px; color: var(--tx-3); letter-spacing: .05em; text-transform: uppercase }
.co-stats b { display: block; font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; color: var(--tx); margin-bottom: 1px }
.co-stats b.g { color: var(--green) }
.co-stats b.a { color: var(--amber) }

/* tables */
.tbl { width: 100%; border-collapse: collapse }
.tbl th {
  text-align: left; font-size: 9.5px; letter-spacing: .10em; text-transform: uppercase; color: var(--tx-3);
  font-weight: 600; padding: 9px 12px; border-bottom: 2px solid var(--line); background: var(--s2);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--hair); font-size: 12px; vertical-align: middle }
.tbl tbody tr:last-child td { border-bottom: none }
.tbl tbody tr:hover { background: var(--s2) }
.tbl .t-title { font-weight: 500; letter-spacing: -.005em }
.tbl .t-sub { font-size: 10.5px; color: var(--tx-3); margin-top: 2px }
.stack { display: flex }
.stack .av { width: 20px; height: 20px; font-size: 8.5px; margin-left: -5px; box-shadow: 0 0 0 2px var(--paper) }
.stack .av:first-child { margin-left: 0 }
.stack .more {
  width: 20px; height: 20px; border-radius: 50%; background: var(--s3); color: var(--tx-2);
  display: grid; place-items: center; font-size: 8.5px; font-weight: 500; margin-left: -5px;
  box-shadow: 0 0 0 2px var(--paper);
}
.row-act { display: flex; gap: 5px; justify-content: flex-end }

/* empty state */
.empty { padding: 28px 12px; text-align: center; color: var(--tx-3) }
.empty svg { width: 22px; height: 22px; margin-bottom: 8px; color: var(--tx-3) }
.empty p { font-size: 12px }
.empty p + p { margin-top: 4px; font-size: 11px }

/* flash */
.flash {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 12px;
  border-radius: var(--r); font-size: 12px; border: 2px solid var(--line); background: var(--paper);
  box-shadow: var(--pop-sm);
}
.flash svg { width: 14px; height: 14px; flex: none }
.flash-ok { background: #DCEBCB; color: #33591B }
.flash-bad { background: #F7D9D0; color: #8E2A15 }

/* forms */
.form { display: flex; flex-direction: column; gap: 13px }
.field { display: flex; flex-direction: column; gap: 6px }
.field > label {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-2); font-weight: 600;
}
.hint { font-size: 10.5px; color: var(--tx-3) }
.input, .textarea, .select {
  width: 100%; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r);
  color: var(--tx); font: inherit; padding: 8px 10px; outline: none;
  transition: box-shadow .13s;
}
.textarea { min-height: 220px; resize: vertical; line-height: 1.6 }
.input:focus, .textarea:focus, .select:focus { box-shadow: var(--pop-sm) }
.input::placeholder, .textarea::placeholder { color: var(--tx-3) }
.form-act { display: flex; align-items: center; gap: 8px; padding-top: 2px }
.form-act .spacer { margin-left: auto }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto }
.pick {
  display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--paper); cursor: pointer;
  transition: background .13s, box-shadow .13s;
}
.pick:hover { background: var(--s2) }
.pick input { accent-color: var(--cyan); width: 14px; height: 14px; flex: none; cursor: pointer }
.pick b { display: block; font-size: 12px; font-weight: 500 }
.pick span { display: block; font-size: 10px; color: var(--tx-3) }
.pick:has(input:checked) { background: #CFE6E9; box-shadow: var(--pop-sm) }

/* The account profile, beside the company it belongs to in the studio picker. */
.pick-wrap { display: flex; flex-direction: column; gap: 4px }
.profile { font-size: 10px; color: var(--tx-3); padding: 0 9px }
.profile summary {
  cursor: pointer; color: var(--tx-2); letter-spacing: .06em; text-transform: uppercase;
  font-size: 9px; padding: 2px 0;
}
.profile summary:hover { color: var(--cyan) }
.profile { border-left: 2px solid var(--hair); margin-left: 9px }
.profile p { margin: 5px 0 0; line-height: 1.55; color: var(--tx-2) }
.profile p b { color: var(--tx-3); font-weight: 500 }

/* image uploads */
.drop {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 14px; border-radius: var(--r); background: var(--s1);
  border: 2px dashed var(--line); color: var(--tx-2);
  transition: background .13s;
}
/* The input covers the zone, so the whole zone is the click target and the
   control still works with the client script blocked. */
.drop-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer }
.drop svg { width: 18px; height: 18px; color: var(--tx-3); flex: none }
.drop-tx b { display: block; font-size: 12px; font-weight: 500; color: var(--tx) }
.drop-tx span { display: block; font-size: 10.5px; color: var(--tx-3) }
.drop:hover, .drop.over { background: #CFE6E9 }
.drop:focus-within { box-shadow: var(--pop-sm) }
.drop.over svg, .drop:hover svg { color: var(--cyan) }

/* The chosen-file list the client script fills in before submit. */
.up-list { list-style: none; display: flex; flex-direction: column; gap: 4px }
.up-list li {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tx-2);
  padding: 5px 8px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line);
}
.up-list li span:last-child { margin-left: auto; color: var(--tx-3) }
.up-list li.bad { background: #F7D9D0; color: #8E2A15 }
.up-list li.bad span:last-child { color: #8E2A15 }

.img-list { list-style: none; display: flex; flex-direction: column; gap: 10px }
.img-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px;
  border: 2px solid var(--line); border-radius: var(--r); background: var(--paper);
}
.img-thumb {
  width: 78px; height: 60px; border-radius: var(--r); overflow: hidden; flex: none;
  background: var(--s3); border: 1px solid var(--line); display: block;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.img-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px }
.img-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.img-sub { font-size: 10.5px; color: var(--tx-3) }
.img-url { display: flex; align-items: center; gap: 7px; min-width: 0 }
.img-url code {
  font-size: 10.5px; color: var(--tx-2); background: var(--s2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.alt-form { display: flex; align-items: center; gap: 7px }
.alt-form .input { height: 27px; padding: 0 8px; font-size: 11.5px }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px }
.auth-card { width: 100%; max-width: 360px }
.auth-card .brand { border-right: none; padding: 0 0 18px; height: auto; gap: 14px }
.auth-card .mark { width: 38px; height: 38px; border-color: var(--line) }
.auth-card .panel { padding: 18px }
.auth-note { margin-top: 12px; font-size: 10.5px; color: var(--tx-3); line-height: 1.6 }
.auth-note b { color: var(--tx-2); font-weight: 500 }

/* ---------- right panel ---------- */
.panel-r { background: var(--s2); border-left: 3px solid var(--line); display: flex; flex-direction: column; overflow: hidden }
.panel-collapsed .panel-r { border-left: none }
.pr-head { display: flex; align-items: center; gap: 8px; padding: 0 13px; height: 44px; border-bottom: 2px solid var(--line); flex: none }
.pr-head h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx) }
.pr-sec { padding: 12px 13px; border-bottom: 2px solid var(--line) }
.pr-sec:last-child { border-bottom: none }
.feed { display: flex; flex-direction: column; gap: 1px }
.ev { display: flex; gap: 10px; padding: 8px; border-radius: var(--r-sm); position: relative }
.ev:hover { background: var(--paper) }
.ev-i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--paper); border: 1px solid var(--line) }
.ev-i svg { width: 13px; height: 13px }
.ev-ok .ev-i { background: var(--green); color: var(--paper) }
.ev-bad .ev-i { background: var(--red); color: var(--paper) }
.ev-cy .ev-i { background: var(--cyan); color: var(--paper) }
.ev-vi .ev-i { background: var(--violet); color: var(--paper) }
.ev-am .ev-i { background: var(--amber); color: var(--nav) }
.ev-tx { min-width: 0; flex: 1 }
.ev-tx p { font-size: 12px; line-height: 1.4 }
.ev-tx p b { font-weight: 500 }
.ev-mt { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 10px; color: var(--tx-3) }
.ev-mt i { width: 1px; height: 8px; background: var(--hair) }
/* The detail truncates; the timestamp never does. */
.ev-mt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }
.ev-mt span + i + span { flex: none }
.ev-mt i { flex: none }

.who { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--r-sm) }
.who:hover { background: var(--paper) }
.who-av { position: relative; flex: none }
.who-av .st {
  position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px var(--s2);
}
.who-av .st.idle { background: var(--amber); box-shadow: 0 0 0 2px var(--s2) }
.who-av .st.off { background: var(--tx-3); box-shadow: 0 0 0 2px var(--s2) }
.who b { display: block; font-size: 12px; font-weight: 500 }
.who span { display: block; font-size: 10px; color: var(--tx-3) }
.who .tag {
  margin-left: auto; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx-2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px;
}

@media (max-width: 1240px) {
  .shell, .shell.nav-collapsed { grid-template-columns: 60px minmax(0, 1fr) }
  .panel-r { display: none }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .grid-2 { grid-template-columns: minmax(0, 1fr) }
  .side-lbl, .nav-i span, .nav-i .ct, .side-foot-tx { display: none }
  .nav-i { justify-content: center; padding: 0 }
  .tabs, .search { display: none }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }
