:root {
  --bg: #f7f4ee; --card: #fff; --ink: #24223a; --soft: #6f6c86; --line: #e8e2d6;
  --coral: #ff7a59; --teal: #1fa6a0; --ok: #24b06c; --warn: #f2a516; --bad: #e0453a;
  --l0: #ece8f3; --l1: #ffd9cf; --l2: #ffe7a6; --l3: #c9eec0; --l4: #6fd09a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; }
[hidden] { display: none !important; }
h1, h2, h3, .brand { font-family: Fredoka, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { background: var(--card); border-radius: 24px; padding: 32px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 12px; }
.gate-card h1 { margin: 0; font-size: 26px; }
.gate-card p { margin: 0; color: var(--soft); }
.gate-emoji { font-size: 54px; }
.gate-card input { padding: 12px; border: 2px solid var(--line); border-radius: 12px; text-align: center; font-size: 22px; letter-spacing: 6px; }
.gate-card button[type=submit] { padding: 12px; border: 0; border-radius: 12px; background: var(--coral); color: #fff; font-weight: 600; font-size: 17px; }
.err { color: var(--bad) !important; min-height: 1.2em; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: rgba(247,244,238,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 700; }
.brand span { font-weight: 500; color: var(--soft); font-size: 17px; }
.tabs { display: flex; gap: 4px; background: #ece7dc; padding: 4px; border-radius: 12px; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--soft); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.go-class { margin-left: auto; background: var(--coral); color: #fff; padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.card { background: var(--card); border-radius: 18px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid var(--line); }
.card h2 { margin: 0 0 12px; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 16px 0 8px; font-size: 16px; }
.muted { color: var(--soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.kpi b { display: block; font-family: Fredoka; font-size: 32px; font-weight: 600; }
.kpi span { color: var(--soft); font-size: 13px; }
.banner { background: #fff4d6; border: 1px solid #f5d98a; border-radius: 14px; padding: 12px 16px; }

.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; }
.steps .ic { width: 34px; height: 34px; border-radius: 10px; background: #f2eee6; display: grid; place-items: center; }
.steps .t { font-weight: 600; }
.steps .g { color: var(--soft); font-size: 13px; }
.steps .acts { font-size: 13px; color: var(--soft); margin-top: 2px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f0ece4; color: var(--soft); white-space: nowrap; }
.pill.ok { background: #d9f5e6; color: #137a45; }
.pill.warn { background: #fff0cc; color: #8a5a00; }
.pill.bad { background: #fde1dc; color: #a12a1f; }

.strat { border-left: 4px solid var(--teal); padding: 6px 0 6px 12px; margin-bottom: 12px; }
.strat.off { opacity: .45; border-color: var(--line); }
.strat .st-title { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.strat p { margin: 4px 0 0; font-size: 14px; }
.strat .home { color: #8a5a00; }

.skills-domain { display: flex; flex-direction: column; gap: 16px; }
.stage-title { font-weight: 600; color: var(--soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600; background: var(--l0); text-align: left; min-width: 64px; }
.chip small { display: block; font-weight: 500; opacity: .75; font-size: 11px; }
.chip.l1 { background: var(--l1); } .chip.l2 { background: var(--l2); } .chip.l3 { background: var(--l3); } .chip.l4 { background: var(--l4); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--soft); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #faf8f3; }

.btn { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 10px; font-weight: 600; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.coral { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.f { display: grid; gap: 12px; }
form.f label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
form.f input, form.f textarea, form.f select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-weight: 400; font-size: 15px; background: #fffdf9; }
form.f textarea { min-height: 90px; resize: vertical; }

.session-detail video { width: 100%; border-radius: 14px; background: #000; max-height: 60vh; }
.md h1 { font-size: 22px; } .md h2 { font-size: 17px; margin: 18px 0 6px; } .md ul { margin: 4px 0; padding-left: 20px; } .md li { margin: 3px 0; }
.md pre { background: #f6f3ec; padding: 12px; border-radius: 10px; white-space: pre-wrap; font-size: 13px; max-height: 360px; overflow: auto; }
.transcript { max-height: 420px; overflow: auto; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.transcript .tl { display: grid; grid-template-columns: 48px 90px 1fr; gap: 8px; }
.transcript .who-t { color: var(--teal); font-weight: 600; }
.transcript .who-c { color: var(--coral); font-weight: 600; }

dialog { border: 0; border-radius: 20px; padding: 0; width: min(1000px, 96vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(36,34,58,.4); }
#dlg-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 50; }
.obs { font-size: 14px; display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.obs:last-child { border: 0; }

@media print {
  .top, .btn, .tabs, .go-class { display: none !important; }
  body { background: #fff; }
  dialog { position: static; box-shadow: none; width: 100%; max-height: none; }
}
