/* Layout: top bar, tab row, then one working column; idea detail opens as a side panel. */
:root {
  --bg: #f5f5f2;
  --panel: #ffffff;
  --ink: #1c1d1a;
  --muted: #696b63;
  --line: #dcdcd4;
  --accent: #b5832a;
  --accent-ink: #ffffff;
  --accent-soft: #f4ead6;
  --ok: #2f7a4f;
  --warn: #9a6a00;
  --bad: #b3261e;
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --panel: #1d1d1a;
    --ink: #ecebe5;
    --muted: #9c9d94;
    --line: #34342f;
    --accent: #d7a548;
    --accent-ink: #1c1d1a;
    --accent-soft: #3a3020;
    --ok: #6cc28e;
    --warn: #e2b54f;
    --bad: #f08a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; }

.wrap { max-width: 1920px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

header.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.brand { font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.brand img { border-radius: 7px; display: block; }
.auth-card-actions { width: 100%; gap: 10px; }

nav.tabs { display: flex; gap: 4px; overflow-x: auto; padding-block: 12px; }
nav.tabs button { background: none; border: 0; padding: 7px 12px; border-radius: 999px; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
nav.tabs button[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

main { padding-block: 4px 48px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); }

button, .btn { font: inherit; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 12px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
textarea.tall { min-height: 220px; }
select.auto { width: auto; max-width: 60vw; }
.gap-top { margin-top: 12px; }
label.check { flex-direction: row; align-items: center; color: var(--ink); }
label.check input { width: auto; }
.bad { color: var(--bad); }
.wrap-any { overflow-wrap: anywhere; }
.inline label.narrow { flex: 0 0 160px; min-width: 140px; }
.video-slot { display: grid; place-items: center; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: pointer; }
.video-slot.final { max-width: 320px; }
.video-slot .play { width: 48px; height: 48px; border-radius: 50%; background: rgb(255 255 255 / .14); position: relative; transition: background .15s; }
.video-slot .play::after { content: ""; position: absolute; left: 19px; top: 15px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.video-slot:hover .play { background: rgb(255 255 255 / .24); }
.video-slot:focus-visible { outline: 2px solid var(--accent, #fff000); outline-offset: 2px; }
video.final { max-width: 320px; width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 6px; }
a.btn { display: inline-flex; justify-content: center; text-decoration: none; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline label { flex: 1; min-width: 180px; }

/* The board: every stage side by side, sharing the window's width; scrolls sideways when the
   window is narrower than the columns need, and stacks on a phone. */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.column { display: flex; flex-direction: column; gap: 8px; flex: 1 1 0; min-width: 200px; scroll-snap-align: start; }
@media (max-width: 640px) {
  .board { flex-direction: column; overflow-x: visible; }
  .column { min-width: 0; width: 100%; }
}
/* Forms and lists keep a readable width on very wide windows; the board and library use it all. */
main.wrap > .card, main.wrap > form, main.wrap > details, main.wrap > section, main.wrap > .stack > .card { max-width: 1180px; }
.column > h3 { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; padding-inline: 2px; }
.idea { text-align: left; width: 100%; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.idea strong { font-weight: 600; }
.idea[role=button] { cursor: pointer; }
.idea[role=button]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); }

.takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.take { display: flex; flex-direction: column; gap: 6px; }
.take video, .take img, .lib video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; border-radius: 6px; }
.take.picked { outline: 2px solid var(--accent); border-radius: 8px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.panel-bg { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 10; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); z-index: 11; overflow-y: auto; border-left: 1px solid var(--line); padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 32px 16px; display: flex; flex-direction: column; gap: 16px; }
.fold { border-top: 1px solid var(--line); padding-top: 12px; }
.fold > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold > summary h3 { margin: 0; }
.fold > .stack { margin-top: 10px; }
.script { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }

.comments { display: flex; flex-direction: column; gap: 8px; }
.comment { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.table-wrap { overflow-x: auto; }

.signin { min-height: 100vh; display: grid; place-items: center; }
.signin .card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; }

#toast { position: fixed; bottom: max(16px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: no-preference) {
  .panel { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } }
}

.activity-row { display: flex; gap: 10px; align-items: baseline; padding-block: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.activity-row:last-child { border-bottom: 0; }
.activity-who { font-weight: 600; white-space: nowrap; }
.activity-when { white-space: nowrap; }
.pill.system { background: var(--ink); color: var(--bg); font-weight: 600; }

/* Report a problem */
.report { width: min(560px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); padding: 20px; }
.report::backdrop { background: rgb(0 0 0 / .45); }
.report h2 { margin: 0; }
.report textarea { min-height: 110px; }
.report-preview { width: 100%; max-height: 260px; background: #000; border-radius: 8px; }
.report-bar { position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px rgb(0 0 0 / .3); }
.report-dot { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; animation: report-pulse 1.2s infinite; }
.report-clock { font-variant-numeric: tabular-nums; }
@keyframes report-pulse { 50% { opacity: .35; } }
.panel-frame { width: 100%; height: calc(100vh - 190px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
