/* vantage — levels page + lesson page */

/* inline fractions: {{a/b}} */
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 .12em; font-size: .9em; }
.fr i { font-style: normal; padding: 0 .15em; }
.fr i:first-child { border-bottom: 2px solid currentColor; }
.m { font-family: var(--f-mono); font-size: .95em; background: var(--paper-2); border-radius: 8px; padding: 1px 8px; white-space: nowrap; }

.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font: 400 .8125rem var(--f-mono); color: var(--ink-3); }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.page-hero { padding: 40px 0 56px; }
.page-hero .soft { font-size: 1.375rem; line-height: 1.45; max-width: 600px; margin: 18px 0 0; }

/* ---------- levels page ---------- */
.mini-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ms { border-radius: 20px; padding: 20px; background: var(--paper-2); display: flex; flex-direction: column; gap: 4px; min-height: 148px; }
.ms svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: auto; }
.ms b { font: 600 1.125rem var(--f-display); margin-top: 14px; }
.ms small { font: 400 .9375rem/1.4 var(--f-soft); color: var(--ink-2); }
.ms.rec { background: var(--ink); color: #fff; position: relative; }
.ms.rec small { color: rgba(255,255,255,.65); }
.ms.rec::after { content: 'recommended'; position: absolute; right: 16px; top: 16px; font: 500 .75rem var(--f-mono); background: var(--hl); color: var(--ink); border-radius: 999px; padding: 4px 10px; }
.styles-note { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; font: 400 1rem var(--f-soft); color: var(--ink-2); }
.styles-note b { color: var(--ink); font-family: var(--f-display); font-weight: 600; }
.styles-note a { font: 600 .9375rem var(--f-display); text-decoration: none; border-bottom: 2px solid var(--hl); }
@media (max-width: 900px) { .mini-styles { grid-template-columns: 1fr 1fr; } }

.stage-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.stage-tabs .lbl { font: 400 .8125rem var(--f-mono); color: var(--ink-3); margin-right: 6px; }
.lvb { min-height: 48px; min-width: 64px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: 600 1rem var(--f-display); transition: background .25s, color .25s, border-color .25s, transform .35s var(--spring); }
.lvb:hover { border-color: var(--ink); transform: translateY(-2px); }
.lvb[aria-selected="true"] { background: var(--ink); color: var(--hl); border-color: var(--ink); }
.lvb.soon { border-style: dashed; color: var(--ink-3); }
.lvb + .sep { width: 1px; height: 28px; background: var(--line); margin: 0 6px; }

.lv-top { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: end; padding: 28px 32px; border-radius: 28px; background: var(--ink); color: #fff; margin-bottom: 14px; overflow: hidden; position: relative; }
.lv-top .n { font: 800 clamp(4.5rem, 10vw, 7.5rem)/.85 var(--f-display); letter-spacing: -.06em; color: var(--hl); }
.lv-top h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.lv-top p { font: 400 1rem/1.5 var(--f-soft); color: rgba(255,255,255,.7); margin: 8px 0 0; }
.lv-top .prog { text-align: right; font: 400 .8125rem var(--f-mono); color: rgba(255,255,255,.55); }
.lv-top .prog b { display: block; font: 700 2rem var(--f-display); color: #fff; letter-spacing: -.03em; }
.lv-top .bar { width: 160px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.14); margin-top: 8px; overflow: hidden; }
.lv-top .bar i { display: block; height: 100%; background: var(--hl); border-radius: 8px; transition: width .8s cubic-bezier(.3,1.2,.4,1); }
@media (max-width: 760px) { .lv-top { grid-template-columns: 1fr; gap: 12px; } .lv-top .prog { text-align: left; } }

.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .units { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .units { grid-template-columns: 1fr; } }
.unit { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); background: #fff; text-decoration: none;
  transition: transform .45s var(--spring), border-color .25s, box-shadow .3s; }
.unit:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: var(--shadow); }
.unit .no { width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); display: grid; place-items: center; font: 500 .8125rem var(--f-mono); transition: transform .45s var(--spring), background .25s; }
.unit:hover .no { transform: rotate(-8deg) scale(1.08); background: var(--hl); }
.unit b { font: 600 1.125rem/1.3 var(--f-display); margin: 14px 0 auto; }
.unit .st { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font: 400 .8125rem var(--f-mono); color: var(--ink-3); }
.unit .st .go { font: 600 .9375rem var(--f-display); color: var(--ink); transition: transform .35s var(--spring); }
.unit:hover .st .go { transform: translateX(4px); }
.unit.ready { border-color: var(--ink); }
.unit.ready .no { background: var(--ink); color: var(--hl); }
.chip-ready { font: 500 .75rem var(--f-mono); background: var(--hl); color: var(--ink); border-radius: 999px; padding: 4px 10px; }
.unit.done .no::after { content: '✓'; position: absolute; left: 50px; top: 18px; width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #fff; font: 700 .75rem/22px var(--f-body); text-align: center; }
.unit.soon { background: var(--paper-2); border-color: transparent; }
.unit.soon b { color: var(--ink-2); }
.lv-soon { border-radius: 28px; border: 2px dashed var(--line); padding: 56px 24px; text-align: center; }
.lv-soon b { display: block; font: 700 1.75rem var(--f-display); letter-spacing: -.03em; }
.lv-soon p { font: 400 1.0625rem var(--f-soft); color: var(--ink-2); margin: 8px auto 20px; max-width: 420px; }
.lv-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- lesson page ---------- */
.l-hero { padding: 32px 0 40px; }
.l-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-top: 16px; }
.l-hero .hook { font: 400 1.375rem/1.45 var(--f-soft); color: var(--ink-2); margin: 16px 0 0; max-width: 640px; }
.l-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.l-meta span { font: 500 .8125rem var(--f-mono); background: var(--paper-2); border-radius: 999px; padding: 8px 14px; }
.l-meta span.lv { background: var(--ink); color: var(--hl); }

.steps-bar { position: sticky; top: 76px; z-index: 40; background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.steps-bar .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 10px; padding-bottom: 10px; }
.steps-bar a { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font: 600 .9375rem var(--f-display); color: var(--ink-2); transition: background .25s, color .25s; }
.steps-bar a i { font: 400 .75rem var(--f-mono); font-style: normal; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--paper-2); transition: background .25s; }
.steps-bar a.on { background: var(--ink); color: #fff; }
.steps-bar a.on i { background: var(--hl); color: var(--ink); }
.steps-bar a.seen i { background: var(--ink); color: var(--hl); }
.steps-bar .fill { position: absolute; left: 0; bottom: -1px; height: 3px; background: var(--hl); width: 0; transition: width .2s; }

.lesson-sec { padding: 72px 0 8px; scroll-margin-top: 150px; }
.ls-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.ls-head .k { font: 400 .8125rem var(--f-mono); color: var(--ink-3); }
.ls-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.prose p { font: 400 1.1875rem/1.65 var(--f-soft); color: var(--ink); margin: 0 0 16px; }
.prose p b { font-family: var(--f-display); font-weight: 600; }
.key { margin-top: 8px; padding: 18px 22px; border-radius: 20px; background: var(--hl); font: 700 1.5rem var(--f-display); letter-spacing: -.02em; }
.key small { display: block; font: 400 .8125rem var(--f-mono); letter-spacing: 0; margin-bottom: 4px; }
.fml { display: grid; gap: 8px; margin: 18px 0 6px; }
.fml .label { margin-bottom: 2px; }
.fml-r { display: grid; grid-template-columns: 7.2em 1.2em 1fr auto; align-items: center; gap: 6px; padding: 12px 16px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.fml-r b { font: 700 1.12rem var(--f-display); letter-spacing: -.01em; white-space: nowrap; }
.fml-r b:first-child { background: var(--hl-soft); padding: 2px 8px; justify-self: start; }
.fml-r i { font-style: normal; font-weight: 600; color: var(--ink-2); text-align: center; }
.fml-r small { font-size: .72rem; color: var(--ink-2); text-align: right; }
@media (max-width: 560px) { .fml-r { grid-template-columns: auto auto 1fr; } .fml-r small { grid-column: 1 / -1; text-align: left; } }
.vocab { display: grid; gap: 8px; margin-top: 16px; }
.vocab div { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.vocab b { flex: none; min-width: 120px; font: 600 1rem var(--f-display); }
.vocab div > span { font: 400 1rem var(--f-soft); color: var(--ink-2); }
@media (max-width: 900px) { .learn-grid { grid-template-columns: 1fr; } }

/* the interactive diagram tile */
.widget { position: sticky; top: 160px; border-radius: 28px; background-color: var(--ink); color: #fff; padding: 22px; overflow: hidden;
  background-image: linear-gradient(rgba(203,233,106,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(203,233,106,.06) 1px, transparent 1px); background-size: 28px 28px;
  box-shadow: 0 30px 60px -25px rgba(20,21,23,.5); }
@media (max-width: 900px) { .widget { position: relative; top: 0; } }
.w-top { display: flex; justify-content: space-between; gap: 12px; font: 400 .8125rem var(--f-mono); color: rgba(255,255,255,.55); }
.widget svg { display: block; width: 100%; height: auto; margin: 10px 0 6px; }
.w-read { font: 600 1.375rem var(--f-display); letter-spacing: -.02em; min-height: 2em; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.w-read b { color: var(--hl); font-weight: 600; }
.w-ctrl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.w-ctrl label { font: 400 .8125rem var(--f-mono); color: rgba(255,255,255,.6); flex: none; }
.w-ctrl input[type=range] { flex: 1; min-width: 140px; accent-color: var(--hl); height: 44px; }
.wb { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.35); background: transparent; color: #fff; font: 600 .9375rem var(--f-display); transition: background .2s, color .2s, border-color .2s, transform .3s var(--spring); }
.wb:hover { border-color: #fff; transform: translateY(-2px); }
.wb.on, .wb.hl { background: var(--hl); color: var(--ink); border-color: var(--hl); }
.wb:disabled { opacity: .35; pointer-events: none; }
.w-hint { margin-top: 10px; font: 400 .875rem var(--f-soft); color: rgba(255,255,255,.55); }

/* step by step */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.how-steps li { counter-increment: st; display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; border-radius: 20px; border: 1px solid var(--line); background: #fff; }
.how-steps li::before { content: '0' counter(st); width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: var(--hl); display: grid; place-items: center; font: 600 1.125rem var(--f-display); }
.how-steps b { display: block; font: 600 1.125rem var(--f-display); }
.how-steps li > div > span { font: 400 1rem/1.5 var(--f-soft); color: var(--ink-2); }
.how-steps .mx { font: 500 1rem var(--f-mono); background: var(--paper-2); border-radius: 12px; padding: 10px 14px; white-space: nowrap; }
@media (max-width: 760px) { .how-steps li { grid-template-columns: 44px 1fr; } .how-steps li::before { width: 44px; height: 44px; border-radius: 12px; } .how-steps .mx { grid-column: 2; justify-self: start; white-space: normal; } }

/* worked examples */
.ex { border-radius: 28px; background: var(--paper-2); padding: 28px; margin-bottom: 14px; }
.ex-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ex .q { font: 600 clamp(1.25rem, 2.4vw, 1.5rem)/1.4 var(--f-display); letter-spacing: -.015em; margin: 12px 0 18px; }
.ex ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex ol li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border-radius: 16px; background: #fff; font: 400 1.0625rem/1.5 var(--f-soft); animation: rise .45s cubic-bezier(.2,.9,.3,1.2); }
.ex ol li > i { font: 400 .75rem/1.9 var(--f-mono); font-style: normal; color: var(--ink-3); }
.ex ol li.ans { background: var(--ink); color: #fff; }
.ex ol li.ans > i { color: var(--hl); }
.ex ol li.ans b { color: var(--hl); font-family: var(--f-display); }
.ex .acts { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.ex .acts small { font: 400 .875rem var(--f-soft); color: var(--ink-3); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* your turn + challenge */
.turns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
@media (max-width: 960px) { .turns { grid-template-columns: 1fr; } }
.turn { border-radius: 24px; border: 1px solid var(--line); padding: 22px; background: #fff; display: flex; flex-direction: column; }
.turn .q { font: 600 1.125rem/1.45 var(--f-display); margin: 10px 0 16px; }
.turn .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.opt { min-height: 52px; text-align: left; padding: 10px 16px; border: 2px solid var(--line); border-radius: 16px; background: #fff; font: 600 1.0625rem var(--f-display);
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--spring); }
.opt:not(.right):not(.wrong):not(:disabled):hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); }
.opt.right { background: var(--good-bg); border-color: var(--good); }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.why { display: none; margin-top: 12px; font: 400 1rem/1.5 var(--f-soft); color: var(--ink-2); }
.why.show { display: block; animation: rise .4s ease; }
.why b { color: var(--ink); font-family: var(--f-display); font-weight: 600; }
.saved { display: inline-flex; margin-top: 8px; font: 500 .75rem var(--f-mono); background: var(--ink); color: var(--hl); border-radius: 999px; padding: 5px 11px; }
.score { display: flex; align-items: center; gap: 12px; margin-top: 14px; font: 400 .9375rem var(--f-soft); color: var(--ink-2); }
.score b { font: 700 1.5rem var(--f-display); color: var(--ink); }

.chal { border-radius: 28px; background: var(--ink); color: #fff; padding: clamp(28px, 4vw, 44px); position: relative; overflow: hidden; }
.chal .lbl { display: inline-flex; gap: 8px; align-items: center; font: 500 .8125rem var(--f-mono); background: var(--hl); color: var(--ink); border-radius: 999px; padding: 6px 12px; }
.chal .q { font: 600 clamp(1.375rem, 2.8vw, 1.875rem)/1.4 var(--f-display); letter-spacing: -.02em; margin: 18px 0 24px; max-width: 820px; }
.chal .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 760px) { .chal .opts { grid-template-columns: 1fr 1fr; } }
.chal .opt { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.chal .opt:not(.right):not(.wrong):not(:disabled):hover { background: #fff; color: var(--ink); border-color: #fff; }
.chal .opt.right { background: var(--hl); color: var(--ink); border-color: var(--hl); }
.chal .opt.wrong { background: rgba(229,72,77,.25); border-color: var(--bad); }
.chal .tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.chal .hint, .chal .sol { margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.07); font: 400 1.0625rem/1.55 var(--f-soft); animation: rise .4s ease; }
.chal .hint > span, .chal .sol > span { display: block; font: 400 .75rem var(--f-mono); color: var(--hl); margin-bottom: 4px; }
.chal .sol ol { margin: 0; padding-left: 20px; } .chal .sol li { margin: 4px 0; }
.chal .ghost { position: absolute; right: -10px; bottom: -60px; font: 800 260px/1 var(--f-display); opacity: .05; pointer-events: none; }

/* summary */
.sum-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
@media (max-width: 900px) { .sum-grid { grid-template-columns: 1fr; } }
.sum-card { border-radius: 28px; border: 1px solid var(--line); padding: 28px; background: #fff; }
.sum-card ul { list-style: none; margin: 14px 0 0; padding: 0; }
.sum-card li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font: 400 1.0625rem/1.5 var(--f-soft); }
.sum-card li:last-child { border: 0; }
.sum-card li::before { content: ''; flex: none; width: 10px; height: 10px; margin-top: 9px; border-radius: 3px; background: var(--ink); transform: rotate(45deg); }
.tips { display: grid; gap: 10px; }
.tip { border-radius: 20px; background: var(--hl); padding: 18px 20px; }
.tip small { font: 500 .75rem var(--f-mono); }
.tip b { display: block; font: 600 1.0625rem/1.4 var(--f-display); margin-top: 4px; }
.tip > span { font: 400 .9375rem/1.45 var(--f-soft); }
.oops { border-radius: 20px; background: var(--bad-bg); padding: 18px 20px; }
.oops small { font: 500 .75rem var(--f-mono); color: var(--bad); }
.oops p { margin: 6px 0 0; font: 400 1rem/1.5 var(--f-soft); }

.l-end { margin: 64px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.l-end a, .l-end button { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-radius: 24px; border: 1px solid var(--line); background: #fff; text-decoration: none; text-align: left; min-height: 104px;
  transition: transform .45s var(--spring), border-color .25s, background .25s; }
.l-end a:hover, .l-end button:hover { transform: translateY(-4px); border-color: var(--ink); }
.l-end small { font: 400 .8125rem var(--f-mono); color: var(--ink-3); }
.l-end b { font: 600 1.25rem var(--f-display); letter-spacing: -.01em; }
.l-end .done-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.l-end .done-btn small { color: rgba(255,255,255,.55); }
.l-end .done-btn.is-done { background: var(--good); border-color: var(--good); }
.l-end .r { text-align: right; align-items: flex-end; }
@media (max-width: 640px) { .l-end { grid-template-columns: 1fr; } .l-end .r { text-align: left; align-items: flex-start; } }
.not-yet { padding: 40px 0 80px; }
.not-yet .box { border-radius: 28px; border: 2px dashed var(--line); padding: 48px 28px; text-align: center; }
.not-yet .box p { font: 400 1.125rem var(--f-soft); color: var(--ink-2); max-width: 460px; margin: 10px auto 24px; }

/* ---------- refinements: bangul's lesson language — lead line, stat cards, numbered heads; shadows instead of borders ---------- */
.l-hero { padding: 28px 0 24px; }
.l-hero h1 { font-size: clamp(2.75rem, 6.5vw, 4.5rem); margin-top: 10px; }
.l-hero .hook { font: 400 1.1875rem/1.5 var(--f); }
.lead { font: 500 1.3125rem/1.55 var(--f); letter-spacing: -.01em; max-width: 760px; margin: 28px 0 22px; }
.lead b { font-weight: 700; }
.lesson-sec .nh { margin-bottom: 28px; }
.how-steps li, .turn, .sum-card, .l-end a, .l-end button { border: 0; box-shadow: var(--shadow); }
.how-steps li::before { font-family: var(--f); }
.l-end a:hover, .l-end button:hover { box-shadow: var(--shadow-lg); }
.ex { background: #fff; box-shadow: var(--shadow); }
.ex ol li { background: var(--paper-2); }
.ex .label, .turn .label { font-weight: 600; color: var(--ink); }
.steps-bar { border-bottom: 0; box-shadow: 0 10px 20px -18px rgba(20,21,23,.35); }
.vocab b { font-weight: 600; }
.chal .lbl, .tip small, .oops small, .saved, .w-top, .w-ctrl label, .ex ol li > i, .how-steps .mx { font-family: var(--f); }
.how-steps .mx { font-weight: 500; }
.key { font-size: 1.625rem; }

/* ---------- recap (bangul's "what you learned"): small numbered cards, one tips table, prev / next ---------- */
.recap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rc { background: #fff; border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); }
.rc em { font: 600 .8125rem var(--f); font-style: normal; color: var(--ink-3); }
.rc p { margin: 6px 0 0; font: 500 1rem/1.5 var(--f); }
.rc:first-child { background: var(--ink); color: #fff; } .rc:first-child em { color: var(--hl); }
@media (max-width: 900px) { .recap { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .recap { grid-template-columns: 1fr; } }
.keep { margin-top: 14px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 22px 26px 12px; }
.keep-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.keep-head b { font: 600 1.125rem var(--f); }
.keep-head > span { font-size: .875rem; color: var(--ink-3); }
.keep-head .btn { margin-left: auto; }
.keep-head .btn.is-done { background: var(--good); border-color: var(--good); }
.keep-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.kr { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kt { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tile); font: 700 .9375rem var(--f); }
.kr b { display: block; font: 600 1rem/1.4 var(--f); }
.kr small { display: block; font: 400 .9375rem/1.45 var(--f); color: var(--ink-2); margin-top: 2px; }
.oops-r .kt { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) { .keep-grid { grid-template-columns: 1fr; } .keep-head .btn { margin-left: 0; } }
.ldots { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 34px 0 18px; }
.ldots .ld-lab { font-size: .8rem; font-weight: 600; color: var(--ink-2, #555); margin-right: 10px; }
.ldots a { width: 22px; height: 8px; border-radius: 8px; background: var(--tile); transition: background .2s, width .3s var(--spring); }
.ldots a.dn { background: var(--hl); } .ldots a.on { background: var(--ink); width: 32px; }
.lnav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.lnav a { position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 16px 20px; border-radius: 20px; background: #fff; box-shadow: var(--shadow);
  text-decoration: none; transition: transform .45s var(--spring), box-shadow .3s; }
.lnav a:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lnav small { grid-column: 1 / -1; font-size: .8125rem; color: var(--ink-3); margin-bottom: 8px; }
.lnav .g { width: 52px; height: 52px; border-radius: 14px; background: var(--tile); display: grid; place-items: center; font: 700 1.125rem var(--f); font-style: normal; transition: transform .45s var(--spring); }
.lnav .g.dn { background: var(--ink); color: var(--hl); }
.lnav a:hover .g { transform: rotate(-8deg); }
.lnav .lt b { display: block; font: 600 1rem var(--f); } .lnav .lt span { font-size: .9375rem; color: var(--ink-2); }
.lnav .ck { position: absolute; right: 20px; bottom: 18px; color: var(--good); font-style: normal; font-weight: 700; }
.lnav a.pv .lt { grid-column: 2; grid-row: 2; } .lnav a.pv .g { grid-column: 1; grid-row: 2; }
.lnav a.nx { grid-template-columns: 1fr 52px; text-align: right; } .lnav a.nx .lt { grid-column: 1; grid-row: 2; } .lnav a.nx .g { grid-column: 2; grid-row: 2; }
.lnav a.nx .ck { left: 20px; right: auto; }
@media (max-width: 640px) { .lnav { grid-template-columns: 1fr; } }

/* ---------- formula as blocks (bangul's word blocks): tiles with a caption, one highlighted ---------- */
.blocks-wrap { margin: 10px 0 6px; }
.blocks { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.blk { min-width: 84px; padding: 14px 14px 10px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: center; transition: transform .45s var(--spring); }
.blk:hover { transform: translateY(-3px) rotate(-2deg); }
.blk b { display: block; font: 700 1.5rem/1.15 var(--f); letter-spacing: -.02em; white-space: nowrap; }
.blk small { display: block; margin-top: 4px; font-size: .75rem; color: var(--ink-3); }
.blk.on { background: var(--hl); } .blk.on small { color: var(--ink); }
.blocks .op { align-self: center; font: 700 1.375rem var(--f); color: var(--ink-3); padding: 0 2px; margin-top: -14px; }
.key { display: none; }

/* ---------- diagrams ---------- */
.vis { background: var(--tile); border-radius: 18px; padding: 14px; display: grid; place-items: center; }
.vis svg { display: block; width: 100%; max-width: 320px; height: auto; }
.vis.sm { margin: 10px 0 2px; padding: 10px; } .vis.sm svg { max-height: 130px; }
.prob { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: center; background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 22px 22px 22px 28px; margin-bottom: 14px; }
.prob-t p { font: 600 1.375rem/1.4 var(--f); letter-spacing: -.015em; margin: 8px 0 6px; }
.prob-t small { font-size: .9375rem; color: var(--ink-3); }
.ex-body.has-v { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.ex-body .q { margin-top: 12px; }
.chal-body.has-v { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: center; margin-bottom: 20px; }
.chal-body .q { margin-bottom: 0; }
.chal .vis { background: #fff; }
@media (max-width: 860px) { .prob, .ex-body.has-v, .chal-body.has-v { grid-template-columns: 1fr; } .prob { padding: 22px; } }

/* ---------- recap: more lime — next lesson, done, ticks ---------- */
.kt { background: var(--hl); }
.oops-r .kt { background: var(--bad-bg); }
.lnav a.nx .g { background: var(--hl); }
.lnav .g.dn { background: var(--hl); color: var(--ink); }
.lnav .ck { color: #7d9a22; }
.ldots a.dn { background: var(--hl); }
.keep-head .btn.is-done { background: var(--hl); border-color: var(--hl); color: var(--ink); }

/* diagrams sit straight on the card — no grey panel */
.vis { background: transparent; padding: 4px 0; }
.vis.sm { padding: 0; }
.chal .vis { background: #fff; padding: 14px; }
.kt { background: var(--hl-soft); }
.lnav a.nx .g, .lnav .g.dn, .ldots a.dn, .keep-head .btn.is-done { background: var(--hl-soft); }

/* ---------- widget parts ---------- */
.w-html { margin: 12px 0 6px; min-height: 120px; }
.pv { display: grid; gap: 6px; }
.pvc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 14px; background: rgba(255,255,255,.06); }
.pvc b { font: 700 2rem/1 var(--f); color: var(--hl); }
.pvc small { font-size: .625rem; line-height: 1.2; text-align: center; color: rgba(255,255,255,.55); min-height: 2.4em; }
.pvb { width: 36px; height: 32px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: .75rem; }
.pvb:hover { background: var(--hl); color: var(--ink); }
.coins { display: flex; flex-wrap: wrap; gap: 8px; min-height: 120px; align-content: flex-start; }
.coins span { display: grid; place-items: center; font: 700 .875rem var(--f); color: var(--ink); }
.coins .coin { width: 52px; height: 52px; border-radius: 50%; background: var(--hl); box-shadow: inset 0 0 0 4px rgba(0,0,0,.12); }
.coins .note { width: 84px; height: 48px; border-radius: 8px; background: #f4f2ea; box-shadow: inset 0 0 0 3px var(--hl); }
.stp { display: grid; gap: 12px; }
.stp-n { display: flex; gap: 4px; } .stp-n i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); } .stp-n i.on { background: var(--hl); }
.stp-e { font: 700 1.625rem/1.35 var(--f); letter-spacing: -.02em; min-height: 2.6em; }
.stp-v { background: #fff; border-radius: 16px; padding: 10px; } .stp-v svg { display: block; width: 100%; max-height: 170px; }
.widget .w-read .fr i:first-child { border-color: currentColor; }

.prob.nov { grid-template-columns: 1fr; }
