/* Light theme only: blue-grey ground, white panels, navy headings, cobalt actions. */
:root {
  color-scheme: light;
  --bg: #EDF2F8;
  --panel: #FFFFFF;
  --navy: #0F2147;
  --ink: #24324D;
  --muted: #5D6C87;
  --line: #D7E0EC;
  --cobalt: #1F4FD8;
  --cobalt-dark: #173FB4;
  --cobalt-soft: #E6EDFD;
  --warn: #B4321F;
  --warn-soft: #FBEAE7;
  --ok: #12784F;
  --r: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { color: var(--navy); font-weight: 800; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--cobalt); color: #FFFFFF; border: 0; border-radius: 12px;
  padding: 12px 18px; font-weight: 700; cursor: pointer; min-height: 46px;
}
.btn:hover { background: var(--cobalt-dark); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: var(--panel); color: var(--cobalt); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--cobalt-soft); }
.btn.small { padding: 8px 12px; min-height: 38px; font-size: 0.875rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cobalt); font-weight: 600; cursor: pointer; text-decoration: underline; }
.linkbtn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

input[type="email"], input[type="text"], input[type="search"] {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; min-height: 48px;
}
label.lab { display: block; font-size: 0.8rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }

/* ---------- sign in ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 10px 30px rgba(15, 33, 71, 0.06);
}
.gate-card form { display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand-name { font-weight: 800; color: var(--navy); font-size: 1.05rem; letter-spacing: -0.01em; }
.code-input { font-size: 1.5rem !important; letter-spacing: 0.3em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; }
.notice.err { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.notice.info { background: var(--cobalt-soft); color: var(--navy); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* ---------- app shell ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top, 0px); }
.wrap { max-width: 860px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 44vw; }
main.wrap { padding-block: 22px 56px; display: flex; flex-direction: column; gap: 22px; }
.intro { display: flex; flex-direction: column; gap: 6px; }

.phase { display: flex; flex-direction: column; gap: 10px; }
.phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item.open { border-color: var(--cobalt); }
.item-head {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: none; border: 0; padding: 14px; cursor: pointer;
}
.daynum {
  flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--cobalt-soft); color: var(--cobalt);
  display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}
.daynum small { display: block; font-size: 0.55rem; letter-spacing: 0.08em; font-weight: 700; text-transform: uppercase; }
.daynum b { display: block; font-size: 1.05rem; }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.item-hook { font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.item-min { flex: none; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 0; }
.item.open .chev { transform: rotate(-135deg); margin: 4px 4px 0 0; }

.detail { border-top: 1px solid var(--line); padding: 16px 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 0; font-size: 0.9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.block { background: var(--bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.track { display: flex; flex-direction: column; gap: 8px; }
.track + .track { border-top: 1px solid var(--line); padding-top: 10px; }
.track-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.track-name { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--cobalt-soft); color: var(--cobalt); margin-left: 6px; white-space: nowrap; }
audio { width: 100%; height: 40px; }

.state { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .item-min { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .chev { transition: transform 0.15s ease; }
}

/* ---------- second step for team sign-in ---------- */
.step-list { display: flex; flex-direction: column; gap: 12px; }
.step-list p { margin: 0; }
.step-list b { color: inherit; font-weight: 700; }
.step-qr { display: block; width: 184px; height: 184px; margin: 0 auto; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.step-key { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; letter-spacing: 0.04em; word-break: break-all; color: var(--navy); background: var(--cobalt-soft); border-radius: 6px; padding: 2px 6px; }
.gate.tall { align-items: start; padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
.step-alt { color: inherit; text-decoration: underline; }
.step-list .row { justify-content: center; }
