/* Graded English Daily · learn.klemhq.com
   Green system from miniapp/design/SPEC.md (v8 tokens): --g / --gd / --gl / --gh, ink scale, single-layer light shadows,
   radius scale 10/6/3/999 px (= 20/12/6/999 rpx). Channel gold #F4C430 is the accent (top bar, highlights), never a
   generic button colour. Paper-and-teaching-aid feel: white cards on a pale green-grey ground, round stamps, no cartoon. */
:root {
  --g: #1E7B4E; --gd: #16543C; --gl: #EBF3EE; --gh: #2A9163; --gdd: #0F3D2B;
  --gold: #F4C430; --gold-t: #8A6A12; --cream: #FFFDF6; --cream2: #FBF3DF; --cedge: #E7DCBE;
  --bg: #F3F5F2; --card: #FFFFFF; --paper: #FEFEFC; --pedge: #E7E3D8;
  --ink: #14261F; --ink2: #3C4E45; --mut: #6E8078; --faint: #A6B3AC; --line: #E4EAE6; --line2: #F0F4F2;
  --ok: #1E7B4E; --bad: #B3261E; --bad-l: #FBEAE8;
  --sh-1: 0 1px 3px rgba(20, 38, 31, .06);
  --sh-2: 0 2px 8px rgba(20, 38, 31, .07);
  --sh-3: 0 8px 24px rgba(20, 38, 31, .10);
  --r1: 10px; --r2: 6px; --r3: 3px; --rp: 999px;
  --sp-1: 6px; --sp-2: 13px; --sp-3: 20px; --sp-4: 28px;
  --a1: #2E8B57; --a2: #138A8A; --b1: #2D6CC0; --b2: #7A4DB8; --c1: #D9771E; --c2: #C8423A;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
a { color: var(--g); }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.hide { display: none !important; }

/* top bar */
.top { background: var(--gd); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 30px; height: 24px; }
.top nav { display: flex; align-items: center; gap: 14px; }
.top nav a.tl { color: #DCEBE2; text-decoration: none; font-size: 15px; font-weight: 600; }
.top nav a.tl:hover { color: #fff; }

/* buttons: green = main action on light ground; white = main action on green ground */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: var(--rp); font-weight: 700; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; }
.btn-g { background: var(--g); color: #fff; box-shadow: 0 3px 0 var(--gd); }
.btn-g:hover { background: var(--gh); }
.btn-w { background: #fff; color: var(--gd); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px #fff; }
.btn-ln { background: var(--card); color: var(--gd); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ln:hover { box-shadow: inset 0 0 0 2px var(--g); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: default; }
.yt { width: 18px; height: 18px; }

/* hero */
.hero { background: var(--gd); color: #fff; padding: 36px 0 60px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 16px; background: var(--bg); border-radius: 16px 16px 0 0; }
.hero-grid { display: grid; gap: 30px; align-items: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.hero h1 { font-size: clamp(34px, 8vw, 54px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: 18px; color: #DCEBE2; margin: 0 0 24px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.ladder { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding: 18px; border-radius: 20px;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.ladder a { flex: 1; border-radius: var(--r1) var(--r1) var(--r2) var(--r2); background: #fff; position: relative; text-decoration: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.14); transition: transform .15s; }
.ladder a:hover { transform: translateY(-3px); }
.ladder a:last-child { background: var(--gold); }
.ladder span { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-weight: 800; font-size: 13px; color: var(--gd); }

/* sections */
section { padding: 52px 0; }
h2 { font-size: clamp(25px, 5vw, 33px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
.sub { color: var(--ink2); margin: 0 0 24px; }
.card { background: var(--card); border-radius: var(--r1); box-shadow: var(--sh-2); }

.steps { display: grid; gap: 12px; }
.step { background: var(--card); border-radius: var(--r1); padding: 18px 18px 16px; box-shadow: var(--sh-2); }
.step .n { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--gl); color: var(--gd); font-weight: 800; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; font-size: 19px; }
.step p { margin: 0; color: var(--ink2); font-size: 15.5px; }

/* level cards (home) */
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lv { display: block; text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--r1);
  padding: 16px; box-shadow: var(--sh-2); transition: transform .15s, box-shadow .15s; position: relative; }
.lv:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
.badge { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; flex: none;
  color: #fff; font-weight: 800; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.lv .badge { margin-bottom: 10px; }
.lv b { display: block; font-size: 17px; }
.lv small { display: block; color: var(--ink2); font-size: 14px; line-height: 1.45; margin-top: 4px; }
.lv .go { display: block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--g); }
.lv .go.soon { color: var(--mut); }
.lv .mini { height: 5px; border-radius: var(--rp); background: var(--line2); margin-top: 10px; overflow: hidden; }
.lv .mini i { display: block; height: 100%; background: var(--g); border-radius: var(--rp); }

/* continue card */
.resume { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 0 0 22px; text-decoration: none; color: var(--ink); }
.resume b { display: block; }
.resume small { color: var(--mut); font-size: 14px; }
.resume .btn { margin-left: auto; flex: none; }

/* workbook block */
.wb { background: var(--card); border-radius: 16px; box-shadow: var(--sh-3); padding: 22px; display: grid; gap: 26px; }
.cover { aspect-ratio: 210 / 297; max-width: 230px; margin: 0 auto; width: 100%; background: var(--gd); color: #fff; border-radius: 4px 10px 10px 4px;
  padding: 20px 16px; display: flex; flex-direction: column; justify-content: space-between; position: relative;
  box-shadow: -6px 0 0 var(--gdd) inset, var(--sh-3); transform: rotate(-2deg); }
.cover img { width: 46px; }
.cover .t1 { font-size: 25px; font-weight: 800; line-height: 1.05; }
.cover .t2 { color: var(--gold); font-weight: 700; margin-top: 6px; font-size: 15px; }
.cover .lvl { position: absolute; top: 16px; right: 14px; width: 44px; height: 44px; border-radius: 50%; background: var(--gold);
  color: var(--gdd); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cover .ft { font-size: 12px; color: #CFE2D7; }
.inside { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.inside li { padding-left: 30px; position: relative; }
.inside li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gl) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%2316543C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }

/* forms */
form.sub-f { display: grid; gap: 12px; }
label.f { font-weight: 700; font-size: 15px; }
input[type=email] { width: 100%; min-height: 50px; padding: 0 16px; font-size: 17px; border-radius: var(--r1); border: 2px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; }
input[type=email]:focus { outline: none; border-color: var(--g); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink2); line-height: 1.45; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--g); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { font-size: 15px; min-height: 1.4em; margin: 0; }
.msg.err { color: var(--bad); }
.done { background: var(--gl); border-radius: var(--r1); padding: 16px; }
.done .btn { margin-top: 10px; }

/* green band */
.band { background: var(--gd); color: #fff; border-radius: 16px; padding: 30px 22px; text-align: center; }
.band h2 { color: #fff; }
.band p { color: #DCEBE2; margin: 0 0 18px; }

/* course: level / unit / episode */
.crumb { font-size: 14px; color: #CFE2D7; margin: 0 0 10px; }
.crumb a { color: #fff; text-decoration: none; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.phead { background: var(--gd); color: #fff; padding: 26px 0 44px; position: relative; }
.phead::after { content: ""; position: absolute; inset: auto 0 0 0; height: 16px; background: var(--bg); border-radius: 16px 16px 0 0; }
.phead .row { display: flex; gap: 14px; align-items: center; }
.phead h1 { margin: 0; font-size: clamp(26px, 6vw, 38px); line-height: 1.12; letter-spacing: -.01em; }
.phead p { margin: 8px 0 0; color: #DCEBE2; }
.phead .badge { width: 54px; height: 54px; font-size: 18px; }
.prog { padding: 16px 18px; margin: -6px 0 26px; }
.prog .at { font-weight: 700; }
.prog .bar { height: 8px; border-radius: var(--rp); background: var(--line2); margin: 10px 0 6px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--g); border-radius: var(--rp); transition: width .3s; }
.prog small { color: var(--mut); }
.prog .btn { margin-top: 12px; }
.unit { margin: 0 0 22px; overflow: hidden; }
.unit-h { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 10px; }
.unit-h .ul { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--g); }
.unit-h h2 { font-size: 21px; margin: 0; }
.unit-h h2 a { color: var(--ink); text-decoration: none; }
.eps { list-style: none; margin: 0; padding: 0 0 6px; }
.eps li a, .eps li .soonrow { display: flex; align-items: center; gap: 12px; padding: 11px 18px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line2); }
.eps li a:hover { background: var(--line2); }
.epn { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--gl); color: var(--gd); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; }
.eps .t { flex: 1; min-width: 0; }
.eps .t b { display: block; font-weight: 600; }
.eps .t small { color: var(--mut); font-size: 13.5px; }
.eps li.is-done .epn { background: var(--g); color: #fff; font-size: 0; }
.eps li.is-done .epn::after { content: ""; width: 14px; height: 8px; border: 3px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.eps .soonrow { color: var(--mut); }
.eps .soonrow .epn { background: var(--line2); color: var(--faint); }
.tag { flex: none; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--rp); background: var(--gl); color: var(--gd); }
.tag.soon { background: var(--line2); color: var(--mut); }
.tag.score { background: var(--cream2); color: var(--gold-t); }
.empty { padding: 26px 20px; text-align: center; color: var(--ink2); }
.empty b { display: block; font-size: 19px; color: var(--ink); margin-bottom: 4px; }

.lesson { display: grid; gap: 18px; padding-bottom: 20px; }
.box { padding: 18px; }
.box h2 { font-size: 20px; margin: 0 0 12px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r1); overflow: hidden; background: var(--gd); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vface { position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; color: #fff; background: var(--gd); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 18px; font-family: inherit; text-align: center; }
.vface .play { width: 68px; height: 68px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.vface .play::after { content: ""; border-left: 22px solid var(--gdd); border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }
.vface b { font-size: 19px; }
.vface small { color: #CFE2D7; font-size: 14px; }
.vsoon { cursor: default; }
.vsoon .bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; }
.vsoon .bars i { width: 9px; background: rgba(255,255,255,.85); border-radius: 3px; }
.vsoon .bars i:last-child { background: var(--gold); }
.vnote { font-size: 13px; color: var(--mut); margin: 8px 0 0; }
.kw { display: grid; gap: 10px; }
.kw div { padding: 12px 14px; border-radius: var(--r2); background: var(--line2); }
.kw b { display: block; font-size: 17px; color: var(--gd); }
.kw span { display: block; }
.kw i { display: block; color: var(--ink2); font-size: 15px; margin-top: 2px; }
details.tx summary { cursor: pointer; font-weight: 700; color: var(--g); list-style: none; }
details.tx summary::-webkit-details-marker { display: none; }
details.tx summary::before { content: "+ "; }
details.tx[open] summary::before { content: "– "; }
.lines { font-family: var(--serif); font-size: 17px; line-height: 1.55; margin-top: 12px; }
.lines p { margin: 0 0 6px; display: grid; grid-template-columns: 52px 1fr; gap: 6px; }
.lines .who { font-family: var(--font); font-weight: 800; font-size: 13px; padding-top: 3px; }
.who.Nina { color: var(--a2); } .who.Ray { color: var(--gold-t); }
.q { padding: 14px 0; border-top: 1px solid var(--line2); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q .qt { font-weight: 700; margin: 0 0 8px; }
.q button.opt { display: flex; width: 100%; text-align: left; align-items: center; gap: 10px; margin: 6px 0; padding: 10px 12px; min-height: 46px;
  border-radius: var(--r2); border: 2px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; }
.q button.opt:hover:not([disabled]) { border-color: var(--g); }
.q button.opt .l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line2); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.q button.opt[disabled] { cursor: default; }
.q button.opt.right { border-color: var(--ok); background: var(--gl); }
.q button.opt.right .l { background: var(--ok); color: #fff; }
.q button.opt.wrong { border-color: var(--bad); background: var(--bad-l); }
.q button.opt.wrong .l { background: var(--bad); color: #fff; }
.q .why { margin: 8px 0 0; font-size: 15px; color: var(--ink2); }
.q .why b.ok { color: var(--ok); } .q .why b.no { color: var(--bad); }
.score { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r1); background: var(--gl); margin-top: 8px; }
.score b { font-size: 22px; color: var(--gd); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pn a, .pn span { padding: 14px 16px; text-decoration: none; color: var(--ink); min-height: 72px; }
.pn small { display: block; color: var(--mut); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pn b { display: block; font-weight: 600; line-height: 1.3; }
.pn .nx { text-align: right; }
.pn span { color: var(--faint); box-shadow: none; background: transparent; border: 2px dashed var(--line); border-radius: var(--r1); }

/* footer */
footer { padding: 28px 0 44px; color: var(--ink2); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer a { color: var(--ink2); }

/* legal */
.legal { padding: 36px 0 24px; }
.legal h1 { font-size: clamp(30px, 6vw, 40px); margin: 0 0 6px; }
.legal .upd { color: var(--ink2); margin: 0 0 26px; font-size: 15px; }
.legal h2 { font-size: 21px; margin: 28px 0 8px; }
.legal p, .legal li { color: #2C3A33; }
.legal table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0; }
.legal td, .legal th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--line2); }

@media (min-width: 720px) {
  .hero { padding: 52px 0 84px; }
  .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 48px; }
  .ladder { height: 280px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .levels { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .wb { grid-template-columns: 250px 1fr; padding: 38px; align-items: center; }
  section { padding: 68px 0; }
  .band { padding: 46px; }
  .kw { grid-template-columns: 1fr 1fr; }
  .box { padding: 24px; }
  .phead { padding: 34px 0 52px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 420px) { .top nav a.tl { display: none; } .brand { font-size: 16px; } }
.recap { margin: 0; padding-left: 22px; font-family: var(--serif); font-size: 18px; }
.recap li { padding: 4px 0; }
.goals .inside { margin: 0; }
