/* YT Studio (ADR-003). Layout after the Everstory lanes app: dark hero carrying one number, a light sheet over
   it, bottom tab bar on phone, dark sidebar from 1100px. Violet accent, never Everstory's terracotta. */
:root {
  --ink: #121218;
  --ink-2: #1D1D27;
  --ink-text: #F4F3FA;
  --ink-muted: #A9A7BC;
  --bg: #F5F5F8;
  --card: #FFFFFF;
  --text: #16161D;
  --muted: #64637A;
  --line: #E5E4EE;
  --accent: #6D5EF5;
  --accent-ink: #4A3CD6;
  --accent-soft: #EEEBFF;
  --rec: #E5484D;
  --ok: #1E9E6A;
  --ok-soft: #E3F5EC;
  --warn: #B5631A;
  --warn-soft: #FDF0E3;
  --radius: 22px;
  --tabs-h: 76px;
  --shadow: 0 1px 2px rgba(18, 18, 24, .04), 0 6px 24px rgba(18, 18, 24, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E13; --card: #191921; --text: #F1F0F7; --muted: #A09FB3; --line: #2A2A36;
    --accent-soft: #24203F; --ok-soft: #12291F; --warn-soft: #2C1E10; --ink: #1C1A2E; --ink-2: #2A2740; --accent-ink: #B9AEFF;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E13; --card: #191921; --text: #F1F0F7; --muted: #A09FB3; --line: #2A2A36;
  --accent-soft: #24203F; --ok-soft: #12291F; --warn-soft: #2C1E10; --ink: #1C1A2E; --ink-2: #2A2740; --accent-ink: #B9AEFF; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
.app { min-height: 100vh; }
.boot { padding: 40px 20px; color: var(--muted); }

/* ---------- navigation ---------- */
.side { display: none; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 8px 6px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none;
  border-radius: 16px; min-height: 52px;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-ink); }
.tab[aria-current="page"] .ico { background: var(--accent-soft); }
.tab .ico { display: grid; place-items: center; width: 54px; height: 32px; border-radius: 16px; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--rec); color: #fff; font: 700 12px/20px Archivo, sans-serif; text-align: center;
}
.main { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px); outline: none; }

/* ---------- hero + sheet ---------- */
.hero {
  position: relative; overflow: hidden; background: var(--ink); color: var(--ink-text);
  padding: calc(env(safe-area-inset-top) + 22px) 22px 64px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 80% at 100% 0%, rgba(109, 94, 245, .28), transparent 60%);
}
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 19px/1 Archivo, sans-serif; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; left: 11px; top: 8px; border: 7px solid transparent; border-left: 11px solid #fff; border-right: 0; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: rgba(255,255,255,.08); color: var(--ink-text);
}
.icon-btn svg { width: 22px; height: 22px; }
.kicker { color: var(--ink-muted); font-size: 15px; margin: 0 0 4px; }
.big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.big b { font: 900 68px/1 Archivo, sans-serif; letter-spacing: -.03em; }
.big span { font-size: 19px; color: var(--ink-muted); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); font-weight: 600; font-size: 14px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.dot.on { background: #4ADE80; } .dot.off { background: var(--rec); } .dot.wait { background: #FBBF24; }
.sheet {
  position: relative; z-index: 2; margin-top: -32px; background: var(--bg);
  border-radius: 28px 28px 0 0; padding: 22px 16px 8px;
}
.sec-title { font: 800 13px/1 Archivo, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 12px; }
.sec-title:first-child { margin-top: 4px; }
.stack { display: grid; gap: 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 6px; font: 700 19px/1.3 Inter, sans-serif; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); }
.callout { background: linear-gradient(135deg, var(--accent), var(--accent-ink)); color: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.callout .label { font: 800 12.5px/1 Archivo, sans-serif; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.callout h3 { font: 800 28px/1.15 Archivo, sans-serif; margin: 10px 0 6px; }
.callout p { margin: 0 0 16px; opacity: .92; }
.callout.rec { background: linear-gradient(135deg, #2A2A36, var(--ink)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 14px; font-weight: 700; text-decoration: none; background: var(--accent); color: #fff;
}
.btn.light { background: #fff; color: #4A3CD6; }
.btn.ghost { background: var(--accent-soft); color: var(--accent-ink); }
.btn.quiet { background: transparent; color: var(--muted); padding: 0 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.row .s { color: var(--muted); font-size: 14px; }
.tile { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; font: 800 15px Archivo, sans-serif; }
.tile svg { width: 22px; height: 22px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: var(--line); color: var(--muted); }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--accent); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

/* ---------- decide ---------- */
.ask .meta { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.ask .media { margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: var(--ink); }
.ask .media img, .ask .media video { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.ask .body { white-space: pre-wrap; margin-bottom: 16px; }
.opts { display: grid; gap: 10px; margin-bottom: 14px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 16px; background: var(--card); text-align: left; width: 100%;
}
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; margin-top: 1px; display: grid; place-items: center; }
.opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-checked="true"] .radio { border-color: var(--accent); }
.opt[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.opt .lab { font-weight: 600; }
.opt .rec-tag { display: block; margin-top: 4px; font: 800 11px/1 Archivo, sans-serif; letter-spacing: .08em; color: var(--accent-ink); text-transform: uppercase; }
textarea, input[type=email], input[type=password], input[type=text] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); min-height: 48px;
}
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.decided .row .s b { color: var(--text); }

/* ---------- record ---------- */
.rec-wrap { display: grid; gap: 14px; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.prompter { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; min-height: 280px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.prompter .ctx { color: var(--muted); font-size: 15px; opacity: .75; }
.prompter .now { font: 600 25px/1.4 Inter, sans-serif; letter-spacing: -.01em; }
.prompter .lineno { font: 800 13px Archivo, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.controls .side-btn { justify-self: center; }
.recbtn {
  width: 92px; height: 92px; border-radius: 50%; border: 6px solid var(--card); background: var(--rec); color: #fff;
  box-shadow: 0 0 0 2px var(--rec), var(--shadow); display: grid; place-items: center; justify-self: center;
}
.recbtn i { width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: all .15s; }
.recbtn.on i { border-radius: 6px; width: 28px; height: 28px; }
.recbtn.on { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, .18), var(--shadow); } }
.round { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text); }
.round svg { width: 24px; height: 24px; }
.round[disabled] { opacity: .35; }
.status { text-align: center; color: var(--muted); font-weight: 600; min-height: 24px; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.lines { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.split > *, .grid2 > *, .stack > * { min-width: 0; }
.line-btn { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; background: var(--card); border-radius: 14px; padding: 12px 14px; width: 100%; box-shadow: var(--shadow); }
.line-btn .n { font: 800 13px Archivo, sans-serif; color: var(--muted); width: 22px; flex: none; }
.line-btn .x { flex: 1; min-width: 0; color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-btn.done .x { color: var(--text); }
.line-btn[aria-current="true"] { outline: 2px solid var(--accent); }
.check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: transparent; flex: none; }
.line-btn.done .check { background: var(--ok); color: #fff; }
.check svg { width: 14px; height: 14px; }

/* ---------- chat ---------- */
.threads .row { cursor: pointer; }
.thread-view { display: flex; flex-direction: column; min-height: calc(100vh - 260px); }
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 16px; }
.day { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--line); border-radius: 999px; padding: 3px 10px; margin: 8px 0; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.claude { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.johannes { align-self: flex-end; background: var(--ink-2); color: var(--ink-text); border-bottom-right-radius: 6px; }
.msg-meta { font-size: 12px; color: var(--muted); margin-top: -4px; }
.msg-meta.r { align-self: flex-end; }
.composer {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 8px); display: flex; gap: 8px; align-items: flex-end;
  background: var(--card); padding: 8px; border-radius: 20px; box-shadow: var(--shadow);
}
.composer textarea { border: 0; min-height: 44px; max-height: 160px; resize: none; padding: 10px 12px; }
.composer textarea:focus { outline: none; }
.composer .btn { min-height: 44px; padding: 0 16px; }
.back { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-muted); background: none; border: 0; padding: 0; font-weight: 600; margin-bottom: 10px; min-height: 44px; }
.back svg { width: 20px; height: 20px; }

/* ---------- videos ---------- */
.vid .top { display: flex; gap: 12px; align-items: flex-start; }
.vid .when { color: var(--muted); font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.steps i { height: 6px; border-radius: 3px; background: var(--line); }
.steps i.done { background: var(--accent); }
.steps i.now { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--accent-soft) 6px 10px); }
.steps-lab { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.vid video { width: 100%; border-radius: 14px; margin-top: 14px; background: #000; }

/* ---------- login ---------- */
.login { max-width: 420px; margin: 0 auto; }
.login form { display: grid; gap: 12px; }
.err { color: var(--rec); font-weight: 600; min-height: 22px; }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  .sheet { padding: 26px 28px 8px; }
  .hero { padding-left: 28px; padding-right: 28px; }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  :root { --tabs-h: 0px; }
  .tabs { display: none; }
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 26px 16px;
    background: var(--ink); color: var(--ink-text);
  }
  .side .brand { padding: 0 10px 30px; }
  .side-links { display: grid; gap: 4px; }
  .side .tab {
    flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; min-height: 48px; font-size: 15px; color: var(--ink-muted);
  }
  .side .tab .ico { width: auto; height: auto; background: none !important; }
  .side .tab svg { width: 21px; height: 21px; }
  .side .tab[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; }
  .side .badge { position: static; margin-left: auto; }
  .side-foot { margin-top: auto; padding: 0 10px; font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
  .main { padding: 28px 36px 40px; max-width: 1240px; width: 100%; }
  .hero { border-radius: 28px; padding: 26px 34px 34px; }
  .hero .brand, .hero-top .brand { display: none; }
  .hero-top { justify-content: flex-end; margin-bottom: 0; }
  .sheet { background: transparent; padding: 0; margin-top: 24px; border-radius: 0; }
  .sheet > .lead { padding: 0 20px; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split.chat { grid-template-columns: 340px minmax(0, 1fr); }
  .split.rec { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .thread-view { min-height: 60vh; }
  .composer { bottom: 16px; }
  .prompter { min-height: 340px; padding: 34px 36px; }
  .prompter .now { font-size: 30px; }
}
