/* ============================================================
   Island Boy Content Engine — design system
   Brand: Island Boy Homes (warm brown, from the logo)
   Type:  Geist (UI) · Geist Mono (numerals/meta) · Newsreader (brand moments)
   ============================================================ */

/* ---------- Fonts (self-hosted, offline-safe) ---------- */
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/hanken-400.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/hanken-500.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/hanken-600.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/hanken-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/plexmono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/plexmono-500.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/newsreader-500.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/newsreader-600.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: italic; font-display: swap;
  src: url("/static/fonts/newsreader-500-italic.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;

  /* Warm neutral ramp (OKLCH) */
  --bg:          oklch(0.972 0.006 74);
  --bg-tint:     oklch(0.962 0.009 72);
  --surface:     oklch(0.995 0.0015 75);
  --surface-2:   oklch(0.966 0.008 74);
  --sunk:        oklch(0.955 0.010 72);
  --border:      oklch(0.905 0.010 72);
  --border-strong: oklch(0.855 0.014 70);
  --ink:         oklch(0.305 0.020 58);
  --ink-2:       oklch(0.435 0.020 60);
  --muted:       oklch(0.545 0.017 62);

  /* Brand (warm brown from the logo) */
  --brand:        oklch(0.545 0.050 62);
  --brand-strong: oklch(0.470 0.055 58);
  --brand-soft:   oklch(0.945 0.022 70);
  --brand-ink:    oklch(0.985 0.004 75);

  /* Focus */
  --focus:      oklch(0.55 0.09 62);
  --focus-ring: oklch(0.55 0.09 62 / 0.30);

  /* Status pairs — harmonious, urgency-ordered by hue */
  --st-red-bg:    oklch(0.930 0.048 27);  --st-red-ink:    oklch(0.470 0.140 27);
  --st-orange-bg: oklch(0.935 0.055 62);  --st-orange-ink: oklch(0.480 0.120 55);
  --st-amber-bg:  oklch(0.945 0.055 90);  --st-amber-ink:  oklch(0.470 0.090 85);
  --st-blue-bg:   oklch(0.935 0.032 245); --st-blue-ink:   oklch(0.480 0.110 250);
  --st-teal-bg:   oklch(0.935 0.035 190); --st-teal-ink:   oklch(0.460 0.075 195);
  --st-purple-bg: oklch(0.935 0.035 305); --st-purple-ink: oklch(0.480 0.110 305);
  --st-indigo-bg: oklch(0.935 0.035 278); --st-indigo-ink: oklch(0.475 0.110 278);
  --st-green-bg:  oklch(0.935 0.045 150); --st-green-ink:  oklch(0.440 0.100 152);
  --st-gray-bg:   oklch(0.930 0.006 72);  --st-gray-ink:   oklch(0.500 0.010 65);

  /* Semantic (also aliased below for template inline styles) */
  --ok:   oklch(0.470 0.100 152);
  --warn: oklch(0.500 0.095 70);
  --bad:  oklch(0.500 0.150 27);
  --danger: oklch(0.560 0.135 32);

  /* Elevation — warm-tinted, never pure black */
  --shadow-xs: 0 1px 2px oklch(0.35 0.03 60 / 0.06);
  --shadow-sm: 0 1px 2px oklch(0.35 0.03 60 / 0.05), 0 2px 6px oklch(0.35 0.03 60 / 0.05);
  --shadow-md: 0 2px 4px oklch(0.35 0.03 60 / 0.05), 0 8px 20px oklch(0.35 0.03 60 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.35 0.03 60 / 0.14), 0 4px 8px oklch(0.35 0.03 60 / 0.06);

  /* Radii — locked scale: pill / lg card / md control / sm input */
  --r-sm: 9px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  /* Motion — strong custom curves (Emil) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-fast: 120ms; --dur: 180ms; --dur-slow: 240ms;

  /* Legacy aliases so template inline styles keep working */
  --sand: var(--bg); --card: var(--surface); --line: var(--border);
  --sea: var(--brand); --sea-dark: var(--brand-strong); --coral: var(--danger);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(120% 80% at 50% -10%, oklch(0.99 0.01 78 / 0.7), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.55;
  font-feature-settings: "cv01", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--brand-soft); color: var(--brand-strong); }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }

main { max-width: 1000px; margin: 0 auto; padding: 28px 20px 80px; }
main.narrow { max-width: 580px; }
@media (prefers-reduced-motion: no-preference) {
  main { animation: page-in 260ms var(--ease-out) both; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Typography ---------- */
h1 {
  font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em;
  font-weight: 600; margin: 4px 0 18px; text-wrap: balance;
}
h1 .accent { font-family: var(--font-serif); font-weight: 500; font-style: italic;
  letter-spacing: 0; }
h2 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.01em;
  font-weight: 600; margin: 30px 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
.help { color: var(--muted); font-size: 0.78rem; margin-top: 4px; line-height: 1.5; }
strong, b { font-weight: 600; }
.mono, .num { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* ---------- Header ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: oklch(0.99 0.003 75 / 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 22px;
}
header.topbar .brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
header.topbar .brand img { height: 34px; display: block; }
header.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
header.topbar nav a {
  color: var(--ink-2); padding: 7px 13px; border-radius: var(--r-pill);
  font-size: 0.875rem; font-weight: 500; letter-spacing: -0.01em;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
header.topbar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
header.topbar nav a.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
header.topbar .who { margin-left: auto; font-size: 0.8125rem; color: var(--muted);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.topbar .who .whoami { font-weight: 500; color: var(--ink-2); }
header.topbar .who .settings-link { color: var(--muted); display: inline-flex; align-items: center;
  gap: 5px; transition: color var(--dur) var(--ease-out); }
header.topbar .who .settings-link:hover { color: var(--ink); text-decoration: none; }

/* Segmented language toggle */
.lang-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 2px; gap: 2px; }
.lang-toggle button {
  border: 0; background: transparent; padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
  color: var(--muted); font-family: var(--font-mono);
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.lang-toggle button:hover:not(.on) { color: var(--ink); }
.lang-toggle button.on { background: var(--surface); color: var(--brand-strong);
  box-shadow: var(--shadow-xs); }

/* ---------- Layout helpers ---------- */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
a.card, .card.link { display: block; color: inherit;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--border-strong); text-decoration: none; }
}
.card.link:active { transform: translateY(0) scale(0.995); }

/* ---------- Flash / alerts ---------- */
.flash {
  background: var(--st-green-bg); border: 1px solid transparent; color: var(--st-green-ink);
  padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 14px;
  font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow-xs);
  display: flex; gap: 8px;
}
.flash::before { content: "✓"; font-weight: 700; }
.error-box { background: var(--st-red-bg); color: var(--st-red-ink); padding: 12px 16px;
  border-radius: var(--r-md); margin-bottom: 14px; font-weight: 500; font-size: 0.875rem; }
.feedback-box { background: oklch(0.965 0.03 40); color: oklch(0.45 0.11 32);
  border-radius: var(--r-md); padding: 10px 14px; margin-top: 8px; font-weight: 500;
  font-size: 0.85rem; line-height: 1.5; }

/* ---------- Badges (status = urgency-ordered) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.005em; white-space: nowrap;
  line-height: 1.4;
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.9; }
.badge.red    { background: var(--st-red-bg);    color: var(--st-red-ink); }
.badge.orange { background: var(--st-orange-bg); color: var(--st-orange-ink); }
.badge.amber  { background: var(--st-amber-bg);  color: var(--st-amber-ink); }
.badge.blue   { background: var(--st-blue-bg);   color: var(--st-blue-ink); }
.badge.teal   { background: var(--st-teal-bg);   color: var(--st-teal-ink); }
.badge.purple { background: var(--st-purple-bg); color: var(--st-purple-ink); }
.badge.indigo { background: var(--st-indigo-bg); color: var(--st-indigo-ink); }
.badge.green  { background: var(--st-green-bg);  color: var(--st-green-ink); }
.badge.gray   { background: var(--st-gray-bg);   color: var(--st-gray-ink); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand-strong); --btn-fg: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--r-md); cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 600; letter-spacing: -0.01em;
  padding: 11px 18px; text-align: center; white-space: nowrap;
  background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn:hover { background: var(--brand); box-shadow: var(--shadow-sm); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.secondary { --btn-bg: var(--surface); --btn-fg: var(--ink); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn.danger:hover { background: oklch(0.5 0.15 32); }
.btn.block { display: flex; width: 100%; }
.btn.small { font-size: 0.8rem; padding: 7px 13px; border-radius: var(--r-sm); }
.btn:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--border);
  cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- Forms ---------- */
form.stack label { display: block; font-weight: 500; font-size: 0.85rem; color: var(--ink-2);
  margin: 14px 0 6px; }
form.stack input[type=text], form.stack input[type=email], form.stack input[type=password],
form.stack input[type=date], form.stack input[type=time], form.stack input[type=number],
form.stack select, form.stack textarea,
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.9rem; font-family: inherit; color: var(--ink); background: var(--surface);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
textarea { min-height: 76px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23857a6d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
input[type=file] { font-size: 0.85rem; }

/* ---------- Section (collapsible board sections) ---------- */
details.section { margin-bottom: 24px; }
details.section > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; padding: 4px 2px;
  color: var(--ink);
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .chev { font-size: 0.7rem; color: var(--muted);
  transition: transform var(--dur) var(--ease-out); display: inline-block; }
details.section[open] > summary .chev { transform: rotate(90deg); }
details.section > summary .count { font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--muted); font-weight: 500; background: var(--surface-2);
  padding: 2px 8px; border-radius: var(--r-pill); }

/* ---------- Stat strip (metric chips) ---------- */
.stat-strip { display: flex; align-items: stretch; gap: 8px; overflow-x: auto;
  padding: 4px 0 18px; scrollbar-width: thin; }
.stat-strip::-webkit-scrollbar { height: 0; }
.stat-strip a {
  display: inline-flex; flex-direction: column; gap: 1px; flex: 0 0 auto;
  color: var(--ink); padding: 10px 15px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out); min-width: 92px;
}
.stat-strip a b { font-family: var(--font-mono); font-feature-settings: "tnum";
  font-size: 1.35rem; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.stat-strip a { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  .stat-strip a:hover { transform: translateY(-2px); border-color: var(--brand);
    box-shadow: var(--shadow-sm); text-decoration: none; }
}

/* ---------- Filters (sleek inline) ---------- */
.filters { display: flex; gap: 7px; align-items: center; overflow-x: auto;
  padding: 0 0 18px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select, .filters input[type=text] {
  width: auto; padding: 7px 11px; border-radius: var(--r-pill); font-size: 0.8rem;
  background: var(--surface); flex: 0 0 auto; box-shadow: var(--shadow-xs); }
.filters select { padding-right: 30px; background-position: right 9px center; }
.filters input[type=text] { min-width: 130px; }

/* ---------- Content ideas ---------- */
.idea-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.idea-toolbar input[type=text], .idea-toolbar select {
  width: auto; padding: 10px 13px; border-radius: var(--r-md); font-size: 0.9rem; }
.idea-toolbar input[type=text] { flex: 2 1 220px; }
.idea-toolbar select { flex: 1 1 150px; }
.idea-toolbar .btn { flex: 0 0 auto; }
.idea-card { position: relative; }
.idea-card.review   { border-color: var(--border-strong); }
.idea-card.approved { border-color: color-mix(in oklch, var(--st-green-ink) 30%, var(--border)); }
.idea-mini { display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-tint);
  color: var(--muted); font-size: 0.82rem; margin-bottom: 7px; }
.idea-mini .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: line-through; text-decoration-color: var(--border-strong); }
.idea-mini form { margin: 0; }
.idea-mini button { border: 1px solid var(--border); background: var(--surface);
  color: var(--brand-strong); font-size: 0.72rem; font-weight: 600; cursor: pointer;
  padding: 4px 10px; border-radius: var(--r-pill); font-family: inherit;
  transition: background var(--dur) var(--ease-out); }
.idea-mini button:hover { background: var(--surface-2); }

/* ---------- Callouts (recommendation / warning) ---------- */
.rec-card { background: color-mix(in oklch, var(--brand-soft) 55%, var(--surface));
  border-color: color-mix(in oklch, var(--brand) 22%, var(--border)); }
.note-warn { background: var(--st-amber-bg); border-color: transparent; }
.note-warn strong { color: var(--st-amber-ink); }

.creds-block { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; margin: 10px 0; white-space: pre-wrap; word-break: break-word;
  color: var(--ink); }
.role-help { font-size: 0.78rem; color: var(--muted); line-height: 1.5;
  background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 11px; margin-top: 6px; }

/* ---------- Tables ---------- */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; font-size: 0.85rem; }
table.list th { text-align: left; padding: 11px 14px; background: var(--surface-2);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border); }
table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background var(--dur-fast) var(--ease-out); }
@media (hover: hover) { table.list tbody tr:hover { background: var(--bg-tint); } }

/* ---------- Calendar ---------- */
.cal-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal-table th { padding: 10px 6px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  vertical-align: top; width: 14.28%; height: 96px; padding: 6px; font-size: 0.72rem; }
.cal-table td:nth-child(7n) { border-right: 0; }
.cal-table td > strong { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-2);
  font-weight: 500; }
.cal-table td.dim { background: var(--bg-tint); }
.cal-table td.dim > strong { color: var(--muted); opacity: 0.6; }
.cal-table td.today { background: var(--brand-soft); }
.cal-table td.today > strong { color: var(--brand-strong); font-weight: 700; }
.cal-post { display: block; background: var(--surface-2); border-radius: 6px; padding: 3px 6px;
  margin-top: 4px; color: var(--ink-2); font-size: 0.68rem; line-height: 1.35;
  border: 1px solid var(--border); transition: border-color var(--dur) var(--ease-out); }
.cal-post:hover { border-color: var(--brand); text-decoration: none; }
.cal-post.posted { color: var(--muted); opacity: 0.75; }

/* ---------- Progress ---------- */
.progressbar { background: var(--sunk); border-radius: var(--r-pill); height: 8px; overflow: hidden;
  box-shadow: inset 0 1px 2px oklch(0.4 0.02 60 / 0.08); }
/* Fill width is rendered server-side at its final value (no in-page progress
   animation), so no width transition is needed — avoids layout-property motion. */
.progressbar > div { background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  height: 100%; border-radius: var(--r-pill); }

/* ---------- Shot cards (staff) ---------- */
.shot-card { border-radius: var(--r-lg); }
.shot-card.done   { background: color-mix(in oklch, var(--st-green-bg) 30%, var(--surface));
  border-color: color-mix(in oklch, var(--st-green-ink) 22%, var(--border)); }
.shot-card.retake { background: color-mix(in oklch, var(--st-red-bg) 30%, var(--surface));
  border-color: color-mix(in oklch, var(--st-red-ink) 22%, var(--border)); }
.shot-num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-strong); color: var(--brand-ink); font-family: var(--font-mono);
  font-weight: 500; font-size: 0.85rem; align-items: center; justify-content: center; }

/* ---------- Media thumbs ---------- */
.thumb { width: 82px; height: 146px; object-fit: cover; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 auto; }
.thumb-placeholder { width: 82px; height: 146px; border-radius: var(--r-md); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 26px;
  border: 1px solid var(--border); flex: 0 0 auto; }

/* ---------- Checklist ---------- */
.checklist { padding-left: 0; list-style: none; margin: 0; }
.checklist li { padding: 6px 0 6px 30px; position: relative; font-size: 0.9rem; line-height: 1.5; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--brand-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236e5a42' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }

/* ---------- Fold (accordion form) ---------- */
details.fold { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  margin-bottom: 14px; box-shadow: var(--shadow-xs); overflow: hidden; }
details.fold summary { padding: 15px 18px; font-weight: 600; font-size: 0.92rem; cursor: pointer;
  list-style: none; color: var(--ink); }
details.fold summary::-webkit-details-marker { display: none; }
details.fold[open] summary { border-bottom: 1px solid var(--border); }
details.fold .inner { padding: 16px 18px; }

/* ---------- Key/value ---------- */
.kv { margin: 8px 0; font-size: 0.9rem; line-height: 1.5; }
.kv b { color: var(--muted); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.03em;
  text-transform: uppercase; display: block; margin-bottom: 2px; }

/* ---------- Stat grid (progress dashboard) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; text-align: center; color: inherit; box-shadow: var(--shadow-xs); }
.stat .num { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 500; color: var(--ink);
  letter-spacing: -0.02em; }
.stat .lbl { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ---------- Auth / login ---------- */
main:has(.auth) { max-width: none; padding: 0; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(120% 90% at 50% -20%, var(--brand-soft), transparent 55%),
    radial-gradient(100% 70% at 100% 110%, oklch(0.95 0.02 40 / 0.6), transparent 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 36px 32px;
  box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo img { height: 46px; }
.auth-title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; text-align: center;
  letter-spacing: -0.01em; margin: 0 0 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 0.82rem; margin-bottom: 24px;
  line-height: 1.5; }

/* legacy login classes (fallback) */
.login-wrap { max-width: 400px; margin: 8vh auto; padding: 0 16px; }
.login-logo { text-align: center; font-family: var(--font-serif); font-size: 1.6rem; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 20px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; }
  main { animation: none; }
  .card.link:hover, .stat-strip a:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  main { padding: 20px 15px 64px; }
  h1 { font-size: 1.5rem; }
  header.topbar { padding: 9px 15px; gap: 10px 14px; }
  header.topbar .brand img { height: 30px; }
  header.topbar .who { gap: 9px; width: 100%; order: 3; margin-left: 0;
    padding-top: 8px; border-top: 1px solid var(--border); }
  header.topbar nav { order: 2; margin-left: auto; }
  .idea-toolbar .btn { flex-basis: 100%; }
}
