/* ═══════════════════════════════════════════════
   CageRace Launchpad — admin.css
   ═══════════════════════════════════════════════ */

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

:root {
  /* ─── NASA-style Launchpad palette (v1 — 2026-04-20) ─────────────
     Colour is instruction, not decoration. Strict hierarchy:
       blue    = action / commit / strong trajectory
       orange  = attention / pressure / active focus (rare, meaningful)
       green   = success / stable / confirmed
       red     = failure / blocked / cannot proceed
     Orange must never replace primary/success/failure roles.
  */
  --white: #FFFFFF;
  --black: #000000;
  --dark:       #0E1116;   /* body background */
  --dark-card:  #161A21;   /* raised panels */
  --dark-hover: #1d222a;
  --border:       rgba(255,255,255,0.10);
  --border-light: rgba(255,255,255,0.22);
  --text-dim:    rgba(255,255,255,0.65);
  --text-dimmer: rgba(255,255,255,0.4);

  /* Semantic tokens */
  --action:      #2F80ED;
  --action-dark: #1d6fd8;
  --attention:   #F2994A;
  --success:     #27AE60;
  --failure:     #EB5757;

  /* Legacy compat — pre-existing rules use var(--red) to mean "primary
     action". Repoint to blue so the hierarchy holds. Error / failure
     surfaces are split out individually to var(--failure). */
  --red:      var(--action);
  --red-dark: var(--action-dark);

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; zoom: 1.2; }
body {
  background: var(--dark);
  color: var(--white);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN GATE ─────────────────────────────── */
.login-gate {
  position: fixed;
  inset: 0;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  z-index: 1000;
}
/* Pre-paint auth class set by admin.html's <head> script — when present
   the login gate never paints on an authenticated navigation, killing the
   flash between page reloads. app.js still re-validates in the background
   and will rollback to the gate if the key is actually stale. */
html.lp-authed .login-gate { display: none !important; }
html.lp-authed #app         { display: block !important; }
/* Brett-locked 2026-05-03: stripped login box. No logo, no titles —
   just username + password + eye + forgot-help. Reusable shell for
   cagerace, ipqld.land, scottwagner. Tenant-specific support contact
   lives in admin.html and is overridable per tenant. */
.login-box {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 48px 40px;
  border: 1px solid var(--border);
  background: var(--dark-card);
  border-radius: 6px;
}
.password-wrap {
  position: relative;
  margin-bottom: 12px;
}
/* Brett-locked 2026-05-03: eye-toggle for the launchpad password
   field. Was rendered in the HTML but had no CSS — invisible. Now
   sits absolute-right inside .password-wrap, click toggles the
   input's `type` between password and text via app.js. */
.login-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: color 120ms ease, background 120ms ease;
}
.login-eye:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}
.login-eye svg {
  width: 22px;
  height: 22px;
  display: block;
}
.login-eye.visible {
  color: var(--accent, #ff3a1f);
}
.login-eye.visible svg path {
  /* When showing, dim the eye-outline a touch so the user knows the
     password is now visible. */
  stroke-opacity: 0.85;
}
.login-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
}
.login-input {
  width: 100%;
  padding: 18px 52px 18px 18px;
  background: var(--dark);
  border: 1px solid var(--border-light);
  color: var(--white);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  outline: none;
  letter-spacing: 0.1em;
}
.login-input:focus { border-color: var(--red); }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1;
}
.password-toggle:hover { color: var(--white); }
.password-toggle.visible { color: var(--red); }
.login-btn {
  width: 100%;
  padding: 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--red-dark); }
.login-error {
  color: var(--failure);
  font-size: 12px;
  margin-top: 12px;
  letter-spacing: 0.05em;
}
.login-note {
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 24px;
}
/* Forgot-password help line. Tenant-overridable via meta tags in
   <head> + a small JS shim in app.js that swaps the mailto/tel. */
.login-help {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  letter-spacing: 0.01em;
  word-break: break-word;
}
.login-help a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255,255,255,0.25);
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
.login-help a:hover {
  color: var(--accent, #ff3a1f);
  text-decoration-color: var(--accent, #ff3a1f);
}

/* ── ASSET INSPECTOR ─────────────────────────── */
.asset-inspector {
  margin-top: 20px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 20px;
}
.asset-preview {
  margin-bottom: 12px;
  max-height: 320px;
  overflow: hidden;
  background: var(--black);
  border: 1px solid var(--border);
}
.asset-preview img,
.asset-preview video {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.asset-meta {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.asset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.asset-actions button { flex: 1; min-width: 140px; }

.asset-ai-output {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ai-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.ai-result {
  background: var(--dark);
  border: 1px solid var(--border);
  padding: 16px;
}
.ai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin: 12px 0 6px;
}
.ai-label:first-child { margin-top: 0; }
.ai-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--white);
  white-space: pre-wrap;
}
.ai-actions { margin-top: 16px; }
.ai-error {
  padding: 16px;
  background: rgba(255,0,0,0.08);
  border: 1px solid var(--red);
  color: var(--white);
  font-size: 12px;
}
.ai-hint { margin-top: 8px; color: var(--text-dim); font-size: 11px; }

.watermark-row {
  margin-top: 16px;
  display: flex;
}

/* ACTIVE CHAIN TASK box — the action verb lives in the centre. Brett's
   audit: "we need 'Upload 1 still'" / "'Upload X images' needs to be in the
   centre of the template." */
.active-task {
  background: linear-gradient(135deg, rgba(255,0,0,0.08), rgba(255,0,0,0.02));
  border: 1px solid rgba(255,0,0,0.4);
  border-left: 3px solid var(--red);
  padding: 24px 18px;
  border-radius: 4px;
  margin-bottom: 16px;
  text-align: center;
}
.active-task-empty {
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}
.active-task-num {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.active-task-action {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 6px;
}
.active-task-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.active-task-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.active-task-platform {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(90,255,158,0.08);
  border: 1px solid rgba(90,255,158,0.35);
  padding: 3px 10px;
  border-radius: 12px;
  color: #5AFF9E;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.active-task-warn {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #FFAA00;
  font-style: italic;
}
.active-task-progress {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #5AFF9E;
  font-variant-numeric: tabular-nums;
}

/* Day · Slot pill at top of active-task — locked-in slot context */
.active-task-when {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* Theme = the brief Brett films to. Research-surfaced content angle. */
.active-task-theme {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(90,255,158,0.06);
  border-left: 2px solid #5AFF9E;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  text-align: left;
  font-style: italic;
}

/* ── ASSET METADATA INSPECTOR ROWS ─────────────── */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.meta-row span {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
}
.meta-row--tech span { color: #FFAA00; border-color: rgba(255,170,0,0.3); }
.meta-row--desc span { color: #5AFF9E; border-color: rgba(90,255,158,0.3); }
.meta-needs-review {
  margin-top: 8px;
  font-size: 11px;
  color: #FFAA00;
  letter-spacing: 0.04em;
}

/* ── ASSET CREATIVE-EVIDENCE PANEL (GAP 1) ─────────
   Shows verdict + peak/avg/variance + suggested action.
   Brett's rule: "shape behaviour more than any score." */
.asset-perf {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(255,255,255,0.2);
  border-radius: 4px;
}
.asset-perf--consistent-performer { border-left-color: #5AFF9E; background: rgba(90,255,158,0.05); }
.asset-perf--situational-weapon  { border-left-color: #FFAA00; background: rgba(255,170,0,0.05); }
.asset-perf--volatile            { border-left-color: #FF8C00; }
.asset-perf--promising           { border-left-color: #5AFF9E; opacity: 0.85; }
.asset-perf--underperforming     { border-left-color: #B71C1C; background: rgba(183,28,28,0.05); }
.asset-perf--dead                { border-left-color: #616161; opacity: 0.6; }
.asset-perf--dormant             { border-left-color: #6A1B9A; }
.asset-perf--untested            { border-left-color: rgba(255,255,255,0.15); }

.asset-perf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.asset-perf-tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--white);
}
.asset-perf--consistent-performer .asset-perf-tag { color: #5AFF9E; }
.asset-perf--situational-weapon  .asset-perf-tag { color: #FFAA00; }
.asset-perf--underperforming     .asset-perf-tag { color: #FF6B6B; }
.asset-perf--dead                .asset-perf-tag { color: var(--text-dim); }

.asset-perf-trend {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}
.asset-perf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.03em;
}
.asset-perf-stats strong { color: var(--white); font-weight: 800; font-variant-numeric: tabular-nums; }
.asset-perf-stats small { opacity: 0.6; font-size: 10px; }
.asset-perf-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin-left: 8px;
}
.asset-perf-action {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.88);
  border-left: 2px solid rgba(255,255,255,0.2);
}
.asset-perf-action strong { color: var(--white); font-weight: 800; letter-spacing: 0.05em; }
.asset-perf-action--promote      { border-left-color: #5AFF9E; background: rgba(90,255,158,0.08); }
.asset-perf-action--observe      { border-left-color: #FFAA00; background: rgba(255,170,0,0.06); }
.asset-perf-action--retire       { border-left-color: #B71C1C; background: rgba(183,28,28,0.06); }
.asset-perf-action--retry-new-hook { border-left-color: #FF8C00; background: rgba(255,140,0,0.06); }
.asset-perf-action--resurrect    { border-left-color: #6A1B9A; background: rgba(106,27,154,0.08); }
.link-edit-meta {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--red);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: underline;
  cursor: pointer;
}
.link-edit-meta--quiet {
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
  display: inline-block;
}
.link-edit-meta:hover { color: var(--white); }

/* ── SUGGESTED FRAMES (template fitness) ────────── */
.suggested-frames { margin-top: 14px; }
.suggested-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
.suggested-loading,
.suggested-empty {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}
.suggested-list { display: flex; flex-direction: column; gap: 4px; }
.suggested-cell {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--white);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.suggested-cell:hover { border-color: #5AFF9E; background: rgba(90,255,158,0.04); }
.suggested-pos {
  font-size: 11px;
  font-weight: 800;
  color: #5AFF9E;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.suggested-info {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.suggested-info em {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.45);
  font-style: normal;
}
.suggested-score {
  font-size: 11px;
  font-weight: 700;
  color: #FFAA00;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── METADATA EDITOR MODAL ──────────────────────── */
.meta-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.meta-modal {
  background: var(--dark-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.meta-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.meta-modal-head h3 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.meta-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.meta-modal-close:hover { color: var(--white); }
.meta-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}
.meta-modal-filename {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}
.meta-section {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.meta-section:last-child { border-bottom: 0; }
.meta-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: 12px;
}
.meta-section label {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
}
.meta-section input[type="text"],
.meta-section input:not([type]),
.meta-section input[type="date"],
.meta-section select {
  width: 100%;
  padding: 8px 10px;
  background: var(--dark);
  border: 1px solid var(--border-light);
  color: var(--white);
  font-family: var(--font);
  font-size: 12px;
  border-radius: 3px;
  outline: none;
}
.meta-section input[type="checkbox"] {
  justify-self: start;
  width: auto;
  accent-color: #5AFF9E;
}
.meta-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* Carousel preview: stack uploaded images side-by-side as a thin strip */
.asset-preview--strip {
  max-height: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
}
.asset-preview--strip img,
.asset-preview--strip video {
  width: calc((100% - 16px) / 5);
  height: auto;
  max-height: 80px;
  object-fit: cover;
  margin: 0;
}

/* Active chain cell highlight — GREEN means "you're on this one". Red is
   reserved for the brand. Brett audit: PLAIN outline only, no blur/glow/lift. */
.chain-cell--active {
  border-color: #5AFF9E;
  border-width: 2px;
}
.chain-cell--active:hover { border-color: #5AFF9E; transform: none; }
.chain-cell--active .chain-cell-num { background: #5AFF9E; color: var(--black); }

/* Frames that target an unwired platform get a small amber dot in the corner. */
.chain-cell--has-nonlive::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFAA00;
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
}

/* ── NEWS PANEL ────────────────────────────────── */
.news-stats {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.news-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}
@media (max-width: 1024px) {
  .news-split { grid-template-columns: 1fr; }
}
.news-compose,
.news-published {
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 4px;
}
.news-compose-head,
.news-published-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.news-compose-head code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  color: var(--red);
  letter-spacing: 0.05em;
}
.news-dropzone {
  padding: 24px;
  margin-top: 4px;
}
.news-asset-preview {
  margin-top: 12px;
  background: var(--dark);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 3px;
}
.news-asset-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}
.news-asset-meta {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.news-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.news-categories label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  padding: 4px 0;
}
.news-categories input { accent-color: #5AFF9E; }

.news-published-list { display: flex; flex-direction: column; gap: 6px; }
.news-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}
.news-row {
  padding: 12px 14px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-left: 3px solid #6A1B9A;
  border-radius: 3px;
}
.news-row-meta {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.news-row-headline {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 6px;
}
.news-row-actions a {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.news-row-actions a:hover { color: var(--white); }
.news-feed-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.news-feed-links a {
  color: var(--text-dim);
  text-decoration: none;
}
.news-feed-links a:hover { color: var(--red); }

/* ── CONNECTIONS PANEL ─────────────────────────── */
.conn-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(90,255,158,0.12);
  border: 1px solid rgba(90,255,158,0.35);
  color: #5AFF9E;
  border-radius: 8px;
  letter-spacing: 0.05em;
}
.conn-summary {
  display: flex;
  gap: 8px;
}
.conn-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.conn-pill--live      { color: #5AFF9E; border-color: rgba(90,255,158,0.4); background: rgba(90,255,158,0.06); }
.conn-pill--pending   { color: #FFAA00; border-color: rgba(255,170,0,0.4);  background: rgba(255,170,0,0.06); }
.conn-pill--notwired  { color: var(--text-dim); }

.conn-list { display: flex; flex-direction: column; gap: 8px; }
.conn-loading { padding: 40px; text-align: center; color: var(--text-dim); font-size: 13px; }
.conn-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 4px;
}
.conn-row--live      { border-left-color: #5AFF9E; }
.conn-row--pending-creds { border-left-color: #FFAA00; }
.conn-row--not-wired { border-left-color: rgba(255,255,255,0.15); opacity: 0.7; }

.conn-dot {
  font-size: 18px;
  text-align: center;
}
.conn-row--live .conn-dot      { color: #5AFF9E; }
.conn-row--pending-creds .conn-dot { color: #FFAA00; }
.conn-row--not-wired .conn-dot { color: var(--text-dimmer); }

.conn-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}
.conn-method {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.conn-reason {
  font-size: 11px;
  color: #FFAA00;
  margin-top: 4px;
  font-style: italic;
}
.conn-accounts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
.conn-account {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
}
.conn-account--none { color: var(--text-dimmer); background: transparent; }
.conn-status {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.conn-row--live .conn-status      { color: #5AFF9E; }
.conn-row--pending-creds .conn-status { color: #FFAA00; }

/* ── LANDING-PANEL TRIDENT (Brett 2026-05-02 PM) ───
   The big white trident centred on the /admin home panel. Halved
   from the SVG natural size and tuned to 2% opacity so it reads
   as a faint watermark behind the Launchpad kicker. */
.lp-home {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - 200px);
  padding-top: 17vh;
  text-align: center;
}
.lp-home-trident {
  width: clamp(120px, 22vw, 280px);
  height: auto;
  /* Brett-locked 2026-04-28 PM: home is the white trident, centred.
     Was opacity:0.02 from when this was a watermark behind a kicker
     — that kicker no longer exists, so the watermark style left the
     trident invisible (Brett: "no trident; nothing"). Now full opacity. */
  opacity: 1;
  pointer-events: none;
  margin-top: clamp(40px, 8vh, 120px);
}

/* ── TRIDENT STRIP (watermark colour picker) ───────
   Replaces the legacy <select>. Each pick is the trident silhouette
   in its colour, sized small enough to live as one row. */
.trident-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}
.trident-pick {
  width: 36px;
  height: 36px;
  background: var(--dark);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.15s, transform 0.1s;
  /* Render the trident shape via CSS mask using the same SVG path silhouette */
  --trident-color: #FFFFFF;
}
.trident-pick:hover { border-color: var(--white); }
.trident-pick.is-selected {
  border-color: #5AFF9E;
  box-shadow: 0 0 0 1px rgba(90,255,158,0.35);
}
.trident-pick::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  background-color: var(--trident-color);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'><path d='M543.87,449.52l5.82-75.51c.43-5.63,3.54-9.1,8.98-10.52l81.56-21.25c6.35-1.65,11.51.55,13.7,7.14l41.83,125.51-62.21-28.49,81.46,186.47,44.52,98.42,17.2,33.66c1.28-13.49-1.61-24.74-4.85-37.04l-52.42-199.33,46.12,15.89-70.39-254.24c-.85-3.07-2.83-6.03-4.67-7.32-2.63-1.84-5.95-1.65-9.53-.86l-143.98,37.09v-149.06s201.92-.03,201.92-.03c31.57,2.21,60.05,15.47,81.59,38.57,19.89,21.33,33.68,49.5,33.69,79.51l.06,430.75c0,36.53-16.06,71.25-43.27,95.22-21.15,18.63-49.16,31.41-78.22,31.44l-442.43.37c-46.48-3.18-87.29-28.62-108.34-69.99-9.69-19.69-14.4-40.63-14.41-63.13l-.12-420.47c-.02-69.2,56.41-124.63,125.84-122.25h192.66s0,149.23,0,149.23l-147.35-37.84c-5.44-.13-8.67,3.01-10.33,8.29l-70.75,254.77,45.11-15.83-53.78,208.02c-2.53,9.8-3.14,18.39-3.14,28.8,2.37-2.23,3.78-4.11,5.03-6.85l35.63-77.34,65.49-148.32,37.1-86.67-61.24,28.12,41.37-125.99c1.38-4.19,5.24-7.8,10.02-6.57l86.47,22.35c3.86,1,7.6,3.99,7.95,8.51l10.91,138.37,1.19,12.57-50.91-44.96,28.8,107.77,47.27,180.65,29.84-110.52,47.93-177.76-49.38,43.29-1.78.92c-.23.12.11-.78.26-1.44l6.15-72.09Z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'><path d='M543.87,449.52l5.82-75.51c.43-5.63,3.54-9.1,8.98-10.52l81.56-21.25c6.35-1.65,11.51.55,13.7,7.14l41.83,125.51-62.21-28.49,81.46,186.47,44.52,98.42,17.2,33.66c1.28-13.49-1.61-24.74-4.85-37.04l-52.42-199.33,46.12,15.89-70.39-254.24c-.85-3.07-2.83-6.03-4.67-7.32-2.63-1.84-5.95-1.65-9.53-.86l-143.98,37.09v-149.06s201.92-.03,201.92-.03c31.57,2.21,60.05,15.47,81.59,38.57,19.89,21.33,33.68,49.5,33.69,79.51l.06,430.75c0,36.53-16.06,71.25-43.27,95.22-21.15,18.63-49.16,31.41-78.22,31.44l-442.43.37c-46.48-3.18-87.29-28.62-108.34-69.99-9.69-19.69-14.4-40.63-14.41-63.13l-.12-420.47c-.02-69.2,56.41-124.63,125.84-122.25h192.66s0,149.23,0,149.23l-147.35-37.84c-5.44-.13-8.67,3.01-10.33,8.29l-70.75,254.77,45.11-15.83-53.78,208.02c-2.53,9.8-3.14,18.39-3.14,28.8,2.37-2.23,3.78-4.11,5.03-6.85l35.63-77.34,65.49-148.32,37.1-86.67-61.24,28.12,41.37-125.99c1.38-4.19,5.24-7.8,10.02-6.57l86.47,22.35c3.86,1,7.6,3.99,7.95,8.51l10.91,138.37,1.19,12.57-50.91-44.96,28.8,107.77,47.27,180.65,29.84-110.52,47.93-177.76-49.38,43.29-1.78.92c-.23.12.11-.78.26-1.44l6.15-72.09Z'/></svg>") center/contain no-repeat;
}
/* "Off" pick: no trident, just the ∅ symbol */
.trident-pick--off::before { display: none; }
.trident-pick--off .trident-x {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dim);
  line-height: 1;
}
.trident-pick--off.is-selected .trident-x { color: #5AFF9E; }

/* ── DRY-RUN TOGGLE (developer escape hatch — small + quiet) ─── */
.dry-run-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.05em;
  user-select: none;
}
.dry-run-toggle input { accent-color: var(--red); cursor: pointer; }

/* ── BTN NEXT — green "go" button, lives at the TOP of compose-right
   right under the active-task box. Brett audit: red is the brand,
   green is "advance". Green button → green outline jumps to next link. */
.btn-next {
  width: 100%;
  padding: 18px 24px;
  font-size: 14px;
  letter-spacing: 0.18em;
  font-weight: 900;
}
.btn-next--green {
  background: #5AFF9E;
  border: 1px solid #5AFF9E;
  color: var(--black);
}
.btn-next--green:hover {
  background: #3EE886;
  border-color: #3EE886;
  box-shadow: 0 4px 16px rgba(90,255,158,0.25);
}
.btn-next--green:active { box-shadow: none; }
.btn-next--green:disabled,
.btn-next--green[disabled] {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  cursor: not-allowed;
  box-shadow: none;
}

/* Top-positioned action bar — sits flush against the active-task box,
   no top border (the active-task box already has its own border below). */
.action-bar--top {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 16px;
}

/* ── CONFIDENCE + RISK INDICATOR (GAP 5) ───────────
   Two scores not one — keeps creative edge alive.
   Brett: "must publish" surfaces when both are high. */
.conf-risk {
  margin: 8px 0 16px;
  padding: 12px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.conf-risk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.conf-risk-pill {
  padding: 8px 12px;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.conf-risk-pill--confidence { border-left: 3px solid #5AFF9E; }
.conf-risk-pill--risk       { border-left: 3px solid #FFAA00; }
.conf-risk-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.conf-risk-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.conf-risk-verdict {
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--text-dim);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.conf-risk[data-label="must-publish"] .conf-risk-verdict {
  background: rgba(90,255,158,0.08);
  font-weight: 900;
  letter-spacing: 0.08em;
}
.conf-risk[data-label="weak"] .conf-risk-verdict {
  background: rgba(255,107,107,0.08);
}
.conf-risk-detail summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 4px 0;
}
.conf-risk-detail summary:hover { color: var(--white); }
.conf-risk-factors {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conf-risk-fact-group {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.conf-risk-fact-group strong {
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.conf-risk-fact-group span {
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

/* ── DAM DASHBOARD (top of Studio — the new front door) ───────────
   Brett's audit: "I was expecting to be greeted by a new approach."
   This strip lands above the chain and answers: what week are we in,
   how many assets are tagged, how many gaps remain, what's up next. */
.dam-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .dam-dashboard { grid-template-columns: repeat(2, 1fr); }
  .dam-stat--next { grid-column: 1 / -1; }
}
.dam-stat {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.dam-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  opacity: 0.6;
}
.dam-stat--week::before    { background: #FF0000; }
.dam-stat--frames::before  { background: #5AFF9E; }
.dam-stat--assets::before  { background: #FFAA00; }
.dam-stat--gaps::before    { background: #FFAA00; }
.dam-stat--next::before    { background: #5AFF9E; }
.dam-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.dam-stat-value {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.dam-stat-value small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-left: 2px;
}
.dam-stat-value--small { font-size: 14px; letter-spacing: 0.05em; }
.dam-stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.dam-stat-progress {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.dam-stat-progress-fill {
  height: 100%;
  background: #5AFF9E;
  transition: width 0.4s ease;
}

/* CHAIN STRIP (top of Studio) — week-at-a-glance progress */
.chain-strip-wrap {
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.chain-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.chain-strip-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
}
.chain-strip-progress {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--red);
}
.coverage-chip {
  margin-left: 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: help;
}
.coverage-chip strong { color: #FFAA00; font-weight: 800; }
/* Chain strip — auto-fits all frames per the WEEKLY_PLAN length.
   Brett audit: bigger thumbnails, plain outlines, all visible at once. */
.chain-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
}
@media (max-width: 720px) {
  .chain-strip { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
}
.chain-strip-loading {
  color: var(--text-dim);
  font-size: 12px;
  padding: 24px;
  text-align: center;
  grid-column: 1 / -1;
}
.chain-cell {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--dark);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.chain-cell:hover { border-color: var(--white); }
.chain-cell-num {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--white);
  background: rgba(0,0,0,0.7);
  padding: 1px 4px;
  border-radius: 2px;
}
.chain-cell-status {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  background: rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.4);
}
.chain-cell--queued .chain-cell-status {
  background: var(--red);
  color: var(--white);
}
.chain-cell--queued.chain-cell--published .chain-cell-status {
  background: #2E7D32;
}
.chain-cell-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(255,255,255,0.25);
}
.chain-cell-thumb img,
.chain-cell-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Trident silhouette as the empty-cell glyph — every link in the chain
   shows the trident until a real asset fills it. */
.chain-cell-trident {
  width: 50%;
  height: 50%;
  fill: rgba(255,255,255,0.18);
  transition: fill 0.15s;
}
.chain-cell:hover .chain-cell-trident { fill: rgba(255,255,255,0.4); }
.chain-cell--active .chain-cell-trident { fill: #5AFF9E; }
.chain-cell-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 2px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.4);
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chain-cell--queued .chain-cell-label {
  color: var(--white);
}

/* Template section grouping */
.template-section { margin-bottom: 18px; }
.template-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.template-section-hint {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--red);
  opacity: 0.85;
}

/* Video and Carousel template shapes */
.video-shape, .carousel-shape {
  aspect-ratio: 9/16;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 2px;
}
.carousel-shape {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}
.video-duration {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.video-icon {
  font-size: 16px;
  color: var(--red);
  opacity: 0.7;
}
.carousel-count {
  font-size: 30px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.04em;
}
.carousel-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* Auto-schedule note in compose */
.auto-schedule-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 16px 0 4px;
  background: rgba(255,0,0,0.05);
  border: 1px solid rgba(255,0,0,0.25);
  border-left: 3px solid var(--red);
  border-radius: 3px;
  font-size: 12px;
  color: var(--white);
  line-height: 1.5;
}
.auto-schedule-note strong { color: var(--red); }
.auto-schedule-icon { font-size: 16px; }

/* Publish Now is de-emphasised on purpose — Launchpad is a SCHEDULER.
   Use it as an escape hatch, not a default. */
.btn-publish {
  padding: 3px 8px;
  font-size: 9px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.btn-publish:hover {
  opacity: 1;
  color: var(--red);
  border-color: var(--red);
}

/* ── MODAL (Crop) ───────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--dark-card);
  border: 1px solid var(--border-light);
  max-width: 720px;
  width: 100%;
  padding: 28px;
}
.modal-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.crop-stage {
  background: var(--black);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  padding: 20px;
}
.crop-frame {
  max-height: 420px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #222;
  position: relative;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  display: block;
}
.crop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.crop-controls input[type="range"] {
  flex: 1;
  accent-color: var(--red);
}
.crop-controls button {
  padding: 6px 12px;
  font-size: 11px;
}
.crop-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── SAFE-AREA OVERLAY (inside .crop-frame) ───────── */
.crop-safe-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.crop-safe-overlay.hidden { display: none; }
.crop-safe-zone {
  fill: rgba(90, 255, 158, 0.06);
  stroke: rgba(90, 255, 158, 0.85);
  stroke-width: 0.4;
  stroke-dasharray: 1.2 0.8;
  vector-effect: non-scaling-stroke;
}
.crop-unsafe-zone {
  fill: rgba(255, 0, 0, 0.22);
}
.crop-safe-label {
  fill: rgba(90, 255, 158, 0.95);
  font-family: 'Montserrat', sans-serif;
  font-size: 3.2px;
  font-weight: 900;
  letter-spacing: 0.3px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.pub-fail { color: var(--red); }


/* ── TEMPLATE CHAIN ─────────────────────────── */
.chain-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.chain-subs {
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 32px 28px;
  margin-bottom: 32px;
  text-align: center;
}
.chain-subs-num {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--white);
}
.chain-subs-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
}
.chain-subs-label .red { color: var(--red); }
.chain-subs-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  margin-top: 18px;
  overflow: hidden;
}
.chain-subs-bar-fill {
  height: 100%;
  background: var(--red);
  transition: width 0.4s ease;
}
.chain-subs-meta {
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 14px;
}
.chain-subs-export {
  margin-top: 16px;
  padding: 8px 16px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.chain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px 4px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.chain-week-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.chain-week-id {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chain-progress {
  text-align: right;
}
.chain-progress-num {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  color: var(--red);
}
.chain-progress-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

.chain-loading {
  padding: 60px 20px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

.chain-group {
  margin-bottom: 28px;
}
.chain-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.chain-group-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chain-group-count {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.chain-task {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chain-task:hover {
  background: var(--dark-hover);
  border-color: var(--border-light);
}
.chain-task[data-status="posted"] {
  opacity: 0.45;
  cursor: default;
}
.chain-task[data-status="posted"]:hover { background: var(--dark-card); }

.chain-task-num {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--white);
}
.chain-task[data-status="posted"] .chain-task-num { color: var(--text-dimmer); }

.chain-task-body {
  min-width: 0;
}
.chain-task-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chain-task-ratio {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.chain-task-meta {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chain-task-intent-conversion {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-left: 6px;
}
.chain-task-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 5px 8px;
  border: 1px solid var(--border);
}
.chain-task[data-status="captioned"] .chain-task-status { color: #FFB347; border-color: #FFB347; }
.chain-task[data-status="queued"] .chain-task-status { color: #5AFF9E; border-color: #5AFF9E; }
.chain-task[data-status="posted"] .chain-task-status { color: var(--text-dimmer); }

.chain-foot {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.chain-foot .btn-ghost {
  padding: 8px 14px;
  font-size: 11px;
}


/* ── APP LAYOUT ─────────────────────────────── */
.app { min-height: 100vh; padding-bottom: 60px; }

.topbar {
  /* Brett-locked 2026-05-02 PM: launchpad letterbox = public-site
     .site-nav proportions. Halved vertical padding from 16→8 so the
     band reads as a thin nav letterbox instead of a thick chrome
     slab. Left/right padding mirrors public site (24px left, 110px
     right keeps room for any future Discord/hamburger anchors). */
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: grid;
  /* Brett 2026-05-04: logo sits on the LEFT at natural width;
     the nav fills the remaining row. Was `1fr auto auto` which
     stretched col 1 and pushed nav onto a second row. */
  grid-template-columns: auto 1fr;
  gap: 0;
  align-items: center;
  padding: 8px 110px 8px 24px;
}

/* Brett-locked 2026-05-04: 1px red speed-blur line on the LEADING
   EDGE of the top letterbox — sits under the MENU ROW itself
   (not the bottom of the whole topbar / search-bar row). Mirrors
   the pattern from css/style-2.css:498-515 on the public site,
   but runs only 3/4 of the way across — solid red holds through
   ~60%, then tapers off (the speed-blur trail). Soft fade-in at
   the left so both ends taper. */
.lp-nav { position: relative; }
.lp-nav::after {
  content: '';
  position: absolute;
  /* Brett 2026-05-04: line starts OFF the page (negative left)
     so the leading edge isn't a visible "begin point" — it
     just slides in already at full intensity, like motion
     entering frame. */
  left: -8%;
  bottom: -8px;
  width: 75%;
  height: 1px;
  background: linear-gradient(to right,
    #FF0000 0%,
    #FF0000 60%,
    rgba(255, 0, 0, 0.55) 82%,
    transparent 100%);
  filter: blur(0.4px);
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.55), 0 0 14px rgba(255, 0, 0, 0.25);
  pointer-events: none;
}

/* ── MAGAZINE package frame (2026-04-24) ──────────────────────────
   Rev 2 · functional 3-pane capture. Left = UPLOAD, Middle = DATA
   DUMP, Right = LIVE PREVIEW. Chips are confirmation UI. Confidence
   colours: high = body colour, low = oxford-blue italic, attn = red
   outline (shame-red pattern). Template picker = 5 coloured swatches. */

.frame-body--magazine {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 520px;
}
.mag-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 12px;
}
.mag-slot-number {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.mag-title-status { font-size: 11px; color: rgba(255,255,255,0.5); }

.mag-three-pane {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 12px;
  flex: 1;
  min-height: 420px;
}
@media (max-width: 1100px) {
  .mag-three-pane { grid-template-columns: 1fr; }
}
.mag-pane {
  border: 1px solid rgba(255,255,255,0.14);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: rgba(255,255,255,0.02);
}
.mag-pane-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--action);
  margin-bottom: 12px;
}

/* UPLOAD pane */
.mag-dropzone {
  border: 1.5px dashed rgba(255,255,255,0.3);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.75);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mag-dropzone:hover,
.mag-dropzone:focus { border-color: var(--action); color: #fff; outline: none; }
.mag-dropzone--hover { border-color: var(--action); background: rgba(47,128,237,0.08); }
.mag-dropzone-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.mag-files { margin-top: 14px; flex: 1; overflow-y: auto; }
.mag-files-empty {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mag-file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.mag-file-name { color: rgba(255,255,255,0.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mag-file-meta { font-size: 10px; color: rgba(255,255,255,0.45); letter-spacing: 0.1em; }
.mag-file-remove {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  width: 20px; height: 20px;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}
.mag-file-remove:hover { color: #EB5757; border-color: #EB5757; }

/* DATA DUMP pane */
.mag-dump-textarea {
  flex: 1;
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  min-height: 220px;
}
.mag-dump-textarea:focus { outline: none; border-color: var(--action); }
.mag-dump-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.18em;
  margin-top: 8px;
  text-transform: uppercase;
}

/* LIVE PREVIEW pane */
.mag-preview-body { display: flex; flex-direction: column; gap: 10px; }
.mag-preview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}
.mag-preview-headline {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
}
.mag-preview-headline--empty { color: rgba(255,255,255,0.3); font-style: italic; }
.mag-preview-address { font-size: 12px; color: rgba(255,255,255,0.7); }
.mag-preview-price { font-size: 12px; color: var(--action); letter-spacing: 0.08em; }
.mag-preview-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Chips — confidence-aware */
.mag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  background: transparent;
}
.mag-chip[data-confidence="high"] { color: #fff; border-color: rgba(255,255,255,0.5); }
.mag-chip[data-confidence="low"]  { color: rgba(255,255,255,0.5); font-style: italic; border-color: rgba(255,255,255,0.18); }
.mag-chip[data-confidence="attn"] { color: #EB5757; border-color: #EB5757; border-width: 2px; }
.mag-chip[data-confidence="none"] { color: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.12); }
.mag-chip-icon { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mag-chip-empty { opacity: 0.6; }

/* Story preview */
.mag-preview-story { margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 10px; }
.mag-preview-story-heading {
  font-size: 13px;
  letter-spacing: -0.01em;
  font-family: Georgia, serif;
  font-weight: 300;
  color: #fff;
  margin-bottom: 4px;
}
.mag-preview-story-body {
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255,255,255,0.7);
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

/* Template picker */
.mag-preview-templates-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: rgba(255,255,255,0.5);
  margin-top: 10px;
}
.mag-template-picker { display: flex; gap: 6px; margin-top: 6px; }
.mag-template-swatch {
  width: 56px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: transform 0.1s, border-color 0.12s;
}
.mag-template-swatch:hover { border-color: rgba(255,255,255,0.7); transform: translateY(-1px); }
.mag-template-swatch--active { border: 2px solid var(--action); box-shadow: 0 0 0 1px var(--action); }
.mag-template-swatch-label {
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

/* Inference state strip */
.mag-preview-infer {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 28px;
  color: rgba(255,255,255,0.4);
}
.mag-preview-infer--pending { color: var(--action); }
.mag-preview-infer--error   { color: #EB5757; }

/* NEXT button */
.mag-next {
  align-self: flex-end;
  background: var(--action);
  border: 1px solid var(--action);
  color: #fff;
  padding: 10px 22px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 700;
  margin-top: 6px;
}
.mag-next:hover { background: var(--action-dark); border-color: var(--action-dark); }

/* ── PACKAGE bar (2026-04-24) ─────────────────────────────────────
   Top-level publishing-package switcher. Only renders when the tenant
   supports more than one package (flow.js's list() returns length > 1).
   Active package highlighted in NASA --action blue. Geometric only. */
.package-bar {
  display: flex;
  gap: 4px;
  align-items: center;
}
.package-bar[hidden] { display: none; }
.package-bar-btn {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 5px 11px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.package-bar-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.package-bar-btn--active {
  color: #fff;
  background: var(--action);
  border-color: var(--action);
  cursor: default;
}
.package-bar-btn--active:hover {
  background: var(--action);
  border-color: var(--action);
}
.role-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.28);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
a.role-badge:hover,
a.role-badge:focus {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
  outline: none;
}
/* Brett 2026-05-04: Launchpad rocket logo at the front of the
   topbar. The grid (`.topbar`) has `1fr auto auto`, so giving
   the logo a fixed size lets the 1fr column simply hold the
   logo at its natural width — nav items sit immediately after
   with the column gap. To push the nav further right we widen
   the gap and bump the logo's right margin. */
.topbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-right: 28px;     /* space between logo and the menu */
  padding: 0;
  flex-shrink: 0;
}
.topbar-logo .tl-mark {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2em;
}
.topbar-version {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--red);
  background: rgba(255,0,0,0.08);
  border: 1px solid rgba(255,0,0,0.4);
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: -4px;
}
/* INFO toggle — off by default (operator mode). When on, body.info-mode is
   applied and .info-hint elements become visible across the SPA. */
.info-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.78);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 6px 12px;
  cursor: pointer;
  text-transform: uppercase;
}
.info-toggle:hover { color: #fff; border-color: #fff; }
.info-toggle[aria-pressed="true"] {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}

/* SIMULATION toggle — attention-orange when active so it cannot be
   confused with live launch. Rule: simulation state must be impossible
   to miss at a glance (topbar + banner + launch button all change). */
.sim-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.78);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 6px 12px;
  cursor: pointer;
  text-transform: uppercase;
}
.sim-toggle:hover { color: #fff; border-color: #fff; }
.sim-toggle[aria-pressed="true"] {
  background: var(--attention);
  border-color: var(--attention);
  color: var(--black);
}
.sim-toggle[aria-pressed="true"]::before {
  content: '●';
  margin-right: 6px;
  color: var(--black);
}

/* Simulation banner — full-width orange strip under the topbar. Only
   present when simulation is active. Not dismissable by design. */
.sim-banner {
  background: var(--attention);
  color: var(--black);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 40;
}
.sim-banner[hidden] { display: none; }
.sim-banner-dot {
  display: inline-block;
  margin-right: 10px;
  font-size: 10px;
  animation: sim-banner-pulse 1.6s ease-in-out infinite;
}
@keyframes sim-banner-pulse {
  0%, 100% { opacity: 1;   }
  50%      { opacity: 0.4; }
}
/* When simulation is active, the app body carries sim-mode so other
   surfaces (launch buttons, last-run chip in v3) can style accordingly. */
body.sim-mode .btn-primary,
body.sim-mode .btn-next {
  outline: 1px solid var(--attention);
  outline-offset: 2px;
}

/* ─── LAST RUN chip (Deploy 3) ─────────────────────────────────────
   Sits next to the SIMULATION toggle. Shows the glyph of the most
   recent run (✓ pass · ! partial · ✕ fail). Click to re-open the
   drawer. Hidden until a first run completes. */
.sim-lastrun {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.78);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  cursor: pointer;
  text-transform: uppercase;
}
.sim-lastrun:hover { color: #fff; border-color: #fff; }
.sim-lastrun[hidden] { display: none; }
.sim-lastrun-glyph { font-size: 12px; line-height: 1; }
.sim-lastrun[data-status="pass"]    .sim-lastrun-glyph { color: var(--success); }
.sim-lastrun[data-status="partial"] .sim-lastrun-glyph { color: var(--attention); }
.sim-lastrun[data-status="fail"]    .sim-lastrun-glyph { color: var(--failure); }

/* ─── SIMULATION REPORT DRAWER (Deploy 3) ───────────────────────────
   Bottom drawer, sticky header with extract + actions, scrollable body
   with event timeline. No modal, no backdrop — operator keeps working
   while reading. */
.sim-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--dark-card);
  border-top: 2px solid var(--attention);
  font-family: var(--font);
}
.sim-drawer[hidden] { display: none; }

.sim-drawer-head {
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--dark-card);
}
.sim-drawer-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
}
.sim-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  flex-shrink: 0;
}
.sim-drawer-glyph { font-size: 18px; line-height: 1; }
.sim-drawer[data-status="pass"]    .sim-drawer-glyph { color: var(--success); }
.sim-drawer[data-status="partial"] .sim-drawer-glyph { color: var(--attention); }
.sim-drawer[data-status="fail"]    .sim-drawer-glyph { color: var(--failure); }
.sim-drawer-meta {
  flex: 1;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-drawer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.sim-drawer-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
}
.sim-drawer-btn:hover { color: var(--white); border-color: var(--white); }
.sim-drawer-btn--close {
  font-weight: 900;
}

.sim-drawer-extract {
  padding: 10px 0 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--white);
}
.sim-drawer-extract section {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 16px;
  margin-bottom: 6px;
}
.sim-drawer-extract .k {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  align-self: start;
  padding-top: 1px;
}
.sim-drawer-extract .v ul { margin: 0; padding: 0 0 0 16px; }
.sim-drawer-extract .v li { line-height: 1.5; }
.sim-drawer-extract .v code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.sim-drawer-body {
  padding: 12px 24px 20px;
  overflow-y: auto;
  flex: 1;
}
.sim-drawer-body h3 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 14px 0 8px;
}
.sim-drawer-body h3:first-child { margin-top: 0; }
.sim-event {
  display: grid;
  grid-template-columns: 92px 140px 1fr auto;
  gap: 10px;
  padding: 6px 0;
  font-size: 11px;
  line-height: 1.45;
  border-bottom: 1px dashed var(--border);
}
.sim-event-time   { color: var(--text-dimmer); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sim-event-type   { color: var(--text-dim); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sim-event-label  { color: var(--white); overflow: hidden; text-overflow: ellipsis; }
.sim-event-status { font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.sim-event-status[data-s="passed"] { color: var(--success); }
.sim-event-status[data-s="blocked"],
.sim-event-status[data-s="failed"]  { color: var(--failure); }
.sim-event-status[data-s="warning"] { color: var(--attention); }
.sim-event-status[data-s="info"]    { color: var(--text-dim); }

/* Inline hints — hidden by default. Visible only when body.info-mode.
   Per discipline spec: no boxes, no icons, subtle colour, smaller than
   the label. Pure inline explanation that never blocks the action. */
.info-hint {
  display: none;
  font-size: 10px;
  line-height: 1.55;
  color: #7A828E;
  margin: 4px 0 10px;
  letter-spacing: 0.01em;
}
body.info-mode .info-hint { display: block; }
.info-hint > span { display: block; }
.info-hint b {
  font-weight: 700;
  color: #8E95A0;
  margin-right: 4px;
}

.bug-btn {
  background: transparent;
  border: 1px solid rgba(255,170,0,0.45);
  color: #FFAA00;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bug-btn:hover { background: #FFAA00; color: var(--black); }
.topbar-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.tab {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { color: var(--white); border-color: var(--border-light); }
.tab.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}
.logout-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}
.logout-btn:hover { color: var(--white); }

/* ── UNIFIED TOPBAR BUTTON SIZING + CLICK FEEDBACK ─────────────
   All 8 topbar controls (CONNECTIONS / MISSION CONTROL / NEWS /
   FIRING RANGE / SIM / ERRORS / ADMIN / EXIT) share one size so
   the bar reads as a single row of equal tiles.
   ────────────────────────────────────────────────────────────── */
.topbar .tab,
.topbar .sim-toggle,
.topbar .sim-lastrun,
.topbar .intel-btn,
.topbar .errors-btn,
.topbar .role-badge,
.topbar .logout-btn {
  height: 40px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  min-width: 112px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.16s ease, border-color 0.16s ease,
              color 0.16s ease, transform 0.06s ease, box-shadow 0.35s ease;
}

/* Press — held-mouse feedback, nearly imperceptible dip. */
.topbar .tab:active,
.topbar .sim-toggle:active,
.topbar .errors-btn:active,
.topbar .role-badge:active,
.topbar .logout-btn:active {
  transform: translateY(1px);
  background: rgba(255,255,255,0.06);
}

/* Release — a brief inner-ring flash so the click registers visually
   after the mouse has left the button. Cleared by admin/app.js. */
@keyframes topbar-tile-flash {
  0%   { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.75); }
  100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0);    }
}
.topbar .just-clicked {
  animation: topbar-tile-flash 380ms ease-out;
}

/* ── PANELS ─────────────────────────────────── */
.panel {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px;
}
/* Brett-locked 2026-05-04 (Connections panel bug): `.lp-home`
   sets display:flex on the home panel, which beat the user-
   agent `[hidden]` rule and left the home panel taking 840px
   of vertical space even when switchToPanel() set hidden=true.
   Result: clicking Connections in the menu DID load the data
   (badge updated, list rendered) but the connections panel
   showed up 939px below the fold, so Brett saw the home hero
   and assumed nothing loaded. Same bug class threatens any
   future panel that sets its own display:. Force HTML's
   semantic hide back on. */
.panel[hidden] { display: none !important; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.panel-head h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

/* ── UPLOAD PANEL SPLIT ─────────────────────── */
.panel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 1024px) {
  .panel-split { grid-template-columns: 1fr; }
}

/* ── DROPZONE ───────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-light);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--dark);
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--red);
  background: rgba(255,0,0,0.05);
}
.dropzone-icon { font-size: 48px; margin-bottom: 16px; }
.dropzone-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
}
.dropzone-sub {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.file-queue {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-item {
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-dim); font-size: 11px; }
.file-item-status { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.file-item-status.pending { color: var(--text-dim); }
.file-item-status.uploading { color: #FFAA00; }
.file-item-status.done { color: #4a8c28; }
.file-item-status.error { color: var(--red); }

/* ── COMPOSE RIGHT ──────────────────────────── */
.compose-right {
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 28px;
}
.compose-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 20px 0 10px;
}
.field-label:first-of-type { margin-top: 0; }
.field-input,
.field-textarea {
  width: 100%;
  padding: 14px;
  background: var(--dark);
  border: 1px solid var(--border-light);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.field-textarea { min-height: 120px; font-size: 14px; line-height: 1.5; }
.field-input:focus,
.field-textarea:focus { border-color: var(--red); }
.field-hint {
  font-size: 10px;
  color: var(--text-dimmer);
  margin-top: 6px;
  text-align: right;
}

/* ── TEMPLATE GRID ──────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .template-grid { grid-template-columns: repeat(2, 1fr); }
}
.template-card {
  background: var(--dark);
  border: 1px solid var(--border);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  color: var(--white);
  text-align: left;
}
.template-card:hover { border-color: var(--border-light); }
.template-card.selected {
  border-color: var(--red);
  background: rgba(255,0,0,0.08);
}
.template-shape {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 60px;
  margin: 0 auto 10px;
  position: relative;
}
.template-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  text-align: center;
}
.template-dim {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* ── PLATFORM CHIPS ─────────────────────────── */
.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--dark);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip input { accent-color: var(--red); cursor: pointer; }
.chip:has(input:checked) {
  border-color: var(--red);
  background: rgba(255,0,0,0.1);
}

/* ── SCHEDULE ROW ───────────────────────────── */
.schedule-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

/* ── ACTION BAR ─────────────────────────────── */
.action-bar {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.btn-primary,
.btn-secondary,
.btn-ghost {
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  flex: 1;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary {
  background: var(--dark);
  color: var(--white);
  border-color: var(--border-light);
}
.btn-secondary:hover { border-color: var(--white); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--white); }

/* ── GALLERY ────────────────────────────────── */
.gallery-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.filter.active {
  border-color: var(--red);
  color: var(--red);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery-empty,
.queue-empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-dim);
  background: var(--dark-card);
  border: 1px dashed var(--border);
  font-size: 13px;
}

.gallery-item {
  background: var(--dark-card);
  border: 1px solid var(--border);
  aspect-ratio: 1/1;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  font-size: 10px;
  color: var(--white);
  letter-spacing: 0.05em;
  pointer-events: none;
}
.gallery-item-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.95);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.85; /* always visible; was hover-only — Brett kept missing them */
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.gallery-item:hover .gallery-item-delete { opacity: 1; }
.gallery-item-delete:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: scale(1.08);
}

/* ── QUEUE ──────────────────────────────────── */
.queue-stats { display: flex; gap: 8px; }
.stat-pill {
  background: var(--dark-card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-pill b { color: var(--red); margin-left: 4px; }

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.queue-item {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
}
.queue-item-thumb {
  width: 80px;
  height: 80px;
  background: var(--dark);
  overflow: hidden;
}
.queue-item-thumb img,
.queue-item-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.queue-item-body {
  font-size: 13px;
  line-height: 1.5;
}
.queue-item-meta {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.queue-item-caption {
  color: var(--white);
  font-size: 13px;
  opacity: 0.85;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.queue-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.queue-item-actions .btn-del {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
  font-family: var(--font);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.queue-item-actions .btn-del:hover { color: var(--red); border-color: var(--red); }

/* ── CALENDAR ENTRY (queue card middle) ──────── */
.queue-cal {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.cal-card {
  flex-shrink: 0;
  width: 64px;
  border: 1px solid var(--border);
  background: var(--dark);
  text-align: center;
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font);
}
.cal-month {
  background: var(--red);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 3px 0;
}
.cal-day {
  font-size: 26px;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  padding-top: 4px;
}
.cal-weekday {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  padding-bottom: 2px;
}
.cal-time {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white);
  background: rgba(255,255,255,0.04);
  padding: 4px 0;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.cal-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cal-intent {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--red);
  color: var(--white);
}
.cal-intent--cta       { background: #FF0000; }
.cal-intent--race      { background: #B71C1C; }
.cal-intent--training  { background: #1E88E5; }
.cal-intent--news      { background: #6A1B9A; }
.cal-intent--athlete   { background: #2E7D32; }
.cal-intent--community { background: #F57C00; }
.cal-intent--default   { background: #616161; }

.cal-template {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--white);
  opacity: 0.85;
}
.cal-auto {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.18);
}
.cal-platforms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cal-platform {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  background: rgba(90,255,158,0.06);
  border: 1px solid rgba(90,255,158,0.3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5AFF9E;
}
.cal-platform-label {
  font-size: 10px;
  opacity: 1;
  letter-spacing: 0.1em;
}
.cal-dryrun {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #FFAA00;
  border: 1px solid #FFAA00;
  padding: 3px 8px;
  border-radius: 3px;
}
.cal-caption {
  color: var(--white);
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.cal-why {
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  margin-top: 2px;
}
.cal-why summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 2px 0;
}
.cal-why summary:hover { color: var(--white); }
.cal-why-body {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.4);
  border-left: 2px solid var(--red);
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255,255,255,0.7);
}
.cal-why-body strong { color: var(--white); }
.cal-why-body em { font-style: italic; opacity: 0.8; }
.cal-why-body code {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 10px;
  background: rgba(255,255,255,0.07);
  padding: 1px 4px;
  border-radius: 2px;
  color: #FFAA00;
  word-break: break-all;
}
.cal-tracking ul li {
  margin-top: 2px;
  list-style-type: '· ';
}

.queue-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 24px;
}

/* ── TOAST ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-card);
  border: 1px solid var(--red);
  border-left-width: 3px;
  padding: 14px 20px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pub-note {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  max-width: 500px;
}

/* ── MOBILE ─────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { grid-template-columns: 1fr; gap: 12px; padding: 12px 16px; }
  .topbar-tabs { justify-content: flex-start; }
  .topbar-user { justify-content: space-between; }
  .package-bar { justify-content: flex-start; flex-wrap: wrap; }
  .panel { padding: 20px 16px; }
  .dropzone { padding: 40px 20px; }
  .compose-right { padding: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ipqld — readability polish on top of the dark Launchpad theme.
   Background is dark grey, cards one shade up, text white/dim-white.
   Active states + focus rings use maroon, never CageRace red.
   ═══════════════════════════════════════════════════════════════════ */

/* Topbar tabs — readable at rest, pop on hover, maroon when active. */
.topbar-tabs { gap: 10px; }
.tab {
  color: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.22);
  font-weight: 800;
}
.tab:hover { color: #fff; border-color: rgba(255,255,255,0.55); }
.tab.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.topbar-user { color: rgba(255,255,255,0.78); }
#userEmail { color: rgba(255,255,255,0.85); font-weight: 700; }
.logout-btn {
  color: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.28);
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Kill CageRace-red rgba tints (hardcoded 255,0,0 values elsewhere in the
   file) by layering maroon-tinted accents on the most visible selectors. */
.field-input:focus,
.field-textarea:focus,
.login-input:focus { border-color: var(--red); }
.template-card.selected {
  border-color: var(--action);
  background: rgba(47,128,237,0.12);
}
.field-input,
.field-textarea {
  background: var(--dark-card);
  color: var(--white);
  border: 1px solid var(--border-light);
}
.field-input::placeholder,
.field-textarea::placeholder { color: var(--text-dimmer); }

/* Frame chips (chain strip) — visible border; active frame = ATTENTION.
   Active is "this is where you're working now" — orange per spec. */
.chain-cell {
  border: 1px solid var(--border-light);
  background: var(--dark-card);
}
.chain-cell:hover { border-color: var(--white); }
.chain-cell--active {
  border-color: var(--attention) !important;
  border-width: 2px !important;
}
.chain-cell--active:hover { border-color: var(--attention) !important; }
.chain-cell--active .chain-cell-num {
  background: var(--attention);
  color: var(--black);
}
.chain-cell--active .chain-cell-trident { fill: var(--attention); }

/* Chain task rows (the vertical list under the frame strip). */
.chain-task {
  background: var(--dark-card);
  border: 1px solid var(--border-light);
}
.chain-task:hover {
  background: var(--dark-hover);
  border-color: var(--action);
}
/* Queued = committed for launch = action colour (blue). */
.chain-task[data-status="queued"] .chain-task-status { color: var(--action); border-color: var(--action); }
/* Published / launched = success (green). */
.chain-task[data-status="published"] .chain-task-status,
.chain-task[data-status="posted"] .chain-task-status { color: var(--success); border-color: var(--success); }

/* Active "compose right" card — the big featured frame. Maroon frame,
   not the pink-tinted one it had before. */
.compose-right {
  background: var(--dark-card);
  border: 2px solid var(--red);
}

/* Template grid cards. */
.template-card {
  background: var(--dark-card);
  color: var(--white);
  border: 1px solid var(--border-light);
}
.template-card:hover { border-color: var(--white); }

/* Dashboard stats + panel headers — keep text legible on dark bg. */
.dam-stat { background: var(--dark-card); border: 1px solid var(--border-light); }
.dam-stat-label { color: var(--text-dim); }
.dam-stat-value { color: var(--white); }
.dam-stat-sub { color: var(--text-dimmer); }

/* ── TARGET PROFILE ──────────────────────────────────────────────
   Above compose in Mission Control. Populated from
   window.__TENANT__.audiences + campaign.primary_audience_id.
   Typography-led: small uppercase muted label + stronger value lines,
   tight grouping, no heavy borders. */
.target-profile {
  max-width: 1600px;
  margin: 20px auto 0;
  padding: 20px 24px;
  background: var(--dark-card);
  border: 1px solid var(--border);
}
.target-profile[hidden] { display: none; }
.target-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  user-select: none;
}
.target-profile-head:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}
.target-profile-head-left  { min-width: 0; flex: 1; }
.target-profile-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Expanded body: spacing between head and body only when open. */
.target-profile[data-collapsed="false"] .target-profile-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.target-profile[data-collapsed="true"]  .target-profile-body { display: none; }
.target-profile[data-collapsed="true"]  .target-profile-chev { transform: rotate(-90deg); }

/* Chev glyph — sits at the far left of the head as a disclosure control,
   in a bordered square so it reads as "open / close" not as a directional
   arrow pointing at something. */
.target-profile-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  color: var(--white);
  border: 1px solid var(--border-light);
  background: var(--dark);
  flex-shrink: 0;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.target-profile-head:hover .target-profile-chev {
  border-color: var(--white);
  background: var(--dark-hover);
}

/* Collapsed summary line (short core_problem snippet). Hidden when expanded
   because the body already shows the full text. */
.target-profile-summary {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 720px;
}
.target-profile[data-collapsed="false"] .target-profile-summary { display: none; }

/* Pin button */
.target-profile-pin {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-family: var(--font);
}
.target-profile-pin:hover { color: var(--white); border-color: var(--white); }
.target-profile-pin[aria-pressed="true"] {
  background: var(--attention);
  border-color: var(--attention);
  color: var(--black);
}
.target-profile-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.target-profile-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--white);
}
.target-profile-lock {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--success);
  padding: 4px 10px;
  border: 1px solid var(--success);
}

.target-profile-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 32px;
}
@media (max-width: 960px) {
  .target-profile-body { grid-template-columns: 1fr; }
}
.tp-field-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.tp-field-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--white);
}
.tp-field-value ol,
.tp-field-value ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tp-field-value li { padding: 2px 0; }
.tp-field-value li + li { border-top: 1px solid var(--border); }
.tp-field-value--avoid li { color: var(--failure); }
.tp-pair {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.tp-pair-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--action);
  padding: 3px 10px;
  border: 1px solid var(--action);
}
.tp-pair-chip--conversion { color: var(--attention); border-color: var(--attention); }

/* Dropzone styling so it doesn't look like a disabled form. */
.dropzone {
  background: var(--dark-card);
  border: 2px dashed var(--border-light);
  color: var(--text-dim);
}
.dropzone:hover { border-color: var(--red); color: var(--white); }

/* ─── ORIGIN MODAL (Phase B, 2026-04-20) ─────────────────────────────
   Minimal upload gate: suggest → confirm → save. Not a wizard.
*/
.origin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  /* Per discipline spec: no glow, no blur. Solid scrim, nothing decorative. */
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.origin-modal[hidden] { display: none; }
.origin-modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--dark-card);
  /* Launch Prep is an attention surface — the operator is mid-commit and
     the flow is blocked until they confirm. Orange, not blue. */
  border: 2px solid var(--attention);
  color: var(--white);
  padding: 28px 28px 22px;
  font-family: var(--font);
}
.origin-modal-head { margin-bottom: 18px; }
.origin-modal-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.origin-modal-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* Launch Prep is always "attention" when this modal is open. */
  color: var(--attention);
  margin-bottom: 6px;
}
.origin-modal-sub {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}
.origin-modal-form { display: flex; flex-direction: column; gap: 14px; }
.origin-field { display: flex; flex-direction: column; gap: 4px; }
.origin-field-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.origin-field input,
.origin-field select {
  padding: 10px 12px;
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--border-light);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}
.origin-field input:focus,
.origin-field select:focus { border-color: var(--red); }
.origin-field-hint {
  font-size: 10px;
  color: var(--text-dimmer);
  line-height: 1.4;
}
.origin-field-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--text-dim);
}
.origin-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.origin-fieldset {
  border: 1px solid var(--border-light);
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.origin-fieldset legend {
  padding: 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--action);
}
.origin-modal-error {
  /* Validation failure — failure colour, not attention. */
  color: var(--failure);
  font-size: 12px;
  line-height: 1.4;
  padding: 10px 12px;
  background: rgba(235,87,87,0.12);
  border: 1px solid var(--failure);
}
.origin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.origin-btn {
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
}
.origin-btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-light);
}
.origin-btn--ghost:hover { color: var(--white); border-color: var(--white); }
.origin-btn--primary {
  background: var(--red);
  color: var(--white);
}
.origin-btn--primary:hover { background: var(--red-dark); }

/* ─── ORIGIN BREADCRUMB in asset inspector ──────────────────────── */
.origin-breadcrumb-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  /* Label, not alert — muted per discipline spec. */
  color: var(--text-dim);
  margin: 14px 0 6px;
}
.origin-breadcrumb {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 10px 12px;
  margin-top: 10px;
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--red);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-dim);
  line-height: 1.5;
  word-break: break-all;
}
.origin-breadcrumb dt {
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
}
.origin-breadcrumb dd { margin: 0; }
.origin-breadcrumb--legacy {
  border-left-color: #FFAA00;
}
.origin-breadcrumb--legacy {
  border-left-color: var(--attention);
}
.origin-breadcrumb--legacy::before {
  grid-column: 1 / -1;
  content: '! origin needs review — legacy asset';
  color: var(--attention);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   FRAME-BY-FRAME FLOW — Phase 1 · 2026-04-20
   Opt-in via ?flow=1 or localStorage('launchpad_flow_mode'='on').
   When active, body.flow-mode applies: hide the legacy compose panels,
   show the 15/50/35 flow-root.
   ═══════════════════════════════════════════════════════════════════ */

/* ── HARD TAKEOVER (Phase 1 correction · 2026-04-20) ─────────────
   Every legacy child of [data-panel="upload"] is forced-hidden with
   !important so no cascade/inline-style override can leak the old UI
   back into the viewport. Plus: the origin modal (a bare <div> outside
   the panel) is also force-hidden in flow mode, and the topbar gets a
   FLOW MODE watermark so there is zero ambiguity. */
/* Brett-locked 2026-05-04 PM: ALSO match html.lp-flow-mode so the
   legacy DAM scaffold is hidden BEFORE first paint when the pre-paint
   script can't yet apply body.flow-mode (body doesn't exist in <head>
   script time). Without this, every navigation to ?package=magazine
   flashed the legacy DAM dashboard for ~50ms before flow.js init
   added body.flow-mode. */
body.flow-mode [data-panel="upload"] > .dam-dashboard,
body.flow-mode [data-panel="upload"] > .chain-strip-wrap,
body.flow-mode [data-panel="upload"] > .target-profile,
body.flow-mode [data-panel="upload"] > .panel-split,
body.flow-mode [data-panel="upload"] > .panel-head,
html.lp-flow-mode [data-panel="upload"] > .dam-dashboard,
html.lp-flow-mode [data-panel="upload"] > .chain-strip-wrap,
html.lp-flow-mode [data-panel="upload"] > .target-profile,
html.lp-flow-mode [data-panel="upload"] > .panel-split,
html.lp-flow-mode [data-panel="upload"] > .panel-head {
  display: none !important;
}
/* Pre-paint also unhides the flow-root so the rich builder can claim
   the upload panel's space without waiting for flow.js to remove the
   `hidden` attribute. (flow.js still does the JS-side unhide too —
   this is just a pre-paint visual.) */
html.lp-flow-mode .flow-root[hidden] {
  display: grid !important;
}

/* Origin modal (legacy Launch Prep) — used by the old handleFiles.
   Flow mode owns origin capture inline; belt-and-braces hide so a
   stray legacy code path can't pop a modal mid-session. */
body.flow-mode #originModal { display: none !important; }

/* FLOW MODE topbar watermark retired 2026-04-24 PM — the new menu
   itself is the UI, there's no "legacy vs flow" duality anymore. */

/* Flow root: vertical 15/50/35 grid. Fixed viewport height — no page
   scroll ever. Individual frame bodies scroll internally only when a
   frame demands it (Phase 1 frames do not). */
.flow-root {
  display: grid;
  grid-template-rows: 15vh 50vh 35vh;
  gap: 0;
  height: calc(100vh - 64px); /* minus topbar */
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
}
.flow-root[hidden] { display: none; }

/* ─── FRAME STRIP (top 15%) ──────────────────────────────────────── */
.frame-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}
.frame-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
/* Upcoming (disabled from interaction) should still feel alive — part
   of the journey, not greyed-out UI. No opacity reduction; signal
   "not yet" via a dashed border + calmer text, not by fading. */
.frame-pill[disabled] {
  cursor: default;
  opacity: 1;
  border-style: dashed;
  border-color: var(--border);
  color: var(--text-dimmer);
  background: rgba(255,255,255,0.015);
}
.frame-pill[disabled]:hover { background: rgba(255,255,255,0.025); }
.frame-pill-glyph {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}
.frame-pill[disabled] .frame-pill-glyph { color: var(--text-dimmer); }
.frame-pill-label { font-size: 11px; }

.frame-pill--active {
  color: var(--black);
  background: var(--attention);
  border-color: var(--attention);
}
.frame-pill--active[disabled] {
  /* Active beats disabled — solid again even if the frame is "disabled". */
  border-style: solid;
  color: var(--black);
  background: var(--attention);
  border-color: var(--attention);
  opacity: 1;
}
.frame-pill--complete {
  color: var(--success);
  border-color: var(--success);
  border-style: solid;
}
.frame-pill--complete .frame-pill-glyph { color: var(--success); }
.frame-pill--complete:hover { background: rgba(39,174,96,0.08); }
.frame-pill--blocked {
  color: var(--failure);
  border-color: var(--failure);
  border-style: solid;
}
.frame-pill--pending {
  /* Explicit upcoming state — dashed, alive, clearly "next steps". */
  border-style: dashed;
  border-color: var(--border-light);
  color: var(--text-dim);
  opacity: 1;
}
.frame-pill--pending .frame-pill-glyph { color: var(--text-dim); }

/* Chain connector between pills — slightly brighter so the strip
   reads as a continuous journey, not a row of isolated tiles. */
.frame-pill + .frame-pill { margin-left: 0; }
.frame-pill + .frame-pill::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 1px;
  background: var(--border-light);
  margin-right: -4px;
  vertical-align: middle;
}

/* ─── ACTIVE FRAME (middle 50%) ──────────────────────────────────── */
.active-frame {
  padding: 20px 40px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}
.frame-body {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.frame-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--white);
}
.frame-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}
.frame-sub--muted {
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Campaign frame auto-lock hint */
.frame-body--auto .frame-title { color: var(--success); }

/* Campaign multi-select (future) */
.frame-campaign-list {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
.frame-campaign-btn {
  text-align: left;
  padding: 14px 18px;
  background: var(--dark-card);
  border: 1px solid var(--border-light);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}
.frame-campaign-btn:hover {
  border-color: var(--action);
  color: var(--action);
}

/* Asset frame dropzone */
.frame-body--asset { align-items: stretch; }
.frame-drop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  background: var(--dark-card);
  border: 2px dashed var(--border-light);
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color 140ms ease, color 140ms ease;
}
.frame-drop:hover,
.frame-drop.is-drag {
  border-color: var(--attention);
  color: var(--white);
}
.frame-drop-glyph { font-size: 32px; line-height: 1; }
.frame-drop-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}
.frame-drop-sub { font-size: 12px; color: var(--text-dim); }

/* Description frame */
.frame-body--description { height: 100%; }
.frame-description {
  flex: 1;
  min-height: 180px;
  padding: 16px 18px;
  background: var(--dark-card);
  border: 1px solid var(--border-light);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  resize: none;
  outline: none;
}
.frame-description:focus { border-color: var(--action); }
.frame-description::placeholder { color: var(--text-dimmer); }

.frame-description-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.frame-counter {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Continue button — shared by description + stubs. */
.frame-continue {
  align-self: flex-end;
  padding: 12px 22px;
  background: var(--action);
  color: #fff;
  border: 1px solid var(--action);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.frame-continue:hover { background: var(--action-dark); }
.frame-continue[disabled] {
  background: transparent;
  color: var(--text-dimmer);
  border-color: var(--border-light);
  cursor: not-allowed;
}

/* Stub frames (4–8 in Phase 1) */
.frame-body--stub {
  align-items: flex-start;
  gap: 10px;
}
.frame-stub-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--attention);
}
.frame-stub-title { font-size: 22px; font-weight: 900; color: var(--white); }
.frame-stub-sub   { font-size: 13px; color: var(--text-dim); max-width: 600px; }

.frame-body--blocked .frame-title { color: var(--failure); }

/* ─── CONTEXT PANEL (bottom 35%) ─────────────────────────────────── */
.frame-context {
  padding: 18px 48px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px 32px;
  align-content: start;
}
.frame-context-label {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 4px;
}
.frame-context b {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.frame-context > div { color: var(--white); font-size: 13px; }
.frame-context-empty { color: var(--text-dimmer); font-style: italic; }

/* ── Inline origin form inside Asset frame (Phase 1 correction) ──
   Replaces the legacy Launch Prep modal. Lives INSIDE the active-frame
   area so the session never jumps out to a modal. 50vh is tight — use
   a compact two-column grid on wider viewports, single column on narrow. */
.frame-body--asset-origin { gap: 10px; overflow: auto; }
.frame-origin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .frame-origin-grid { grid-template-columns: 1fr; }
}
.frame-origin-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.frame-origin-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-origin-field input,
.frame-origin-field select {
  padding: 8px 10px;
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--border-light);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}
.frame-origin-field input:focus,
.frame-origin-field select:focus { border-color: var(--action); }

.frame-origin-error {
  color: var(--failure);
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--failure);
  background: rgba(235,87,87,0.08);
}

.frame-origin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.frame-back {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 16px;
  cursor: pointer;
}
.frame-back:hover { color: var(--white); border-color: var(--white); }

/* ── Asset frame BRIEF + choices (signal-first, Phase 1 · 2026-04-20) ─
   System speaks first, then asks for the file. Order on screen:
   1. Session context (tenant · campaign · target · purpose)
   2. "What we need now" kicker
   3. Three asset-choice cards
   When a card is selected, Stage B renders the dropzone with a compact
   option chip at the top so the operator stays oriented.
*/
.frame-body--brief { gap: 14px; align-items: stretch; }

.frame-brief {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 6px;
  border-bottom: 1px solid var(--border);
}
.frame-brief-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-brief-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--white);
}
.frame-brief-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}

.frame-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--attention);
  margin-top: 6px;
}

/* Three-card grid — one row on wide, stacks on narrow. */
.frame-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 2px;
}
@media (max-width: 900px) {
  .frame-choices { grid-template-columns: 1fr; }
}
.frame-choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 20px;
  background: var(--dark-card);
  border: 1px solid var(--border-light);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 140ms ease, background 140ms ease;
}
.frame-choice:hover {
  border-color: var(--attention);
  background: var(--dark-hover);
}
.frame-choice-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.frame-choice-spec {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}
.frame-choice-note {
  font-size: 11px;
  color: var(--text-dimmer);
  font-style: italic;
}

/* Compact option chip — stays visible during Stage B + Stage C so the
   operator never loses the brief. */
.frame-option-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  background: rgba(242,153,74,0.08);
  border: 1px solid var(--attention);
  color: var(--white);
  font-family: var(--font);
  font-size: 12px;
}
.frame-option-chip-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--attention);
}
.frame-option-chip-title {
  font-weight: 900;
  letter-spacing: 0.04em;
}
.frame-option-chip-spec {
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame-option-chip-change {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
}
.frame-option-chip-change:hover { color: var(--white); border-color: var(--white); }

/* ── TODAY'S BEST ASSET ASK (director model · rev 3 · 2026-04-20) ─
   Replaces the three-card chooser. ONE primary ask, optional fallback,
   small toggle. Visual hierarchy: kicker → headline → spec → why →
   accept button. The accept button is the only bright action on screen.
   The fallback toggle sits below, deliberately subordinate. */
.frame-body--ask { gap: 14px; align-items: stretch; }

.frame-ask-heading { margin-top: 4px; }
.frame-ask-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--attention);
}

.frame-ask-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 20px;
  background: var(--dark-card);
  border: 1px solid var(--border-light);
}
.frame-ask-headline {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--white);
  line-height: 1.25;
}
.frame-ask-spec {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-ask-why-label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-ask-why {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
  color: var(--white);
}
.frame-ask-why li {
  position: relative;
  padding-left: 0;
}
.frame-ask-why li::before {
  content: '▬';
  position: absolute;
  left: -14px;
  color: var(--attention);
  font-size: 10px;
}

.frame-ask-accept {
  margin-top: 8px;
  align-self: flex-start;
}

/* Fallback toggle — small, low-contrast, deliberately subordinate. */
.frame-ask-toggle {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.frame-ask-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
}
.frame-ask-toggle-btn:hover { color: var(--white); }

/* ── DEFINE THIS PIECE (Pass 1 · 2026-04-20) ─────────────────────
   Replaces the "Confirm origin" stage. Emotion-first: one prominent
   question (story/angle), context chips up top, operational metadata
   collapsed into SYSTEM DETAILS. Reuses .frame-origin-grid /
   .frame-origin-field / .frame-origin-error for the expanded form. */
/* asset-define overrides the default .frame-body gap for density. */
.frame-body--asset-define { gap: 8px; overflow: hidden; }

.frame-define-heading { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.frame-define-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--attention);
}
.frame-define-sub {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

/* Context strip — compact list inside the right column. Vertical
   stack, kicker inline with value, no background box: keeps it quiet
   so the preview is the dominant right-column element. */
.frame-define-ctx {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(47,128,237,0.05);
  border: 1px solid var(--border-light);
  font-family: var(--font);
}
.frame-define-ctx-chip {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 11px;
  color: var(--white);
  line-height: 1.4;
}
.frame-define-ctx-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-define-ctx-value {
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* True two-column working surface. Left column is the operator's
   inputs + commit; right column is the system's proof-of-state —
   preview, compact context, collapsed details. Nothing scrolls. */
.frame-define-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-top: 2px;
}
@media (max-width: 640px) {
  .frame-define-surface { grid-template-columns: 1fr; }
}
.frame-define-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.frame-define-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.frame-define-right-block { display: flex; flex-direction: column; gap: 3px; }

/* Footer — discrete back button. */
.frame-define-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 6px;
}

/* Primary CTA — aligned with the story field. */
.frame-define-cta {
  align-self: flex-start;
  padding: 12px 22px;
  font-size: 12px;
  min-width: 200px;
  margin-top: 2px;
}
.frame-define-cta[disabled] {
  opacity: 0.55;
  cursor: default;
}

.frame-define-field { display: flex; flex-direction: column; gap: 3px; }

/* Quiet status line — still available for nudges that aren't upload phases. */
.frame-define-status {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--action);
  padding: 2px 0;
}

/* Persistent upload-progress surface. ALWAYS visible, directly above
   the NEXT button. Label on the left (READY · PREPARING… · UPLOADING
   · PROCESSING… · DONE ✓), percent on the right when known. Bar fill
   creeps within each phase so motion is continuous. */
.frame-define-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(47,128,237,0.05);
  border: 1px solid var(--border-light);
}
.frame-define-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.frame-define-progress-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--action);
}
.frame-define-progress-pct {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--action);
  font-variant-numeric: tabular-nums;
}
.frame-define-progress-track {
  height: 4px;
  background: var(--dark);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.frame-define-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--action);
  transition: width 280ms ease-out;
}
.frame-define-story {
  padding: 10px 12px;
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.42;
  min-height: 56px;
  outline: none;
  resize: vertical;
}
.frame-define-story::placeholder {
  color: var(--text-dimmer);
  font-weight: 400;
}
.frame-define-story:focus { border-color: var(--action); }

/* Missing-field highlight — SECONDARY cue. The directive line above NEXT
   is the primary signal; this just softly ringlights the thing the
   directive names. No bg tint, no inset — stays out of the way. */
.frame-define-story.is-missing,
.frame-origin-field input.is-missing,
.frame-origin-field select.is-missing {
  border-color: var(--attention);
}
.frame-define-story.is-missing::placeholder,
.frame-origin-field input.is-missing::placeholder {
  color: var(--attention);
  opacity: 0.85;
}

/* Theme tags — inline row directly under story. No label, no form
   tone: compact chips and a small "+ theme" input that disappears
   visually until interacted with. Tags are optional colour, not a
   gate. */
.frame-define-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.frame-define-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}
.frame-define-tag-chips:empty { display: none; }
.frame-define-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: rgba(39,174,96,0.10);
  border: 1px solid var(--success);
  color: var(--white);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.frame-define-tag-chip:hover { background: rgba(39,174,96,0.18); }
.frame-define-tag-x { color: var(--text-dim); font-size: 12px; }
.frame-define-tag-input {
  padding: 5px 10px;
  background: transparent;
  color: var(--text);
  border: 1px dashed var(--border-light);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  min-width: 90px;
  max-width: 160px;
}
.frame-define-tag-input::placeholder { color: var(--text-dimmer); }
.frame-define-tag-input:focus {
  border-style: solid;
  border-color: var(--action);
  background: rgba(47,128,237,0.06);
}

/* Thumbnail slot — native aspect ratio. Default to 9:16 for the loading
   state (social content is overwhelmingly vertical); once the video's
   real dimensions are known, JS sets --thumb-ratio so 9:16 uploads look
   like 9:16 and 16:9 uploads look like 16:9. No letterboxing, no forcing
   vertical media into a horizontal frame. Height-driven; width auto. */
.frame-define-thumb {
  position: relative;
  height: 280px;
  aspect-ratio: var(--thumb-ratio, 9 / 16);
  width: auto;
  max-width: 100%;
  background: #000;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-start;
}
.frame-define-thumb.is-loading,
.frame-define-thumb:has(.frame-define-thumb-state) {
  border-style: dashed;
  cursor: default;
}
@media (max-height: 820px) {
  .frame-define-thumb { height: 230px; }
}
@media (max-height: 720px) {
  .frame-define-thumb { height: 190px; }
}
.frame-define-thumb-img,
.frame-define-thumb-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.frame-define-thumb-video { background: black; }

/* Play badge — subtle overlay, indicates click-to-play. */
.frame-define-thumb-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: var(--white);
  font-size: 14px;
  pointer-events: none;
  transition: background 120ms ease, transform 120ms ease;
}
.frame-define-thumb:hover .frame-define-thumb-play {
  background: rgba(47,128,237,0.85);
  transform: translate(-50%, -50%) scale(1.05);
}

/* Empty / loading / error state centered inside the tile. */
.frame-define-thumb-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px;
  color: var(--text-dim);
}
.frame-define-thumb-glyph { font-size: 28px; color: var(--text-dimmer); }
.frame-define-thumb-hint {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  color: var(--text-dimmer);
}

/* ── SYSTEM AUTO-DETECTED chip row ─────────────────────────────────
   Replaces the old <details> form. Reads as a chip row, never as a
   field list. When everything is populated, collapses to one line. */
.frame-define-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.frame-define-ready-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 12px;
  background: rgba(39,174,96,0.10);
  border: 1px solid rgba(39,174,96,0.35);
  color: var(--success);
  border-radius: 999px;
}
.frame-define-ready-glyph { font-size: 13px; }
.frame-define-sys-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 11px;
  line-height: 1.25;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.frame-define-sys-chip:hover {
  border-color: var(--action);
  color: var(--text);
}
.frame-define-sys-chip.is-blank {
  border-color: var(--border-light);
  color: var(--text-dim);
  background: rgba(242,153,74,0.04);
}
.frame-define-sys-chip.is-missing {
  border-color: var(--attention);
  box-shadow: 0 0 0 2px rgba(242,153,74,0.22);
  color: var(--attention);
}
.frame-define-sys-chip-glyph {
  font-size: 11px;
  color: var(--success);
}
.frame-define-sys-chip.is-blank .frame-define-sys-chip-glyph {
  color: var(--text-dimmer);
}
.frame-define-sys-chip.is-missing .frame-define-sys-chip-glyph {
  color: var(--attention);
}
.frame-define-sys-chip-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.frame-define-sys-chip-value {
  font-weight: 600;
  color: var(--text);
}
.frame-define-sys-chip.is-blank .frame-define-sys-chip-value,
.frame-define-sys-chip.is-blank .frame-define-sys-chip-hint {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}
.frame-define-sys-chip-hint { font-size: 10px; color: var(--text-dim); }
.frame-define-sys-chip--edit {
  padding: 4px 6px;
  background: var(--dark-card);
  border-color: var(--action);
  box-shadow: 0 0 0 2px rgba(47,128,237,0.18);
  cursor: default;
}
.frame-define-sys-chip-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 3px 4px;
  min-width: 110px;
  outline: none;
}
.frame-define-sys-chip-done,
.frame-define-sys-chip-cancel {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
}
.frame-define-sys-chip-done   { color: var(--success); }
.frame-define-sys-chip-cancel { color: var(--text-dim); }
.frame-define-sys-chip-done:hover   { background: rgba(39,174,96,0.15); }
.frame-define-sys-chip-cancel:hover { background: rgba(255,255,255,0.06); color: var(--attention); }

.frame-define-right-block--chips {
  padding-top: 2px;
}

/* ── Single directive line — the ONE signal above NEXT ────────────── */
.frame-define-directive {
  font-size: 12px;
  line-height: 1.35;
  min-height: 18px;
  padding: 6px 2px 2px;
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--text-dim);
  transition: color 140ms ease;
}
.frame-define-directive.is-block    { color: var(--attention); }
.frame-define-directive.is-ready    { color: var(--success); font-weight: 700; }
.frame-define-directive.is-progress { color: var(--text); font-weight: 600; }

/* ── Piece header strip — sits above every downstream frame so the
     operator's story persists visibly across the frame boundary. ──── */
.piece-header-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(47,128,237,0.06), rgba(47,128,237,0.02));
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 12px;
}
.piece-header-thumb {
  width: 46px;
  height: 82px;   /* 9:16 */
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.piece-header-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dimmer);
  font-size: 20px;
}
.piece-header-body { min-width: 0; }
.piece-header-story {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.piece-header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.piece-header-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  background: rgba(39,174,96,0.12);
  border: 1px solid rgba(39,174,96,0.30);
  color: var(--text);
  border-radius: 999px;
}
.piece-header-ask {
  text-align: right;
  max-width: 180px;
  line-height: 1.2;
}
.piece-header-ask-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-dimmer);
}
.piece-header-ask-title {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}
@media (max-width: 760px) {
  .piece-header-strip { grid-template-columns: auto 1fr; }
  .piece-header-ask { grid-column: 1 / -1; text-align: left; max-width: none; }
}

/* Provisional shoot_day — this is a GUESS (today), not an assertion.
   Dashed underline + dimmed color until operator edits. */
.frame-origin-field input[type="date"].is-provisional {
  color: var(--text-dim);
  border-style: dashed;
  opacity: 0.78;
}
.frame-origin-field input[type="date"].is-provisional:focus { opacity: 1; }

/* Two-tier message slot. Nudge is quiet (no red), for missing creative
   or retrievability fields. Error is loud (red border), reserved for
   real backend upload failures. */
.frame-define-msg {
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
  font-family: var(--font);
}
.frame-define-msg.is-nudge {
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding-left: 0;
}
.frame-define-msg.is-error {
  color: var(--failure);
  border: 1px solid var(--failure);
  background: rgba(235,87,87,0.08);
}
.frame-define-msg.is-success {
  color: var(--success);
  border: 1px solid var(--success);
  background: rgba(39,174,96,0.10);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════
   ERRORS DRAWER
   Human-readable diagnostic panel — every function call, JS error,
   and network failure lands here. Opens from the ERRORS button in
   the topbar (next to BUG). Backed by admin/errors.js.
   ══════════════════════════════════════════════════════════════════ */
.errors-btn {
  position: relative;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.errors-btn:hover {
  border-color: var(--action);
  color: var(--action);
}
.errors-btn[data-has-errors="true"] {
  border-color: var(--failure);
  color: var(--failure);
}
.errors-btn[data-has-errors="true"]:hover {
  background: rgba(235,87,87,0.08);
}
.errors-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--failure);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.errors-badge[hidden] { display: none; }

/* Backdrop + drawer — side panel, slides in from the right. */
.errors-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.errors-drawer-backdrop[hidden] { display: none; }
.errors-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  background: var(--dark-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}
.errors-drawer[hidden] { display: none; }
.errors-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
  flex-shrink: 0;
}
.errors-drawer-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.errors-drawer-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.24em;
  color: var(--failure);
}
.errors-drawer-sub {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.errors-drawer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.errors-action {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.errors-action:hover {
  border-color: var(--action);
  color: var(--action);
}
.errors-close {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.errors-close:hover {
  border-color: var(--failure);
  color: var(--failure);
}
.errors-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  display: flex;
  flex-direction: column;
}

/* ── Health strip — live snapshot of tenant + auth + env + flow state. */
.errors-health {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
}
.errors-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  line-height: 1.3;
}
.errors-health-pill.is-ok {
  border-color: rgba(39,174,96,0.4);
  color: var(--success);
  background: rgba(39,174,96,0.06);
}
.errors-health-pill.is-err {
  border-color: rgba(235,87,87,0.5);
  color: var(--failure);
  background: rgba(235,87,87,0.08);
}
.errors-health-pill.is-neutral {
  color: var(--text-dimmer);
}
.errors-pill-mark {
  font-size: 11px;
  font-weight: 800;
}
.errors-pill-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 9px;
}
.errors-pill-detail {
  color: var(--text);
  font-weight: 600;
  font-size: 10px;
  opacity: 0.85;
}

/* ── Filter bar + search ────────────────────────────────────────── */
.errors-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
}
.errors-filter-tabs {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.errors-filter-tab {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
}
.errors-filter-tab:hover {
  border-color: var(--action);
  color: var(--action);
}
.errors-filter-tab.is-active {
  border-color: var(--action);
  color: var(--action);
  background: rgba(47,128,237,0.08);
}
.errors-search {
  flex: 1;
  min-width: 0;
  padding: 5px 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-family: var(--font);
  font-size: 11px;
  outline: none;
}
.errors-search:focus { border-color: var(--action); }
.errors-search::placeholder { color: var(--text-dimmer); }

.errors-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

/* ── Restored-from-storage indicator ────────────────────────────── */
.errors-event.is-restored {
  opacity: 0.62;
  border-left-style: dashed;
}
.errors-tag-restored {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  color: var(--text-dimmer);
}

/* ── Warn-level (amber) for console.warn captures ──────────────── */
.errors-event.is-warn {
  border-left-color: var(--attention);
  background: rgba(242,153,74,0.04);
}

/* ── Log-kind console captures get a muted purple-ish tag ─────── */
.errors-kind--log {
  background: rgba(162, 122, 255, 0.18);
  color: #c9b9ff;
}
.errors-kind--system {
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
}
.errors-empty {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 20px;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.errors-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.errors-event {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--border);
  border-radius: 0 4px 4px 0;
}
.errors-event.is-error {
  border-left-color: var(--failure);
  background: rgba(235,87,87,0.05);
}
.errors-event.is-info {
  border-left-color: var(--success);
  background: rgba(39,174,96,0.03);
  opacity: 0.78;
}
.errors-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.errors-kind {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
}
.errors-kind--fetch   { background: rgba(47,128,237,0.18); color: var(--action); }
.errors-kind--js      { background: rgba(235,87,87,0.18);  color: var(--failure); }
.errors-kind--promise { background: rgba(242,153,74,0.18); color: var(--attention); }
.errors-time {
  font-size: 10px;
  color: var(--text-dimmer);
  font-variant-numeric: tabular-nums;
}
.errors-event-main {
  font-size: 12px;
  color: var(--white);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.4;
}
.errors-event.is-info .errors-event-main {
  font-weight: 400;
  color: var(--text);
}
.errors-event-detail {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════════
   21-FRAME CAPTURE LOOP
   Locked 2026-04-20 · ARRIFLEX-aesthetic, bold, minimal chrome
   ══════════════════════════════════════════════════════════════════ */

/* ─── Flow-root layout: the 21-frame loop doesn't use the context aside.
     Collapse to top-strip + big active-frame + auto (hidden) third row. */
.flow-mode .flow-root {
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - 64px);
}

/* ─── Strip — 21 media-type pills across the top ───────────────── */
.flow-mode .frame-strip {
  gap: 10px;
  padding: 20px 28px;
  justify-content: flex-start;
  align-items: center;
}
/* Kill the chain connector for capture pills; shapes speak for themselves. */
.flow-mode .frame-pill + .frame-pill::before { display: none; }

/* Capture pills have no text — the shape carries the meaning. Sized
   for cinema-deck punch: readable at a glance, not fiddly dots. */
.frame-pill--vertical,
.frame-pill--horizontal,
.frame-pill--still,
.frame-pill--terminal {
  padding: 0;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  border-width: 2px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.frame-pill--vertical   { width: 36px; height: 80px; border-radius: 4px; }
.frame-pill--horizontal { width: 80px; height: 36px; border-radius: 4px; }
.frame-pill--still      { width: 52px; height: 52px; border-radius: 50%; }
.frame-pill--terminal   { display: none; }

/* Hide any text / glyph children — the shape + thumbnail carry meaning. */
.frame-pill--vertical   > :not(.frame-pill-thumb),
.frame-pill--horizontal > :not(.frame-pill-thumb),
.frame-pill--still      > :not(.frame-pill-thumb),
.frame-pill--terminal   > * { display: none; }

/* Thumbnail inside a completed pill — native aspect cover, clipped to
   the pill shape so 9:16 uploads fill the tall pill and 16:9 uploads
   fill the wide pill. */
.frame-pill-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}
/* Completed pills with a thumbnail drop the solid orange fill so the
   image reads clearly — the orange border alone signals "captured". */
.frame-pill--vertical.frame-pill--complete:has(.frame-pill-thumb),
.frame-pill--horizontal.frame-pill--complete:has(.frame-pill-thumb),
.frame-pill--still.frame-pill--complete:has(.frame-pill-thumb) {
  background: transparent;
}

/* Palette (override the generic .frame-pill--active / --complete)
   per Brett's mockup: ACTIVE = green outline, COMPLETE = orange fill. */
.frame-pill--vertical.frame-pill--active,
.frame-pill--horizontal.frame-pill--active,
.frame-pill--still.frame-pill--active {
  border-color: var(--success);
  background: rgba(39,174,96,0.14);
  box-shadow: 0 0 0 2px rgba(39,174,96,0.28);
}
.frame-pill--vertical.frame-pill--complete,
.frame-pill--horizontal.frame-pill--complete,
.frame-pill--still.frame-pill--complete {
  border-color: var(--attention);
  background: var(--attention);
  box-shadow: none;
}
.frame-pill--vertical.frame-pill--pending,
.frame-pill--horizontal.frame-pill--pending,
.frame-pill--still.frame-pill--pending {
  border-style: dashed;
  border-color: var(--border);
  background: rgba(255,255,255,0.02);
}
.frame-pill--vertical.frame-pill--pending:hover,
.frame-pill--horizontal.frame-pill--pending:hover,
.frame-pill--still.frame-pill--pending:hover {
  background: rgba(255,255,255,0.04);
}

/* ─── Capture frame body ───────────────────────────────────────── */
.frame-body--capture {
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 0;
}

/* ── Campaign context (tenant + target + purpose) */
.frame-capture-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 2px;
}
.frame-capture-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.frame-capture-target {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.005em;
}
.frame-capture-purpose {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Progress bar (sits directly under the header, lights up orange
       as the upload runs. Matches Brett's mockup). */
.frame-capture-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}
.frame-capture-progress-track {
  height: 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.frame-capture-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--attention);
  transition: width 280ms ease-out;
}
.frame-capture-progress-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Heading row — kicker (orange) + slot readout (muted) */
.frame-capture-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}
.frame-capture-heading-kicker {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.frame-capture-heading-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--attention);
}
.frame-capture-heading-role {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--success);
}
.frame-capture-heading-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}
.frame-capture-heading-pos    { color: var(--text-dim); }
.frame-capture-heading-media  { color: var(--white); }
.frame-capture-heading-platforms {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
}
.frame-capture-heading-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(242,153,74,0.08);
  border: 1px solid rgba(242,153,74,0.35);
  color: var(--attention);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* ── Main surface — [UPLOAD] [DATA DUMP] [THUMB] [NEXT] */
.frame-capture-surface {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: stretch;
  margin-top: 4px;
}
@media (max-width: 940px) {
  .frame-capture-surface {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "upload dump" "thumb next";
  }
}

/* ── UPLOAD tile — native-aspect drop zone for this frame's media type */
.frame-capture-upload {
  position: relative;
  height: 300px;
  aspect-ratio: var(--upload-ratio, 9 / 16);
  width: auto;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 14px;
  background: rgba(255,255,255,0.03);
  border: 2px dashed var(--border-light);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
  align-self: flex-start;
}
.frame-capture-upload:hover,
.frame-capture-upload.is-drag {
  border-color: var(--success);
  color: var(--white);
  background: rgba(39,174,96,0.08);
}
.frame-capture-upload[data-state="filled"] {
  border-style: solid;
  border-color: var(--attention);
  background: rgba(242,153,74,0.05);
  color: var(--white);
}
.frame-capture-upload-word {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--success);
  line-height: 1;
}
.frame-capture-upload[data-state="filled"] .frame-capture-upload-word {
  color: var(--attention);
  font-size: 32px;
}
.frame-capture-upload-sub {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.35;
}
@media (max-height: 820px) {
  .frame-capture-upload { height: 250px; }
  .frame-capture-upload-word { font-size: 38px; }
}
@media (max-height: 720px) {
  .frame-capture-upload { height: 210px; }
  .frame-capture-upload-word { font-size: 32px; }
}

/* ── DATA DUMP — paste-anything area, centre column.
     Drag-drop of text/PDFs/URLs: the wrap ringlights in green and the
     file either inlines as text (txt/md/csv/json/html) or leaves a
     [FILE: name · size] marker in the dump area. */
.frame-capture-dump-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  border-radius: 4px;
  transition: box-shadow 120ms ease;
}
.frame-capture-dump-wrap.is-drag {
  box-shadow: 0 0 0 2px var(--success), 0 0 0 5px rgba(39,174,96,0.22);
}
.frame-capture-dump-wrap.is-drag .frame-capture-dump {
  border-color: var(--success);
}
.frame-capture-dump {
  flex: 1;
  width: 100%;
  min-height: 300px;
  padding: 14px 16px;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  outline: none;
  resize: none;
}
.frame-capture-dump::placeholder {
  color: var(--text-dimmer);
  font-weight: 400;
}
.frame-capture-dump:focus { border-color: var(--action); }
@media (max-height: 820px) { .frame-capture-dump { min-height: 250px; } }
@media (max-height: 720px) { .frame-capture-dump { min-height: 210px; } }

/* ── THUMB — native-aspect preview, honours --thumb-ratio */
.frame-capture-thumb {
  position: relative;
  height: 300px;
  aspect-ratio: var(--thumb-ratio, 9 / 16);
  width: auto;
  max-width: 220px;
  background: #000;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  align-self: flex-start;
  flex-shrink: 0;
}
.frame-capture-thumb[data-state="empty"],
.frame-capture-thumb[data-state="loading"] {
  background: var(--dark);
  border-style: dashed;
  cursor: default;
}
.frame-capture-thumb[data-state="ready"] {
  border-color: var(--success);
}
.frame-capture-thumb[data-state="error"] {
  border-color: var(--failure);
  cursor: default;
}
.frame-capture-thumb-img,
.frame-capture-thumb-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.frame-capture-thumb-video { background: black; }
/* Crop hint — tiny overlay on an auto-cropped image preview telling
   the operator they can drag to reframe. Visible on hover, clears on
   drag. Only shown when a crop was actually applied (source ≠ target). */
.frame-capture-crop-hint {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--white);
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}
.frame-capture-thumb:hover .frame-capture-crop-hint { opacity: 1; }
.frame-capture-thumb.is-dragging .frame-capture-crop-hint { opacity: 0; }
.frame-capture-thumb:has(.frame-capture-crop-hint) { cursor: grab; }
.frame-capture-thumb.is-dragging { cursor: grabbing; }

.frame-capture-thumb-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: var(--white);
  font-size: 14px;
  pointer-events: none;
  transition: background 120ms ease, transform 120ms ease;
}
.frame-capture-thumb:hover .frame-capture-thumb-play {
  background: rgba(39,174,96,0.85);
  transform: translate(-50%, -50%) scale(1.06);
}
.frame-capture-thumb-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px;
  color: var(--text-dim);
  text-align: center;
}
.frame-capture-thumb-glyph { font-size: 26px; color: var(--text-dimmer); }
.frame-capture-thumb-hint {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1.35;
}
@media (max-height: 820px) { .frame-capture-thumb { height: 250px; } }
@media (max-height: 720px) { .frame-capture-thumb { height: 210px; } }

/* ── NEXT — big, cinematic, action-word only (ARRIFLEX feel) */
.frame-capture-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
  height: 300px;
  padding: 14px 22px;
  background: var(--dark-card);
  border: 2px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
  align-self: flex-start;
}
.frame-capture-next[disabled] {
  opacity: 0.35;
  cursor: default;
}
.frame-capture-next-label {
  font-size: 38px;
  letter-spacing: 0.05em;
  line-height: 1;
}
.frame-capture-next-arrow {
  font-size: 30px;
  line-height: 1;
  opacity: 0.75;
}
.frame-capture-next.is-ready {
  border-color: var(--success);
  color: var(--success);
  background: rgba(39,174,96,0.08);
}
.frame-capture-next.is-ready:hover {
  background: rgba(39,174,96,0.16);
  transform: translateY(-1px);
}
.frame-capture-next.is-waiting {
  border-color: var(--attention);
  color: var(--attention);
  background: rgba(242,153,74,0.06);
}
.frame-capture-next.is-error {
  border-color: var(--failure);
  color: var(--failure);
  background: rgba(235,87,87,0.06);
}
@media (max-height: 820px) { .frame-capture-next { height: 250px; } .frame-capture-next-label { font-size: 32px; } }
@media (max-height: 720px) { .frame-capture-next { height: 210px; } .frame-capture-next-label { font-size: 28px; } }

/* ── Context aside — hidden in the 21-frame loop */
.flow-mode .frame-context { display: none !important; }

/* ══════════════════════════════════════════════════════════════════
   FIRING RANGE — per-capture row list, local-only FIRE for now.
   Reads state.data from the flow controller; renders into #queueList
   when body.flow-mode is active.
   ══════════════════════════════════════════════════════════════════ */
.flow-mode [data-panel="queue"] .queue-stats .stat-pill {
  font-size: 12px;
}
.firing-range-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.firing-range-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 40px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.firing-range-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 130px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 140ms ease, opacity 140ms ease;
}
/* Per-row × — appears on hover, top-right. Low-key at rest so FIRE
   stays the dominant action. */
.firing-range-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.firing-range-row:hover .firing-range-delete,
.firing-range-delete:focus { opacity: 1; }
.firing-range-delete:hover {
  border-color: var(--failure);
  color: var(--failure);
  background: rgba(235,87,87,0.08);
}

/* Purge-all — destructive action, red-outlined pill in the panel head. */
.firing-range-purge {
  margin-left: 10px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--failure);
  color: var(--failure);
  border-radius: 4px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.firing-range-purge:hover {
  background: var(--failure);
  color: var(--white);
}
.firing-range-row.is-fired {
  border-color: var(--success);
  opacity: 0.82;
}
.firing-range-thumb {
  height: 110px;
  max-width: 110px;
  aspect-ratio: var(--thumb-ratio, 9 / 16);
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.firing-range-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.firing-range-thumb-empty {
  color: var(--text-dimmer);
  font-size: 28px;
}
.firing-range-schedule {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.firing-range-day {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--attention);
  line-height: 1;
}
.firing-range-date {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 6px;
}
.firing-range-role {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--success);
  margin-top: 6px;
  line-height: 1.25;
}
.firing-range-slot {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-top: 2px;
}
.firing-range-transcript-ok {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success);
  margin-top: 4px;
  opacity: 0.85;
}
.firing-range-blurb {
  font-size: 13px;
  line-height: 1.5;
  color: var(--white);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 4px;
}

/* ── Payload cell — Claude-synthesised post content per capture.
     Structure: [oneLine kicker] [hook] [setup] [cta] [tags] + ↻ regen.
     Pending + error variants use the same slot with simpler markup. */
.firing-range-payload {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 28px 2px 4px;
  min-width: 0;
}
.firing-range-oneline {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.firing-range-hook {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.firing-range-setup {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.firing-range-cta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--action);
}
.firing-range-tags {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-dimmer);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.firing-range-payload--pending .firing-range-payload-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--attention);
  animation: firingRangePulse 1.6s ease-in-out infinite;
}
.firing-range-payload--pending .firing-range-payload-preview {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.firing-range-payload--error .firing-range-payload-err {
  font-size: 11px;
  color: var(--failure);
  line-height: 1.4;
}
@keyframes firingRangePulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* Re-roll button — tiny, top-right of the payload cell. Appears on
   hover or when the cell is in error state. */
.firing-range-regen {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.firing-range-row:hover .firing-range-regen,
.firing-range-payload--error .firing-range-regen,
.firing-range-regen:focus { opacity: 1; }
.firing-range-payload--error .firing-range-regen {
  width: auto;
  height: auto;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-color: var(--failure);
  color: var(--failure);
  position: static;
  margin-top: 4px;
  align-self: flex-start;
}
.firing-range-regen:hover {
  border-color: var(--action);
  color: var(--action);
  background: rgba(47,128,237,0.08);
}
.firing-range-fire {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 90px;
  padding: 14px 18px;
  background: transparent;
  border: 2px solid var(--attention);
  border-radius: 4px;
  color: var(--attention);
  font-family: var(--font);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 120ms ease;
}
.firing-range-fire:hover {
  background: var(--attention);
  color: var(--black);
  transform: translateY(-1px);
}
.firing-range-fire:active { transform: translateY(0); }
.firing-range-fire.is-fired {
  border-color: var(--success);
  color: var(--success);
  background: rgba(39,174,96,0.08);
  cursor: default;
  font-size: 14px;
}
.firing-range-fire.is-fired:hover {
  background: rgba(39,174,96,0.08);
  color: var(--success);
  transform: none;
}
.firing-range-fire-check {
  font-size: 14px;
  letter-spacing: 0.14em;
}
.firing-range-fire-when {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: none;
}
.firing-range-fire-label { letter-spacing: 0.14em; }

@media (max-width: 720px) {
  .firing-range-row {
    grid-template-columns: 90px 1fr;
    grid-template-areas: "thumb schedule" "payload payload" "fire fire";
    gap: 10px;
  }
  .firing-range-thumb    { grid-area: thumb; height: 90px; max-width: 90px; }
  .firing-range-schedule { grid-area: schedule; }
  .firing-range-blurb,
  .firing-range-payload  { grid-area: payload; padding-right: 4px; }
  .firing-range-fire     { grid-area: fire; min-height: 56px; font-size: 18px; }
}

/* ── Terminal frame (after 21) — minimal placeholder until queue lands */
/* ══════════════════════════════════════════════════════════════════
   MOBILE PASS — targeted at phones (≤ 640px portrait).
   Launchpad needs to be usable for swimmers dropping captures on their
   phones. Stack the capture surface, compact the pill strip, let the
   topbar tabs scroll horizontally, give NEXT a proper thumb-sized tap
   target at the bottom.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .flow-mode .flow-root {
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: calc(100vh - 64px);
  }
  .flow-mode .frame-strip {
    padding: 10px 14px;
    gap: 6px;
  }
  /* Compact pills on phones — same shape language, less footprint */
  .frame-pill--vertical   { width: 22px; height: 48px; }
  .frame-pill--horizontal { width: 48px; height: 22px; }
  .frame-pill--still      { width: 32px; height: 32px; }

  /* Topbar — let the tabs + utility buttons scroll horizontally if
     they overflow rather than wrapping into a messy grid. */
  .topbar-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .topbar-tabs::-webkit-scrollbar { display: none; }
  .topbar-user {
    flex-wrap: wrap;
    gap: 6px;
  }
  .sim-toggle, .info-toggle, .bug-btn, .errors-btn, .logout-btn {
    padding: 5px 10px;
    font-size: 10px;
  }

  /* Capture frame — single column, tap-sized. */
  .frame-body--capture {
    max-width: none;
    padding: 2px 14px 16px;
    gap: 12px;
  }
  .frame-capture-target {
    font-size: 16px;
  }
  .frame-capture-heading {
    gap: 10px;
  }
  .frame-capture-heading-title,
  .frame-capture-heading-role {
    font-size: 12px;
  }
  .frame-capture-heading-slot {
    flex-direction: column;
    gap: 2px;
  }
  .frame-capture-surface {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 12px;
  }
  .frame-capture-upload {
    width: 100%;
    max-width: 100%;
    height: auto;
    /* aspect-ratio keeps the target shape; width goes full so it's a
       real drop target for a thumb tap. */
  }
  .frame-capture-dump {
    min-height: 140px;
    font-size: 15px;      /* ≥16px avoids iOS zoom-on-focus */
    line-height: 1.45;
  }
  .frame-capture-thumb {
    width: 100%;
    max-width: 100%;
    height: auto;
    align-self: stretch;
  }
  /* NEXT goes full-width at the bottom — natural thumb-reach on a phone. */
  .frame-capture-next {
    width: 100%;
    min-width: 0;
    height: 64px;
    flex-direction: row;
    gap: 14px;
    padding: 0 20px;
  }
  .frame-capture-next-label { font-size: 26px; }
  .frame-capture-next-arrow { font-size: 22px; margin: 0; }

  /* Errors drawer — already capped via min(560px, 92vw). Just make the
     health strip pills wrap nicer. */
  .errors-drawer-head { padding: 10px 12px; }
  .errors-drawer-kicker { font-size: 11px; }
  .errors-health { padding: 8px 10px 6px; gap: 4px; }
  .errors-health-pill { font-size: 9px; padding: 3px 7px; }
  .errors-filter-bar { padding: 8px 10px; flex-wrap: wrap; }
  .errors-search { min-width: 140px; }
}

/* Extra tightening for very narrow phones (SE-class, 360px). */
@media (max-width: 380px) {
  .frame-capture-upload-word { font-size: 32px; }
  .frame-capture-next-label  { font-size: 22px; }
  .flow-mode .frame-strip { padding: 8px 10px; }
}

.frame-body--terminal {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 40px;
  text-align: center;
}
.frame-terminal-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--attention);
}
.frame-terminal-big {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--success);
  line-height: 1.1;
}
.frame-terminal-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 560px;
}

/* ============================================================
   Community Desk — Ed Anderson's composer (News panel)
   ============================================================ */
.cd-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .cd-wrap { grid-template-columns: 1fr; }
}

.cd-compose {
  background: #0d0d0d;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cd-kicker {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #F2994A;
}
.cd-sub {
  font-size: 13px;
  color: var(--text-dim, #888);
  line-height: 1.5;
  margin: -6px 0 4px;
}
.cd-field { display: flex; flex-direction: column; gap: 6px; }
.cd-field > label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8c8c8;
}
.cd-field > input,
.cd-field > select,
.cd-field > textarea {
  background: #050505;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 12px;
  color: #f5f5f5;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 120ms ease;
}
.cd-field > input:focus,
.cd-field > select:focus,
.cd-field > textarea:focus {
  outline: none;
  border-color: #FF0000;
}
/* Hero-image upload row sits beneath the URL input. The label-as-button
   pattern (label[for] + hidden input) opens the file picker on click. */
.cd-upload-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.cd-upload-btn {
  display: inline-flex; align-items: center; padding: 8px 14px;
  background: transparent; color: #ddd;
  border: 1px solid #2a2a2a; border-radius: 6px;
  font-family: inherit; font-size: 11px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; transition: border-color 120ms, color 120ms;
}
.cd-upload-btn:hover { border-color: #FF0000; color: #FF0000; }
.cd-upload-status { font-family: 'SF Mono', Menlo, monospace; font-size: 11px; color: #888; }
.cd-upload-status[data-state="uploading"] { color: #ffc47a; }
.cd-upload-status[data-state="done"]      { color: #7affc8; }
.cd-upload-status[data-state="error"]     { color: #ff7a7a; }
/* Author quick-pick pills — Brett or Ed in one tap. The free-text
   input below stays for the rare third-party author case. */
.cd-author-quick { display: flex; gap: 8px; }
.cd-author-pill {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  color: #ccc;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.cd-author-pill:hover { border-color: #FF0000; color: #fff; }
.cd-author-pill.is-active { background: #FF0000; border-color: #FF0000; color: #fff; }
/* Save-draft button — green so it's visually distinct from the red
   primary publish button + the ghost clear button. Drafts persist
   in localStorage; the restore prompt below appears on page load
   when an unpublished draft is found. */
.btn-draft {
  display: inline-flex; align-items: center;
  padding: 10px 18px;
  background: #1a8a4a; color: #fff;
  border: 1px solid #1a8a4a; border-radius: 6px;
  font-family: inherit; font-size: 12px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: background 120ms, border-color 120ms;
}
.btn-draft:hover { background: #207a3f; border-color: #207a3f; }
.btn-draft--small { padding: 6px 12px; font-size: 10px; }
.btn-ghost--small { padding: 6px 12px; font-size: 10px; }
.cd-draft-restore {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(26,138,74,0.10);
  border: 1px solid rgba(26,138,74,0.40);
  border-radius: 6px;
  font-size: 12px; color: #c8c8c8;
}
.cd-draft-msg { flex: 1; }
.cd-field > textarea { resize: vertical; min-height: 140px; }
.cd-field[hidden] { display: none; }

.cd-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.cd-channels label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #050505;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.cd-channels label:hover { border-color: #444; }
.cd-channels input[type="checkbox"] {
  accent-color: #5AFF9E;
  margin: 0;
}
.cd-channels label:has(input:checked) {
  border-color: #5AFF9E;
  background: #0a1a10;
}
.cd-channel-status {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, #888);
}
.cd-channel-status.is-ok      { color: #5AFF9E; }
.cd-channel-status.is-missing { color: #FF6666; }

.cd-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cd-actions .btn-primary {
  background: #FF0000;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms ease;
}
.cd-actions .btn-primary:hover:not(:disabled) { filter: brightness(1.15); }
.cd-actions .btn-primary:disabled { opacity: 0.55; cursor: wait; }
.cd-actions .btn-ghost {
  background: transparent;
  color: #ccc;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.cd-actions .btn-ghost:hover { border-color: #555; }

.cd-status {
  font-size: 13px;
  color: var(--text-dim, #888);
  margin-left: auto;
  min-height: 18px;
  text-align: right;
  flex: 1;
}
.cd-status.is-success { color: #5AFF9E; }
.cd-status.is-error   { color: #FF6666; }

.cd-recent {
  background: #0a0a0a;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cd-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.cd-recent-head .cd-kicker { margin: 0; }
.cd-feed-links {
  font-size: 11px;
  color: var(--text-dim, #888);
}
.cd-feed-links a {
  color: #F2994A;
  text-decoration: none;
  border-bottom: 1px dotted #F2994A55;
}
.cd-feed-links a:hover { border-bottom-style: solid; }

.cd-recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 640px;
  overflow-y: auto;
}
.cd-recent-item {
  padding: 10px 12px;
  background: #050505;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cd-recent-kicker {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F2994A;
}
.cd-recent-headline {
  font-size: 14px;
  font-weight: 600;
  color: #f5f5f5;
  text-decoration: none;
  line-height: 1.3;
}
.cd-recent-headline:hover { color: #FF0000; }
.cd-recent-lead {
  font-size: 12px;
  color: var(--text-dim, #888);
  line-height: 1.5;
}
.cd-recent-empty,
.cd-recent-loading {
  padding: 20px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim, #888);
  font-style: italic;
}

/* Legacy IPQ composer — collapsed by default */
.legacy-compose {
  margin-top: 36px;
  border-top: 1px dashed #1e1e1e;
  padding-top: 20px;
}
.legacy-compose > summary {
  cursor: pointer;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim, #888);
  padding: 6px 0;
}
.legacy-compose > summary:hover { color: #ccc; }
.legacy-compose-body { margin-top: 16px; }

/* ── INTEL DRAWER (2026-04-24) ──────────────────────────────────
   Sibling to ERRORS. Right-slide panel with collector health dots
   + top/cold asset rankings in the shame-red pattern
   (red <50 score · amber 50–500 · green >500). */
.intel-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.intel-drawer-backdrop[hidden] { display: none; }
.intel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 94vw);
  background: var(--dark-card);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}
.intel-drawer[hidden] { display: none; }
.intel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--dark);
  flex-shrink: 0;
}
.intel-drawer-title { display: flex; flex-direction: column; gap: 2px; }
.intel-drawer-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.24em;
  color: var(--action, #8aff8a);
}
.intel-drawer-sub { font-size: 10px; color: var(--text-dim); letter-spacing: 0.04em; }
.intel-drawer-actions { display: flex; gap: 6px; align-items: center; }
.intel-window {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.intel-action {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.intel-action:hover { border-color: var(--action); color: var(--action); }
.intel-close {
  width: 28px; height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.intel-close:hover { border-color: var(--failure); color: var(--failure); }
.intel-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 24px;
}

.intel-section { margin-bottom: 24px; }
.intel-section-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.intel-section-title--cold { color: #ff6666; }

.intel-collectors { display: flex; flex-wrap: wrap; gap: 10px; }
.intel-collector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.intel-collector-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #666;
}
.intel-collector-signals {
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-dim);
}
.intel-collector--green  .intel-collector-dot { background: #4ade80; box-shadow: 0 0 6px #4ade8088; }
.intel-collector--amber  .intel-collector-dot { background: #fbbf24; box-shadow: 0 0 6px #fbbf2488; }
.intel-collector--red    .intel-collector-dot { background: #ff4444; box-shadow: 0 0 6px #ff444488; }

.intel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.intel-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}
.intel-row-score {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.intel-row-label { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.intel-row-sub { font-size: 11px; color: var(--text-dim); }
.intel-row-platforms { color: var(--text); }
.intel-row--hot  { border-left: 3px solid #4ade80; }
.intel-row--hot  .intel-row-score { color: #4ade80; }
.intel-row--warm { border-left: 3px solid #fbbf24; }
.intel-row--warm .intel-row-score { color: #fbbf24; }
.intel-row--cold { border-left: 3px solid #ff4444; }
.intel-row--cold .intel-row-score { color: #ff4444; }
.intel-list--cold .intel-row { background: rgba(255,68,68,0.04); }

.intel-note {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  line-height: 1.55;
}
.intel-note--dim  { color: var(--text-dim); }
.intel-note--warn { border-color: #fbbf24; color: #fbbf24; }
.intel-note--err  { border-color: #ff4444; color: #ff8888; }
.intel-note code { background: rgba(255,255,255,0.05); padding: 1px 4px; border-radius: 2px; }

.intel-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   LAUNCHPAD MENU v2 (Brett-locked 2026-04-24 PM)
   HOME · Connections · Create · Publishing · Environmental · The Brain
        · Admin · Help · Exit
   Each parent opens a submenu on click; submenu items route to a panel
   or trigger an action. Sound plays on click (mutable via HELP).
   ═══════════════════════════════════════════════════════════════════ */

.lp-nav {
  /* Brett-locked 2026-05-02 PM: nav rides up inside the slimmer
     letterbox. Halved vertical padding from 8→2 and trimmed
     horizontal so the row sits centred without the prior dead
     space underneath it.
     Brett 2026-05-04: nav now sits NEXT TO the rocket logo on
     the same row (was `grid-column: 1 / -1` which forced it to
     a new row by itself). Topbar grid changed to `auto 1fr` so
     logo is natural width and nav fills the remainder. */
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.lp-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Brett 2026-05-04: padding tightened from 8px 14px → 6px 10px
     so the full menu (HOME → EXIT + search) fits on ONE row
     after the rocket logo took the front slot. */
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255,255,255,0.65);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.lp-nav-item:hover,
.lp-nav-item:focus-visible {
  color: #fff;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.15);
  outline: none;
}
.lp-nav-group[data-open="true"] > .lp-nav-item,
.lp-nav-group[data-active="true"] > .lp-nav-item {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 6px 24px rgba(0,0,0,0.4);
}
/* Light-up pulse after click; removed after 300ms by the JS. */
.lp-nav-item[data-flash="1"] {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.45);
}
.lp-nav-item--home { color: rgba(255,255,255,0.8); }
/* Brett 2026-05-04: EXIT styled like an exit sign — softer white
   box (not pure #FFF, doesn't overpower the rest of the chrome)
   with a red outline + BLACK text. Slightly smaller padding than
   the other nav items so the box feels like a sign, not just
   another menu chip. */
/* Brett-locked 2026-05-08 — global save signal in the topbar after the
   search box. Any autosave anywhere in the operator chrome calls
   window.LP.flashSaved() / flashFail() / flashSaving(); the pill fades
   in on the right of the search input, briefly. Heavy-data-entry sites
   need re-assurance the work won't be lost. Per feedback_swimmers_with_wet_fingers.md
   + feedback_green_means_go.md (green = saved, red = failed). */
.lp-save-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 6px 12px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-1px) scale(0.96);
  transition: opacity 200ms ease, transform 200ms ease;
}
.lp-save-pill.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.lp-save-pill[data-state="saving"] {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
}
.lp-save-pill[data-state="saved"] {
  color: #3ad27a;
  background: rgba(58,210,122,0.12);
  border: 1px solid rgba(58,210,122,0.45);
}
.lp-save-pill[data-state="failed"] {
  color: #ff9a9a;
  background: rgba(255,61,61,0.12);
  border: 1px solid rgba(255,61,61,0.5);
}
.lp-nav-item--exit {
  margin-left: auto;
  padding: 5px 10px;        /* smaller than nav default 8px 14px */
  font-size: 10.5px;
  color: #000;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 0, 0, 0.85);
}
.lp-nav-item--exit:hover {
  color: #000;
  background: rgba(255, 255, 255, 0.92);
  border-color: #FF0000;
}

.lp-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.lp-nav-badge--errors { background: var(--red, #ff3b3b); }

.lp-nav-group { position: relative; }

.lp-submenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-width: 360px;
  padding: 8px;
  background: #0b0b0c;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.6), 0 2px 0 rgba(255,255,255,0.03) inset;
  z-index: 60;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.lp-nav-group[data-open="true"] .lp-submenu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.lp-sub {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: rgba(255,255,255,0.78);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.lp-sub:hover,
.lp-sub:focus-visible {
  /* Brett-locked 2026-05-04: hover BG handled by .lp-submenu-pill
     (the moving translucent red pill). The default white-on-white
     hover BG is gone — keep the colour change so text still pops. */
  background: transparent;
  color: #fff;
  outline: none;
}
.lp-sub { position: relative; z-index: 1; }

/* Brett-locked 2026-05-04: NO separate orange line on the pill.
   The "this is what we are on" cue is the existing red speed-blur
   line at the leading edge of the top letterbox (.topbar::after
   below) — it turns orange under the active item. We don't add
   another line. */

/* Brett-locked 2026-05-04: hover-pill that follows the cursor /
   keyboard focus down the dropdown. Width is pinned to the longest
   item by JS (lp-nav.js wirePill()). Translucent red, no glow —
   "neon light without the halo". On mousedown each item the pill
   pulses brighter for 220ms in sync with the audible tick().
   (Submenu's own `position: absolute` from rule above is the
   positioning context for this pill — no extra rule needed.) */
.lp-submenu-pill {
  position: absolute;
  /* Brett-locked 2026-05-04: pill nudged left so its rounded
     leading edge OPTICALLY aligns with the first letter (the
     curve eats a few px on each end; pulling left compensates).
     Right side stays where it lands. Reads as a sleek glass
     tube whose head + tail wrap the first/last characters. */
  left: 10px;
  right: 18px;
  top: 0;               /* JS sets translateY to the hovered item's
                           offsetTop + the (item-h - pill-h)/2 centering
                           offset; height is pinned slim by JS too. */
  height: 24px;
  border-radius: 999px; /* full capsule — reads as a glass tube */
  /* Hover state (≈25% brightness) — vertical gel gradient with a
     touch of red. Top half catches a faint highlight, bottom half
     deepens to bordeaux to give the surface dimension. */
  background:
    linear-gradient(180deg,
      rgba(255, 80, 80, 0.10) 0%,
      rgba(255,  0,  0, 0.20) 50%,
      rgba(120,  0,  0, 0.22) 100%);
  /* Glass-tube highlights:
     · top inset = white sheen on the upper rim
     · bottom inset = soft inner shadow under the lip
     · 1px outer ring = thin glass wall
     · faint outer glow = the tube glowing into the dark BG */
  box-shadow:
    inset 0 1px 0    rgba(255, 255, 255, 0.12),
    inset 0 -1px 1px rgba(0,   0,   0,   0.45),
    0 0 0 1px        rgba(255, 80,  80,  0.22),
    0 0 6px          rgba(255, 0,   0,   0.10);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: transform 160ms cubic-bezier(.2,.8,.2,1),
              height 160ms cubic-bezier(.2,.8,.2,1),
              opacity 120ms ease,
              background 140ms ease,
              box-shadow 140ms ease;
  will-change: transform, opacity;
}
.lp-submenu-pill[data-flash="1"] {
  /* Click flash — Brett 2026-05-04: "more subtle in its final state,
     too garish". Pulled back across the board: gradient lifted only
     a touch above hover, sheen halved, outer glow trimmed and tighter
     so it stops at the pill's silhouette instead of bleeding into the
     surrounding text. Reads as a soft confirm-pulse, not a flare. */
  background:
    linear-gradient(180deg,
      rgba(255, 120, 120, 0.18) 0%,
      rgba(255,  20,  20, 0.32) 50%,
      rgba(140,   0,   0, 0.30) 100%);
  box-shadow:
    inset 0 1px 0    rgba(255, 255, 255, 0.22),
    inset 0 -1px 1px rgba(0,   0,   0,   0.35),
    0 0 0 1px        rgba(255, 80,  80,  0.35),
    0 0 6px          rgba(255, 0,   0,   0.18);
}
.lp-sub--link::after {
  content: ' ↗';
  opacity: 0.55;
  margin-left: 4px;
}
.lp-sub--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.lp-sub--disabled:hover { background: transparent; color: rgba(255,255,255,0.78); }
.lp-sub--toggle { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.6); }

.lp-submenu-divider {
  height: 1px;
  margin: 6px 8px;
  background: rgba(255,255,255,0.08);
}
.lp-submenu-hint {
  padding: 9px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.03em;
}
.lp-submenu-list .lp-sub { padding-left: 20px; }

/* ── Placeholder-panel ("coming soon") look ─────────────────────── */
.lp-stub {
  padding: 48px 28px;
  max-width: 720px;
  margin: 40px auto;
}
.lp-stub-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lp-stub-h {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.lp-stub-p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.68);
  max-width: 640px;
}
.lp-stub-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  max-width: 640px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.62);
}
.lp-stub-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lp-stub-list li:last-child { border-bottom: none; }
.lp-stub-list strong {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lp-stub-list code {
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  color: rgba(255,235,180,0.85);
}
.lp-stub-p code {
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  color: rgba(255,235,180,0.85);
}

/* ── Onboarding features grid ──────────────────────────────────── */
.lp-features-body { padding: 16px 24px 40px; max-width: 840px; }
.lp-features-status {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 16px;
}
.lp-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.lp-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.lp-feature:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); }
.lp-feature input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #4a9eff;
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.lp-feature-text { display: flex; flex-direction: column; gap: 2px; }
.lp-feature-name { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.lp-feature-note { font-size: 11px; color: rgba(255,255,255,0.55); line-height: 1.4; }
.lp-feature[data-on="true"] {
  background: rgba(74,158,255,0.08);
  border-color: rgba(74,158,255,0.4);
}
.lp-feature[data-required="true"] {
  opacity: 0.85;
  cursor: default;
}
.lp-feature[data-required="true"] input { cursor: default; }

.lp-features-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.lp-features-saved {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4a9e6d;
  opacity: 0;
  transition: opacity 160ms ease;
}
.lp-features-saved[data-show="true"] { opacity: 1; }

.lp-features-section { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.lp-features-section-h {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: 6px 2px;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lp-features-section:first-child .lp-features-section-h { border-top: none; margin-top: 0; }

/* Override flex-display so the legacy .topbar-user container can be
   truly hidden when its markup is retained only for JS bindings. */
.topbar-user[hidden] { display: none !important; }

/* ── Package-switch fade (kills the Campaign→Magazine flash) ────────
   flow.js sets html.lp-switching + a localStorage flag BEFORE the
   reload; the head script in admin.html re-applies the class on the
   new page before first paint. flow.js's init clears both. */
html.lp-switching .panel,
html.lp-switching .flow-root,
html.lp-switching .package-bar,
html.lp-switching .dam-dashboard,
html.lp-switching .chain-strip {
  opacity: 0 !important;
  transition: opacity 220ms ease;
}
html.lp-ready .panel,
html.lp-ready .flow-root {
  opacity: 1;
  transition: opacity 160ms ease;
}

/* ─────────────────────────────────────────────────────────────────────
   Magazine package · ATHLETE kind · two-pane editor (cagerace)
   ───────────────────────────────────────────────────────────────────── */

.frame-body--athlete {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  height: 100%;
  min-height: 720px;
}

.mag-ath-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 12px 18px 0 18px;
}

.mag-ath-pagelabel {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.mag-ath-page-num {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: #FF0000;
  line-height: 1;
}

.mag-ath-page-name {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #fff;
}

.mag-ath-page-blurb {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
}

.mag-ath-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 260px;
}

.mag-ath-picker-label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.mag-ath-picker {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.5) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.5) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.mag-ath-picker:focus {
  outline: 2px solid #FF0000;
  outline-offset: 1px;
}

.mag-ath-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 12px 12px;
  flex: 1;
  min-height: 640px;
}

.mag-ath-pane {
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  min-height: 640px;
}

.mag-ath-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mag-ath-pane-label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.mag-ath-open-tab {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.mag-ath-open-tab:hover { color: #FF0000; }

.mag-ath-refresh {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.mag-ath-refresh:hover {
  color: #fff;
  border-color: #FF0000;
  background: rgba(255, 0, 0, 0.08);
}

.mag-ath-iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 600px;
}

@media (max-width: 1100px) {
  .mag-ath-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .mag-ath-pane {
    min-height: 480px;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Magazine COVER frame · controlled template (page 1 only for now).
   Style is fixed by us: Montserrat Black or Black Italic masthead,
   off-white stock, 9:16 portrait, 2px border, single hero portrait,
   3 sub-headings, bottom-left logo + last-updated.
   No roman numerals anywhere — those are reserved for Formula H₂O.
   ───────────────────────────────────────────────────────────────────── */

.mag-cost-meter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mag-cost-label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}
.mag-cost-value {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #5AFF9E;
  letter-spacing: 0.04em;
}
.mag-cost-hint {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-left: auto;
}

/* Two-pane layout overrides for the Cover frame. */
.mag-ath-body--cover {
  grid-template-columns: minmax(280px, 380px) 1fr;
  align-items: stretch;
}

.mag-cover-controls {
  background: #0a0a0a;
  padding: 18px 18px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.mag-ctl-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mag-ctl-block:last-child { border-bottom: none; }

.mag-ctl-head {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.mag-ctl-input,
.mag-ctl-prompt {
  background: #181818;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  letter-spacing: 0.01em;
  outline: none;
}
.mag-ctl-input:focus,
.mag-ctl-prompt:focus {
  border-color: #FF0000;
}
.mag-ctl-input::placeholder,
.mag-ctl-prompt::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.mag-ctl-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mag-ctl-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mag-ctl-toggle,
.mag-ctl-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  user-select: none;
}
.mag-ctl-toggle input,
.mag-ctl-radio input { accent-color: #FF0000; }

.mag-ctl-hint {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

.mag-ctl-portrait-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mag-ctl-portrait-btn {
  background: #181818;
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  cursor: pointer;
}
.mag-ctl-portrait-btn:hover {
  border-color: #FF0000;
  background: rgba(255, 0, 0, 0.08);
}
.mag-ctl-reset {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11px;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  letter-spacing: 0.02em;
}
.mag-ctl-reset:hover { color: #fff; text-decoration: underline; }

.mag-ctl-sub {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mag-ctl-sub .mag-ctl-input { flex: 1; }
.mag-ctl-ai {
  background: rgba(90, 255, 158, 0.08);
  color: #5AFF9E;
  border: 1px solid rgba(90, 255, 158, 0.32);
  border-radius: 3px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.mag-ctl-ai:hover {
  background: rgba(90, 255, 158, 0.18);
  color: #fff;
}

.mag-ctl-prompt {
  resize: vertical;
  min-height: 64px;
  margin-top: 6px;
}
.mag-ctl-prompt-label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.16em;
  font-weight: 700;
  margin-top: 4px;
}

/* ── The cover stage + cover itself ─────────────────────────────── */
.mag-cover-stage {
  background:
    repeating-linear-gradient(45deg, #131313 0 8px, #161616 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 640px;
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.mag-cover {
  /* 9:16 portrait, scaled to fit the available pane height while
     leaving ~280px of vertical chrome (header + cost meter + padding).
     min(100%) keeps it from blowing past the pane width. */
  width: min(100%, calc((100vh - 320px) * 9 / 16));
  aspect-ratio: 9 / 16;
  background: #f5f0e6;          /* off-white magazine stock */
  position: relative;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  border: 2px solid #ffffff;
  container-type: inline-size;
}
.mag-cover[data-border-color="black"] { border-color: #000000; }

.mag-cover-inner {
  position: absolute;
  inset: 0;
  padding: 5cqw;
  display: flex;
  flex-direction: column;
  gap: 3cqw;
}

.mag-cover-masthead {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 0.82;
}
.mag-cover-title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 900;
  font-style: normal;
  font-size: clamp(28px, 13.5cqi, 84px);
  letter-spacing: -0.025em;
  color: #000;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  outline: none;
  caret-color: #FF0000;
  min-height: 0.82em;
}
.mag-cover-title:empty::before {
  content: 'TITLE';
  color: #c8b8a4;
}
.mag-cover[data-italic="true"] .mag-cover-title { font-style: italic; }

.mag-cover-mag {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(14px, 6.5cqi, 42px);
  letter-spacing: 0.04em;
  color: #000;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.1em;
}
.mag-cover[data-italic="true"] .mag-cover-mag { font-style: italic; }

.mag-cover-portrait {
  flex: 1;
  background: #d8cdb9;
  overflow: hidden;
  position: relative;
  min-height: 0;
}
.mag-cover-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mag-cover-portrait--empty {
  background: linear-gradient(135deg, #ddd1bc 0%, #b8a98e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mag-cover-portrait-placeholder {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(10px, 3cqi, 16px);
  font-weight: 800;
  letter-spacing: 0.32em;
  color: rgba(0, 0, 0, 0.4);
}

.mag-cover-subheads {
  display: flex;
  flex-direction: column;
  gap: 1.2cqw;
}
.mag-cover-subhead {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 3.4cqi, 17px);
  color: #000;
  line-height: 1.25;
  outline: none;
  letter-spacing: 0;
  caret-color: #FF0000;
  min-height: 1.25em;
}
.mag-cover-subhead:empty::before {
  content: 'Sub-heading\u2026';
  color: #b8aa94;
  font-weight: 500;
}

.mag-cover-foot {
  display: flex;
  align-items: center;
  gap: 2.5cqw;
  margin-top: auto;
  padding-top: 2cqw;
}
.mag-cover-logo {
  width: 8cqw;
  height: 8cqw;
  min-width: 28px;
  min-height: 28px;
  background: #FF0000;
  color: #fff;
  font-weight: 900;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(10px, 3.2cqi, 14px);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.mag-cover-updated {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(8px, 1.7cqi, 10px);
  letter-spacing: 0.22em;
  color: #6a6358;
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .mag-ath-body--cover {
    grid-template-columns: 1fr;
  }
  .mag-cover {
    width: min(100%, calc((100vh - 480px) * 9 / 16));
  }
}

/* PUBLISH button at the bottom of the LEFT controls pane. The user
   builds the cover in the controls, then presses PUBLISH to ship it. */
.mag-ctl-block--publish {
  margin-top: 8px;
  border-bottom: none;
}
.mag-publish-btn {
  width: 100%;
  background: #FF0000;
  color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.18em;
  padding: 14px 18px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: filter 120ms ease;
}
.mag-publish-btn:hover { filter: brightness(1.12); }
.mag-publish-btn[data-flash="1"] {
  background: #5AFF9E;
  color: #000;
}

/* When the Magazine page hides the SPA chrome (frame strip + context),
   the cover stage gets the full vertical room. Bumps the cover height
   ceiling so it fills the larger pane without overshooting. */
.frame-body--athlete.frame-body--cover { min-height: 0; height: 100%; }
body.flow-mode .frame-body--cover .mag-cover {
  width: min(100%, calc((100vh - 160px) * 9 / 16));
}

/* Magazine-cover-only mode: collapse the SPA's flow-mode grid + panel
   max-width so the 2-pane editor gets the full viewport. The class is
   added to <html> by renderAthleteCoverFrame() and cleared on package
   switch when flow.js reloads the page. */
html.lp-mag-cover .app {
  flex-direction: column !important;
}
html.lp-mag-cover .panel {
  flex: 1 1 100% !important;
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
}
html.lp-mag-cover #flowRoot {
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  width: 100% !important;
  max-width: none !important;
}
html.lp-mag-cover #activeFrame {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  min-width: 0 !important;
}
html.lp-mag-cover .frame-body--cover {
  width: 100%;
  height: 100%;
  min-width: 0;
}
html.lp-mag-cover .mag-ath-body--cover {
  width: 100%;
}

/* ── WEBSITE EDITOR (.we-* classes) ─────────────────────────────────
   Brett-locked 2026-05-04 PM: the website-pages editor (the WEBSITE
   menu surface) shipped without its own CSS — every field rendered
   as a default browser input, ugly + tiny against the dark admin
   chrome. This block restores Brett's "light grey outlines + text"
   look. Lives here so it inherits the same admin.css cache-bust as
   the rest of the panel system. */

.we-panel {
  padding: 32px clamp(20px, 4vw, 56px) 80px;
  max-width: 1180px;
  margin: 0 auto;
  color: #d6d6d6;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}
.we-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.we-header-left { min-width: 0; }
.we-title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.we-subtitle {
  margin: 0;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}
.we-view-link {
  font-size: 12px;
  color: #ff3d3d;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,61,61,0.5);
  padding-bottom: 1px;
  transition: color 120ms, border-color 120ms;
}
.we-view-link:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Page picker — 14 pills along the top */
.we-page-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.we-pill {
  background: transparent;
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.we-pill:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.we-pill--active {
  background: #ff3d3d;
  color: #0a0a0a;
  border-color: #ff3d3d;
}
.we-pill--active:hover {
  background: #ff5757;
  color: #0a0a0a;
  border-color: #ff5757;
}

/* Search */
.we-search {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: #f0f0f0;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 18px;
  transition: border-color 120ms, background 120ms;
  -webkit-appearance: none;
  appearance: none;
}
.we-search::placeholder { color: rgba(240,240,240,0.4); }
.we-search:focus {
  border-color: #ff3d3d;
  background: rgba(255,255,255,0.06);
}

/* Editor area — stack of field rows */
.we-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.we-loading {
  color: #888;
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* Field row */
.we-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  transition: border-color 120ms, background 120ms;
}
.we-field:focus-within {
  border-color: rgba(255,61,61,0.6);
  background: rgba(255,255,255,0.04);
}
.we-field--edited {
  border-left: 3px solid #ff3d3d;
  padding-left: 13px;
}

.we-field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  cursor: pointer;
}
.we-field-label > span:first-child { letter-spacing: 0.01em; }

.we-field-hint {
  font-size: 11px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: #666;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: auto;
}

.we-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #ff3d3d;
  color: #0a0a0a;
  padding: 2px 7px;
  border-radius: 3px;
}

/* Inputs */
.we-input {
  width: 100%;
  background: #0d0d0d;
  color: #f0f0f0;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  transition: border-color 120ms, background 120ms;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}
.we-input:focus {
  border-color: #ff3d3d;
  background: #111;
}
textarea.we-input { min-height: 72px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
.we-input[data-is-default="1"] { color: #888; }

/* Footer */
.we-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 6px;
  margin-top: 24px;
  background: linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,0.9) 30%, #0a0a0a 60%);
  z-index: 1;
}
.we-save-btn {
  background: #ff3d3d;
  color: #0a0a0a;
  border: 1px solid #ff3d3d;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms, opacity 120ms;
}
.we-save-btn:hover:not(:disabled) { background: #ff5757; }
.we-save-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.we-status {
  font-size: 12px;
  color: #888;
}
.we-status--success { color: #3ad27a; }
.we-status--error   { color: #ff3d3d; }
.we-status--info    { color: #d6d6d6; }

/* ────────────────────────────────────────────────────────────
   THE BRAIN — corpus ingest + lane list views
   Brett-locked 2026-05-04 PM. Replaces the 5 Brain stubs with a
   real ingest UI (dropzone + lane chips + paste form) + 5 lane
   list views over /api/brain-list. No DAM-dashboard / chain-strip
   baggage — Brain is corpus, not a 21-frame social campaign.
   ──────────────────────────────────────────────────────────── */

.brain-panel { padding: 32px 36px 80px; max-width: 1100px; }
.brain-head { margin-bottom: 18px; }
.brain-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff3d3d;
  margin-bottom: 10px;
}
.brain-h {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 8px;
}
.brain-h #brainIngestLaneLabel { color: #ff7a7a; }
.brain-sub {
  color: #b8b8b8;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 12px;
  max-width: 760px;
}

.brain-lane-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}
.brain-lane-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d6d6d6;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms;
}
.brain-lane-chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}
.brain-lane-chip[aria-selected="true"] {
  background: rgba(255,61,61,0.14);
  border-color: rgba(255,61,61,0.55);
  color: #fff;
}

.brain-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 44px 24px;
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  text-align: center;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
  outline: none;
}
.brain-dropzone:hover,
.brain-dropzone:focus-visible {
  background: rgba(255,61,61,0.05);
  border-color: rgba(255,61,61,0.45);
}
.brain-dropzone[data-active="true"] {
  background: rgba(255,61,61,0.08);
  border-color: #ff3d3d;
}
.brain-dropzone-icon {
  font-size: 28px;
  color: #ff3d3d;
  line-height: 1;
}
.brain-dropzone-title { color: #fff; font-size: 15px; font-weight: 600; }
.brain-dropzone-sub   { color: #888; font-size: 12px; }

.brain-paste {
  margin: 18px 0 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.brain-paste > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  color: #d6d6d6;
  font-weight: 500;
}
.brain-paste > summary::-webkit-details-marker { display: none; }
.brain-paste > summary::before { content: '+ '; color: #ff7a7a; font-weight: 700; }
.brain-paste[open] > summary::before { content: '− '; }
.brain-paste-body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.brain-field { display: flex; flex-direction: column; gap: 6px; }
.brain-field > span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}
.brain-field input,
.brain-field textarea {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #f2f2f2;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
}
.brain-field input:focus,
.brain-field textarea:focus {
  outline: none;
  border-color: #ff3d3d;
  background: #111;
}
.brain-paste-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brain-paste-status { font-size: 12px; color: #888; }
.brain-paste-status[data-state="ok"]   { color: #3ad27a; }
.brain-paste-status[data-state="err"]  { color: #ff3d3d; }
.brain-paste-status[data-state="busy"] { color: #d6d6d6; }

.brain-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 120ms, opacity 120ms, border-color 120ms;
  border: 1px solid transparent;
  font-family: inherit;
}
.brain-btn--primary {
  background: #ff3d3d;
  color: #0a0a0a;
  border-color: #ff3d3d;
}
.brain-btn--primary:hover { background: #ff5757; }
.brain-btn--ghost {
  background: transparent;
  color: #d6d6d6;
  border-color: rgba(255,255,255,0.18);
}
.brain-btn--ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}
.brain-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.brain-recent { margin-top: 28px; }
.brain-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.brain-recent-title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
}

.brain-list,
.brain-recent-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.brain-list-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 120ms;
}
.brain-list-row:hover { background: rgba(255,255,255,0.03); }
.brain-list-kind {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  text-align: center;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}
.brain-list-kind[data-kind="pdf"]   { color: #ff7a7a; border-color: rgba(255,122,122,0.4); }
.brain-list-kind[data-kind="image"] { color: #7ad2ff; border-color: rgba(122,210,255,0.4); }
.brain-list-kind[data-kind="audio"] { color: #d27aff; border-color: rgba(210,122,255,0.4); }
.brain-list-kind[data-kind="video"] { color: #ffd27a; border-color: rgba(255,210,122,0.4); }
.brain-list-kind[data-kind="text"]  { color: #7affb0; border-color: rgba(122,255,176,0.4); }
.brain-list-kind[data-kind="url"]   { color: #f2c0ff; border-color: rgba(242,192,255,0.4); }
.brain-list-title {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brain-list-sub {
  color: #888;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brain-list-meta { display: flex; flex-direction: column; min-width: 0; }
.brain-list-when {
  color: #888;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: right;
}
.brain-list-size {
  color: #666;
  font-size: 11px;
  text-align: right;
}
.brain-empty {
  padding: 24px 4px;
  color: #666;
  font-size: 13px;
  font-style: italic;
}

.brain-drop-more {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .brain-panel { padding: 22px 18px 60px; }
  .brain-h { font-size: 22px; }
  .brain-list-row { grid-template-columns: 48px 1fr auto; }
  .brain-list-row .brain-list-meta:nth-child(4) { display: none; }
}
