/* MILO Dojo — light, friendly, obvious. See BRAND.md. Phone first. */
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --sky: #e8f1ff; --sky-2: #f4f8ff; --ink: #0f172a; --ink-2: #475569; --ink-3: #94a3b8;
  --line: #e2e8f0; --white: #fff; --green: #16a34a; --amber: #d97706; --red: #dc2626;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(37,99,235,.06); --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(900px 420px at 50% -80px, #dbe8ff, transparent 70%), var(--sky-2); color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Inter, Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.dash { font-size: 15px; }
a { color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 13px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 5px; font-weight: 500; }
.hidden { display: none !important; }
.wrap { width: min(560px, 100%); margin: 0 auto; padding: 16px 16px 48px; }
.wide { width: min(1040px, 100%); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 16px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark img { width: 34px; height: 34px; }
.wordmark { font-weight: 700; letter-spacing: .2em; font-size: 13px; }
.wordmark small { display: block; letter-spacing: 0; font-weight: 500; color: var(--ink-2); font-size: 12px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav a.on, .nav a:hover { background: var(--sky); color: var(--blue); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 12px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.card h3 { margin: 16px 0 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.lead { color: var(--ink-2); margin: 0 0 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.center { text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--white); font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink);
  transition: background .12s ease, transform .06s ease; }
.btn:hover { background: var(--sky-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 16px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: var(--sky-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip.blue { color: var(--blue); background: var(--sky); border-color: transparent; }
.chip.green { color: var(--green); background: #e9f8ee; border-color: transparent; }
.chip.amber { color: var(--amber); background: #fff4e5; border-color: transparent; }
.chip.red { color: var(--red); background: #fdecec; border-color: transparent; }

.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat .card { margin: 0; padding: 12px 14px; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--ink-2); }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--white);
  text-align: left; width: 100%; color: inherit; text-decoration: none; }
.item:hover { border-color: #bfd3ff; background: var(--sky-2); }
.item .t { font-weight: 600; }
.item .s { font-size: 13px; color: var(--ink-2); }

.levels { display: flex; flex-direction: column; gap: 10px; }
.lvl { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--white);
  text-align: left; width: 100%; color: inherit; }
.lvl .num { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--ink-2); background: var(--sky-2); border: 1.5px solid var(--line); }
.lvl .body { flex: 1; min-width: 0; }
.lvl .t { font-weight: 700; }
.lvl .s { font-size: 13px; color: var(--ink-2); }
.lvl.current, .lvl.open { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.lvl.current .num, .lvl.open .num { background: var(--blue); color: #fff; border-color: var(--blue); }
.lvl.locked { opacity: .55; }
.lvl.done .num { background: #e9f8ee; color: var(--green); border-color: transparent; }
.lvl.done.failed .num { background: #fdecec; color: var(--red); }
.lvl.practice .num { background: var(--sky); color: var(--blue); border-color: transparent; }

.pick { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .pick { grid-template-columns: 1fr 1fr; } .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
.tile { text-align: left; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--white); color: inherit; }
.tile:hover { border-color: #bfd3ff; }
.tile.on { border-color: var(--blue); background: var(--sky); }
.tile .t { font-weight: 700; margin-bottom: 4px; }
.tile .s { font-size: 13px; color: var(--ink-2); }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--sky-2); margin-top: 14px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.check.on { border-color: var(--blue); background: var(--sky); }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin: 8px 0 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 9; }

/* the live call — light, one state at a time */
.call { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); gap: 8px; position: relative; }
.call .tag { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.logo { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin: 8px 0; --mic: 0; }
.logo img { width: 104px; height: 104px; object-fit: contain; position: relative; z-index: 1; transition: transform .3s ease; }
.ring { position: absolute; inset: 10px; border-radius: 50%; opacity: 0; border: 2px solid rgba(37,99,235,.55); }
.ring.r2 { inset: -4px; border-color: rgba(37,99,235,.3); }
.halo { position: absolute; inset: 14px; border-radius: 50%; background: rgba(37,99,235,.22); filter: blur(8px);
  transform: scale(calc(0.9 + var(--mic) * 0.6)); opacity: calc(var(--mic) * .9); transition: transform .08s linear, opacity .12s linear; }
.call[data-state="listening"] .ring { opacity: 1; animation: pulse 2s ease-out infinite; }
.call[data-state="listening"] .ring.r2 { animation-delay: .5s; }
.call[data-state="speaking"] .ring { opacity: 1; animation: pulse 1s ease-out infinite; }
.call[data-state="speaking"] .ring.r2 { animation-delay: .22s; }
.call[data-state="speaking"] .logo img { transform: scale(1.06); }
.call[data-state="thinking"] .logo img, .call[data-state="connecting"] .logo img { animation: breathe 1.4s ease-in-out infinite; }
.call[data-state="ended"] .logo img { filter: saturate(.4); }
.call:not([data-state="listening"]) .halo { opacity: 0; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .85; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.who { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.state { font-size: 16px; font-weight: 600; color: var(--blue); min-height: 24px; }
.caption { max-width: 440px; min-height: 48px; color: var(--ink-2); }
.caption.you { color: var(--ink); }
.controls { display: flex; gap: 10px; margin-top: 16px; width: min(440px, 100%); }
.controls .btn { flex: 1; min-height: 54px; }
.btn.done { background: var(--sky); border-color: transparent; color: var(--blue); }
.btn.hang { background: var(--red); border-color: var(--red); color: #fff; }
.timer { position: absolute; top: 18px; right: 16px; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-2); }
.notice { position: absolute; top: 18px; left: 16px; right: 90px; font-size: 13px; color: var(--amber); text-align: left; }

/* results */
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font-size: 46px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.score span { color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--sky-2); border: 1px solid var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--blue); }
.comp { padding: 10px 0; border-top: 1px solid var(--line); }
.comp:first-child { border-top: 0; }
.comp .row { justify-content: space-between; }
.comp .ev { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.yna h4 { margin: 14px 0 6px; font-size: 13px; }
.yna h4.y { color: var(--green); } .yna h4.n { color: var(--amber); } .yna h4.a { color: var(--blue); }
.yna ul { margin: 0; padding-left: 18px; }
.yna li { margin: 4px 0; }
.transcript p { margin: 8px 0; font-size: 14px; }
.transcript b { color: var(--ink-2); font-weight: 600; }
.transcript p.rep b { color: var(--blue); }
.transcript audio { display: block; width: 100%; height: 34px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox input { font-size: 13px; padding: 9px 10px; background: var(--sky-2); }
.hero { padding: 28px 8px 10px; text-align: center; }
.hero img { width: 76px; height: 76px; animation: breathe 4.5s ease-in-out infinite; }
.hero h1 { font-size: 26px; margin: 10px 0 6px; letter-spacing: -0.02em; }
.hero p { color: var(--ink-2); margin: 0 auto; max-width: 420px; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 18px 0 0; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.steps i { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--blue); }
.login { width: min(420px, 100%); margin: 8vh auto 0; }
