/* Cadence — "Antenne" design system.
   A calm analytics-dashboard look: a cool grey-blue page, white cards
   with large radii and soft shadows, near-black bold figures, muted grey
   labels, and a few series accents (teal, purple, red) plus an orange
   "today" marker. The week is still a sequencer — pillars are tracks,
   posts are beat blocks — just drawn softer.
   Type: Plus Jakarta Sans everywhere; a system mono only for code.
   Page templates only compose these classes; no per-project styling. */

:root {
  /* Surfaces */
  --bg: #eef0f4;
  --panel: #f6f7f9;
  --paper: #fff;
  --line: #e2e5eb;
  --line-strong: #cdd2db;
  /* Text (muted passes AA on --bg and --paper) */
  --ink: #111827;
  --muted: #5f6675;
  --faint: #a3a9b5;
  /* Series accents; the *-ink variants are for text on light surfaces */
  --accent: #14a3a8;
  --accent-ink: #0a7176;
  --purple: #7c3aed;
  --red: #e8384f;
  --amber: #f59e0b;
  --amber-ink: #a84a06;
  --green: #16a34a;
  --green-ink: #15803d;
  --danger: #d42a42;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-label: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgb(17 24 39 / 4%), 0 6px 20px rgb(17 24 39 / 4%);
  --shadow-pill: 0 1px 2px rgb(17 24 39 / 6%), 0 2px 8px rgb(17 24 39 / 6%);
  --shadow-hard: var(--shadow-pill);
  --ring: 0 0 0 3px rgb(20 163 168 / 25%);
  --ease: 120ms ease;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

/* ── Base ─────────────────────────────────────────────────────── */
body.cadence-app {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}
.cadence-app ::selection { background: var(--accent); color: #fff; }
.cadence-app a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--ease);
}
.cadence-app a:hover { color: var(--accent-ink); }
.cadence-app button { font-family: inherit; }
.cadence-app :focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 2px;
}
.cadence-app h1,
.cadence-app h2,
.cadence-app h3 {
  margin: 0;
  font-weight: 700;
}
.cadence-app ::-webkit-scrollbar { width: 10px; height: 10px; }
.cadence-app ::-webkit-scrollbar-thumb {
  background: var(--faint);
  border-radius: 5px;
  border: 3px solid var(--bg);
}

/* Inlined lucide icons inherit currentColor and baseline-align. */
.cadence-app .icon { flex: none; vertical-align: -3px; }

/* ── Type helpers ─────────────────────────────────────────────── */
/* Small muted labels — meta, timestamps, counts, nav. Never body copy. */
/* Template strings here are often lower case ("no undo"); the caps
   are what make them read as labels, so keep the transform. */
.kicker {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.page-subtitle { font-size: 14px; color: var(--muted); }
.hero-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

/* Section label: small muted label with a trailing rule. */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.section-label::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

/* Mono spec-sheet rows: label/value pairs (profile, metadata). */
dl.spec {
  margin: 14px 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
}
dl.spec dt {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
  padding-top: 2px;
}
dl.spec dd {
  margin: 0;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ── Signature: the LED ───────────────────────────────────────── */
.led {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--amber) 0 38%, #f97316 39% 60%, var(--ink) 61%);
  flex: none;
  box-sizing: border-box;
}
.led.small { width: 12px; height: 12px; }

/* ── Chips — hairline pills with small label text ───────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none !important;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background-color var(--ease), color var(--ease);
}
a.chip:hover,
button.chip:hover { background: var(--panel); color: var(--ink); }
.chip.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
a.chip.ink:hover { background: #1f2937; color: #fff; }
.chip.amber { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 700; }
a.chip.amber:hover { background: #fbbf24; color: var(--ink); }
.chip.accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.chip.green { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.chip.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip.quiet { background: transparent; color: var(--muted); }
/* Auto-published (approved without a human): an outlined marker chip. */
.chip.auto { border-style: dashed; border-color: var(--line-strong); color: var(--ink); background: var(--paper); }
/* Manual-platform draft: nothing is sent automatically. */
.chip.manual { border-style: dashed; border-color: var(--amber-ink); color: var(--ink); background: var(--amber); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── App shell: console header, no sidebar ────────────────────── */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 28px 56px;
  box-sizing: border-box;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.console {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  padding: 4px 4px 0;
  flex-wrap: wrap;
}
.console .wordmark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none !important;
}
.console .wordmark:hover { color: var(--accent-ink); }

/* Project switcher: ink chip that opens a plain link list. */
.switcher { position: relative; }
.switcher > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.switcher > summary::-webkit-details-marker { display: none; }
.switcher .menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.switcher .menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-label);
  font-size: 11px;
  text-decoration: none !important;
  color: var(--ink);
  transition: background-color var(--ease);
}
.switcher .menu a:hover { background: var(--panel); color: var(--ink); }
.switcher .menu a .count { margin-left: auto; color: var(--accent-ink); font-weight: 700; }
.switcher .menu a .count.zero { color: var(--faint); font-weight: 400; }
.switcher .menu .none { padding: 6px 10px; color: var(--faint); font-size: 12px; }

/* Week indicator: "WEEK 37 · SEP 7–13" with the big number. */
.console .week-ind {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.console .week-ind .label,
.console .week-ind .range {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.console .week-ind .num { font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: -0.02em; }
.console .status-chips { display: flex; gap: 8px; margin-left: 18px; align-items: center; }

/* Slim nav row of chips under the console. */
.console-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px;
}
.console-nav > .chip {
  letter-spacing: 0;
  text-transform: none;
  border-color: transparent;
  background: transparent;
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.console-nav > a.chip:hover { background: rgb(255 255 255 / 60%); }
.console-nav > .chip.on,
.console-nav > a.chip.on:hover {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
  font-weight: 700;
}
.console-nav .user-chip { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.console-nav .user-chip .chip { letter-spacing: 0; text-transform: none; }

/* Flash messages. */
.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.flash.success { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.flash.error { background: var(--danger); border-color: var(--danger); color: #fff; }
.flash.warning { background: var(--amber); color: var(--ink); }
.flash.info { background: var(--panel); }

/* Content region under the console. */
.content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.content.narrow { max-width: 900px; width: 100%; }

/* ── Modules — the bordered surfaces everything lives on ──────── */
.module {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
}
/* Legacy variants: in Antenne every module is a white card. */
.module.raised,
.module.ink { background: var(--paper); }
.module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 12px;
  flex-wrap: wrap;
}
.module-head .module-title {
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.module-body { padding: 0 24px 22px; }

/* Legacy alias kept for shared partial styling. */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-title { font-size: 15px; font-weight: 700; }

/* Empty states: small label + one sentence + chip action. */
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  background: var(--paper);
}
.empty-state > .icon { display: none; }
.empty-title {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.empty-hint { font-size: 15px; font-weight: 500; color: var(--ink); max-width: 420px; line-height: 1.6; }

/* ── Buttons ──────────────────────────────────────────────────── */
/* Hairline borders, rounded 10; primaries carry a soft shadow that
   drops on press. Hover shifts background, never opacity. */
.cadence-app .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color var(--ease), color var(--ease),
    transform var(--ease), box-shadow var(--ease);
}
.cadence-app .btn .icon { margin-left: -2px; }
.cadence-app .btn-primary {
  background: var(--green-ink);
  border-color: var(--green-ink);
  color: #fff;
  box-shadow: var(--shadow-pill);
}
.cadence-app .btn-primary:hover { background: #166534; color: #fff; }
.cadence-app .btn-primary:active { transform: translateY(1px); box-shadow: none; }
.cadence-app .btn-secondary { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pill); }
.cadence-app .btn-secondary:hover { background: var(--panel); color: var(--ink); }
.cadence-app .btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.cadence-app .btn-ghost:hover { background: var(--panel); color: var(--ink); }
.cadence-app .btn-danger { background: var(--paper); color: var(--danger); }
.cadence-app .btn-danger:hover { background: var(--danger); color: #fff; }
.cadence-app .btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }
.cadence-app .btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* Segmented control (calendar nav) — a chip strip. */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.seg a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none !important;
  border-radius: 9px;
  box-sizing: border-box;
  transition: background-color var(--ease), color var(--ease);
}
.seg a:hover { background: rgb(255 255 255 / 70%); color: var(--ink); }
.seg a.on { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-pill); }
.seg a:focus-visible { outline-offset: -2px; }

/* ── Status inks — blocks, chips, badges ──────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: var(--panel);
}
.pill[class*="status-"] { border-color: transparent; font-weight: 700; }
.pill.warn { color: var(--ink); background: var(--amber); font-weight: 700; }
/* Status fills. Text colour is chosen per fill for >= 4.5:1 contrast
   (small bold text): ink on amber/teal, white on ink, purple and
   danger. Scoped under .cadence-app and repeated for :hover so the global
   link colours (.cadence-app a / a:hover) can't override them on the
   linked beat blocks and calendar events. */
.status-draft,
.cadence-app .status-draft,
.cadence-app .status-draft:hover { color: var(--ink); background: var(--amber); }
.status-approved,
.cadence-app .status-approved,
.cadence-app .status-approved:hover { color: var(--panel); background: var(--ink); }
.status-scheduled,
.cadence-app .status-scheduled,
.cadence-app .status-scheduled:hover { color: #fff; background: var(--purple); }
.status-published,
.cadence-app .status-published,
.cadence-app .status-published:hover { color: var(--ink); background: var(--accent); }
.status-failed,
.cadence-app .status-failed,
.cadence-app .status-failed:hover { color: #fff; background: var(--danger); }

.dot-draft { background: var(--amber); }
.dot-approved { background: var(--ink); }
.dot-scheduled { background: var(--purple); }
.dot-published { background: var(--accent); }
.dot-failed { background: var(--danger); }

/* Status legend: bordered swatch squares + mono labels. */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--ink);
}
.cal-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .swatch {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  display: block;
  box-sizing: border-box;
}
.cal-legend .label { color: inherit; }

/* ── Page header ──────────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head .titling { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dateline {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.cadence-app hr.page-rule { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ── Track view — the sequencer ───────────────────────────────── */
.track-board { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.track-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.track-grid.head {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.track-grid.head .today { color: var(--amber-ink); font-weight: 700; }
.track-label {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  align-self: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.track-label .sub {
  display: block;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
}
.track-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 8px; }

/* Beat block: borderless status fill, small time line, bold label. */
.beat {
  display: block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px;
  min-width: 0;
  box-sizing: border-box;
  text-decoration: none !important;
  transition: background-color var(--ease);
}
.beat .beat-time {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 400;
}
.beat .beat-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.beat.status-draft:hover { background: #fbbf24; }
.beat.status-approved .beat-time { color: var(--faint); }
.beat.status-approved:hover { background: #1f2937; }
.beat.status-scheduled:hover { background: #6d28d9; }
.beat.status-published:hover { background: #2bb8bd; }
.beat.status-failed:hover { background: #b91c33; }
/* Waiting to be posted by hand: an outlined future slot, like the
   dashed upcoming bars on an analytics chart. */
.cadence-app .beat.to-post,
.cadence-app .beat.to-post:hover { color: var(--ink); background: var(--paper); border: 1.5px dashed var(--line-strong); }
.cadence-app .beat.to-post:hover { border-color: var(--ink); }
.beat.to-post .beat-time { color: var(--muted); }
.track-empty-hint { padding: 6px 0; }

/* Track toolbar (week nav chips). */
.track-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.track-toolbar .push { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Deck under the board: NEXT PROOF + WEEK OUTPUT. */
.deck { display: flex; gap: 16px; align-items: stretch; }
.deck .proof { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; }
.proof .proof-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-label);
  font-size: 11px;
}
.proof .proof-meta .push { margin-left: auto; color: var(--muted); }
.proof .proof-text { font-size: 16px; font-weight: 500; line-height: 1.5; max-width: 70ch; }
.proof .proof-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.deck .output {
  width: 250px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
}
.deck .output .big { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.deck .output .breakdown {
  margin-top: auto;
  font-family: var(--font-label);
  font-size: 11px;
  line-height: 1.7;
}

/* ── Project list ─────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 16px;
  background: var(--paper);
  transition: box-shadow var(--ease);
}
.project-card:hover { box-shadow: 0 2px 4px rgb(17 24 39 / 5%), 0 12px 28px rgb(17 24 39 / 8%); }
.project-card .head { display: flex; align-items: flex-start; gap: 12px; }
.project-card .name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
/* The whole card is clickable via the title link's cover overlay… */
.project-card .name a { text-decoration: none !important; color: inherit; }
.project-card .name a:hover { color: inherit; }
.project-card .name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.project-card .platforms {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.project-card .pending { margin-left: auto; text-align: right; flex: none; }
.project-card .pending .n {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.project-card .pending .n.zero { color: var(--faint); }
.project-card .pending .word {
  font-family: var(--font-label);
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.project-card .stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}
.project-card .stats li + li::before { content: "· "; color: var(--faint); }
.project-card .stats .hot { color: var(--accent-ink); font-weight: 700; }
.project-card .stats .quiet { color: var(--faint); }
/* …while the explicit actions sit above the overlay. */
.project-card .actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ── Review queue ─────────────────────────────────────────────── */
.queue { display: flex; flex-direction: column; gap: 14px; }
.queue-card { display: flex; overflow: hidden; }
.queue-card .edge { width: 4px; flex: none; background: var(--amber); }
.queue-card .edge.warn { background: var(--red); }
.queue-card .body { flex: 1; min-width: 0; padding: 20px 24px 18px; }
.queue-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}
.queue-meta .platform {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1px 8px;
  font-size: 10px;
  color: var(--ink);
  background: var(--panel);
}
.queue-meta .pillar-name { color: var(--ink); font-weight: 700; }
.queue-meta .meta-sep { color: var(--faint); }
.queue-meta .when { color: var(--muted); }
.queue-meta .waiting {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--accent-ink);
}
.queue-meta .detail-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink);
  text-decoration: none !important;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: background-color var(--ease);
}
.queue-meta .detail-link:hover { background: var(--paper); color: var(--ink); }
.queue-editor {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  min-height: 96px;
  resize: vertical;
  box-sizing: border-box;
  transition: box-shadow var(--ease);
}
.queue-editor:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent-ink); }
.queue-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.queue-actions .push { margin-left: auto; }

/* Day subheadings: label chip + rule. */
.day-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin: 10px 0 -2px;
}
.day-heading .day-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 3px 10px;
}
.day-heading::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.day-heading:first-child { margin-top: 0; }

/* ── Proof preview: how the post will read ────────────────────── */
.post-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 14px 16px 11px;
}
.post-preview .pp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--amber);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  flex: none;
  text-transform: uppercase;
  box-sizing: border-box;
}
.post-preview .pp-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.post-preview .pp-name { font-size: 13px; font-weight: 700; }
.post-preview .pp-sub {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
}
.post-preview .pp-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  max-width: 68ch;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
/* Media thumbnails — aspect-aware without server-side dimension probing:
   height/width stay auto and the max-box does the work. A landscape card
   (1200×675) hits max-width first and lands ~200px tall; a portrait card
   (1080×1920) hits max-height at 280px. Also used outside .post-preview
   (tracks NEXT PROOF), so these selectors are unprefixed. */
.pp-media {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 12px;
}
.media-thumb {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.media-thumb img {
  display: block;
  width: auto;
  height: auto;
  max-height: 280px;
  max-width: 356px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-sizing: border-box;
}
.media-item { margin: 0; }
.media-item .media-index {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.chip.media-more { align-self: center; }

/* Native <dialog> lightbox (base.html + static/js/lightbox.js). */
dialog.media-lightbox {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  max-width: min(92vw, 1240px);
  max-height: 92vh;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-hard);
}
dialog.media-lightbox[open] { display: flex; }
dialog.media-lightbox::backdrop { background: rgb(17 24 39 / 72%); }
.media-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(90vw, 1200px);
  max-height: calc(92vh - 46px);
  min-height: 0;
  object-fit: contain;
  margin: 0 auto;
}
.media-lightbox .lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 44px 8px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
}
.media-lightbox .lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
}

/* Regenerate-image action on the post detail page. */
.regen-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.regen-form .regen-hint {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}
.regen-hint {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}

/* Video posts: player + render status block, script editor. */
.media-video {
  display: block;
  max-height: 280px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
}
.video-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.video-block .media-video { max-height: 420px; }
.video-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pill.render-busy { background: var(--amber); font-weight: 700; }
.pill.render-ready { background: var(--green); color: var(--ink); font-weight: 700; }
.pill.render-failed { background: var(--danger); color: #fff; font-weight: 700; }
.video-duration,
.video-note,
.video-refresh {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}
.video-note { color: var(--ink); }
.video-error { margin: 0; white-space: pre-wrap; font-size: 11px; }
.video-block .regen-form { margin-top: 0; }
.script-editor { margin-top: 16px; }
/* Same insets as .module-head / .module-body so content clears the frame. */
.script-editor .section-head { padding: 14px 20px 10px; }
.script-editor .section-body { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 18px; }
.script-errors { margin: 6px 0 0; padding-left: 18px; }
.scene-edit {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 14px 14px;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene-edit legend { font-weight: 700; padding: 0 6px; }
.scene-edit .helptext { font-size: 12px; color: var(--muted); line-height: 1.5; }
.scene-edit .field { margin-bottom: 0; }
.cue-table { width: 100%; border-collapse: collapse; }
.cue-table th {
  font-family: var(--font-label);
  font-size: 10px;
  text-align: left;
  padding: 2px 4px;
}
.cue-table td { padding: 2px 4px; }
.cue-table .cue-n { width: 2em; font-family: var(--font-label); font-size: 11px; color: var(--muted); }
.cue-table input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 5px 8px;
  font: inherit;
  font-size: 13px;
}
.cue-table input[type="text"]:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent-ink); }

/* Configure → Video section rows. */
.video-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.video-row form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.video-row input[type="file"] { font-size: 12px; max-width: 240px; }
.scene-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
/* Video kit upload: expected layout and the last run's result. */
.kit-layout { margin: 0 0 10px; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.kit-status { display: grid; gap: 8px; margin-bottom: 12px; }
.kit-error { margin: 0; color: var(--danger); font-weight: 700; font-size: 13px; }
.kit-report { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 12px; }
.kit-report dt { color: var(--muted); font-weight: 700; text-transform: uppercase; }
.kit-report dd { margin: 0; overflow-wrap: anywhere; }
.kit-skipped { margin: 0; padding-left: 16px; }
.post-preview .pp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.char-count {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
}
.char-count.over { color: var(--danger); font-weight: 700; }

/* First comment (X/Threads/Instagram/Facebook): a reply-style block under
   the caption, where links and CTAs live. */
.post-preview .pp-first-comment {
  margin-top: 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--paper);
}
.post-preview .pp-first-comment[hidden] { display: none; }
.post-preview .pp-fc-label {
  display: block;
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.post-preview .pp-fc-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.queue-editor.first-comment-editor { min-height: 56px; }

/* Edit toggle: preview by default, textarea only while editing. */
[data-post-card] .queue-editor,
[data-post-card] .save-btn { display: none; }
[data-post-card].is-editing .queue-editor { display: block; margin-top: 12px; }
[data-post-card].is-editing .save-btn { display: inline-flex; }
[data-post-card].is-editing .post-preview { background: var(--panel); }

/* Inline reject confirmation (details/summary — no JS required). */
.confirm-reject > summary { list-style: none; user-select: none; }
.confirm-reject > summary::-webkit-details-marker { display: none; }
.confirm-reject[open] > summary { display: none; }
.confirm-reject .confirm-pop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--paper);
}
.confirm-reject .confirm-note { font-size: 12.5px; color: var(--danger); font-weight: 700; }
.confirm-reject .confirm-pop .btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}
.confirm-reject .confirm-pop .btn-danger:hover { background: #b91c33; color: #fff; }

/* ── Post detail page ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
/* Metadata panel: a mono spec-sheet. */
.detail-meta { padding: 16px 18px; }
.detail-meta dl { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; }
.detail-meta dt {
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
  padding-top: 2px;
}
.detail-meta dd {
  margin: 0;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
.status-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.6;
}
.status-note.failed { background: var(--danger); color: #fff; }
.status-note.warn { background: var(--amber); }
/* Review-window drafts: auto-publish deadline + Hold, or the held note. */
.status-note.auto-approve {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  background: var(--amber);
}
.status-note.auto-approve form { margin: 0; flex-shrink: 0; }
.status-note.held { margin: 12px 0; border-style: dashed; }

/* Blog posts: metadata panel (read-only), editor fields, send status. */
.blog-meta {
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.blog-meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 13px;
}
.blog-meta-list dt { font-weight: 700; color: var(--muted); }
.blog-meta-list dd { margin: 0; overflow-wrap: anywhere; }
.blog-meta-list .char-count { margin-left: 8px; }
.blog-tag { margin: 0 4px 4px 0; }
.blog-sent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--green);
  padding: 8px 12px;
  font-weight: 700;
}
.blog-error p { margin: 0; }
.blog-problems { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.blog-problems.warn { color: var(--danger); font-weight: 600; }
.pp-text.pp-markdown { font-family: var(--font-mono); font-size: 12.5px; }
.blog-meta-editor {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
[data-post-card].is-editing .blog-meta-editor { display: grid; }
.blog-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.blog-field-label { font-weight: 700; }
.blog-field input,
.blog-field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 6px 8px;
  font: inherit;
}

/* Manual platforms: approved post waiting to be posted by hand. */
.manual-post {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px 14px;
}
.manual-post.overdue { box-shadow: inset 6px 0 0 var(--accent); padding-left: 20px; }
.manual-post .manual-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-family: var(--font-label);
  font-size: 11px;
}
.manual-post .manual-title { font-weight: 700; color: var(--ink); }
.manual-post .manual-when { color: var(--muted); }
.manual-post .manual-hint { margin: 8px 0 10px; font-size: 13px; color: var(--ink); }
.manual-post .manual-text {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
}
.manual-post .queue-actions { margin-top: 10px; }
.manual-post form.push { margin-left: auto; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ── Calendar — month grid of beat blocks ─────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cal-toolbar .titling { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-title {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.cal-card { overflow: hidden; background: var(--paper); }
.cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.cal-grid-head .weekday {
  padding: 9px 10px;
  font-family: var(--font-label);
  font-size: 10px;
  color: var(--muted);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell {
  min-height: 108px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-grid:last-child .cal-cell { border-bottom: none; }
.cal-daynum { display: flex; align-items: center; gap: 6px; }
.cal-cell.tall { min-height: 240px; }
.cal-cell.out { background: var(--panel); }
.cal-cell .num {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--faint);
}
.cal-cell.in .num { color: var(--muted); }
.cal-cell.today .num { color: var(--amber-ink); font-weight: 700; }
.cal-cell .today-mark {
  font-family: var(--font-label);
  font-size: 9px;
  color: var(--ink);
  background: var(--amber);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 4px;
}
/* Events: little beat blocks, status-colored. */
.cal-event {
  display: block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 3px 7px;
  min-width: 0;
  text-decoration: none !important;
  transition: background-color var(--ease);
}
.cal-event .dot { display: none; }
.cal-event .time {
  display: block;
  font-family: var(--font-label);
  font-size: 9px;
}
.cal-event .label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event.status-draft:hover { background: #fbbf24; }
.cal-event .auto-mark {
  display: inline-block;
  margin-top: 2px;
  padding: 0 4px;
  border: 1px dashed currentColor;
  border-radius: 3px;
  font-family: var(--font-label);
  font-size: 9px;
}
.cal-event.status-approved .time { color: var(--faint); }
.cal-event.status-approved:hover { background: #1f2937; }
.cal-event.status-scheduled:hover { background: #6d28d9; }
.cal-event.status-published:hover { background: #2bb8bd; }
.cal-event.status-failed:hover { background: #b91c33; }
.cadence-app .cal-event.to-post,
.cadence-app .cal-event.to-post:hover { color: var(--ink); background: var(--paper); border: 1.5px dashed var(--line-strong); }
.cadence-app .cal-event.to-post:hover { border-color: var(--ink); }
.cal-event.to-post .time { color: var(--muted); }

/* ── Forms ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field > label {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.field .helptext { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.5; }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field > legend {
  padding: 0;
  margin-bottom: 6px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.field input[type="text"],
.field input[type="url"],
.field input[type="number"],
.field input[type="time"],
.field input[type="password"],
.field input[type="email"],
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink);
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  transition: box-shadow var(--ease);
}
.field select { max-width: 320px; }
.field input[type="time"] { max-width: 160px; font-family: var(--font-label); }
.field input[type="number"] { max-width: 160px; font-family: var(--font-label); }
/* Number input + unit label (e.g. "240 min"). */
.input-suffixed { display: inline-flex; align-items: center; gap: 8px; }
.input-suffix {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--muted);
}
.field textarea { max-width: none; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  box-shadow: var(--ring); border-color: var(--accent-ink);
}
.field ::placeholder { color: var(--faint); }
/* Code-ish editors: JSON config, HTML templates, CSS. */
.field textarea.code,
.field input.code,
pre.code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--paper);
  min-height: 120px;
  resize: vertical;
  tab-size: 2;
}
pre.code {
  min-height: 0;
  overflow-x: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field input[type="checkbox"] { width: auto; max-width: none; accent-color: var(--accent-ink); }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

/* Platform toggle pills: bordered chips, selected = ink bg. */
.platform-pills > div,
.platform-pills ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.platform-pills li { display: contents; }
.platform-pills label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  transition: background-color var(--ease), color var(--ease);
}
.platform-pills label:has(input[type="checkbox"]):hover { background: var(--paper); }
.platform-pills input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.platform-pills label:has(input:checked) {
  background: var(--ink);
  color: var(--panel);
}
.platform-pills label:has(input:checked)::before { content: "✓"; font-size: 11px; }
.platform-pills label:has(input:focus-visible) {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.errorlist {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}
.errorlist li + li { margin-top: 4px; }

/* ── Configure page ───────────────────────────────────────────── */
.config-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.config-nav {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  overflow-x: auto;
  flex-wrap: wrap;
}
.config-section { scroll-margin-top: 16px; }
.config-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.config-section .section-head .card-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.config-section .section-desc {
  padding: 0 20px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.55;
}
.config-section .section-body { padding: 0 20px 18px; }
.config-section .section-body > .field:last-child { margin-bottom: 0; }

/* Destructive surfaces (danger zone, project delete). */
.cadence-app .danger-card { border-color: var(--danger); }
.cadence-app .danger-card .section-head { border-bottom-color: var(--danger); }
.cadence-app .danger-card .card-title,
.cadence-app .danger-card .kicker { color: var(--danger); }
.cadence-app .danger-card .btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.cadence-app .danger-card .btn-danger:hover { background: #b91c33; color: #fff; }
.cadence-app .cascade-summary {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-family: var(--font-label);
  font-size: 12px;
}
.cadence-app .cascade-summary strong { color: var(--danger); }
.cadence-app .danger-zone { margin-top: var(--space-4); }

/* Formset entries: one bordered sub-module per existing row. */
.subforms { display: flex; flex-direction: column; gap: 12px; }
.subform {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px 10px;
}
.subform .subform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 16px;
  align-items: start;
}
.subform .subform-grid .field { margin-bottom: 10px; }
.subform .wide { grid-column: 1 / -1; }
.subform-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px dashed var(--line-strong);
}
/* The delete checkbox styled as a remove chip. */
.remove-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-left: auto;
  box-sizing: border-box;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease);
}
.remove-toggle:hover { color: var(--danger); border-color: var(--danger); background: var(--paper); }
.remove-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.remove-toggle:has(input:checked) {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}
.remove-toggle:has(input:checked)::after { content: "— removed on save"; }
.remove-toggle:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* "Add …" disclosure holding the blank extra form. Works without JS. */
.add-entry { border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.add-entry > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 16px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--ease);
}
.add-entry > summary::-webkit-details-marker { display: none; }
.add-entry > summary:hover { background: var(--panel); }
.add-entry[open] { border-style: solid; background: var(--paper); }
.add-entry[open] > summary { border-bottom: 1px dashed var(--line-strong); border-radius: var(--radius) var(--radius) 0 0; }
.add-entry .subform { border: none; background: none; padding: 14px 16px 10px; }

.configured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 10px;
  color: #fff;
  background: var(--green-ink);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
}
.form-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}

/* Get-started checklist for freshly created projects. */
.checklist { background: var(--panel); }
.checklist .inner { padding: 16px 20px; }
.checklist .title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.checklist ol { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--ink); line-height: 1.9; }
.checklist a { color: inherit; }

/* ── Auth (entrance) pages ────────────────────────────────────── */
.entrance {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px;
  box-sizing: border-box;
}
.entrance .entrance-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.entrance .entrance-brand a {
  color: var(--ink);
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
.entrance-module {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.entrance-module h1 {
  font-size: 20px;
  font-weight: 700;
}
.entrance-module p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.entrance-module form { display: flex; flex-direction: column; gap: 4px; }
.entrance-module .field { margin-bottom: var(--space-3); }
.entrance-module .btn { width: 100%; }
.entrance .entrance-foot {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.entrance-module .panel { margin-bottom: 14px; }
.entrance-module .chip-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-label);
  font-size: 12px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-size: 10px;
  color: var(--muted);
}

/* ── Content library (Library page + review queue's proposed ideas) ── */
.library-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.library-stats .stat { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; }
.library-stats .big { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.library-stats .stat-line { font-size: 15px; font-weight: 700; line-height: 1.3; }
.library-stats .mono { font-size: 11px; color: var(--muted); }
.idea-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.idea-filters select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  height: 30px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
}
.idea-card { display: flex; flex-direction: column; gap: 8px; }
.idea-card .idea-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.idea-card .idea-title { font-size: 15px; }
.idea-card .idea-key { font-size: 11px; color: var(--muted); }
.idea-card .idea-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.idea-card .idea-hook { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.5; }
.idea-card .idea-angle { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.55; max-width: 80ch; }
.idea-card .idea-sources { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.6; }
.idea-card .idea-foot { flex-wrap: wrap; }
.idea-card .idea-usage { font-size: 11px; color: var(--muted); }
.idea-card .idea-actions { margin-left: auto; }
.idea-card .idea-actions form { display: inline-flex; gap: 8px; }
.idea-card .idea-edit { margin-top: 4px; }
.idea-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 16px;
}
.idea-add-grid .wide { grid-column: 1 / -1; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .track-grid { grid-template-columns: 120px repeat(7, minmax(0, 1fr)); }
  .deck { flex-direction: column; }
  .deck .output { width: auto; }
}
@media (max-width: 720px) {
  .shell { padding: 12px 12px 40px; }
  .console { padding: 10px 14px; }
  .console .week-ind { margin-left: 0; }
  .console .status-chips { margin-left: 0; }
  .cal-cell { min-height: 72px; }
  .cal-event .label { display: none; }
  .track-grid { grid-template-columns: 90px repeat(7, minmax(0, 1fr)); gap: 4px; }
  .beat { padding: 4px 6px; }
  .beat .beat-label { display: none; }
}

.media-lightbox .lightbox-close:hover { background: var(--accent); color: var(--ink); }

/* Post detail → Dialogue script. Speaker A (sceptic) wears the accent,
   speaker B ink; both read as tags in the line table. */
.dialogue-table td { vertical-align: top; padding: 6px 4px; border-top: 1px solid var(--faint); }
.dialogue-table .line-say { font-size: 13px; }
.dialogue-table .line-show { font-size: 11px; color: var(--muted); margin-top: 2px; }
.speaker-badge {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: nowrap;
}
.speaker-badge.speaker-a { background: var(--accent); color: #fff; }
.speaker-badge.speaker-b { background: var(--ink); color: var(--paper); }
.dialogue-line.speaker-a td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.dialogue-line.speaker-b td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
.board-chip { font-size: 10px; margin: 0 4px 4px 0; white-space: nowrap; }
.line-edit { margin-top: 6px; }
.line-edit > summary { cursor: pointer; }
.line-edit form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dialogue-facts { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pill.fact-example { background: var(--amber); }
.pill.fact-sourced { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.pill.fact-mcp { background: var(--panel); }
.speaker-field textarea { min-height: 64px; }

/* Dialogue theme section */
.theme-preview { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.theme-preview-img { width: 270px; height: auto; border: 1px solid var(--line); }
.theme-preview-meta { display: flex; flex-direction: column; gap: 10px; }
.theme-fieldset { border: 0; margin: 0 0 14px; padding: 0; }
.theme-fieldset input[type="color"] { width: 64px; height: 36px; padding: 2px; }

/* ── Configure: one page per section, side nav ────────────────── */
.content.config-wide { max-width: 1180px; width: 100%; }
.config-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.config-main { min-width: 0; }
.config-sidenav { position: sticky; top: 16px; }
.config-sidenav-list { display: flex; flex-direction: column; gap: var(--space-4); }
.config-nav-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.config-nav-label {
  font-family: var(--font-label);
  font-size: 11.5px;
  padding-left: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.cadence-app .config-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--ease), border-color var(--ease);
}
.cadence-app .config-nav-link:hover { background: rgb(255 255 255 / 60%); border-color: transparent; color: var(--ink); }
.cadence-app .config-nav-link.on { background: var(--paper); border-color: transparent; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-pill); }
.cadence-app .config-nav-link.danger { color: var(--danger); }
.cadence-app .config-nav-link.danger.on { background: var(--danger); border-color: transparent; color: #fff; }
.cadence-app .config-nav-link.quiet { color: var(--muted); font-size: 12px; }
.nav-dot {
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--amber);
  border: 1px solid var(--line);
  box-sizing: border-box;
  flex: none;
}
.config-jump { display: none; align-items: center; gap: 8px; }
.config-jump select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
}
.config-crumbs { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
.pillar-table td { vertical-align: top; }
.pillar-table .pillar-name { font-family: var(--font-sans); font-size: 14px; font-weight: 700; color: var(--ink); }
.pillar-table .pillar-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pillar-table .row-actions { white-space: nowrap; text-align: right; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 900px) {
  .config-shell { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .config-sidenav { position: static; }
  .config-sidenav-list { display: none; }
  .config-jump { display: flex; }
}

/* ── Founder log (review page) ── */
.founder-entry.is-hidden { opacity: 0.55; }
.founder-entry .founder-sources { margin: 0; font-size: 11px; color: var(--muted); }
.founder-note .field { margin-bottom: 0; }
