/* LevelUP — mobile-first. Navy + orange, from the manual. */
:root {
  --navy: #1f2a38; --navy-2: #2c3a4d; --orange: #e8731c; --orange-soft: #fdf0e6;
  --green: #2f8f5b; --green-soft: #e8f4ec; --blue: #2f6aa8; --blue-soft: #e8f0f8; --red: #c2412d; --red-soft: #fbeae7; --amber: #b7791f; --amber-soft: #fdf5e3;
  --bg: #f4f6f8; --card: #fff; --line: #dde3ea; --text: #1d2530; --muted: #5b6878;
  --radius: 16px; --tap: 52px;
  --fs: 17px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
html.ts0 { --fs: 15px; } html.ts1 { --fs: 17px; } html.ts2 { --fs: 19px; } html.ts3 { --fs: 21px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font: 400 var(--fs)/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: 1.6em; } h2 { font-size: 1.3em; } h3 { font-size: 1.1em; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0 0 .75em; padding-left: 1.3em; } li { margin: .25em 0; }
.muted { color: var(--muted); } .small { font-size: .85em; } .center { text-align: center; }
.hidden { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.logo-mark { font-weight: 800; font-size: 1.6em; color: var(--navy); letter-spacing: -.02em; }
.logo-mark b { color: var(--orange); }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: calc(8px + var(--safe-t)) 14px 8px; display: flex; align-items: center; gap: 10px; min-height: 56px; }
.topbar .logo-mark { color: #fff; font-size: 1.2em; }
.topbar .title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .iconbtn { background: transparent; border: 0; color: #fff; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3em; }
.topbar .iconbtn:active { background: rgba(255,255,255,.12); }
.langsw { display: inline-flex; background: rgba(255,255,255,.14); border-radius: 999px; padding: 3px; }
.langsw button { border: 0; background: transparent; color: #cfd8e3; font-weight: 700; font-size: .85em; padding: 6px 12px; border-radius: 999px; min-width: 44px; min-height: 36px; }
.langsw button.on { background: var(--orange); color: #fff; }
.langsw.light { background: #e6ebf1; } .langsw.light button { color: var(--muted); } .langsw.light button.on { color: #fff; }

main.view { padding: 16px 14px calc(96px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
main.view.full { padding-bottom: calc(110px + var(--safe-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); }
.tabbar a { flex: 1; text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; font-size: .72em; font-weight: 600; position: relative; min-height: 58px; }
.tabbar a .ic { font-size: 1.55em; line-height: 1; }
.tabbar a.on { color: var(--orange); }
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--orange); color: #fff; border-radius: 999px; font-size: .9em; padding: 1px 6px; min-width: 18px; text-align: center; }

/* ---------- generic ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 2px rgba(20,30,45,.06), 0 4px 14px rgba(20,30,45,.05); margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 12px 20px; border-radius: 14px; border: 0; font-weight: 700; background: var(--navy); color: #fff; text-decoration: none; text-align: center; }
.btn.primary { background: var(--orange); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--line); }
.btn.soft { background: #e9eef4; color: var(--navy); }
.btn.danger { background: var(--red); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(.95); }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: .78em; font-weight: 700; background: #e9eef4; color: var(--navy); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); } .pill.warn { background: var(--amber-soft); color: var(--amber); } .pill.bad { background: var(--red-soft); color: var(--red); } .pill.or { background: var(--orange-soft); color: #b2550f; }
label.f { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .92em; }
input.in, select.in, textarea.in { width: 100%; min-height: var(--tap); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
input.in:focus, select.in:focus, textarea.in:focus { outline: none; border-color: var(--blue); }
textarea.in { min-height: 100px; resize: vertical; }
.err { color: var(--red); font-weight: 600; margin-top: 10px; }
.bar { height: 10px; background: #e6ebf1; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .3s; }
.bar.green > i { background: var(--green); }
#toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login .logo-mark { font-size: 2.6em; text-align: center; }
.login .tag { text-align: center; color: var(--muted); margin-bottom: 26px; }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ring { --p: 0; width: 74px; height: 74px; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--p) * 1%), #e6ebf1 0); display: grid; place-items: center; flex: none; }
.ring > span { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; color: var(--navy); font-size: .95em; text-align: center; line-height: 1.05; }
.ring.big { width: 132px; height: 132px; } .ring.big > span { width: 108px; height: 108px; font-size: 1.7em; }
.ring.green { background: conic-gradient(var(--green) calc(var(--p) * 1%), #e6ebf1 0); }
.ring.red { background: conic-gradient(var(--red) calc(var(--p) * 1%), #e6ebf1 0); }
.ring.amber { background: conic-gradient(var(--amber) calc(var(--p) * 1%), #e6ebf1 0); }
.next-card { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; }
.next-card h2, .next-card h3 { color: #fff; }
.next-card .eyebrow { color: #ffb57d; font-weight: 700; font-size: .8em; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.reminder { display: flex; gap: 12px; align-items: center; background: var(--orange-soft); border: 1px solid #f6d2b5; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; text-decoration: none; color: var(--text); }
.reminder .ic { font-size: 1.6em; }
.phase-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 4px 10px; }
.phase-h h3 { margin: 0; }
.unit-row { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; background: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); min-height: 76px; }
.unit-row.locked { opacity: .55; }
.unit-row .num { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: #e9eef4; color: var(--navy); flex: none; }
.unit-row.passed .num { background: var(--green); color: #fff; }
.unit-row.current { border: 2px solid var(--orange); }
.unit-row.current .num { background: var(--orange); color: #fff; }
.unit-row .t { font-weight: 700; line-height: 1.3; }
.unit-row .bar { height: 6px; margin-top: 8px; }
.exam-row .num { background: var(--navy); color: #fff; }

/* ---------- unit ---------- */
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); margin-bottom: 8px; text-decoration: none; color: inherit; min-height: 64px; }
.lesson-row .chk { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 800; color: #fff; }
.lesson-row.done .chk { background: var(--green); border-color: var(--green); }
.gatebox { border-radius: 14px; padding: 14px; background: #eef2f6; margin: 10px 0; }
.gatebox.warn { background: var(--amber-soft); } .gatebox.bad { background: var(--red-soft); }

/* ---------- lesson player ---------- */
.player { display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.player-top { padding: 10px 14px 0; max-width: 760px; margin: 0 auto; width: 100%; }
.dots { display: flex; gap: 4px; }
.dots i { flex: 1; height: 5px; border-radius: 3px; background: #dbe2ea; }
.dots i.on { background: var(--orange); } .dots i.seen { background: #f3b98d; }
.player-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .85em; }
.toolbtn { border: 0; background: #e9eef4; color: var(--navy); border-radius: 10px; min-height: 40px; min-width: 44px; padding: 6px 12px; font-weight: 700; font-size: .9em; }
.toolbtn.on { background: var(--orange); color: #fff; }
.stage { flex: 1; padding: 12px 14px; max-width: 760px; margin: 0 auto; width: 100%; touch-action: pan-y; }
.lcard { background: #fff; border-radius: 20px; padding: 22px 20px; box-shadow: 0 2px 6px rgba(20,30,45,.06), 0 10px 30px rgba(20,30,45,.06); animation: cardIn .22s ease-out; }
.lcard.from-left { animation-name: cardInL; }
@keyframes cardIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes cardInL { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.lcard h2 { font-size: 1.25em; }
.lcard .kicker { font-size: .78em; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 8px; color: var(--orange); }
.callout { border-left: 6px solid; }
.callout.construction, .callout.headstart { border-color: var(--green); background: var(--green-soft); } .callout.construction .kicker, .callout.headstart .kicker { color: var(--green); }
.callout.watchout { border-color: var(--orange); background: var(--orange-soft); }
.callout.rule { border-color: var(--red); background: var(--red-soft); } .callout.rule .kicker { color: var(--red); }
.callout.tip { border-color: var(--blue); background: var(--blue-soft); } .callout.tip .kicker { color: var(--blue); }
.player-nav { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, rgba(244,246,248,0)); padding: 14px 14px calc(14px + var(--safe-b)); }
.player-nav .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.player-nav .btn { flex: 1; }
.player-nav .btn.ghost { flex: 0 0 auto; min-width: 64px; }

.fig { margin: 4px -6px 10px; }
.fig svg { display: block; width: 100%; height: auto; }
.fig .lv-hs { cursor: pointer; }
.hs-info { border-radius: 12px; background: #eef2f6; padding: 12px 14px; margin-top: 8px; min-height: 52px; }
.hs-info b { color: var(--navy); }
.hs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hs-chips button { border: 2px solid var(--line); background: #fff; border-radius: 999px; min-width: 40px; min-height: 40px; font-weight: 800; color: var(--navy); }
.hs-chips button.seen { border-color: #f3b98d; } .hs-chips button.on { background: var(--orange); border-color: var(--orange); color: #fff; }

.rowcards .rc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.rowcards .rc .h { font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.rowcards .rc p:last-child { margin-bottom: 0; }
.qa-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.qa-item button.say { width: 100%; text-align: left; border: 0; background: #f7f9fb; padding: 14px; font-style: italic; font-weight: 600; display: flex; gap: 10px; align-items: center; min-height: var(--tap); }
.qa-item button.say::after { content: '＋'; margin-left: auto; font-style: normal; color: var(--orange); font-weight: 800; }
.qa-item.open button.say::after { content: '－'; }
.qa-item .ask { padding: 12px 14px; display: none; border-top: 1px solid var(--line); }
.qa-item.open .ask { display: block; animation: fadeIn .2s; }
.qa-item .ask .lbl { font-size: .75em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--orange); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal-box { margin-top: 12px; }
.reveal-box .ans { display: none; background: var(--green-soft); border-radius: 12px; padding: 14px; animation: fadeIn .25s; }
.reveal-box.open .ans { display: block; } .reveal-box.open .btn { display: none; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 48px; }
.checklist input { width: 24px; height: 24px; flex: none; accent-color: var(--green); margin-top: 1px; }
.keys .kr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
kbd { display: inline-block; font: 700 .82em ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff; border: 1px solid #c9d2dc; border-bottom-width: 3px; border-radius: 7px; padding: 3px 8px; margin: 1px; color: var(--navy); white-space: nowrap; }
.kplus { color: var(--muted); font-size: .8em; margin: 0 1px; }
.term-chip { display: inline; border: 0; background: var(--blue-soft); color: var(--blue); font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.termcards { display: grid; gap: 8px; }
.tcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; text-align: left; width: 100%; min-height: 56px; }
.tcard .tt { font-weight: 800; color: var(--navy); display: flex; justify-content: space-between; gap: 8px; }
.tcard .tt::after { content: '↻'; color: var(--orange); }
.tcard .td { display: none; margin-top: 6px; }
.tcard.open .td { display: block; animation: fadeIn .2s; }
.sorter .opt, .q-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; min-height: var(--tap); font-weight: 500; }
.sorter .opt .n, .q-opt .n { width: 30px; height: 30px; border-radius: 50%; background: #e9eef4; display: grid; place-items: center; font-weight: 800; flex: none; color: var(--navy); font-size: .85em; }
.sorter .opt.picked { border-color: var(--orange); } .sorter .opt.picked .n { background: var(--orange); color: #fff; }
.q-opt.sel { border-color: var(--orange); background: var(--orange-soft); } .q-opt.sel .n { background: var(--orange); color: #fff; }
.q-opt.good { border-color: var(--green); background: var(--green-soft); } .q-opt.good .n { background: var(--green); color: #fff; }
.q-opt.badc { border-color: var(--red); background: var(--red-soft); } .q-opt.badc .n { background: var(--red); color: #fff; }
.q-opt:disabled { cursor: default; color: inherit; }
.q-stem { font-size: 1.12em; font-weight: 700; color: var(--navy); margin-bottom: 14px; line-height: 1.4; }
.match-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.match-row .a { font-weight: 700; margin-bottom: 8px; }
.match-row.good { border-color: var(--green); background: var(--green-soft); } .match-row.badc { border-color: var(--red); background: var(--red-soft); }
.feedback { border-radius: 14px; padding: 14px; margin-top: 12px; animation: fadeIn .2s; }
.feedback.good { background: var(--green-soft); } .feedback.badc { background: var(--red-soft); }
.feedback .h { font-weight: 800; margin-bottom: 4px; }
.feedback.good .h { color: var(--green); } .feedback.badc .h { color: var(--red); }
.widget input[type=range] { width: 100%; height: 40px; accent-color: var(--orange); }
.lh-out { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0; }
.lh-big { font-size: 2.4em; font-weight: 800; color: var(--orange); line-height: 1; }
.lh-letter { font-weight: 900; color: var(--navy); line-height: .8; transition: font-size .15s; }
.vz-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 180px; position: relative; background: #fff; }
.vz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vz-row canvas, .vz-row svg { width: 100%; height: 180px; display: block; image-rendering: pixelated; }

/* ---------- test ---------- */
.testbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 10px; background: #e9eef4; }
.timer.low { background: var(--red-soft); color: var(--red); }
.result-head { text-align: center; padding: 22px 18px; }
.band { border-radius: 16px; padding: 16px; margin: 14px 0; text-align: left; }
.band.ready { background: var(--green-soft); } .band.close { background: var(--amber-soft); } .band.back { background: var(--red-soft); }
.band h2 { margin-bottom: 4px; }
.band.ready h2 { color: var(--green); } .band.close h2 { color: var(--amber); } .band.back h2 { color: var(--red); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .v { font-size: 1.4em; font-weight: 800; color: var(--navy); }
.stat .k { font-size: .8em; color: var(--muted); font-weight: 600; }
.note { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: #eef2f6; margin-bottom: 8px; }
.ans-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: #fff; }
.ans-item.good { border-left: 6px solid var(--green); } .ans-item.badc { border-left: 6px solid var(--red); }
.ans-item .lbl { font-size: .75em; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 8px; }

/* ---------- flashcards ---------- */
.flash { perspective: 1000px; margin: 10px 0 14px; }
.flash .inner { position: relative; min-height: 240px; transition: transform .45s; transform-style: preserve-3d; }
.flash.flipped .inner { transform: rotateY(180deg); }
.flash .side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; box-shadow: 0 6px 24px rgba(20,30,45,.1); }
.flash .back { transform: rotateY(180deg); background: var(--navy); color: #fff; }
.flash .front .w { font-size: 1.7em; font-weight: 800; color: var(--navy); }

/* ---------- glossary ---------- */
.gl-item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.gl-item .t { font-weight: 800; color: var(--navy); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gl-item .alt { color: var(--muted); font-size: .85em; margin-top: 2px; }
.gl-item .ex { color: var(--muted); font-style: italic; font-size: .9em; margin-top: 4px; }
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(15,22,32,.45); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .15s; }
.sheet .panel { background: #fff; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); max-height: 85vh; overflow: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }

/* ---------- practice ---------- */
.pitem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.pitem input { width: 26px; height: 26px; accent-color: var(--green); flex: none; margin-top: 2px; }
.pitem .st { font-size: .78em; margin-top: 3px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; min-height: 44px; font-weight: 600; }
.choice button.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88em; }
.tbl th { text-align: left; font-size: .78em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column-reverse; min-width: 0; height: 100%; }
.chart .col i { display: block; width: 100%; }
.chart .col.goal { position: relative; }
.chart-x { display: flex; gap: 3px; font-size: .65em; color: var(--muted); } .chart-x span { flex: 1; text-align: center; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78em; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.learner-card { text-decoration: none; color: inherit; display: block; }
.flag { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); margin-bottom: 6px; font-size: .9em; }
.seg { display: flex; background: #e9eef4; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; font-weight: 700; min-height: 44px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { width: 48px; height: 28px; accent-color: var(--orange); flex: none; }

/* ---------- iPad / wide ---------- */
@media (min-width: 768px) {
  :root { --fs: 18px; }
  html.ts0 { --fs: 16px; } html.ts2 { --fs: 20px; } html.ts3 { --fs: 22px; }
  main.view { padding-top: 22px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .termcards { grid-template-columns: 1fr 1fr; }
  .rowcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .rowcards .rc { margin: 0; }
  .lcard { padding: 30px 30px; }
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .home-grid > .card { margin: 0; }
}
@media (min-width: 1100px) { main.view { max-width: 900px; } .player-top, .stage, .player-nav .inner { max-width: 860px; } }

/* ---------- print (admin report) ---------- */
@media print {
  .topbar, .tabbar, .noprint, #toast { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main.view { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .tblwrap { overflow: visible; }
}
