/* Learner app: mobile first, one clear action per screen. */
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(248, 245, 241, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.topbar .logo { height: 22px; display: block; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .crumb { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink); text-decoration: none; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; border: 0; cursor: pointer; flex: none; }
.menu { position: absolute; right: 16px; top: 60px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.12); padding: 6px; min-width: 220px; }
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who strong { display: block; }
.menu .who small { color: var(--muted); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; background: none; border: 0; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; }
.menu a:hover, .menu button:hover { background: var(--bg); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px 24px; }
.auth-card .logo { height: 26px; margin-bottom: 28px; }
.auth-card h1 { font-size: 26px; }
.auth-card p.lead { color: var(--muted); margin: 0 0 24px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 56px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px; }

/* ---------- home ---------- */
.hello { padding: 20px 0 8px; }
.hello h1 { font-size: 28px; margin-bottom: 4px; }
.hello p { margin: 0; color: var(--muted); }
.hero { padding: 22px; margin: 18px 0 28px; position: relative; overflow: hidden; }
.hero .eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-ink); }
.hero h2 { font-size: 22px; margin: 6px 0 6px; }
.hero p { color: var(--muted); margin: 0 0 18px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hero-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), #efe8e0 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.hero-progress strong { display: block; font-size: 17px; }
.hero-progress small { color: var(--muted); }

.section-title { font-size: 15px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 8px 0 12px; }
.path { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.path li a, .path li .row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink);
}
.path li a:hover { border-color: #e0d2c4; }
.path .num { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: #f3eee8; color: var(--ink-2); }
.path .num svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.path .passed .num { background: var(--green-soft); color: var(--green); }
.path .open .num { background: var(--orange); color: #fff; }
.path .locked { opacity: 0.6; }
.path .txt { flex: 1; min-width: 0; }
.path .txt strong { display: block; font-size: 16px; }
.path .txt small { color: var(--muted); font-size: 13.5px; }
.chev { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }

.done-card { padding: 28px 22px; text-align: center; margin: 18px 0 28px; }
.done-card .medal { width: 76px; height: 76px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; margin: 0 auto 14px; }
.done-card .medal svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- day ---------- */
.day-head { padding: 18px 0 6px; }
.day-head .eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-ink); }
.day-head h1 { font-size: 26px; margin: 6px 0; }
.day-head p { color: var(--muted); margin: 0; }
.lesson-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.lesson-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.lesson-list a:hover { border-color: #e0d2c4; }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d9cfc4; flex: none; display: grid; place-items: center; }
.check.on { background: var(--green); border-color: var(--green); }
.check svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lesson-list .txt { flex: 1; min-width: 0; }
.lesson-list .txt strong { display: block; }
.lesson-list .txt small { color: var(--muted); }
.quiz-card { padding: 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.quiz-card .txt { flex: 1 1 240px; }
.quiz-card h3 { margin: 0 0 4px; font-size: 18px; }
.quiz-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.quiz-card.passed { background: var(--green-soft); border-color: #cbe9dc; }

/* ---------- lesson ---------- */
.reader { padding: 8px 0 24px; }
.reader-top { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 6px 0 10px; }
.reader h1 { font-size: 27px; margin: 18px 0 6px; }
.reader .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.reader-nav { display: flex; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.reader-nav .btn.primary { flex: 1; }

/* ---------- quiz ---------- */
.quiz { padding: 10px 0 24px; }
.quiz-steps { display: flex; gap: 6px; margin: 8px 0 22px; }
.quiz-steps i { flex: 1; height: 6px; border-radius: 99px; background: #e9e1d8; }
.quiz-steps i.done { background: var(--orange); }
.quiz-steps i.now { background: var(--ink); }
.quiz .qcount { font-size: 14px; font-weight: 700; color: var(--muted); }
.quiz h2 { font-size: 21px; margin: 6px 0 6px; line-height: 1.4; }
.quiz .hint { font-size: 14px; color: var(--orange-ink); font-weight: 700; margin-bottom: 18px; }
.options { display: grid; gap: 10px; margin-bottom: 26px; }
.opt { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left; width: 100%; font-size: 16px; line-height: 1.45; transition: border-color 0.12s, background 0.12s; }
.opt:hover { border-color: #dccfc2; }
.opt .mark { width: 26px; height: 26px; flex: none; border: 2px solid #d4c9be; border-radius: 50%; display: grid; place-items: center; }
.opt.multi .mark { border-radius: 8px; }
.opt .mark svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.opt[aria-checked="true"] { border-color: var(--orange); background: var(--orange-soft); }
.opt[aria-checked="true"] .mark { background: var(--orange); border-color: var(--orange); }
.opt[aria-checked="true"] .mark svg { opacity: 1; }
.quiz-nav { display: flex; gap: 10px; }
.quiz-nav .btn.primary { flex: 1; }

.result { text-align: center; padding: 26px 20px; margin-top: 18px; }
.result .score { font-size: 54px; font-weight: 800; line-height: 1; margin: 14px 0 6px; letter-spacing: -0.03em; }
.result.pass .score { color: var(--green); }
.result.fail .score { color: var(--ink); }
.result .emblem { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.result.pass .emblem { background: var(--green); }
.result.fail .emblem { background: var(--orange-soft); }
.result .emblem svg { width: 36px; height: 36px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.result.pass .emblem svg { stroke: #fff; }
.result.fail .emblem svg { stroke: var(--orange); }
.result p { color: var(--muted); max-width: 440px; margin: 8px auto 20px; }
.result .actions { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; }
.wrong-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; text-align: left; }
.wrong-list li { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; }
.wrong-list li p { margin: 0 0 6px; color: var(--ink); font-weight: 600; text-align: left; max-width: none; }
.wrong-list a { font-size: 14px; font-weight: 700; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } * { transition: none !important; animation-duration: 0.01s !important; } }

/* ---------- certificate ---------- */
.cert { padding: 40px 28px; text-align: center; border: 2px solid var(--orange); margin: 20px 0; background: #fff; }
.cert .logo { height: 28px; margin-bottom: 26px; }
.cert small { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 800; color: var(--muted); font-size: 12px; }
.cert h1 { font-size: 30px; margin: 10px 0; }
.cert p { color: var(--ink-2); }
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .cert { box-shadow: none; margin: 40px 0; }
}

@media (min-width: 640px) {
  .hello h1 { font-size: 32px; }
  .hero { padding: 28px; }
  .auth-card { padding: 40px 36px; }
}
