/* Flirt Buddy design system (web console + public pages). Construction rules borrowed from Duolingo (3D-lip
   buttons, flat 2px cards, two type weights, one meaning per colour); identity is Flirt Buddy's own (coral,
   Fredoka + Nunito). Tokens match the app's src/theme.ts: a fill carries only large text (19px+ bold) or white
   text on a deep fill; small coloured text uses a *-text token that clears WCAG AA in both themes. */
:root {
  --coral: #F0557A; --coral-lip: #C73B60; --coral-soft: #FFE1EA; --coral-faint: #FFF0F4; --coral-text: #B63457;
  --coral-deep: #C73B60; --coral-deep-lip: #9C2A49;
  --canvas: #FFF7F9; --card: #FFFFFF; --border: #F1DDE4; --border-strong: #E7C9D4;
  --ink: #3B2A33; --ink-2: #6B5662; --ink-3: #765F6B;
  --red: #FF4B4B; --red-lip: #D83A3A; --red-soft: #FFE3E3; --red-text: #C62727; --red-deep: #C62727; --red-deep-lip: #9A1F1F;
  --orange: #FF9600; --orange-text: #C77500;
  --yellow: #FFC800; --yellow-lip: #D1A300; --yellow-soft: #FFF3C2; --xp-text: #8A6700;
  --purple: #CE82FF; --purple-soft: #F1E0FF; --purple-text: #9500F6;
  --blue: #1CB0F6; --blue-soft: #DDF3FF; --blue-text: #0771A4;
  --display: "Fredoka", "Nunito", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
  --r: 16px; --lip: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --canvas: #1F141A; --card: #2A1C23; --border: #3E2A34; --border-strong: #52394A; --ink: #FBEFF3; --ink-2: #C9B3BD; --ink-3: #B8AAB0;
  --coral-soft: #4A2434; --coral-faint: #35202A; --red-soft: #4A2424; --yellow-soft: #4A3F1E; --purple-soft: #3B2A4A; --blue-soft: #1F3444;
  --coral-text: #F590A8; --red-text: #FF6565; --orange-text: #FF9600; --xp-text: #FFC800; --purple-text: #CE82FF; --blue-text: #1CB0F6;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --canvas: #1F141A; --card: #2A1C23; --border: #3E2A34; --border-strong: #52394A; --ink: #FBEFF3; --ink-2: #C9B3BD; --ink-3: #B8AAB0;
  --coral-soft: #4A2434; --coral-faint: #35202A; --red-soft: #4A2424; --yellow-soft: #4A3F1E; --purple-soft: #3B2A4A; --blue-soft: #1F3444;
  --coral-text: #F590A8; --red-text: #FF6565; --orange-text: #FF9600; --xp-text: #FFC800; --purple-text: #CE82FF; --blue-text: #1CB0F6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--ink); font-family: var(--body); font-weight: 500; font-size: 17px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; } h2 { font-size: 22px; } h3 { font-size: 19px; }
b, strong { font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--coral-text); }
a.quiet { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
::placeholder { color: var(--ink-3); opacity: 1; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
body.console .screen { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* console top bar: the wordmark and Log out */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top)) 12px 6px 16px; background: var(--canvas); border-bottom: 2px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--coral); white-space: nowrap; }
.brand-tag { padding: 3px 8px; border-radius: 999px; background: var(--coral-faint); color: var(--coral-text); font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }

/* the admin's own stats inside Play */
.stats-strip { display: flex; gap: 16px; align-items: center; justify-content: flex-end; margin-left: auto; }
.stat { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.stat-streak b { color: var(--orange-text); } .stat-xp b { color: var(--xp-text); } .stat-freeze b { color: var(--blue-text); }
.xp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); display: inline-block; }
.flame { display: inline-block; animation: flame-idle 2s ease-in-out infinite; }
.flame.at-risk { animation: flame-urgent .8s ease-in-out infinite; filter: saturate(1.3); }
.flame.off { filter: grayscale(1); opacity: .5; animation: none; }
@keyframes flame-idle { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.05) rotate(2deg); } }
@keyframes flame-urgent { 0%,100% { transform: scale(1) rotate(-3deg); } 25% { transform: scale(1.1) rotate(3deg); } 50% { transform: scale(1) rotate(-3deg); } 75% { transform: scale(1.1) rotate(3deg); } }

/* buttons: flat fill + darker lip; press drops onto the lip. Labels are 19px bold so white on coral reads (large text). */
.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 16px; border: 0; border-bottom: var(--lip) solid var(--coral-lip); border-radius: var(--r); background: var(--coral); color: #fff; font-family: var(--body); font-weight: 700; font-size: 19px; letter-spacing: .8px; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: filter 100ms ease, transform 100ms ease, border-bottom-width 100ms ease; }
.btn:active, .btn.pressed { border-bottom-width: 0; transform: translateY(var(--lip)); filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:active { border-bottom-width: var(--lip); transform: none; filter: none; }
/* small labels sit on the deep fills, which carry small white text */
.btn-sm { min-height: 44px; font-size: 14px; padding: 8px 14px; width: auto; background: var(--coral-deep); border-bottom-color: var(--coral-deep-lip); }
.btn-secondary { background: var(--card); color: var(--ink-2); border: 2px solid var(--border-strong); border-bottom-width: var(--lip); }
.btn-secondary:active { border-bottom-width: 2px; transform: translateY(2px); }
.btn-red { background: var(--red); border-bottom-color: var(--red-lip); }
.btn-red.btn-sm { background: var(--red-deep); border-bottom-color: var(--red-deep-lip); }
.btn-ghost { background: transparent; border: 0; color: var(--coral-text); text-transform: none; letter-spacing: 0; min-height: 44px; }
.btn-ghost:active { transform: none; filter: none; text-decoration: underline; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

/* cards */
.card { background: var(--card); border: 2px solid var(--border); border-radius: var(--r); padding: 16px; }
.card + .card, .card + .btn, .btn + .card, .stack > * + * { margin-top: 12px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-3); }
.label.coral { color: var(--coral-text); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }

/* progress */
.bar { height: 16px; border-radius: 8px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--coral); transition: width 300ms ease-out; }
.bar.xp > i { background: var(--yellow); }
.bar.info > i { background: var(--blue); }
.rep-dots { display: flex; gap: 6px; } .rep-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); } .rep-dots i.on { background: var(--coral); }

/* the student path (inside Play) */
.unit { margin-top: 18px; }
.unit-head { border-radius: var(--r); padding: 14px 16px; background: var(--coral-deep); color: #fff; border-bottom: var(--lip) solid var(--coral-deep-lip); }
.unit-head.locked { background: var(--card); color: var(--ink-2); border: 2px solid var(--border); border-bottom-width: var(--lip); }
.unit-head .label { color: #fff; } .unit-head.locked .label { color: var(--ink-3); }
.nodes { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 6px; }
.node { position: relative; width: 74px; height: 74px; border-radius: 50%; border: 0; background: var(--border); border-bottom: 6px solid var(--border-strong); display: grid; place-items: center; font-size: 26px; cursor: default; transition: transform 100ms; }
.node.current { background: var(--coral); border-bottom-color: var(--coral-lip); color: #fff; cursor: pointer; box-shadow: 0 0 0 6px var(--coral-soft); animation: pulse 1.6s ease-in-out infinite; }
.node.current:active { transform: translateY(4px); border-bottom-width: 2px; }
.node.done { background: var(--yellow); border-bottom-color: var(--yellow-lip); }
.node.soon { opacity: .55; }
.node-label { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: center; max-width: 150px; margin-top: -6px; }
.node.offset-l { transform: translateX(-56px); } .node.offset-r { transform: translateX(56px); }
.node.current.offset-l:active { transform: translateX(-56px) translateY(4px); } .node.current.offset-r:active { transform: translateX(56px) translateY(4px); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 6px var(--coral-soft); } 50% { box-shadow: 0 0 0 12px var(--coral-soft); } }

/* play */
.play-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: flex; gap: 6px; }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.chip-review { background: var(--blue-soft); color: var(--blue-text); }
.chip-type { background: var(--coral-faint); color: var(--coral-text); }
.her { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.her > div:last-child { flex: 1; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--coral-soft); color: #2B1B24; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; flex: none; }
.bubble { background: var(--coral-faint); border: 2px solid var(--border); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 18px; overflow-wrap: anywhere; }
.bubble.you { background: var(--blue-soft); border-radius: 18px 18px 6px 18px; margin-left: auto; }
.chat { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.chat .bubble { max-width: 86%; font-size: 16px; } .chat .bubble.dead { color: var(--ink-3); text-decoration: line-through; border-style: dashed; }
textarea.reply { display: block; width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border: 2px solid var(--border-strong); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 18px; }
textarea.reply:focus { outline: 0; border-color: var(--blue); }
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.opt { text-align: left; background: var(--card); border: 2px solid var(--border-strong); border-bottom-width: var(--lip); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 500; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; min-height: 50px; transition: transform 100ms, border-bottom-width 100ms; }
.opt:active { transform: translateY(2px); border-bottom-width: 2px; }
.opt:disabled { cursor: default; }
.opt .key { font-family: var(--display); font-weight: 700; color: var(--coral-text); min-width: 22px; }
.opt.picked { border-color: var(--coral); background: var(--coral-faint); }
.hint { background: var(--blue-soft); border: 2px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin-top: 10px; }

/* verdict */
.score { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; color: var(--coral); }
.score.miss { color: var(--red); }
.score small { font-size: 22px; color: var(--ink-3); }
.verdict-label { display: inline-block; margin-top: 8px; padding: 8px 14px; border-radius: 999px; background: var(--coral-faint); color: var(--coral-text); font-family: var(--display); font-weight: 700; font-size: 18px; }
.verdict-label.miss { background: var(--red-soft); color: var(--red-text); }
.xp-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--yellow-soft); color: var(--xp-text); font-weight: 700; }
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.dim .label { display: flex; justify-content: space-between; margin-bottom: 4px; } .dim .bar { height: 10px; border-radius: 5px; }
.feedback-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.box { border-radius: 12px; padding: 12px; border: 2px solid var(--border); background: var(--card); }
.box p { margin: 4px 0 0; }
.box .label { margin-bottom: 4px; }
.box.good { background: var(--coral-faint); } .box.good .label { color: var(--coral-text); }
.box.info { background: var(--blue-soft); } .box.info .label { color: var(--blue-text); }
.box.flag { background: var(--red-soft); border-color: var(--red); } .box.flag .label { color: var(--red-text); }
.better { border: 2px dashed var(--coral); background: var(--coral-faint); border-radius: 12px; padding: 12px 14px; font-size: 18px; overflow-wrap: anywhere; }
.better .label { color: var(--coral-text); }
.lesson { background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.grounding { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
/* Slides up above the tab bar and fades away completely, so it never rests on the tabs. */
.banner { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); opacity: 0; visibility: hidden; width: min(480px, 100%); padding: 16px 20px; border-radius: 16px 16px 0 0; color: #fff; font-family: var(--display); font-weight: 700; font-size: 20px; transition: transform 200ms ease-out, opacity 200ms ease-out, visibility 0s linear 200ms; z-index: 9; pointer-events: none; }
.banner.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 200ms ease-out, opacity 200ms ease-out; } .banner.good { background: var(--coral); } .banner.miss { background: var(--red); }

/* buddy */
.buddy-wrap { display: grid; place-items: center; }
.buddy { width: 150px; height: 150px; overflow: visible; }
.buddy .body { transform-origin: 100px 110px; animation: breathe 3s ease-in-out infinite; }
.buddy .eye-closed, .buddy .eye-half, .buddy .eye-x, .buddy .blush, .buddy .sweat, .buddy .dots, .buddy .zz, .buddy .shades, .buddy .brows, .buddy .mouths > * { display: none; }
.buddy .m-smile { display: block; }
.b-idle .pupil { animation: look 6s ease-in-out infinite; }
.b-thinking .pupil { transform: translate(2px, -4px); } .b-thinking .dots { display: block; animation: dots 1s ease-in-out infinite; } .b-thinking .m-smile { display: none; } .b-thinking .m-small { display: block; }
.b-celebrate .body { animation: bounce .6s cubic-bezier(.34,1.56,.64,1) 2; } .b-celebrate .m-smile { display: none; } .b-celebrate .m-grin { display: block; } .b-celebrate .eye-open { display: none; } .b-celebrate .eye-closed { display: block; } .b-celebrate .blush { display: block; }
.b-smug .m-smile { display: none; } .b-smug .m-smirk { display: block; } .b-smug .shades { display: block; } .b-smug .eye-open { display: none; }
.b-sheepish .m-smile { display: none; } .b-sheepish .m-small { display: block; } .b-sheepish .blush { display: block; } .b-sheepish .pupil { transform: translate(-3px, 4px); }
.b-bored .eye-open { display: none; } .b-bored .eye-half { display: block; } .b-bored .m-smile { display: none; } .b-bored .m-flat { display: block; }
.b-panic .eye-open circle { transform-origin: center; } .b-panic .pupil { r: 3.5; } .b-panic .m-smile { display: none; } .b-panic .m-o { display: block; } .b-panic .sweat { display: block; } .b-panic .brows { display: block; } .b-panic .body { animation: shake .4s ease-in-out infinite; }
.b-asleep .eye-open { display: none; } .b-asleep .eye-closed { display: block; } .b-asleep .m-smile { display: none; } .b-asleep .m-small { display: block; } .b-asleep .zz { display: block; animation: zz 2s ease-in-out infinite; } .b-asleep .body { animation: breathe 5s ease-in-out infinite; }
.b-dead .heart { fill: #A9A0A4; } .b-dead .eye-open { display: none; } .b-dead .eye-x { display: block; } .b-dead .m-smile { display: none; } .b-dead .m-frown { display: block; } .b-dead .body { animation: none; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes look { 0%,40%,100% { transform: translate(0,0); } 50%,80% { transform: translate(5px,-2px); } }
@keyframes dots { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.15) translateY(-12px); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3px) rotate(-2deg); } 75% { transform: translateX(3px) rotate(2deg); } }
@keyframes zz { 0% { transform: translate(0,0); opacity: 0; } 50% { opacity: 1; } 100% { transform: translate(8px,-14px); opacity: 0; } }
.buddy-says { display: flex; gap: 10px; align-items: flex-start; }
.buddy-says .buddy { width: 72px; height: 72px; flex: none; }
.buddy-says .bubble { border-radius: 6px 18px 18px 18px; background: var(--card); font-size: 16px; }

/* done */
.big-streak { font-family: var(--display); font-weight: 700; font-size: 96px; line-height: 1; color: var(--orange-text); }
.countdown { font-family: var(--display); font-weight: 700; font-size: 36px; color: var(--coral); font-variant-numeric: tabular-nums; }

/* console tabs: content-sized so "Corrections" fits beside five short labels at phone width */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(480px, 100%); display: flex; gap: 2px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--border); z-index: 6; }
.tab { flex: 1 1 auto; min-width: 44px; min-height: 56px; padding: 4px 2px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink-3); border-radius: 12px; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--coral-text); background: var(--coral-faint); } .tab-ico { font-size: 22px; line-height: 1.1; }

/* misc */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--canvas); border-radius: 12px; padding: 12px 14px; font-weight: 700; animation: toast-in 200ms ease-out; }
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.gate-logo { font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--coral); }
.field { margin-top: 12px; } .field label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
input[type=text] { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--border-strong); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 17px; }
input[type=text]:focus { outline: 0; border-color: var(--blue); }
input.code { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; text-align: center; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; } .pill { padding: 10px 14px; border-radius: 999px; border: 2px solid var(--border-strong); background: var(--card); font-weight: 700; font-size: 15px; cursor: pointer; min-height: 44px; }
.pill.on { border-color: var(--coral); background: var(--coral-faint); color: var(--coral-text); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 15px; cursor: pointer; } .check input { width: 22px; height: 22px; margin: 0; accent-color: var(--coral-deep); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .badge { text-align: center; padding: 12px 6px; border-radius: 12px; border: 2px solid var(--border); background: var(--card); font-size: 12px; font-weight: 700; } .badge.off { color: var(--ink-3); } .badge.off .ico { filter: grayscale(1); opacity: .45; } .badge .ico { font-size: 28px; }
.count-up { font-variant-numeric: tabular-nums; }
.sr { position: absolute; left: -9999px; }
.restore-code { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 2px; user-select: all; }

/* Jas's answer-key review */
.key-card .meta { font-size: 13px; color: var(--ink-3); font-weight: 700; letter-spacing: .3px; }
.key-card .key-line { margin-top: 10px; }
.key-card ul { margin: 6px 0 0; padding-left: 18px; font-size: 15px; } .key-card li { margin: 4px 0; }
.key-card .opts-mini div { font-size: 15px; padding: 4px 0; } .key-card .opts-mini .right { font-weight: 700; color: var(--coral-text); }
.key-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .key-actions .btn { flex: 1; min-width: 92px; }
.key-status { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .4px; white-space: nowrap; }
.key-status.approved { background: var(--coral-faint); color: var(--coral-text); } .key-status.rewritten { background: var(--blue-soft); color: var(--blue-text); }
.key-status.dropped { background: var(--red-soft); color: var(--red-text); }

/* admin path: lessons, their Brain notes (a flagged note is red and marked) and card counts */
details.lang { margin-top: 14px; }
details.lang > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 4px; cursor: pointer; list-style: none; }
details.lang > summary::-webkit-details-marker { display: none; }
details.lang > summary::before { content: "▸"; color: var(--ink-3); margin-right: 2px; transition: transform 150ms; }
details.lang[open] > summary::before { transform: rotate(90deg); }
.lang-name { font-family: var(--display); font-weight: 700; font-size: 22px; flex: 1; }
.unit-card + .unit-card { margin-top: 12px; }
.unit-card h3 { margin-bottom: 10px; }
.lesson-row { padding: 12px 0; border-top: 2px solid var(--border); }
.lesson-row:last-child { padding-bottom: 0; }
.lesson-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 8px; background: var(--canvas); border: 2px solid var(--border); color: var(--ink-2); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.note.flagged { background: var(--red-soft); border-color: var(--red); color: var(--red-text); }
.flag-text { color: var(--red-text); } .ok-text { color: var(--coral-text); }
.kv-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; }

/* corrections */
.corr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.corr-head h3 { overflow-wrap: anywhere; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; flex: none; font-weight: 700; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 52px; height: 30px; border-radius: 999px; background: var(--card); border: 2px solid var(--ink-3); transition: background 150ms, border-color 150ms; }
.switch .track i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3); transition: transform 150ms, background 150ms; }
.switch input:checked + .track { background: var(--coral-deep); border-color: var(--coral-deep); }
.switch input:checked + .track i { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + .track { outline: 3px solid var(--blue); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
details.pattern { margin-top: 10px; }
details.pattern > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--ink-2); font-weight: 700; font-size: 14px; }
details.pattern code { display: block; padding: 10px; border-radius: 8px; background: var(--canvas); border: 2px solid var(--border); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }

/* attempts */
.attempt + .attempt { margin-top: 10px; }
.att-top { display: flex; gap: 12px; align-items: flex-start; }
.att-score { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; min-width: 48px; color: var(--coral-text); font-variant-numeric: tabular-nums; }
.att-score.miss { color: var(--red-text); }
.att-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.band { display: inline-block; margin-left: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; background: var(--coral-faint); color: var(--coral-text); vertical-align: 2px; }
.band.needy, .band.boring { background: var(--red-soft); color: var(--red-text); }
.att-detail { margin-top: 8px; padding-top: 10px; border-top: 2px solid var(--border); font-size: 15px; }
.att-detail .kv { margin: 6px 0; overflow-wrap: anywhere; } .att-detail .kv .label { display: block; margin-bottom: 2px; }
.att-detail .scores6 { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px 12px; font-size: 14px; }
.retrieved { margin: 6px 0 0; padding-left: 18px; } .retrieved li { margin: 6px 0; }

/* stats */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { background: var(--card); border: 2px solid var(--border); border-radius: var(--r); padding: 14px; }
.tile-n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.unit-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-top: 10px; font-size: 15px; }
.unit-bar .bar { grid-column: 1 / -1; height: 10px; border-radius: 5px; }
.invite { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 2px solid var(--border); font-size: 15px; }
.label + .invite { border-top: 0; }
.invite code { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 1px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
