/* Campaign HQ — Elevation Brand System v1.0, in a tool register.
   Cream and ink carry the surface; the red is reserved for the one thing that matters. */

:root {
  --font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --red: #bb0404;
  --cream: #f2e9da;
  --cream-card: #fbf6ec;
  --cream-panel: #ece0cc;
  --ink: #16110e;
  --ink-deep: #120d0b;

  --page: #f6f0e4;
  --surface: var(--cream-card);
  --surface-2: #f3ecdd;
  --line: rgba(22, 17, 14, 0.13);
  --line-soft: rgba(22, 17, 14, 0.07);
  --text: var(--ink);
  --text-mid: rgba(22, 17, 14, 0.66);
  --text-dim: rgba(22, 17, 14, 0.45);
  --shadow: 0 1px 2px rgba(22, 17, 14, 0.05), 0 6px 18px -10px rgba(22, 17, 14, 0.22);
  --shadow-lift: 0 2px 4px rgba(22, 17, 14, 0.07), 0 18px 40px -18px rgba(22, 17, 14, 0.35);

  /* piece states — what you scan the screen for */
  --s-idea: #9a8f82;
  --s-written: #4a6fa5;
  --s-ready: #b26a00;
  --s-scheduled: #0f766e;
  --s-out: #6a6157;
  --s-skipped: #a9a29a;

  /* brands */
  --b-eec: #1565c0;
  --b-edc: #c0561a;
  --b-both: #6a4c93;
  --b-personal: #16110e;
  --b-ecs: #0f766e;

  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 8px;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #14100d;
    --surface: #1e1815;
    --surface-2: #241d19;
    --line: rgba(242, 233, 218, 0.14);
    --line-soft: rgba(242, 233, 218, 0.08);
    --text: #f2e9da;
    --text-mid: rgba(242, 233, 218, 0.66);
    --text-dim: rgba(242, 233, 218, 0.42);
    --red: #e23b3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px -10px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
    --s-idea: #a89c8d;
    --s-written: #7ea3d8;
    --s-ready: #e0a33c;
    --s-scheduled: #35a99c;
    --s-out: #9b9186;
    --b-eec: #4a8cd4;
    --b-edc: #ce7433;
    --b-both: #a98cd8;
    --b-personal: #f2e9da;
    --b-ecs: #35a99c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

::selection { background: rgba(187, 4, 4, 0.16); }

/* ─────────────────── shell ─────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 58px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-weight: 800; letter-spacing: -0.02em; font-size: 17px;
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
}
.wordmark .dot { width: 9px; height: 9px; background: var(--red); border-radius: 2px; }

.nav { display: flex; gap: 2px; }
.nav button {
  border: 0; background: none; cursor: pointer;
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--text-mid);
}
.nav button:hover { background: var(--line-soft); color: var(--text); }
.nav button[aria-current='true'] { background: var(--ink); color: var(--cream); }
@media (prefers-color-scheme: dark) { .nav button[aria-current='true'] { background: var(--cream); color: var(--ink); } }

.topbar .spacer { flex: 1; }

.whoami {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-mid);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 5px 10px; background: none; cursor: pointer;
}
.whoami:hover { border-color: var(--text-dim); }

.saveflag {
  font-size: 12px; color: var(--text-dim); min-width: 74px; text-align: right;
  transition: color 0.2s;
}
.saveflag[data-state='saving'] { color: var(--s-ready); }
.saveflag[data-state='error'] { color: var(--red); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 26px 20px 120px; }

.page-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -0.025em;
}
.page-head .sub { color: var(--text-mid); font-size: 14px; margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* ─────────────────── controls ─────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text-dim); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #a10303; border-color: #a10303; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-mid); }
.btn.ghost:hover { background: var(--line-soft); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: rgba(187, 4, 4, 0.08); border-color: var(--red); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field > .label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}
.input, .select, .textarea {
  width: 100%; background: var(--page); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--text-mid);
  box-shadow: 0 0 0 3px rgba(22, 17, 14, 0.07);
}
.textarea { min-height: 108px; resize: vertical; line-height: 1.55; font-size: 15px; }
.select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 150px; }

.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chipset button {
  border: 1px solid var(--line); background: none; cursor: pointer;
  padding: 5px 11px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-mid);
}
.chipset button[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--cream); font-weight: 500; }
@media (prefers-color-scheme: dark) { .chipset button[aria-pressed='true'] { background: var(--cream); border-color: var(--cream); color: var(--ink); } }

/* ─────────────────── board ─────────────────── */

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 18px; cursor: pointer; text-align: left;
  transition: box-shadow 0.16s, transform 0.16s, border-color 0.16s;
  display: flex; flex-direction: column; gap: 11px;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--text-dim); }

.card-top { display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.25; }
.card .goal {
  color: var(--text-mid); font-size: 14px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.card .next { font-size: 13px; color: var(--text-mid); border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: auto; }
.card .next b { font-weight: 600; color: var(--text); }

.brandchip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 2px; color: #fff; background: var(--text-dim);
}
.brandchip[data-b='eec'] { background: var(--b-eec); }
.brandchip[data-b='edc'] { background: var(--b-edc); }
.brandchip[data-b='both'] { background: var(--b-both); }
.brandchip[data-b='personal'] { background: var(--b-personal); color: var(--page); }
.brandchip[data-b='ecs'] { background: var(--b-ecs); }

.statuspill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--text-mid);
}
.statuspill[data-s='live'] { background: var(--red); border-color: var(--red); color: #fff; }
.statuspill[data-s='done'] { color: var(--s-scheduled); border-color: var(--s-scheduled); }
.statuspill[data-s='archived'] { opacity: 0.6; }

.bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line-soft); }
.bar span { display: block; }
.bar-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.bar-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }

/* ─────────────────── campaign view ─────────────────── */

.crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--text-mid); }
.crumb button { border: 0; background: none; cursor: pointer; color: var(--text-mid); padding: 4px 6px; border-radius: var(--r-sm); }
.crumb button:hover { background: var(--line-soft); color: var(--text); }

.camp-head {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.camp-head h1 {
  margin: 0 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 2px 5px; margin-left: -5px;
}
.camp-head h1:focus { outline: none; border-color: var(--line); background: var(--page); }
.camp-goal {
  color: var(--text-mid); font-size: 15px; margin: 0; padding: 3px 5px; margin-left: -5px;
  border: 1px solid transparent; border-radius: var(--r-sm); min-height: 24px;
}
.camp-goal:focus { outline: none; border-color: var(--line); background: var(--page); color: var(--text); }
.camp-goal:empty::before { content: attr(data-placeholder); color: var(--text-dim); }
.camp-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.camp-meta .select, .camp-meta .input { width: auto; flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--text-mid); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--cream); font-weight: 500; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed='true'] { background: var(--cream); color: var(--ink); } }

.daygroup { margin-bottom: 22px; }
.dayhead {
  display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px;
  position: sticky; top: 58px; background: var(--page); z-index: 10;
}
.dayhead .d { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.dayhead .r { font-size: 13px; color: var(--text-dim); }
.dayhead.today .d { color: var(--red); }

.piece {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--s-idea);
  border-radius: var(--r-md); margin-bottom: 7px; overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.piece[data-state='written'] { border-left-color: var(--s-written); }
.piece[data-state='ready'] { border-left-color: var(--s-ready); }
.piece[data-state='scheduled'] { border-left-color: var(--s-scheduled); }
.piece[data-state='out'] { border-left-color: var(--s-out); }
.piece[data-state='skipped'] { border-left-color: var(--s-skipped); opacity: 0.55; }
.piece:hover { box-shadow: var(--shadow); }
.piece.open { box-shadow: var(--shadow-lift); }

.piece-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer;
  min-height: var(--tap);
}
.piece-row .kind {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-dim); width: 46px; flex: 0 0 46px;
}
.piece-row .title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece[data-state='skipped'] .piece-row .title { text-decoration: line-through; }
.piece-row .preview { color: var(--text-dim); font-size: 13px; flex: 2; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-row .time { font-size: 13px; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.statedot { width: 9px; height: 9px; border-radius: 50%; background: var(--s-idea); flex: 0 0 9px; display: inline-block; }
.piece[data-state='written'] .statedot { background: var(--s-written); }
.piece[data-state='ready'] .statedot { background: var(--s-ready); }
.piece[data-state='scheduled'] .statedot { background: var(--s-scheduled); }
.piece[data-state='out'] .statedot { background: var(--s-out); }
.piece[data-state='skipped'] .statedot { background: var(--s-skipped); }

.chanchips { display: flex; gap: 4px; }
.chanchip {
  font-size: 11px; padding: 2px 6px; border-radius: 2px;
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--text-mid);
}
.who {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-mid);
}

.editor { border-top: 1px solid var(--line); padding: 16px 14px; background: var(--page); }
.editor .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor .actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.editor .actions .spacer { flex: 1; }
.counter { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.media-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.media-thumb {
  position: relative; width: 74px; height: 74px; border-radius: var(--r-md);
  overflow: hidden; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center;
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.62); color: #fff; border: 0; cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.dropzone {
  width: 74px; height: 74px; border: 1px dashed var(--line); border-radius: var(--r-md);
  display: grid; place-items: center; cursor: pointer; color: var(--text-dim); font-size: 22px;
  background: none;
}
.dropzone:hover, .dropzone.over { border-color: var(--red); color: var(--red); }

/* ─────────────────── the piece sheet ───────────────────
   One piece, one page, and the page IS the script. Nothing lives in a box: a border
   around every field turns writing a campaign into filling in a form, and the whole
   point is that it should feel like writing. Fields show themselves on hover and focus
   and are otherwise invisible. */

.sheet-scrim { padding: 0; align-items: stretch; }
.sheet {
  background: var(--page); width: 100%; max-width: 820px; margin: 0 auto;
  display: flex; flex-direction: column; height: 100vh;
  animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sheet-bar {
  display: flex; gap: 6px; align-items: center; padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface); flex: 0 0 auto;
}
.sheet-bar .spacer { flex: 1; }
.sheet-where { font-size: 13px; color: var(--text-dim); }
.sheet-bar .btn[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
@media (prefers-color-scheme: dark) { .sheet-bar .btn[aria-pressed='true'] { background: var(--cream); border-color: var(--cream); color: var(--ink); } }

.sheet-body { overflow-y: auto; padding: 30px 30px 120px; }
.sheet-section { margin-bottom: 34px; }

.sheet-rule {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim); padding-bottom: 7px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

/* ── fields you type on, not into ── */

.paper {
  width: 100%; display: block;
  border: 0; background: transparent; color: inherit;
  padding: 3px 6px; margin: 0 0 0 -6px;
  border-radius: var(--r-sm); resize: none; overflow: hidden;
  font: inherit; line-height: inherit;
  transition: background 0.12s;
}
.paper:hover { background: var(--line-soft); }
.paper:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.paper::placeholder { color: var(--text-dim); font-weight: 400; }

.sheet-title {
  font-size: 31px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 4px; margin-left: -6px;
}
.sheet-hook {
  font-size: 21px; font-weight: 600; line-height: 1.4; margin-bottom: 30px;
  padding-left: 14px; border-left: 3px solid var(--red); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.sheet-hook:focus { box-shadow: none; background: var(--surface); }
.sheet-cta {
  font-size: 19px; font-weight: 600; line-height: 1.4; margin-top: 22px;
  padding-left: 14px; border-left: 3px solid var(--s-ready); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.sheet-cta:focus { box-shadow: none; background: var(--surface); }
.sheet-copy { font-size: 16px; line-height: 1.62; }
.sheet-extra { font-size: 14px; color: var(--text-mid); margin-top: 6px; }
.sheet-note { font-size: 14px; color: var(--text-mid); line-height: 1.55; }
.sheet-headline { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.sheet-adline { margin-bottom: 12px; }

/* ── the quiet settings line ── */

.sheet-settings {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  margin: 0 0 30px -4px;
}
.sheet-settings .chip { display: inline-flex; align-items: center; gap: 2px; }
.sheet-settings .select,
.sheet-settings .bare {
  border: 0; background: transparent; color: var(--text-mid);
  font-size: 13px; padding: 4px 7px; border-radius: var(--r-sm); width: auto;
  transition: background 0.12s, color 0.12s; cursor: pointer;
}
.sheet-settings .select { padding-right: 22px; background-position: calc(100% - 11px) 52%, calc(100% - 7px) 52%; }
.sheet-settings .select:hover,
.sheet-settings .bare:hover { background: var(--line-soft); color: var(--text); }
.sheet-settings .select:focus,
.sheet-settings .bare:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.sheet-settings button.bare { border: 0; }
.sheet-settings .bare.unset { padding: 4px 5px; font-size: 12px; opacity: 0; transition: opacity 0.12s; }
.sheet-settings .chip:hover .bare.unset { opacity: 1; }
.sheet-bar .btn.quiet { color: var(--text-dim); }
.sheet-bar .btn.quiet:hover { color: var(--red); background: rgba(187, 4, 4, 0.08); }
.sheet-settings .chan { gap: 3px; margin: 0 2px; }
.sheet-settings .chan button {
  border: 0; background: var(--line-soft); color: var(--text-dim); cursor: pointer;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 6px; border-radius: 2px; transition: background 0.12s, color 0.12s;
}
.sheet-settings .chan button[aria-pressed='true'] { background: var(--b-eec); color: #fff; }

/* ── shots ── */

.shot {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0; position: relative;
  border-top: 1px solid var(--line-soft);
}
.shot:first-of-type { border-top: 0; }

.shot-n {
  flex: 0 0 22px; text-align: right;
  font-size: 13px; font-weight: 700; color: var(--text-dim);
  font-variant-numeric: tabular-nums; padding-top: 7px;
}
.shot-main { flex: 1; min-width: 0; }

.shot-see { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.paper.see {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-mid); flex: 1;
}
.paper.see::placeholder { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 400; }

.secs-wrap { display: inline-flex; align-items: baseline; color: var(--text-dim); flex: 0 0 auto; }
.bare.secs {
  border: 0; background: transparent; color: var(--text-dim); width: 34px; text-align: right;
  font-size: 12px; padding: 3px 0; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.bare.secs::-webkit-outer-spin-button, .bare.secs::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bare.secs:focus { outline: none; color: var(--text); }
.secs-unit { font-size: 12px; }

.paper.say { font-size: 21px; line-height: 1.45; font-weight: 500; letter-spacing: -0.012em; }
.paper.note { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-top: 4px; }
.paper.note::placeholder { font-style: italic; }

.shot-controls {
  position: absolute; top: 8px; right: 0; display: flex; gap: 1px;
  opacity: 0; transition: opacity 0.12s; background: var(--page);
}
.shot:hover .shot-controls, .shot:focus-within .shot-controls { opacity: 1; }
.shot-controls button {
  border: 0; background: none; color: var(--text-dim); cursor: pointer;
  width: 24px; height: 24px; border-radius: var(--r-sm); font-size: 13px; line-height: 1;
}
.shot-controls button:hover:not(:disabled) { background: var(--line-soft); color: var(--text); }
.shot-controls button:last-child:hover { background: rgba(187, 4, 4, 0.12); color: var(--red); }
.shot-controls button:disabled { opacity: 0.2; cursor: default; }

.shot.rehearse { border-top: 0; padding: 16px 0; }
.shot.rehearse .paper.say { font-size: 26px; line-height: 1.4; }

.sheet-tools { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.sheet-tools .spacer { flex: 1; }
.runtime { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.shotflag {
  font-size: 11px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.scrim.stacked { z-index: 70; }

@media (max-width: 860px) {
  .sheet-body { padding: 22px 18px 110px; }
  .sheet-title { font-size: 25px; }
  .sheet-hook { font-size: 18px; }
  .paper.say { font-size: 19px; }
  .shot.rehearse .paper.say { font-size: 22px; }
  .shot { gap: 10px; }
  .shot-controls { opacity: 1; }
}

@media print {
  .topbar, .sheet-bar, .toolbar, .sheet-tools, .shot-controls, .sheet-settings { display: none !important; }
  .scrim { position: static; background: none; padding: 0; backdrop-filter: none; }
  .sheet { height: auto; max-width: none; animation: none; }
  .sheet-body { overflow: visible; padding: 0; }
  .paper { color: #000; }
  .paper.say { font-size: 14pt; }
  .shot { break-inside: avoid; }
  body { background: #fff; color: #000; }
}


/* ─────────────────── calendar ─────────────────── */

.cal { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); }
.cal-head div { padding: 8px; font-size: 12px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; text-align: center; }
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 108px; border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  padding: 5px; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.dim { background: var(--surface-2); opacity: 0.55; }
.cal-cell.today { background: rgba(187, 4, 4, 0.05); }
.cal-cell .n { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.cal-cell.today .n { color: var(--red); }
.cal-cell.over { background: rgba(187, 4, 4, 0.1); outline: 2px solid var(--red); outline-offset: -2px; }
.cal-piece {
  font-size: 11px; padding: 3px 5px; border-radius: 3px; cursor: grab;
  background: var(--surface-2); border-left: 3px solid var(--s-idea);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-piece[data-state='written'] { border-left-color: var(--s-written); }
.cal-piece[data-state='ready'] { border-left-color: var(--s-ready); }
.cal-piece[data-state='scheduled'] { border-left-color: var(--s-scheduled); }
.cal-piece[data-state='out'] { border-left-color: var(--s-out); }

/* ─────────────────── week view ─────────────────── */

.split { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px; }
.panel h2 .count {
  font-size: 12px; font-weight: 700; background: var(--red); color: #fff;
  border-radius: 2px; padding: 1px 6px;
}
.nudge { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.nudge:last-child { border-bottom: 0; }
.nudge:hover .nt { color: var(--red); }
.nudge .nt { font-weight: 600; font-size: 14px; }
.nudge .nm { font-size: 12px; color: var(--text-dim); }

.checkitem { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.checkitem:last-child { border-bottom: 0; }
.checkitem input { width: 18px; height: 18px; accent-color: var(--red); flex: 0 0 18px; }
.checkitem.done .ct { text-decoration: line-through; color: var(--text-dim); }

/* ─────────────────── overlays ─────────────────── */

.scrim {
  position: fixed; inset: 0; background: rgba(18, 13, 11, 0.5); z-index: 60;
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-lift); width: min(560px, 100%); max-height: 86vh; overflow: auto;
  padding: 22px;
}
.modal h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.modal .lede { color: var(--text-mid); font-size: 14px; margin: 0 0 18px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.tpl {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; cursor: pointer;
  background: var(--page); text-align: left;
}
.tpl:hover, .tpl[aria-pressed='true'] { border-color: var(--red); background: rgba(187, 4, 4, 0.05); }
.tpl b { display: block; font-size: 14px; margin-bottom: 3px; }
.tpl span { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 90;
  background: var(--ink); color: var(--cream); padding: 11px 18px; border-radius: var(--r-sm);
  font-size: 14px; box-shadow: var(--shadow-lift); max-width: 90vw;
}
.toast.err { background: var(--red); color: #fff; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty h2 { font-size: 20px; color: var(--text); margin: 0 0 6px; font-weight: 700; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(400px, 100%); }
.gate h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px;
  display: flex; align-items: center; gap: 10px; }
.gate .dot { width: 11px; height: 11px; background: var(--red); border-radius: 2px; }
.gate p { color: var(--text-mid); margin: 0 0 22px; font-size: 14px; }

.skel { background: var(--line-soft); border-radius: var(--r-md); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ─────────────────── phone ─────────────────── */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .editor .row2 { grid-template-columns: 1fr; }
  main { padding: 18px 14px 110px; }
  .topbar { padding: 0 14px; gap: 12px; height: 54px; }
  .wordmark span:not(.dot) { display: none; }
  .nav { flex: 1; }
  .nav button { flex: 1; padding: 7px 8px; }
  .page-head h1 { font-size: 23px; }
  .camp-head h1 { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .piece-row .preview, .piece-row .kind { display: none; }
  .cal-cell { min-height: 62px; }
  .cal-piece { font-size: 0; padding: 3px; height: 8px; }
  .dayhead { top: 54px; }
  .modal { max-height: 92vh; }
}

@media (max-width: 500px) {
  .card { padding: 15px; }
}

/* ═══════════════════ the polish layer ═══════════════════
   Motion with intent, one easing curve everywhere, and the small things you only
   notice when they are missing. */

:root {
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── selection, focus, scrollbars ── */

::selection { background: color-mix(in srgb, var(--red) 22%, transparent); }

:focus-visible { outline: 2px solid color-mix(in srgb, var(--red) 60%, transparent); outline-offset: 2px; border-radius: var(--r-sm); }

* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: 6px; border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 30%, transparent); background-clip: content-box; }

/* ── topbar ── */

.seek {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: var(--page); color: var(--text-dim);
  padding: 5px 8px 5px 12px; border-radius: var(--r-sm); font-size: 13px; cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.seek:hover { border-color: var(--text-dim); color: var(--text); }
.seek kbd, .palette-top kbd {
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-dim); background: var(--line-soft);
  border-radius: 3px; padding: 2px 5px; line-height: 1;
}
@media (max-width: 860px) { .seek span { display: none; } .seek { padding: 5px 8px; } }

.saveflag {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
  background: transparent; transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  min-width: 0; text-align: initial;
}
.saveflag[data-state='saving'] { background: var(--s-ready); animation: breathe 1.1s ease-in-out infinite; }
.saveflag[data-state='saved'] { background: var(--s-scheduled); }
.saveflag[data-state='error'] { background: var(--red); transform: scale(1.35); }
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ── the command palette ── */

.palette-scrim { align-items: flex-start; padding-top: 12vh; background: rgba(18, 13, 11, 0.42); }
.palette {
  width: min(620px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden; animation: drop 0.2s var(--ease-out);
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px) scale(0.985); } to { opacity: 1; transform: none; } }

.palette-top { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-bottom: 1px solid var(--line); }
.palette-input {
  flex: 1; border: 0; background: transparent; color: var(--text);
  padding: 16px 12px; font-size: 16px;
}
.palette-input:focus { outline: none; }
.palette-input::placeholder { color: var(--text-dim); }

.palette-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; color: inherit;
  padding: 9px 10px; border-radius: var(--r-md); font-size: 14px;
}
.palette-row.on { background: var(--line-soft); }
.palette-mark { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; background: var(--text-dim); }
.palette-mark.campaign { background: var(--b-eec); }
.palette-mark.do { background: var(--red); border-radius: 1px; }
.palette-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { margin-left: auto; font-size: 12px; color: var(--text-dim); white-space: nowrap; padding-left: 12px; }
.palette-none { padding: 26px 12px; text-align: center; color: var(--text-dim); font-size: 14px; }

/* ── motion on the things you touch ── */

.card { transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease), border-color 0.22s var(--ease); }
.card:active { transform: translateY(-1px) scale(0.996); }

.piece { transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease); }
.piece:hover { background: var(--surface-2); }

.btn { transition: background 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease), transform 0.08s var(--ease); }
.btn.primary { box-shadow: 0 1px 2px rgba(187, 4, 4, 0.25); }

.sheet { animation: rise 0.26s var(--ease-out); }
.sheet-scrim { animation: fade 0.2s var(--ease); }
.scrim { animation: fade 0.16s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { animation: toastin 0.26s var(--ease-out); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal { animation: drop 0.22s var(--ease-out); }

/* ── the campaign header's quiet line ── */

.camp-meta { margin-bottom: 0; margin-top: 12px; }
.chip-to { font-size: 12px; color: var(--text-dim); padding: 0 2px; }

.tally { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.tally-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.tally-item i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.tally-item b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── numbers line up ── */

.time, .runtime, .shotflag, .counter, .cal-cell .n { font-variant-numeric: tabular-nums; }

/* ── empty states with something to do ── */

.empty { padding: 64px 20px; }
.empty h2 { font-size: 19px; }
.empty p { max-width: 42ch; margin: 0 auto 18px; line-height: 1.55; }

/* ── loading that matches what arrives ── */

.skel { background: linear-gradient(100deg, var(--line-soft) 30%, var(--surface-2) 50%, var(--line-soft) 70%);
  background-size: 220% 100%; animation: sweep 1.5s ease-in-out infinite; }
@keyframes sweep { from { background-position: 180% 0; } to { background-position: -40% 0; } }

/* ── board refinements ── */

.grid { gap: 18px; }
.card { padding: 20px; gap: 12px; border-radius: 10px; }
.card h3 { font-size: 20px; letter-spacing: -0.02em; }
.card .goal { font-size: 13.5px; }
.card .bar { height: 5px; border-radius: 3px; }
.card .meta { font-size: 12.5px; gap: 8px; }
.card .next { font-size: 12.5px; padding-top: 11px; }

/* The filter row is navigation, not content — it should sit back. */
.page-head + .chipset { margin-bottom: 20px; }
.page-head + .chipset button { border-color: transparent; padding: 5px 10px; }
.page-head + .chipset button:hover { background: var(--line-soft); color: var(--text); }
.page-head + .chipset button[aria-pressed='true'] { background: var(--line-soft); color: var(--text); border-color: transparent; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .page-head + .chipset button[aria-pressed='true'] { background: var(--line-soft); color: var(--text); }
}

/* ── the light side of the brand, which is the real one ── */

@media (prefers-color-scheme: light) {
  .card { box-shadow: 0 1px 2px rgba(22, 17, 14, 0.04), 0 8px 22px -14px rgba(22, 17, 14, 0.28); }
  .card:hover { box-shadow: 0 2px 4px rgba(22, 17, 14, 0.06), 0 20px 44px -20px rgba(22, 17, 14, 0.34); }
  .palette { box-shadow: 0 24px 60px -20px rgba(22, 17, 14, 0.32), 0 2px 6px rgba(22, 17, 14, 0.06); }
  .palette-scrim { background: rgba(22, 17, 14, 0.24); }
  .sheet-scrim, .scrim { background: rgba(22, 17, 14, 0.3); }
  .paper:focus { box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(22, 17, 14, 0.04); }
  .topbar { background: color-mix(in srgb, var(--cream-card) 82%, transparent); }
}

/* ── one more pass on the sheet ── */

.sheet { box-shadow: 0 0 80px -20px rgba(0, 0, 0, 0.5); }
.sheet-body { scroll-padding-top: 20px; }
.sheet-title::placeholder { font-weight: 800; }
.shot { transition: background 0.14s var(--ease); border-radius: var(--r-md); }
.shot:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.shot-n { transition: color 0.14s var(--ease); }
.shot:hover .shot-n { color: var(--text); }

/* Long campaign titles should not push the bar around. */
.sheet-where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }

/* ── the campaign toolbar, in the same quiet register ── */

.tabs { display: flex; gap: 2px; }
.tabs button {
  border: 0; background: none; cursor: pointer; color: var(--text-dim);
  padding: 6px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.tabs button:hover { background: var(--line-soft); color: var(--text); }
.tabs button[aria-pressed='true'] { background: var(--line-soft); color: var(--text); font-weight: 600; }

.select.bare-select {
  border: 0; background-color: transparent; color: var(--text-dim);
  font-size: 14px; padding: 6px 26px 6px 10px; width: auto; cursor: pointer;
  background-position: calc(100% - 13px) 53%, calc(100% - 9px) 53%;
  transition: background-color 0.14s var(--ease), color 0.14s var(--ease);
}
.select.bare-select:hover { background-color: var(--line-soft); color: var(--text); }
.select.bare-select:focus { outline: none; background-color: var(--line-soft); color: var(--text); box-shadow: none; }

/* Native date pickers put a heavy glyph in a quiet line; calm it down. */
.sheet-settings .bare::-webkit-calendar-picker-indicator,
.camp-meta .bare::-webkit-calendar-picker-indicator {
  opacity: 0.35; cursor: pointer; transition: opacity 0.14s var(--ease);
}
.sheet-settings .bare:hover::-webkit-calendar-picker-indicator,
.camp-meta .bare:hover::-webkit-calendar-picker-indicator { opacity: 0.8; }
