:root {
  --bg: #fff7e8;
  --ink: #2b2240;
  --muted: #7a7090;
  --card: #ffffff;
  --line: #eadfca;
  --primary: #5b5bf0;
  --primary-ink: #fff;
  --fun: #ff7a59;
  --good: #22a861;
  --good-bg: #e6f8ee;
  --bad: #e0574f;
  --bad-bg: #fff0ee;
  --gold: #ffb703;
  --r: 22px;
  --shadow: 0 2px 0 #e9dcc3, 0 8px 24px rgba(80, 60, 20, .08);
  font-family: ui-rounded, "SF Pro Rounded", "Varela Round", "Nunito", "Segoe UI", system-ui, -apple-system, "Arial Hebrew", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; }
h2 { margin: 28px 0 12px; font-size: 1.5rem; }
h3 { margin: 18px 0 10px; }
code { background: #f3ecdf; padding: 3px 8px; border-radius: 8px; font-size: .95rem; }
small, .small { font-size: .9rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; justify-content: center; }

header#top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 20px 10px;
  background: rgba(255, 247, 232, .92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; }
.logo { font-size: 1.8rem; }
.top-right { display: flex; gap: 8px; align-items: center; }

main { max-width: 980px; margin: 0 auto; padding: 18px 20px 80px; }
.title { font-size: 2.1rem; margin: 18px 0; }
.title small { font-size: 1rem; color: var(--muted); font-weight: 500; }

/* buttons */
.btn, .chip {
  font: inherit; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 12px 20px; font-size: 1.05rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  box-shadow: 0 2px 0 var(--line); transition: transform .08s;
}
.btn:active, .chip:active, .topic:active, .kid:active, .choice:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: #4646c9; box-shadow: 0 3px 0 #3c3cb0; }
.btn.fun { background: var(--fun); color: #fff; border-color: #e5603f; box-shadow: 0 3px 0 #c9502f; }
.btn.big { font-size: 1.25rem; padding: 14px 30px; min-height: 58px; }
.chip { padding: 8px 16px; min-height: 40px; font-size: .95rem; }
.chip.big { padding: 10px 18px; font-size: 1.05rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row.end { justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.link { color: var(--primary); font-weight: 700; }

.card { background: var(--card); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; border: 2px solid var(--line); }

/* learners */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.kid {
  font: inherit; color: inherit; background: var(--card); border: 2px solid var(--line); border-radius: 28px;
  padding: 26px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  box-shadow: var(--shadow); font-size: 1.2rem;
}
.kid .av { font-size: 4.2rem; line-height: 1; }
.kid small { color: var(--muted); }
.kid.add { border-style: dashed; color: var(--muted); }

/* topics */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.topic {
  font: inherit; color: inherit; text-align: start; background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  padding: 16px; display: flex; align-items: center; gap: 12px; font-size: 1.08rem; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow); position: relative; min-height: 76px;
}
.topic .ti { font-size: 2rem; }
.topic .stars { position: absolute; bottom: 6px; inset-inline-end: 12px; color: var(--gold); font-size: .75rem; letter-spacing: 1px; }
.own { display: flex; gap: 10px; margin-top: 18px; }
.own input, label input, label select, .ans, #invEmail, #delName {
  font: inherit; font-size: 1.1rem; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; min-height: 50px; flex: 1;
}
.own input:focus, .ans:focus { outline: 3px solid #c9c9ff; border-color: var(--primary); }

/* ladder */
.ladder { display: flex; gap: 8px; justify-content: center; margin: 8px 0 18px; flex-wrap: wrap; direction: ltr; }
.ladder i {
  font-style: normal; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: #f1e8d6; color: var(--muted); font-weight: 800; transition: all .3s;
}
.ladder i:nth-child(n) { transform: translateY(calc(var(--step, 0) * 1px)); }
.ladder i.ok { background: var(--good); color: #fff; }
.ladder i.bad { background: var(--bad); color: #fff; }
.ladder i.now { background: var(--primary); color: #fff; transform: scale(1.18); box-shadow: 0 4px 12px rgba(91, 91, 240, .4); }

/* question */
.qcard { padding: 26px 28px; }
.qmeta { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; }
.lvl { background: #fff2c6; color: #8a6400; padding: 2px 12px; border-radius: 999px; }
.prompt { font-size: 1.75rem; line-height: 1.5; margin: 18px 0; font-weight: 600; }
.m { font-family: "SF Mono", ui-rounded, "Segoe UI", system-ui, sans-serif; white-space: nowrap; unicode-bidi: isolate; font-weight: 700; color: #3a2a8c; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.05; margin: 0 2px; font-size: .85em; }
.frac span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.qsvg { display: block; max-width: min(100%, 480px); max-height: 300px; margin: 8px auto 16px; }
.paper { background: #f1f6ff; border-radius: 14px; padding: 10px 14px; color: #33508a; }
.answer-row { display: flex; align-items: center; gap: 10px; }
.ans { font-size: 1.8rem; text-align: center; max-width: 340px; font-weight: 700; }
.unit { font-size: 1.4rem; font-weight: 700; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.choice {
  font: inherit; color: inherit; font-size: 1.4rem; font-weight: 700; padding: 18px; border-radius: 18px; cursor: pointer;
  border: 2px solid var(--line); background: #fbf8f2; box-shadow: 0 3px 0 var(--line); min-height: 70px;
}
.tools { margin-top: 18px; }
.hint { background: #fff8d9; padding: 12px 16px; border-radius: 14px; font-size: 1.15rem; }
#answerArea.busy { opacity: .5; pointer-events: none; }
#photoPrev { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--good); font-weight: 700; }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); }
.thinking { color: var(--muted); font-size: 1.1rem; }
.warn { background: #fff4d6; color: #7a5300; padding: 12px 16px; border-radius: 14px; }

.result { border-radius: 18px; padding: 18px 20px; margin-top: 8px; font-size: 1.15rem; }
.result .big { font-size: 1.9rem; font-weight: 800; margin-bottom: 6px; }
.result.good { background: var(--good-bg); border: 2px solid #b7e9cd; }
.result.bad { background: var(--bad-bg); border: 2px solid #f5c9c4; }
.kidfb { font-size: 1.2rem; }
.result details { margin: 10px 0 14px; }
.result summary { cursor: pointer; font-weight: 700; }
.read { background: #fff; border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.read ol { margin: 6px 0 0; padding-inline-start: 26px; }
.read li.err { background: #ffe0dc; border-radius: 6px; padding: 0 6px; }

/* results */
.results .trophy { font-size: 4.5rem; animation: bob 2s ease-in-out infinite; }
.results h1 { margin: 6px 0; }
.big { font-size: 1.3rem; font-weight: 700; }
.kidmsg { font-size: 1.2rem; }
.meter { height: 18px; background: #f1e8d6; border-radius: 999px; overflow: hidden; max-width: 420px; margin: 12px auto; }
.meter div { height: 100%; background: linear-gradient(90deg, #ffd166, #22a861); border-radius: 999px; transition: width 1s; }
.meter.small { height: 10px; margin: 0; flex: 1; min-width: 100px; }
.gaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gapcard { border-inline-start: 8px solid var(--gold); }
.gapcard.sev-major { border-inline-start-color: var(--bad); }
.gapcard.sev-minor { border-inline-start-color: #8fd3a8; }
.gapcard h3 { margin-top: 0; font-size: 1.3rem; }

/* parent */
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pkid { margin: 0; }
.pkid.add { font: inherit; font-size: 1.1rem; color: var(--muted); border-style: dashed; cursor: pointer; }
.pkhead { display: flex; gap: 12px; align-items: center; }
.pkhead .av { font-size: 2.6rem; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0; color: var(--muted); }
.stats b { color: var(--ink); font-size: 1.2rem; }
.stats.big b { font-size: 1.8rem; }
.mrow { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mrow > span { min-width: 220px; font-weight: 700; }
.sess summary { cursor: pointer; font-size: 1.05rem; }
.ltrblock { text-align: left; }
.tag { font-size: .8rem; background: #eef; color: #44a; padding: 2px 8px; border-radius: 999px; }
.tag.sev-major { background: #ffe0dc; color: #a33; }
.tag.sev-moderate { background: #fff2c6; color: #8a6400; }
.tag.sev-minor { background: #e6f8ee; color: #1d7a48; }

/* modal & lessons */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(43, 34, 64, .45); display: grid; place-items: center; padding: 20px; }
.modal .sheet { background: var(--bg); border-radius: 26px; padding: 24px; width: min(520px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal .sheet label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 700; }
.modal.full { padding: 0; }
.modal.full .sheet { width: 100vw; height: 100vh; max-height: none; border-radius: 0; padding: 0; display: flex; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.avpick { font-size: 2rem; width: 58px; height: 58px; border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.avpick.on { border-color: var(--primary); background: #ecebff; }
.lessonbox { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lessonhead { display: flex; align-items: center; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
.lessonhead h2 { margin: 0; font-size: 1.35rem; }
iframe.lesson { flex: 1; width: 100%; border: 0; background: #fff; min-height: 0; }
.lessonbox .loading { flex: 1; }

/* loading */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50vh; gap: 20px; font-size: 1.3rem; color: var(--muted); }
.blocks { display: flex; gap: 10px; }
.blocks i { width: 28px; height: 28px; border-radius: 8px; animation: hop 1s ease-in-out infinite; }
.blocks i:nth-child(1) { background: #ff6b6b; }
.blocks i:nth-child(2) { background: #ffd93d; animation-delay: .12s; }
.blocks i:nth-child(3) { background: #6bcb77; animation-delay: .24s; }
.blocks i:nth-child(4) { background: #4d96ff; animation-delay: .36s; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-22px) rotate(90deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; z-index: 40; }

@media (max-width: 600px) {
  .title { font-size: 1.6rem; }
  .prompt { font-size: 1.35rem; }
  .qcard { padding: 18px; }
  .brand span:last-child { display: none; }
  .kids { grid-template-columns: repeat(2, 1fr); }
}

/* learning log */
.logcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; text-align: left; }
.logcols .card { margin: 0; }
.logcols h3 { margin-top: 4px; }
.logitem { padding: 8px 0; border-bottom: 1px solid var(--line); }
.logitem:last-child { border-bottom: 0; }

/* front camera */
.cam { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; touch-action: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 12%; border-radius: 28px; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); border: 4px dashed rgba(255, 255, 255, .8); transition: border-color .2s; }
.cam-guide.on { border-style: solid; border-color: #ffd93d; }
.cam-guide.ready { border-color: #6bcb77; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 14px; direction: ltr; }
.cam-status { flex: 1; text-align: center; color: #fff; font-size: 1.6rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.cam-icon { width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.5rem; cursor: pointer; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.cam-shutter { position: relative; width: 96px; height: 96px; border: 0; background: none; padding: 0; cursor: pointer; }
.cam-shutter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.cam-shutter circle { fill: none; stroke-width: 8; }
.cam-shutter .track { stroke: rgba(255, 255, 255, .45); }
.cam-shutter .prog { stroke: #6bcb77; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.cam-shutter i { position: absolute; inset: 16px; border-radius: 50%; background: #fff; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam-review { position: absolute; inset: 0; background: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.cam-review img { max-width: 100%; max-height: calc(100% - 110px); border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.cam-review-bar { display: flex; gap: 16px; }

/* schoolwork */
.upload .note { flex: 1; min-width: 220px; font: inherit; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); min-height: 50px; }
.swprev, .swthumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.swprev .pg, .swprev .pdf { position: relative; cursor: pointer; font-weight: 700; color: var(--bad); }
.swprev img, .swthumbs img { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); display: block; }
.swprev .pdf, .swthumbs .pdf { background: #f3ecdf; padding: 10px 14px; border-radius: 12px; color: var(--ink); }
ul.items li { margin-bottom: 6px; }

/* answer modes + handwriting pads */
.modes { display: inline-flex; background: #f1e8d6; border-radius: 999px; padding: 4px; margin-bottom: 14px; gap: 4px; }
.mode { font: inherit; font-weight: 700; font-size: 1.05rem; border: 0; background: none; padding: 10px 20px; border-radius: 999px; cursor: pointer; color: var(--muted); min-height: 44px; }
.mode.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.write { display: flex; flex-direction: column; gap: 10px; }
.padbar { display: flex; gap: 8px; direction: ltr; }
.padtool { font-size: 1.4rem; width: 54px; height: 54px; border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.padtool.on { border-color: var(--primary); background: #ecebff; }
.pads { display: grid; grid-template-columns: 1fr; gap: 12px; direction: ltr; }
.pad { position: relative; border-radius: 18px; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pad, .pad * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.write.big .pad.work { height: 62vh; }
.write.big .pad.answer { height: 22vh; }
@media (min-width: 900px) and (orientation: landscape) { .write.big .pad.answer { height: 30vh; } }
.pad.work { height: 300px; border: 2px solid var(--line);
  background-color: #fff;
  background-image: linear-gradient(#eef2fb 1px, transparent 1px), linear-gradient(90deg, #eef2fb 1px, transparent 1px);
  background-size: 28px 28px; }
.pad.answer { height: 130px; max-width: 460px; border: 4px solid var(--primary); background: #fbfbff; }
.pad-label { position: absolute; top: 8px; left: 12px; font-size: .85rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.pad.answer .pad-label { color: var(--primary); }
@media (min-width: 900px) and (orientation: landscape) {
  .pads { grid-template-columns: 1fr 320px; align-items: start; }
  .pad.work { height: 340px; }
  .pad.answer { height: 180px; }
}

/* practice plan & weekly goals */
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plancard { font: inherit; color: inherit; text-align: start; background: var(--card); border: 2px solid var(--line); border-radius: 22px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; box-shadow: var(--shadow); }
.plancard .go { align-self: flex-end; pointer-events: none; }
.plantitle { display: flex; gap: 12px; align-items: center; }
.plantitle .ti { font-size: 2rem; }
.plantitle small { display: block; margin-top: 2px; }
.goal { display: flex; flex-direction: column; gap: 6px; }
.goalbar { position: relative; height: 18px; background: #f1e8d6; border-radius: 999px; overflow: visible; direction: ltr; }
.goalbar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd166, #22a861); transition: width .8s; }
.goalbar .tgt { position: absolute; right: -6px; top: -7px; font-size: 1.3rem; }
.goal.met .goalbar > div { background: linear-gradient(90deg, #22a861, #16c784); }
.goalmeta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-weight: 700; font-size: .95rem; }
.stars2 { letter-spacing: 2px; color: var(--gold); font-size: 1.1rem; }
.goalmet { color: var(--good); font-weight: 800; }
.mini { margin: 10px 0; }
.planedit .planrow { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.planrow.paused { opacity: .5; }
.planctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.planctl select, .planadd select, .planadd input { font: inherit; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; min-height: 42px; }
.planadd { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.planadd input { flex: 1; min-width: 200px; }
.planadd label, .planctl label { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.free { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-weight: 700; }
.free input { width: 22px; height: 22px; }

/* adaptive level */
.ladder { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ladder .dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lvlbadge { font-weight: 800; background: #fff2c6; color: #8a6400; padding: 6px 16px; border-radius: 999px; transition: transform .3s; }
.lvlbadge.up { background: var(--good); color: #fff; animation: pop .6s; }
.lvlbadge.down { background: #ffe0dc; color: #a33; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.lvlmsg { font-weight: 800; font-size: 1.2rem; padding: 10px 16px; border-radius: 14px; margin-bottom: 10px; }
.lvlmsg.up { background: var(--good-bg); color: var(--good); }
.lvlmsg.down, .lvlmsg.same { background: #fff4d6; color: #7a5300; }
.tutorial { background: #fff; border: 2px dashed var(--fun); border-radius: 14px; padding: 12px 16px; margin: 10px 0; }
.tutorial p { margin: 4px 0 0; }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 3px 0 #c9502f, 0 0 0 0 rgba(255, 122, 89, .5); } 50% { box-shadow: 0 3px 0 #c9502f, 0 0 0 12px rgba(255, 122, 89, 0); } }

/* level history chart */
.lhist summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.lchart { position: relative; margin-top: 6px; direction: ltr; }
.lchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.lc-grid { stroke: #efe6d4; stroke-width: 1; }
.lc-sep { stroke: #d9ccb2; stroke-width: 1; stroke-dasharray: 2 4; }
.lc-axis { font-size: 11px; fill: var(--muted); font-family: inherit; }
.lc-tlabel { font-weight: 700; }
.lc-target { stroke: #8a6400; stroke-width: 1.5; stroke-dasharray: 6 5; }
.lc-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.lc-ok { fill: var(--primary); stroke: #fff; stroke-width: 2; }
.lc-bad { fill: #fff; stroke: var(--bad); stroke-width: 2.5; }
.lc-hit { fill: transparent; cursor: pointer; }
.lc-pt.on .lc-ok, .lc-pt.on .lc-bad { stroke-width: 3.5; }
.lc-key { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.lc-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lc-key .k-ok { background: var(--primary); }
.lc-key .k-bad { background: #fff; border: 2.5px solid var(--bad); box-sizing: border-box; }
.lc-key .k-tgt { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed #8a6400; vertical-align: 3px; }
.lc-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--ink); color: #fff; padding: 6px 10px;
  border-radius: 10px; font-size: .85rem; white-space: nowrap; pointer-events: none; z-index: 2; }

/* voice */
.promptrow { display: flex; align-items: flex-start; gap: 12px; }
.promptrow .prompt { flex: 1; }
.speak { flex: none; width: 56px; height: 56px; margin-top: 14px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; font-size: 1.6rem; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.speak:active { transform: translateY(2px); box-shadow: none; }
.voiceset .row label { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.voiceset select { font: inherit; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; min-height: 42px; }
.lessonhead #lVoice { margin-inline-start: auto; }
.free input[type=checkbox] { flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; margin: 0; accent-color: var(--primary); }
.free { justify-content: flex-start; }
.voiceset .row select { flex: none; }

/* cloud: sign in, family setup, pairing */
.card.narrow { max-width: 560px; margin: 24px auto; }
.card.narrow label { display: block; margin-top: 12px; }
.card.narrow input:not([type=checkbox]) { width: 100%; }
.consent { background: #f6f1e7; border-radius: 14px; padding: 12px 16px; margin-top: 16px; font-size: .95rem; }
.consent label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.consent label.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
input.pincode { font-size: 1.8rem; letter-spacing: .3em; text-align: center; }
.pinshow { font-size: 3rem; font-weight: 800; letter-spacing: .15em; text-align: center; margin: 12px 0; }
.devlist { list-style: none; padding: 0; margin: 8px 0; }
.devlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.devlist li small { display: block; }
.btn.danger { background: #fff0ee; color: #a3271a; border-color: #e9b4ad; }
