@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-display: swap; src: url('/fonts/SourceSans3-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-display: swap; src: url('/fonts/SourceSans3-SemiBold.ttf') format('truetype'); }

:root {
  --bg: #0f1014;
  --panel: #181a21;
  --panel-2: #20232c;
  --line: #2c303b;
  --text: #eef0f4;
  --muted: #9aa1b1;
  --brand: #e24747;
  --brand-dark: #b93434;
  --good: #3ecf8e;
  --warn: #f5b041;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 500px at 50% -200px, rgba(226, 71, 71, 0.18), transparent), var(--bg);
  color: var(--text);
  font: 17px/1.55 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2 { font-family: 'Poppins', system-ui, sans-serif; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 14px; }
[hidden] { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(15, 16, 20, 0.85);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 8px; }
.brand-name { font-family: 'Poppins', sans-serif; font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 0.85rem; }
.user { display: flex; align-items: center; gap: 10px; }
.user img { border-radius: 50%; }
.user span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.hero { text-align: center; }
.hero .facts { text-align: left; max-width: 560px; margin: 18px auto 22px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.button:hover { border-color: var(--muted); }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.big { padding: 13px 26px; font-size: 1.05rem; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button:focus-visible, .link:focus-visible, input:focus-visible { outline: 3px solid rgba(226, 71, 71, 0.6); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.link:hover { color: var(--text); }

.facts { padding-left: 0; list-style: none; }
.facts li { padding: 8px 12px; margin: 6px 0; background: var(--panel-2); border-radius: 10px; }

.notice { padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--muted); }
.notice[data-kind='warn'] { border-left-color: var(--warn); }

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: step; }
.steps li {
  flex: 1; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 0.92rem; counter-increment: step;
}
.steps li::before { content: counter(step) '. '; font-weight: 600; }
.steps li.active { border-color: var(--brand); color: var(--text); }
.steps li.done { color: var(--good); }
.steps li.done::before { content: '✓ '; }

.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h1 { margin: 0; flex: 1; }
.section-head.sticky { position: sticky; top: 0; background: var(--panel); padding: 10px 0; z-index: 2; }
.pill { padding: 4px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 0.9rem; white-space: nowrap; }
.timer { font-variant-numeric: tabular-nums; }
.timer.low { border-color: var(--warn); color: var(--warn); }

.player { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .overlay { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; margin: 14px 0 10px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #ff7a59); transition: width 0.4s; }

.chapters { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.chapters li { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 0.92rem; }
.chapters li.seen { color: var(--text); }
.chapters li.current { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.chapters .time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 4px; }

.quiz-cta { margin-top: 22px; padding: 22px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--brand); }
.quiz-cta .facts li { background: var(--panel); }
.check { display: flex; align-items: center; gap: 10px; margin: 14px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.question { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 10px; margin: 0 0 14px; }
.question legend { display: flex; gap: 10px; align-items: baseline; padding: 0 6px; font-weight: 600; font-size: 1.05rem; }
.qnum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.85rem; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; margin: 6px 0; border-radius: 10px; background: var(--panel-2); cursor: pointer; border: 1px solid transparent; }
.option:hover { border-color: var(--line); }
.option input { margin-top: 5px; accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
.option:has(input:checked) { border-color: var(--brand); }

.result { text-align: center; }
.result-icon { font-size: 3.5rem; line-height: 1; margin-bottom: 12px; }
.result .score { font-family: 'Poppins', sans-serif; font-size: 1.4rem; }
.result[data-kind='pass'] .score { color: var(--good); }
.result[data-kind='fail'] .score { color: var(--brand); }

.footer { text-align: center; padding: 18px; }

@media (max-width: 600px) {
  .card { padding: 18px; }
  h1 { font-size: 1.3rem; }
  .steps li { font-size: 0.8rem; padding: 8px; }
  .brand-sub { display: none; }
  .user span { display: none; }
}

/* ---- owners: staff progress ---- */
body.wide main { max-width: 1180px; }
.button.small { padding: 6px 12px; font-size: 0.88rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 14px 0; }
.total { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.total-num { font-family: 'Poppins', sans-serif; font-size: 1.4rem; font-weight: 700; }
.total-label { color: var(--muted); font-size: 0.85rem; }
.staff-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.staff-tools input {
  flex: 1 1 220px; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.chip.on { border-color: var(--brand); color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.staff-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.staff-table th { text-align: left; font-weight: 600; font-size: 0.85rem; color: var(--muted); padding: 10px 12px; background: var(--panel-2); position: sticky; top: 0; }
.staff-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { border-radius: 50%; flex: none; }
.who-name { font-weight: 600; }
.yes { color: var(--good); font-weight: 600; }
.no { color: var(--muted); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.85rem; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.good { color: var(--good); border-color: rgba(62, 207, 142, 0.4); }
.tag.bad { color: var(--brand); border-color: rgba(226, 71, 71, 0.5); }
.tag.warn { color: var(--warn); border-color: rgba(245, 176, 65, 0.5); }
.tag.info { color: var(--text); }
.tag.muted { color: var(--muted); }
.vid { white-space: nowrap; }
.mini-bar { display: inline-block; width: 70px; height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-right: 8px; vertical-align: middle; }
.mini-bar div { height: 100%; background: linear-gradient(90deg, var(--brand), #ff7a59); }
@media (max-width: 600px) {
  #staff-toggle { font-size: 0.8rem; padding: 5px 9px; }
}
.user .link, .user .button { white-space: nowrap; }
