@font-face { font-family: "Manrope"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/manrope-400.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/manrope-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/manrope-800.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/fraunces-500.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/fraunces-700.woff2") format("woff2"); }
/* ZenFrog AI — shared styles for the desktop app and SCORM packages.
   Same palette and type scale as the iPhone app (Design/Theme.swift). */
/* ZenFrog palette and type (see the ZenFrog design system): hunter green fills, mint for links and small
   accents, dark grounds, Fraunces for display, Manrope for everything else. Fonts ship with the app (OFL). */
:root {
  --bg: #0E110F;
  --surface: #151916;
  --raised: #1E241F;
  --line: #2E352F;
  --ink: #FFFFFF;
  --text: #F4F5F3;
  --muted: #B9BEB8;
  --gray: #9AA09A;
  --hunter: #355E3B;
  --mint: #A9C9AE;
  --tint-fill: #1A241C;
  --ok-fill: #13261A;
  --ok-line: #6FCB82;
  --bad-fill: #2A1715;
  --bad-line: #E08A80;
  --gutter: 20px;
  --r-card: 18px;
  --r-btn: 12px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; border-right: 1px solid var(--line); padding: 20px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; background: var(--bg);
}
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 6px 18px; }
.sidebar .brand .logo { width: 100%; max-width: 190px; height: auto; display: block; }
.sidebar .brand span { display: block; font-size: 11px; color: var(--mint); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: none; border: 0; text-align: left; cursor: pointer; font-weight: 650; color: var(--muted);
}
.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--raised); color: var(--text); }
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.sidebar .foot { font-size: 11px; color: var(--gray); padding: 8px 12px; }
.main { flex: 1; min-width: 0; }
.page { max-width: 760px; margin: 0 auto; padding: 18px var(--gutter) 120px; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 8px; }
.back { background: none; border: 0; cursor: pointer; color: var(--muted); font-weight: 700; padding: 8px 4px; display: inline-flex; align-items: center; gap: 4px; }
.back:hover { color: var(--text); }
.back svg { width: 18px; height: 18px; flex: none; }
.back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; justify-content: space-around;
  }
  .tabbar .nav-btn { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; }
}

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.screen-title { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.1; margin: 4px 0 14px; }
.card-title { font-size: 19px; font-weight: 800; }
.section-label { font-size: 12.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mint); margin: 22px 0 10px; }
.muted { color: var(--muted); }
.detail { font-size: 14px; color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }

/* ---------- Brand ---------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 10px; }
.hero .logo { width: min(360px, 86%); height: auto; display: block; }
.wordmark { text-align: center; line-height: 1; }
.wordmark .eyebrow { font-size: 12.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mint); margin-bottom: 6px; }
.wordmark .ai { font-family: var(--display); font-size: 48px; font-weight: 700; color: var(--ink); line-height: 1.05; }
.wordmark .ip { font-family: var(--display); font-size: 19px; font-weight: 500; color: var(--text); margin-top: 6px; }

/* ---------- Cards & rows ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.card + .card { margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.tile b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tile.accent b { color: var(--mint); }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 10px;
}
.row:hover { background: var(--raised); }
.row .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--raised); display: grid; place-items: center; flex: none; color: var(--text); }
.row .ico svg { width: 20px; height: 20px; }
.row .ico.red { background: var(--hunter); }
.row .txt { flex: 1; min-width: 0; }
.row .txt b { display: block; font-size: 17px; font-weight: 700; }
.row .txt span { font-size: 14px; color: var(--muted); }
.row .chev { color: var(--gray); flex: none; }
.row .badge { background: var(--hunter); color: #fff; font-weight: 800; font-size: 13px; border-radius: 999px; padding: 2px 9px; }
.row.done .ico { background: var(--ok-fill); color: var(--ok-line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--text); border: 1px solid var(--line); }
.chip.warn { background: var(--tint-fill); border-color: var(--mint); color: var(--mint); }
.bar { height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--mint); border-radius: 99px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px;
  border-radius: var(--r-btn); border: 0; cursor: pointer; font-weight: 800; font-size: 16px; width: 100%;
  background: var(--hunter); color: var(--ink);
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.35; cursor: default; filter: none; }
.btn.secondary { background: var(--raised); border: 1px solid var(--line); }
.btn.small { min-height: 40px; width: auto; font-size: 14px; padding: 0 14px; }
.bottombar { position: sticky; bottom: 0; padding: 14px 0 18px; background: linear-gradient(transparent, var(--bg) 30%); margin-top: 18px; display: flex; gap: 10px; }
@media (max-width: 860px) { .app-mode .bottombar { bottom: 62px; } }

/* ---------- Quiz ---------- */
.rail { display: flex; align-items: center; gap: 8px; }
.rail .bars { display: flex; align-items: center; gap: 3px; }
.rail .bars i { width: 5px; height: 14px; border-radius: 2px; background: var(--raised); }
.rail .bars i.on { height: 22px; background: var(--mint); }
.rail .cap { width: 3px; height: 10px; border-radius: 2px; background: var(--gray); }
.rail span { font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.prompt { font-size: 22px; font-weight: 750; margin: 6px 0 16px; line-height: 1.3; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; min-height: 72px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 10px;
  font-size: 17px; font-weight: 600;
}
.option:hover:not(:disabled) { border-color: var(--gray); }
.option .letter { width: 34px; height: 34px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.option.selected { border-color: var(--text); }
.option.selected .letter { background: var(--text); color: var(--bg); }
.option.correct { border-color: var(--ok-line); background: var(--ok-fill); }
.option.correct .letter { background: var(--ok-line); color: #000; }
.option.wrong { border-color: var(--bad-line); background: var(--bad-fill); }
.option.wrong .letter { background: var(--bad-line); color: #000; }
.option.dimmed { color: var(--muted); opacity: 0.7; }
.option:disabled { cursor: default; }
.feedback { border-radius: var(--r-card); padding: 16px; margin-top: 6px; border: 1px solid var(--line); background: var(--surface); }
.feedback.ok { border-color: var(--ok-line); }
.feedback.no { border-color: var(--bad-line); }
.feedback h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.feedback.ok h3 { color: var(--ok-line); }
.feedback.no h3 { color: var(--bad-line); }
.feedback .ref { font-size: 13px; color: var(--gray); margin-top: 10px; }
.feedback .answer { margin: 4px 0 8px; font-weight: 650; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: 13px; margin-top: 10px; }
.kbd-hint { font-size: 12px; color: var(--gray); margin-top: 8px; }
@media (max-width: 860px) { .kbd-hint { display: none; } }

/* ---------- Results ---------- */
.score-big { font-family: var(--display); font-size: 64px; font-weight: 700; color: var(--mint); font-variant-numeric: tabular-nums; line-height: 1; }
.verdict { font-size: 19px; font-weight: 800; text-transform: uppercase; margin-top: 12px; }
.area-row { display: grid; grid-template-columns: 1fr 110px 48px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.area-row:last-child { border-bottom: 0; }
.area-row b { font-weight: 650; font-size: 15px; }
.area-row span { font-variant-numeric: tabular-nums; text-align: right; font-weight: 750; }
.miss { border-color: var(--bad-line); }
.miss p { margin: 6px 0 0; }
.pass-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; margin-top: 10px; }
.pass-pill.ok { background: var(--ok-fill); color: var(--ok-line); border: 1px solid var(--ok-line); }
.pass-pill.no { background: var(--bad-fill); color: var(--bad-line); border: 1px solid var(--bad-line); }

/* ---------- Lessons ---------- */
.lesson-intro { font-size: 18px; line-height: 1.5; margin: 0 0 14px; }
.points { list-style: none; padding: 0; margin: 0; }
.points li { position: relative; padding: 10px 0 10px 22px; border-bottom: 1px solid var(--line); }
.points li:last-child { border-bottom: 0; }
.points li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.numbers div { background: var(--raised); border-radius: 12px; padding: 12px; }
.numbers b { display: block; font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--mint); }
.numbers span { font-size: 13.5px; color: var(--muted); }
.trap { background: var(--tint-fill); border-color: #4F7D56; }
.trap h3 { color: var(--mint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.ref-line { font-size: 13px; color: var(--gray); margin-top: 14px; }
a.gloss { color: var(--mint); text-decoration: none; border-bottom: 1px dotted var(--mint); cursor: pointer; }
.verify-mark { color: var(--mint); font-size: 12px; margin-left: 4px; }

/* ---------- Dictionary ---------- */
.search { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; margin-bottom: 14px; }
.term-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; cursor: pointer; }
.term-row:hover { background: var(--surface); }
.term-row b { font-size: 16.5px; }
.term-row span { display: block; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; max-width: 520px; width: 100%; max-height: 85vh; overflow: auto; }
.modal h2 { font-family: var(--display); font-size: 26px; font-weight: 700; }
.modal .exp { color: var(--muted); font-weight: 650; margin-top: 2px; }

/* ---------- Toggle ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--raised); border: 1px solid var(--line); border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 26px; height: 26px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--ok-line); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- SCORM player ---------- */
.scorm-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.scorm-head .logo { width: 92px; height: auto; flex: none; display: block; }
.scorm-head .t b { display: block; font-size: 17px; font-weight: 800; }
.scorm-head .t span { font-size: 13px; color: var(--muted); }
.steps { display: flex; gap: 4px; margin: 4px 0 16px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--raised); }
.steps i.on { background: var(--mint); }
.lms-note { font-size: 12.5px; color: var(--gray); margin-top: 8px; }
@media (max-width: 520px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .wordmark .ai { font-size: 48px; }
  .prompt { font-size: 20px; }
  .area-row { grid-template-columns: 1fr 70px 44px; }
}

/* ---------- Build track ---------- */
.btn svg { width: 18px; height: 18px; flex: none; }
.build-step { display: flex; gap: 14px; }
.build-step .step-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--hunter); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.build-step .step-b { flex: 1; min-width: 0; }
.build-step .step-b > b { display: block; font-size: 17px; font-weight: 750; margin-top: 4px; }
.build-step .step-b p { margin: 6px 0 0; color: var(--text); line-height: 1.5; }
.copybox { white-space: pre-wrap; word-break: break-word; font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0 10px; max-height: 340px; overflow: auto; color: var(--text); }
.plan-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--mint); margin: 10px 0 0; }
.plan-line svg { width: 16px; height: 16px; flex: none; }
.check-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 2px; cursor: pointer; font: inherit; font-size: 15.5px; line-height: 1.4; }
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-row .box { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--gray); }
.check-row .box svg { width: 22px; height: 22px; }
.check-row.on .box { background: var(--ok-fill); color: var(--ok-line); }
.check-row.on > span:last-child { color: var(--muted); }
.trap .check-row { margin-top: 8px; border-top: 1px solid var(--line); }

/* ---------- Completion badge ---------- */
.badge-wrap { position: relative; width: min(340px, 80%); margin: 6px auto 18px; }
.badge-wrap img { width: 100%; height: auto; display: block; }
.badge-wrap.locked img { filter: grayscale(1) brightness(0.55); }
.badge-wrap .lock { display: table; margin: 12px auto 0; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px; color: var(--mint); }
.req { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.req + .req { border-top: 1px solid var(--line); }
.req .box { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--gray); }
.req .box svg { width: 22px; height: 22px; }
.req.ok .box { background: var(--ok-fill); color: var(--ok-line); }
.req .txt { flex: 1; min-width: 0; }
.req .txt b { display: block; font-size: 16px; }
.req .txt span { font-size: 14px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field input { font: inherit; font-size: 17px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.field input:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.cert-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.cert-meta b { color: var(--text); }
.steps-card .points li { margin-bottom: 8px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btnrow .btn { width: auto; flex: 1 1 200px; text-decoration: none; }

/* ---------- Access code ---------- */
.unlock .logo.hero { width: min(300px, 70%); height: auto; display: block; margin: 4px auto 14px; }
.unlock-form { margin-top: 14px; }
.unlock-form input { text-transform: none; letter-spacing: 0.02em; }
.unlock-msg { min-height: 1.4em; margin: 10px 0 0; font-weight: 700; font-size: 14px; color: var(--muted); }
.unlock-msg.bad { color: var(--wrong-line, #E08A80); }
