/* Computer Warriors Onsite Notes. Layout: one phone-width column, sticky top bar, screens swapped in place, primary action pinned at the bottom. */
/* Layout: one phone-width app column, sticky top bar, screens swapped in place, primary action pinned at the bottom */
:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --ink: #142029;
  --muted: #5b6b77;
  --line: #d6dee3;
  --accent: #0b6e8a;
  --accent-ink: #ffffff;
  --accent-soft: #dcedf2;
  --rec: #d0402f;
  --rec-soft: #fbe3df;
  --ok: #217a4b;
  --ok-soft: #dcf1e5;
  --warn: #9a6400;
  --warn-soft: #fbefd6;
  --font-ui: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f171d; --surface: #17222a; --ink: #e6edf1; --muted: #93a4b0; --line: #2a3943;
  --accent: #4fb3cf; --accent-ink: #06222b; --accent-soft: #163845;
  --rec: #f06a58; --rec-soft: #3d1f1b; --ok: #5ccf8e; --ok-soft: #173426; --warn: #e5b14d; --warn-soft: #382a10;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f171d; --surface: #17222a; --ink: #e6edf1; --muted: #93a4b0; --line: #2a3943;
  --accent: #4fb3cf; --accent-ink: #06222b; --accent-soft: #163845;
  --rec: #f06a58; --rec-soft: #3d1f1b; --ok: #5ccf8e; --ok-soft: #173426; --warn: #e5b14d; --warn-soft: #382a10;
  color-scheme: dark }

html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.app { max-width: 440px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.back { border: 0; background: none; color: var(--accent); font: 600 15px var(--font-ui); padding: 4px 0; cursor: pointer; }
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; min-width: 0; text-wrap: balance; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.proto { font: 600 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 4px; }

main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-block: 20px 28px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
h2 { font-size: 22px; margin: 0; line-height: 1.2; text-wrap: balance; }

/* Home */
.capture { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.recbtn { width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--rec); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 10px var(--rec-soft); font: 700 16px var(--font-ui); transition: transform .12s; }
.recbtn:active { transform: scale(.96); }
.recbtn svg { width: 40px; height: 40px; }
.upload { border: 1px dashed var(--line); background: none; color: var(--accent); font: 600 14px var(--font-ui); padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.list { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.note .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mono { font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--accent-soft); color: var(--accent); }

/* Recording */
.rec-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.timer { font: 600 48px var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--rec); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: blink 1s infinite; }
.paused .dot { animation: none; background: var(--muted); }
.paused .live { color: var(--muted); }
@keyframes blink { 50% { opacity: .25; } }
.wave { display: flex; align-items: center; gap: 4px; height: 70px; width: 100%; max-width: 320px; justify-content: center; }
.wave i { width: 5px; border-radius: 3px; background: var(--rec); height: 10%; transition: height .12s; }
.paused .wave i { background: var(--line); }
.rec-controls { display: flex; gap: 28px; align-items: center; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; font: 600 12px var(--font-ui); }
.stop { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--ink); cursor: pointer; display: grid; place-items: center; }
.stop span { width: 30px; height: 30px; border-radius: 6px; background: var(--rec); }

/* Picker */
.select-wrap { position: relative; }
.select { width: 100%; box-sizing: border-box; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 14px 42px 14px 14px; font: 600 15px var(--font-ui); cursor: pointer; }
.select-wrap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; display: grid; gap: 6px; }
.item .title { font-weight: 600; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 6px; }
.field textarea.short { min-height: 130px; }
/* Processing */
.steps { display: flex; flex-direction: column; gap: 14px; margin: auto 0; }
.step { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.step b { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; flex: none; }
.step.doing { color: var(--ink); }
.step.doing b { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done { color: var(--ink); }
.step.done b { background: var(--ok); border-color: var(--ok); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Review */
.ctx { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px; }
textarea { width: 100%; box-sizing: border-box; min-height: 230px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); color: var(--ink); font: 14.5px/1.5 var(--font-ui); resize: vertical; }
.raw { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; color: var(--muted); font-size: 14px; font-style: italic; }
.toggle { border: 0; background: none; color: var(--accent); font: 600 14px var(--font-ui); padding: 0; cursor: pointer; text-align: left; }
.dest { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt input { margin-top: 3px; accent-color: var(--accent); }
.opt.disabled { opacity: .55; cursor: not-allowed; }
.opt small { display: block; color: var(--muted); font-size: 13px; }

.primary { border: 0; background: var(--accent); color: var(--accent-ink); font: 700 16px var(--font-ui); padding: 15px; border-radius: 12px; cursor: pointer; width: 100%; }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--font-ui); padding: 13px; border-radius: 12px; cursor: pointer; width: 100%; }
.footer { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 18px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; }

/* Done */
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 24px auto 0; }
.center { text-align: center; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Real-app additions */
.textin { width: 100%; box-sizing: border-box; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 13px 14px; font: 16px var(--font-ui); }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.banner.err { background: var(--rec-soft); color: var(--rec); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.linkbtn { border: 0; background: none; color: var(--accent); font: 600 14px var(--font-ui); padding: 4px 0; cursor: pointer; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
body { margin: 0; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
