/* ==========================================================================
   Prep Room 3 — styles
   Tiles for 11–16 year olds, in ten styles the learner chooses (Pop,
   Midnight, Candy, Arcade, Street, Ocean, Forest, Sunset, Clean, Galaxy).
   Works from 280px folding-phone cover screens to desktops, including
   dual-screen and foldable devices.
   ========================================================================== */

@font-face { font-family: "Lexend"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../vendor/fonts/lexend-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../vendor/fonts/lexend-latin-ext-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(../vendor/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(../vendor/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "Fredoka"; font-style: normal; font-display: swap; font-weight: 300 700; src: url(../vendor/fonts/fredoka-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(../vendor/fonts/nunito-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700; src: url(../vendor/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "VT323"; font-style: normal; font-display: swap; font-weight: 400; src: url(../vendor/fonts/vt323-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Permanent Marker"; font-style: normal; font-display: swap; font-weight: 400; src: url(../vendor/fonts/permanent-marker-latin-400-normal.woff2) format("woff2"); }

/* ---- The 10 styles (generated; each colour's text colour picked for contrast) ---- */
:root, html[data-theme="pop"], [data-tp="pop"] {
  --bg: #F6F4EE; --dot: rgba(20,20,43,.08); --bg-img: radial-gradient(var(--dot) 1.3px, transparent 1.4px); --bg-size: 20px 20px;
  --surface: #FFFFFF; --surface-2: #F0EEE6; --surface-3: #E7E4D9;
  --ink: #14142B; --ink-2: #3A3A5A; --muted: #5F5F7C;
  --border: #14142B; --shadow-c: #14142B; --soft: #DEDACD;
  --r: 20px; --r-sm: 14px; --bw: 2px; --sh: 4px 4px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Bricolage Grotesque", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #3D5AFE; --on-electric: #FFFFFF; --c-coral: #FF5A5F; --on-coral: #14142B; --c-lime: #B8F03C; --on-lime: #14142B; --c-sun: #FFC93C; --on-sun: #14142B; --c-violet: #6C50F5; --on-violet: #FFFFFF;
  --c-mint: #2EC4B6; --on-mint: #14142B; --c-tangerine: #FF8A3D; --on-tangerine: #14142B; --c-pink: #FF6FB5; --on-pink: #14142B; --c-sky: #38BDF8; --on-sky: #14142B; --c-ink: #1B1B3A; --on-ink: #FFFFFF;
}
html[data-theme="midnight"], [data-tp="midnight"] {
  --bg: #0F0F26; --dot: rgba(255,255,255,.07); --bg-img: radial-gradient(var(--dot) 1.3px, transparent 1.4px); --bg-size: 20px 20px;
  --surface: #1B1B3A; --surface-2: #25254A; --surface-3: #30305A;
  --ink: #F4F3FF; --ink-2: #CBCAE8; --muted: #A3A2C8;
  --border: #5A5A9A; --shadow-c: #05050F; --soft: #34345E;
  --r: 20px; --r-sm: 14px; --bw: 2px; --sh: 4px 4px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Bricolage Grotesque", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: dark;
  --c-electric: #5C7CFF; --on-electric: #0A0A18; --c-coral: #FF6B70; --on-coral: #0A0A18; --c-lime: #C6FF4D; --on-lime: #0A0A18; --c-sun: #FFD24D; --on-sun: #0A0A18; --c-violet: #9B85FF; --on-violet: #0A0A18;
  --c-mint: #2EE6D6; --on-mint: #0A0A18; --c-tangerine: #FF9E57; --on-tangerine: #0A0A18; --c-pink: #FF7DC4; --on-pink: #0A0A18; --c-sky: #5CCBFF; --on-sky: #0A0A18; --c-ink: #ECEBFF; --on-ink: #0A0A18;
}
html[data-theme="candy"], [data-tp="candy"] {
  --bg: #FFF0F6; --dot: rgba(220,90,150,.16); --bg-img: radial-gradient(var(--dot) 2.2px, transparent 2.4px); --bg-size: 26px 26px;
  --surface: #FFFFFF; --surface-2: #FFF4F9; --surface-3: #FBE4EF;
  --ink: #3A1F48; --ink-2: #5B3B6B; --muted: #765681;
  --border: #4A2C5A; --shadow-c: #E9B9D2; --soft: #F3D5E4;
  --r: 28px; --r-sm: 18px; --bw: 2px; --sh: 0 6px 0 var(--shadow-c); --sh-sm: 0 4px 0 var(--shadow-c);
  --f-head: "Fredoka", "Nunito", system-ui, sans-serif; --f-body: "Nunito", "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #7C9CFF; --on-electric: #14142B; --c-coral: #FF8FA3; --on-coral: #14142B; --c-lime: #B9F5A6; --on-lime: #14142B; --c-sun: #FFE08A; --on-sun: #14142B; --c-violet: #C3A6FF; --on-violet: #14142B;
  --c-mint: #8FE3D6; --on-mint: #14142B; --c-tangerine: #FFB88A; --on-tangerine: #14142B; --c-pink: #FFA6D9; --on-pink: #14142B; --c-sky: #9FDCFF; --on-sky: #14142B; --c-ink: #4A2C5A; --on-ink: #FFFFFF;
}
html[data-theme="arcade"], [data-tp="arcade"] {
  --bg: #0A0A18; --dot: rgba(57,255,20,.08); --bg-img: linear-gradient(var(--dot) 1px, transparent 1px), linear-gradient(90deg, var(--dot) 1px, transparent 1px); --bg-size: 24px 24px;
  --surface: #141430; --surface-2: #1C1C40; --surface-3: #26264F;
  --ink: #F0F0FF; --ink-2: #C9C9F0; --muted: #9C9CD0;
  --border: #8A7CFF; --shadow-c: #FF2BD6; --soft: #2C2C5C;
  --r: 6px; --r-sm: 4px; --bw: 3px; --sh: 4px 4px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "VT323", "Space Grotesk", monospace; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: 0.58;
  color-scheme: dark;
  --c-electric: #3D8BFF; --on-electric: #0A0A18; --c-coral: #FF3B6B; --on-coral: #0A0A18; --c-lime: #39FF14; --on-lime: #0A0A18; --c-sun: #FFE600; --on-sun: #0A0A18; --c-violet: #B026FF; --on-violet: #FFFFFF;
  --c-mint: #00F5D4; --on-mint: #0A0A18; --c-tangerine: #FF8C00; --on-tangerine: #0A0A18; --c-pink: #FF2BD6; --on-pink: #0A0A18; --c-sky: #00D1FF; --on-sky: #0A0A18; --c-ink: #E0E0FF; --on-ink: #0A0A18;
}
html[data-theme="street"], [data-tp="street"] {
  --bg: #E7E4DF; --dot: rgba(0,0,0,.045); --bg-img: repeating-linear-gradient(45deg, var(--dot) 0 10px, transparent 10px 20px); --bg-size: auto;
  --surface: #FFFFFF; --surface-2: #F2F0EC; --surface-3: #E6E2DC;
  --ink: #111111; --ink-2: #333333; --muted: #5E5E5E;
  --border: #111111; --shadow-c: #111111; --soft: #D3CEC6;
  --r: 10px; --r-sm: 8px; --bw: 3px; --sh: 5px 5px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Permanent Marker", "Bricolage Grotesque", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: 0.5;
  color-scheme: light;
  --c-electric: #2D5BFF; --on-electric: #FFFFFF; --c-coral: #FF3D2E; --on-coral: #14142B; --c-lime: #A6FF00; --on-lime: #14142B; --c-sun: #FFD400; --on-sun: #14142B; --c-violet: #8C3BFF; --on-violet: #FFFFFF;
  --c-mint: #00C2A8; --on-mint: #14142B; --c-tangerine: #FF7A00; --on-tangerine: #14142B; --c-pink: #FF4FA3; --on-pink: #14142B; --c-sky: #2BB6FF; --on-sky: #14142B; --c-ink: #111111; --on-ink: #FFFFFF;
}
html[data-theme="ocean"], [data-tp="ocean"] {
  --bg: #E4F4FA; --dot: rgba(11,57,84,.10); --bg-img: radial-gradient(var(--dot) 1.5px, transparent 1.6px); --bg-size: 18px 18px;
  --surface: #FFFFFF; --surface-2: #F0F8FB; --surface-3: #DDEFF6;
  --ink: #0B2F45; --ink-2: #2D5266; --muted: #4A6878;
  --border: #0B3954; --shadow-c: rgba(11,57,84,.22); --soft: #CBE3ED;
  --r: 24px; --r-sm: 16px; --bw: 1.5px; --sh: 0 8px 18px var(--shadow-c); --sh-sm: 0 4px 10px var(--shadow-c);
  --f-head: "Nunito", "Lexend", system-ui, sans-serif; --f-body: "Nunito", "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #1F6FEB; --on-electric: #FFFFFF; --c-coral: #FF6F59; --on-coral: #14142B; --c-lime: #9BE564; --on-lime: #14142B; --c-sun: #FFD166; --on-sun: #14142B; --c-violet: #5A50EE; --on-violet: #FFFFFF;
  --c-mint: #06D6A0; --on-mint: #14142B; --c-tangerine: #F4A261; --on-tangerine: #14142B; --c-pink: #EF476F; --on-pink: #14142B; --c-sky: #4CC9F0; --on-sky: #14142B; --c-ink: #0B3954; --on-ink: #FFFFFF;
}
html[data-theme="forest"], [data-tp="forest"] {
  --bg: #EDF2E6; --dot: rgba(47,62,44,.09); --bg-img: radial-gradient(var(--dot) 1.5px, transparent 1.6px); --bg-size: 22px 22px;
  --surface: #FFFDF6; --surface-2: #F4F1E6; --surface-3: #E8E4D3;
  --ink: #24301F; --ink-2: #45523E; --muted: #5C6754;
  --border: #2F3E2C; --shadow-c: #2F3E2C; --soft: #D9D7C4;
  --r: 22px; --r-sm: 14px; --bw: 2px; --sh: 4px 4px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Nunito", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #3A6EA5; --on-electric: #FFFFFF; --c-coral: #C23B4E; --on-coral: #FFFFFF; --c-lime: #8AC926; --on-lime: #14142B; --c-sun: #EDAE49; --on-sun: #14142B; --c-violet: #7F5A83; --on-violet: #FFFFFF;
  --c-mint: #2A9D8F; --on-mint: #14142B; --c-tangerine: #E76F51; --on-tangerine: #14142B; --c-pink: #D88C9A; --on-pink: #14142B; --c-sky: #5FA8D3; --on-sky: #14142B; --c-ink: #2F3E2C; --on-ink: #FFFFFF;
}
html[data-theme="sunset"], [data-tp="sunset"] {
  --bg: #FFE6D2; --dot: transparent; --bg-img: linear-gradient(165deg, #FFE3C6 0%, #FFD0DA 55%, #E9D6FF 100%); --bg-size: 100% 100%;
  --surface: #FFFAF5; --surface-2: #FFF1E8; --surface-3: #FBE1D6;
  --ink: #2E1622; --ink-2: #53313F; --muted: #7C5A66;
  --border: #3B1F2B; --shadow-c: #3B1F2B; --soft: #EED3C8;
  --r: 20px; --r-sm: 14px; --bw: 2px; --sh: 4px 4px 0 var(--shadow-c); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Bricolage Grotesque", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #5B5BD6; --on-electric: #FFFFFF; --c-coral: #FF5E5B; --on-coral: #14142B; --c-lime: #C5E063; --on-lime: #14142B; --c-sun: #FFB627; --on-sun: #14142B; --c-violet: #8A4CD9; --on-violet: #FFFFFF;
  --c-mint: #00BBA7; --on-mint: #14142B; --c-tangerine: #FF8C42; --on-tangerine: #14142B; --c-pink: #F15BB5; --on-pink: #14142B; --c-sky: #4CB5F5; --on-sky: #14142B; --c-ink: #3B1F2B; --on-ink: #FFFFFF;
}
html[data-theme="clean"], [data-tp="clean"] {
  --bg: #F7F7F9; --dot: transparent; --bg-img: none; --bg-size: auto;
  --surface: #FFFFFF; --surface-2: #F2F2F5; --surface-3: #E8E8ED;
  --ink: #1D1D27; --ink-2: #3E3E4C; --muted: #6B6B7B;
  --border: #D4D4DE; --shadow-c: rgba(20,20,40,.10); --soft: #E3E3EA;
  --r: 16px; --r-sm: 12px; --bw: 1px; --sh: 0 1px 2px var(--shadow-c), 0 4px 14px var(--shadow-c); --sh-sm: 0 1px 3px var(--shadow-c);
  --f-head: "Space Grotesk", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: light;
  --c-electric: #2F54EB; --on-electric: #FFFFFF; --c-coral: #E5484D; --on-coral: #14142B; --c-lime: #7AC943; --on-lime: #14142B; --c-sun: #F5B400; --on-sun: #14142B; --c-violet: #6F4BD8; --on-violet: #FFFFFF;
  --c-mint: #13A89E; --on-mint: #14142B; --c-tangerine: #F27C2C; --on-tangerine: #14142B; --c-pink: #E0478C; --on-pink: #14142B; --c-sky: #1E9BD7; --on-sky: #14142B; --c-ink: #1D1D27; --on-ink: #FFFFFF;
}
html[data-theme="galaxy"], [data-tp="galaxy"] {
  --bg: #120B2E; --dot: rgba(255,255,255,.55); --bg-img: radial-gradient(1.2px 1.2px at 22px 34px, var(--dot), transparent), radial-gradient(1px 1px at 120px 80px, var(--dot), transparent), radial-gradient(1.5px 1.5px at 70px 140px, var(--dot), transparent), radial-gradient(1px 1px at 160px 20px, var(--dot), transparent); --bg-size: 190px 190px;
  --surface: #1E1446; --surface-2: #281B58; --surface-3: #33236B;
  --ink: #F3EFFF; --ink-2: #D3C9F5; --muted: #A99BD8;
  --border: #7A5CFF; --shadow-c: #05020F; --soft: #3A2A75;
  --r: 20px; --r-sm: 14px; --bw: 2px; --sh: 4px 4px 0 var(--shadow-c), 0 0 18px rgba(122,92,255,.25); --sh-sm: 3px 3px 0 var(--shadow-c);
  --f-head: "Space Grotesk", "Lexend", system-ui, sans-serif; --f-body: "Lexend", system-ui, sans-serif; --head-adjust: none;
  color-scheme: dark;
  --c-electric: #6E7BFF; --on-electric: #0A0A18; --c-coral: #FF6B8B; --on-coral: #0A0A18; --c-lime: #B6F36A; --on-lime: #0A0A18; --c-sun: #FFD166; --on-sun: #0A0A18; --c-violet: #A78BFA; --on-violet: #0A0A18;
  --c-mint: #4FE3C1; --on-mint: #0A0A18; --c-tangerine: #FF9F5A; --on-tangerine: #0A0A18; --c-pink: #F472D0; --on-pink: #0A0A18; --c-sky: #67D4FF; --on-sky: #0A0A18; --c-ink: #E9E4FF; --on-ink: #0A0A18;
}
:root {
  --ok: #17803D; --bad: #C62E33; --warn: #B9690B;
  --gap: 14px; --fs: 16px; --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --accent: var(--c-electric); --on-accent: var(--on-electric);
}
html.large { --fs: 18px; }
html.easier body { letter-spacing: .025em; word-spacing: .08em; }
html.easier .bubble, html.easier .prose { line-height: 1.85; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body); font-size: var(--fs); line-height: 1.5; color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bg-img);
  background-size: var(--bg-size);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--f-head); font-size-adjust: var(--head-adjust); line-height: 1.12; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
html[data-theme="sunset"] body { background-attachment: fixed; }
h1 { font-size: clamp(26px, 6vw, 38px); font-weight: 800; }
h2 { font-size: clamp(19px, 4vw, 24px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .7em; text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .875em; }
.center { text-align: center; }
.center-text { text-align: center; letter-spacing: .12em; }
.spacer { flex: 1; }
mark.todo { background: #FFE066; color: #14142B; padding: 0 4px; border-radius: 4px; }
.logo { width: 38px; height: 38px; flex: none; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm);
  border: var(--bw) solid var(--border); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 16px; box-shadow: var(--sh-sm); text-decoration: none; white-space: nowrap;
  transition: transform .1s, box-shadow .1s; max-width: 100%;
}
.btn span { overflow: hidden; text-overflow: ellipsis; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-c); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: var(--c-coral); color: var(--on-coral); }
.btn.ghost { background: var(--surface); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 10px; white-space: normal; text-align: center; line-height: 1.2; padding-top: 8px; padding-bottom: 8px; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border-radius: 14px; border: var(--bw) solid var(--border); background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm);
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; }
.icon-btn.on-dark { background: rgba(255, 255, 255, .92); color: #14142B; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; max-width: 100%;
  border-radius: 999px; border: var(--bw) solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip.solid { background: color-mix(in srgb, var(--subj, var(--accent)) 16%, var(--surface)); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip-row { display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: nowrap; }
.chip-row.wrap { flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; border: var(--bw) solid var(--border); white-space: nowrap; }
.pill.ghost { background: var(--surface); color: var(--ink); max-width: 100%; }
.pill.tiny { font-size: 12px; padding: 1px 9px; background: var(--t, var(--surface-2)); color: #fff; }

/* -------------------------------------------------------------------- forms */
.field { margin: 0 0 16px; min-width: 0; }
.field > label, .field > legend, .lab { display: block; font-weight: 700; margin: 0 0 6px; font-size: 15px; }
.input {
  width: 100%; min-height: 50px; padding: 10px 14px; font-size: 16px;
  border: var(--bw) solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
select.input { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236C6C88' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; text-overflow: ellipsis; }
.input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
input[type=date].input { min-height: 50px; }
.pw { position: relative; }
.pw .input { padding-right: 54px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.note { font-size: 14px; color: var(--muted); margin: 6px 0 12px; display: flex; gap: 6px; align-items: flex-start; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 1.3em; margin: 4px 0; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row2 > .input { flex: 1 1 140px; width: auto; }
.row2 > select.input:first-child { flex: 0 0 104px; }
.tick { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: var(--bw) solid var(--border); border-radius: var(--r-sm); background: var(--surface); margin: 0 0 12px; cursor: pointer; }
.tick input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.tick small { display: block; color: var(--muted); margin-top: 4px; }
.tick.small { padding: 8px 12px; border-style: dashed; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: var(--bw) solid var(--border); border-radius: var(--r-sm); padding: 12px; background: var(--surface); cursor: pointer; min-width: 0; }
.choice input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.choice b { display: block; }
.choice small { display: block; color: var(--muted); font-size: 13px; }
.choice:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: var(--sh-sm); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-grid .tick { margin: 0; }
.seg { display: flex; border: var(--bw) solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.seg-btn { flex: 1; min-height: 46px; border: 0; background: var(--surface); font-weight: 700; border-right: var(--bw) solid var(--border); }
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.meter { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; }
.meter i { flex: 1; height: 10px; border-radius: 9px; border: var(--bw) solid var(--border); background: linear-gradient(90deg, var(--mc, var(--c-coral)) var(--mw, 0%), var(--surface) 0); }
.meter span { font-size: 13px; font-weight: 700; min-width: 92px; text-align: right; }
.meter[data-s="0"] { --mw: 8%; --mc: var(--c-coral); } .meter[data-s="1"] { --mw: 30%; --mc: var(--c-tangerine); }
.meter[data-s="2"] { --mw: 55%; --mc: var(--c-sun); } .meter[data-s="3"] { --mw: 80%; --mc: var(--c-mint); } .meter[data-s="4"] { --mw: 100%; --mc: var(--c-lime); }
.status { border: var(--bw) solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; margin: 10px 0; background: var(--surface); font-size: 15px; }
.status small { display: block; color: var(--muted); margin-top: 4px; }
.status.ok { background: color-mix(in srgb, var(--c-mint) 20%, var(--surface)); }
.status.bad { background: color-mix(in srgb, var(--c-coral) 18%, var(--surface)); }
.status.wait { color: var(--muted); }
.copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; margin: 0 0 10px; }
.copy code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--surface-2); border: var(--bw) solid var(--border); border-radius: 10px; padding: 9px 10px; overflow-x: auto; white-space: nowrap; }
.copy small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); padding: 18px; margin: 0 0 var(--gap); min-width: 0; }
.card.flat { box-shadow: none; }
.card.big { padding: clamp(18px, 5vw, 32px); }
.card h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.card.warn { background: color-mix(in srgb, var(--c-sun) 24%, var(--surface)); }
.card.danger-zone { border-color: var(--c-coral); }
.card.empty { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 36px 18px; }
.card.empty .i { width: 42px; height: 42px; }

/* ------------------------------------------------------------- solo pages */
.solo { container: main / inline-size; max-width: 600px; margin: 0 auto; padding: calc(16px + var(--safe-t)) calc(14px + var(--safe-r)) calc(28px + var(--safe-b)) calc(14px + var(--safe-l)); min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.solo.wide { max-width: 1100px; justify-content: flex-start; }
.solo .card.center { text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.solo .card.center .stack { width: 100%; text-align: left; }
.back { position: absolute; top: 14px; left: 14px; }
.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 22px; min-width: 0; }
.top b { white-space: nowrap; }
.mega { font-size: clamp(32px, 9vw, 56px); margin: 10px 0 20px; }
.badge-i { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: var(--bw) solid var(--border); box-shadow: var(--sh-sm); margin-top: 8px; }
.badge-i .i { width: 32px; height: 32px; }
.steps-list { text-align: left; padding-left: 1.3em; margin: 8px 0 14px; }
.steps-list li { margin: 6px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: center; margin-top: 26px; color: var(--muted); font-size: 14px; }
.foot-links span { display: inline-flex; gap: 6px; align-items: center; }

/* wizard */
.wizard { position: relative; }
.wiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dots { display: flex; gap: 6px; flex: 1; margin-bottom: 18px; }
.wiz-top .dots { margin: 0; }
.dots i { flex: 1; height: 8px; border-radius: 9px; background: var(--surface-3); border: 1.5px solid var(--border); }
.dots i.done { background: var(--ink); } .dots i.on { background: var(--accent); }
.wizard h1 { margin: 4px 0 8px; }
.lede { color: var(--ink-2); font-size: 1.05em; margin-bottom: 18px; }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 2px dashed var(--soft); }
.wiz-nav .btn.primary { min-width: 140px; }
.hero-art { display: flex; justify-content: flex-start; margin-bottom: 10px; }
.hero-art .logo { width: 72px; height: 72px; transform: rotate(-6deg); }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini { background: var(--t); color: var(--on); border: var(--bw) solid var(--border); border-radius: 16px; padding: 12px; box-shadow: var(--sh-sm); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini b { font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 17px; line-height: 1.15; }
.mini small { font-size: 13px; opacity: .9; line-height: 1.25; }
.mini-i .i { width: 26px; height: 26px; margin-bottom: 6px; }
.promise { display: grid; gap: 10px; margin-bottom: 16px; }
.prom { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 12px; min-width: 0; }
.prom > span { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.prom b { display: block; line-height: 1.2; }
.prom small { color: var(--muted); }
.summary { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border-radius: 16px; padding: 14px; margin-bottom: 14px; min-width: 0; }
.summary > div { min-width: 0; }
.summary small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* avatar */
.ava { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; border: var(--bw) solid var(--border); background: var(--ava); }
.ava svg, .ava img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ava-sm { width: 32px; height: 32px; }
.ava-lg { width: 60px; height: 60px; }
.ava-xl { width: 88px; height: 88px; border-width: 3px; }
.ava-xxl { width: 128px; height: 128px; border-width: 3px; box-shadow: var(--sh); }
.ava.plus { background: var(--surface-2); color: var(--ink); }
.ava.plus .i { width: 40%; height: 40%; }
.look { display: grid; gap: 16px; }
.look-preview { display: flex; justify-content: center; }
.look-pick { min-width: 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-bottom: 14px; }
.icon-pick { aspect-ratio: 1; border-radius: 50%; border: var(--bw) solid var(--border); padding: 0; background: none; overflow: hidden; }
.icon-pick svg { width: 100%; height: 100%; display: block; }
.icon-pick[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: var(--bw) solid var(--border); background: var(--c); }
.swatch[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
.look-mini { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

/* year badge */
.year-badge { background: var(--accent); color: var(--on-accent); border: var(--bw) solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--sh); margin: 4px 0 16px; display: grid; gap: 4px; }
.year-badge b { font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: clamp(22px, 6vw, 30px); line-height: 1.1; }
.year-badge.low { background: var(--c-sun); color: var(--on-sun); }

/* 2FA */
.otp { display: flex; gap: 8px; justify-content: center; margin: 6px 0 12px; }
.otp input { width: min(50px, calc((100% - 40px) / 6)); height: 58px; text-align: center; font-size: 24px; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; border: var(--bw) solid var(--border); border-radius: 14px; background: var(--surface); padding: 0; }
.otp input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }
.qr-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.qr { width: 200px; max-width: 100%; aspect-ratio: 1; border: var(--bw) solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--sh-sm); margin: 0 auto 12px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-side { flex: 1 1 220px; min-width: 0; }
.key { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: .04em; background: var(--surface-2); border: var(--bw) dashed var(--border); border-radius: 12px; padding: 10px; margin: 4px 0 14px; word-break: keep-all; overflow-wrap: normal; text-align: center; line-height: 1.7; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.codes code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; text-align: center; padding: 9px 4px; background: var(--surface-2); border-radius: 10px; border: 1.5px solid var(--border); }

/* ------------------------------------------------------------ sign-in */
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 44%), 1fr)); gap: var(--gap); }
.who-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0;
  aspect-ratio: 1 / 1.05; background: var(--surface); border: var(--bw) solid var(--border); border-radius: 24px; box-shadow: var(--sh);
  font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: clamp(16px, 4.6vw, 21px); padding: 12px; transition: transform .12s, box-shadow .12s;
}
.who-tile { container-type: inline-size; }
.who-tile > span:last-child { max-width: 100%; font-size: clamp(14px, 13cqi, 21px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-tile:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 6px 6px 0 var(--shadow-c); }
.who-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-c); }
.who-tile.add { border-style: dashed; box-shadow: none; background: transparent; }
.who-tile .ava-xl { width: clamp(64px, 22vw, 96px); height: clamp(64px, 22vw, 96px); }

/* ------------------------------------------------------------ shell */
.shell { min-height: 100dvh; }
.rail { display: none; }
.main { container: main / inline-size; padding: calc(14px + var(--safe-t)) calc(12px + var(--safe-r)) calc(var(--tab-h) + 24px + var(--safe-b)) calc(12px + var(--safe-l)); min-width: 0; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: var(--bw) solid var(--border); padding: 6px calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l));
}
.nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 14px; min-width: 0; padding: 0 2px; }
.nav-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn .i { width: 24px; height: 24px; }
.nav-btn[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.nav-btn[aria-current="page"] .i { color: var(--accent); }
.shell.focus .tabbar { display: none; }
.shell.focus .main { padding: 0; }
.pad { min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; min-width: 0; }
.page-head + .muted, .page-head p { margin-bottom: 16px; }
.page-head h1 { min-width: 0; }
.group-h { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; font-family: var(--f-body); font-weight: 800; }

/* ------------------------------------------------------------ tiles & grids */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  container-type: inline-size; position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--t, var(--surface)); color: var(--on, var(--ink));
  border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); padding: 14px; text-align: left; overflow: hidden;
}
button.tile, .tile.act { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
button.tile:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--shadow-c); }
button.tile:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow-c); }
.tile.act { min-height: 136px; justify-content: flex-end; }
.tile.ink { --t: var(--c-ink); --on: var(--on-ink); }
.t-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; border: var(--bw) solid currentColor; margin-bottom: auto; }
.tile.act .t-icon + .t-title { margin-top: 10px; }
.t-icon .i { width: 24px; height: 24px; }
.t-title { font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: clamp(16px, 12cqi, 23px); line-height: 1.08; letter-spacing: -.01em; overflow-wrap: break-word; hyphens: manual; }
.t-cap { font-size: clamp(12px, 8cqi, 14px); line-height: 1.25; opacity: .88; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 2; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; min-width: 0; }
.tile-head h2 { font-size: 18px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.tile-head .linkish { min-height: 32px; flex: none; }

/* home */
.hello { background: var(--accent); color: var(--on-accent); justify-content: center; min-height: 136px; }
.hello-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hello-txt { min-width: 0; display: grid; gap: 4px; }
.hello h1 { font-size: clamp(21px, 13cqi, 40px); overflow-wrap: anywhere; }
.school { font-size: 13.5px; font-weight: 600; opacity: .92; line-height: 1.25; }
.kicker { font-weight: 700; opacity: .9; font-size: 15px; }
.hello .pill { background: var(--surface); color: var(--ink); }
.hello .pill.ghost { background: transparent; color: inherit; border-color: currentColor; }
.ask { justify-content: center; gap: 10px; min-height: 136px; }
.ask-form { display: grid; gap: 10px; min-width: 0; }
.ask-label { display: flex; align-items: center; gap: 8px; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: clamp(18px, 6cqi, 26px); min-width: 0; }
.ask-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-row { display: flex; gap: 10px; align-items: flex-end; min-width: 0; }
.ask-row textarea, .comp-row textarea {
  flex: 1; min-width: 0; resize: none; min-height: 50px; max-height: 160px; padding: 13px 14px; font-size: 16px; line-height: 1.4;
  border: var(--bw) solid var(--border); border-radius: 16px; background: var(--surface-2); color: var(--ink);
}
.ask-row textarea:focus, .comp-row textarea:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.send-btn { width: 50px; height: 50px; flex: none; border-radius: 16px; border: var(--bw) solid var(--border); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: var(--sh-sm); }
.send-btn .i { width: 24px; height: 24px; }
.send-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.send-btn.stop { background: var(--c-coral); color: var(--on-coral); }
.ask-off { font-size: 13px; color: var(--muted); margin: 0; display: flex; gap: 6px; align-items: center; }
.recent { gap: 8px; }
.rows { display: grid; gap: 6px; }
.row-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--soft); background: var(--surface-2); text-align: left; min-width: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--border); flex: none; }

/* subjects */
.subj-grid .tile.subj { --on: #fff; min-height: 108px; justify-content: flex-end; }
.subj-grid .tile.subj { background-image: radial-gradient(circle at 100% 0, rgba(255, 255, 255, .2) 0 36px, transparent 37px); }
.subj-hero { background: var(--t); color: #fff; border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); padding: 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-width: 0; }
.subj-hero h1 { color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.how summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.how summary::after { content: "+"; font-weight: 800; font-size: 22px; }
.how[open] summary::after { content: "–"; }
.how p { margin-top: 10px; font-size: 15px; }
.topic-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.tile.topic { min-height: 150px; border-top: 8px solid var(--subj); }
.tile.topic .t-title { font-size: clamp(16px, 6cqi, 19px); }
.tile.topic .t-cap { opacity: .75; -webkit-line-clamp: 3; }
.tile.topic .t-title { overflow-wrap: break-word; }
.flags { display: flex; gap: 5px; flex-wrap: wrap; min-height: 0; }
.flag { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; border: 1.5px solid var(--border); }
.flag.h { background: #E3DBFF; color: #14142B; } .flag.t { background: #CFF5E1; color: #14142B; } .flag.rp { background: #FFE3B3; color: #14142B; }
.topic-acts { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.topic-acts .chip { min-height: 38px; }
.topic-acts .chip:last-child { padding: 0 10px; }

/* pages */
.page-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.tile.page-tile { flex-direction: row; align-items: stretch; padding: 0; border-left: 10px solid var(--t); --t-bg: var(--surface); background: var(--surface); color: var(--ink); }
.page-open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 14px; display: grid; gap: 6px; }
.page-tile .t-title { font-size: 18px; }
.page-tile .del { align-self: center; margin-right: 12px; }

/* me */
.me-card { flex-direction: row; align-items: center; gap: 14px; min-height: 120px; }
.me-card h1 { font-size: clamp(20px, 8cqi, 32px); margin-bottom: 6px; overflow-wrap: anywhere; }
.me-card .school { display: -webkit-box; margin-top: 6px; color: var(--muted); }
.kv { display: grid; gap: 6px; margin-bottom: 10px; }
.kv-row { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr); gap: 0 10px; padding: 8px 0; border-bottom: 1.5px dashed var(--soft); align-items: baseline; }
.kv-row small { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.kv-row b { overflow-wrap: anywhere; min-width: 0; }
.boards { display: grid; gap: 8px; }
.board-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.board-row .input { min-height: 44px; font-size: 15px; padding: 6px 30px 6px 10px; background-position: right 6px center; }

/* grown-ups */
.g-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.tile.learner { gap: 12px; }
.tile.learner h2 { font-size: 22px; }
.tile.add { border-style: dashed; box-shadow: none; background: transparent; }
.tile.add .t-icon { border-style: dashed; }

/* policies */
.pol-grid .tile.act { min-height: 150px; }
.prose { overflow-wrap: anywhere; }
.prose h4 { font-size: 20px; margin: 22px 0 8px; }
.prose h4:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 5px 0; }
.tablewrap { overflow-x: auto; margin: 0 0 1em; border: var(--bw) solid var(--border); border-radius: 14px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1.5px solid var(--soft); vertical-align: top; }
.prose th { background: var(--surface-2); font-family: var(--f-head); font-size-adjust: var(--head-adjust); }
@container main (max-width: 559px) {
  .prose table, .prose thead, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { border-bottom: var(--bw) solid var(--border); padding: 6px 0; }
  .prose td { border: 0; padding: 4px 12px; }
  .prose td::before { content: attr(data-h); display: block; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
}

/* ------------------------------------------------------------ chat */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr); height: 100dvh; min-height: 0; }
.chat-side { display: none; }
.chat-main { display: flex; flex-direction: column; height: 100dvh; min-height: 0; min-width: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); min-width: 0; }
.subj-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; min-width: 0; max-width: calc(100% - 116px); border-radius: 999px; border: var(--bw) solid var(--border); background: var(--surface); font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: 17px; box-shadow: var(--sh-sm); }
.subj-chip .dot { background: var(--c); }
.mode-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); scrollbar-width: none; flex: none; }
.mode-row::-webkit-scrollbar { display: none; }
.mode-row.in-page { padding: 4px 2px 12px; }
.mode { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: var(--bw) solid var(--border); background: var(--surface); font-weight: 700; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.mode .i { width: 18px; height: 18px; }
.mode-row.in-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); overflow: visible; }
.mode-row.in-page .mode { padding: 0 6px; font-size: 14px; }
.mode-row.modes { display: flex; gap: 5px; overflow: visible; }
.mode-row.modes .mode { flex: 1 1 auto; flex-direction: column; gap: 2px; min-height: 54px; padding: 4px 3px; border-radius: 16px; font-size: 11.5px; letter-spacing: -.01em; }
.mode-row.modes .mode .i { width: 20px; height: 20px; }
@container main (min-width: 640px) {
  .mode-row.modes { display: flex; gap: 8px; flex-wrap: wrap; }
  .mode-row.modes .mode { flex: 0 0 auto; flex-direction: row; min-height: 42px; padding: 0 14px; border-radius: 999px; font-size: 14px; gap: 6px; }
}
@container main (max-width: 379px) {
  .mode-row.modes .mode span { display: none; }
  .mode-row.modes .mode { flex: 1 1 0; min-height: 46px; }
  .mode-row.in-page .mode { font-size: 12.5px; padding: 0 3px; }
}
.mode[aria-selected="true"] { background: var(--ink); color: var(--bg); }
html[data-dark] .mode[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px calc(12px + var(--safe-r)) 16px calc(12px + var(--safe-l)); scroll-behavior: smooth; }
.thread.over { outline: 3px dashed var(--accent); outline-offset: -8px; }
.msg { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 16px; min-width: 0; animation: pop .22s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.me { justify-content: flex-end; }
.msg.t { align-items: flex-start; }
.bubble { max-width: min(680px, 100%); min-width: 0; border: var(--bw) solid var(--border); border-radius: 20px; padding: 12px 14px; background: var(--surface); box-shadow: var(--sh-sm); overflow-wrap: anywhere; }
.msg.t .bubble { border-top-left-radius: 6px; flex: 1; }
.msg.me .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; max-width: min(560px, 85%); }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { padding-left: 1.3em; margin: .2em 0 .8em; }
.bubble li { margin: .25em 0; }
.bubble h4 { font-size: 17px; margin: .8em 0 .3em; }
.bubble code { font-family: ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.msg.t .bubble strong { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--subj, var(--accent)) 30%, transparent) 60%); }
.bubble em.say { cursor: pointer; text-decoration: underline dotted 2px; text-underline-offset: 3px; }
.t-name { display: block; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.t-badge { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: 18px; border: var(--bw) solid var(--border); }
html[data-dark] .t-badge { background: var(--accent); color: var(--on-accent); }
.t-badge .i { width: 20px; height: 20px; }
.t-badge.big { width: 64px; height: 64px; font-size: 30px; border-radius: 20px; box-shadow: var(--sh-sm); transform: rotate(-4deg); margin-bottom: 12px; }
.thumb { display: block; max-width: 220px; width: 100%; border-radius: 12px; border: var(--bw) solid var(--border); margin: 0 0 8px; background: #fff; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .22); border: 1.5px solid currentColor; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.bubble details { margin-top: 6px; font-size: 14px; }
.bubble summary { cursor: pointer; opacity: .85; }
.ocr { white-space: pre-wrap; margin-top: 6px; }
.bubble.pending { background: var(--surface); color: var(--ink); width: min(560px, 100%); }
.ocr-edit { width: 100%; min-height: 120px; margin: 6px 0 8px; font-size: 15px; border: var(--bw) solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); color: var(--ink); resize: vertical; }
.bar { height: 10px; border-radius: 9px; background: var(--surface-3); border: 1.5px solid var(--border); overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.res-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: 8px; margin: 12px 0 4px; }
.res-col { display: grid; gap: 8px; }
.res { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 52px; padding: 8px 10px; border-radius: 14px; border: var(--bw) solid var(--border); background: var(--t); color: var(--on); text-decoration: none; box-shadow: 2px 2px 0 var(--shadow-c); }
.res:active { transform: translate(2px, 2px); box-shadow: none; }
.res > span { min-width: 0; display: grid; line-height: 1.15; }
.res b { font-size: 14px; }
.res small { font-size: 12px; opacity: .9; }
.msg-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; min-width: 0; }
.msg-tools .chip { white-space: normal; text-align: left; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; max-width: 100%; height: auto; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.15em; background: var(--accent); margin-left: 3px; animation: blink 1s steps(2) infinite; border-radius: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.support { background: color-mix(in srgb, var(--c-sun) 24%, var(--surface)); }
.help-line { display: grid; padding: 10px 12px; margin: 8px 0; border-radius: 14px; border: var(--bw) solid var(--border); background: var(--surface); text-decoration: none; }
.help-line small { color: var(--muted); }
.welcome { max-width: 640px; margin: 8px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.welcome h2 { margin-bottom: 8px; }
.welcome > p { color: var(--ink-2); }
.starters { display: grid; gap: 8px; width: 100%; margin: 12px 0; }
.starter { text-align: left; min-height: 52px; padding: 10px 14px; border-radius: 16px; border: var(--bw) solid var(--border); background: var(--surface); box-shadow: var(--sh-sm); font-weight: 600; overflow-wrap: anywhere; }
.starter:active { transform: translate(2px, 2px); box-shadow: none; }
.drop-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin: 8px 0 4px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; border-radius: 18px; border: var(--bw) dashed var(--border); background: var(--surface); font-weight: 800; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 16px; padding: 10px; }
.drop .i { width: 30px; height: 30px; color: var(--accent); }
.honest { font-size: 13px; color: var(--muted); margin-top: 14px; max-width: 520px; }
.composer { flex: none; padding: 8px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); background: var(--bg); border-top: var(--bw) solid var(--border); }
.topic-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.topic-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%; padding: 0 12px; border-radius: 999px; border: 1.5px dashed var(--border); background: var(--surface); font-size: 14px; font-weight: 700; min-width: 0; }
.comp-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.icon-btn.add { border-radius: 16px; width: 50px; height: 50px; }
.topic-col { display: grid; gap: 6px; }
.topic-btn { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; text-align: left; min-width: 0; }
.card.side { box-shadow: none; }
.card.side h3 { font-size: 16px; }
.card.side .topic-col { max-height: 46dvh; overflow: auto; }

/* ------------------------------------------------------------ sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 10, 25, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 620px; max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg); border: var(--bw) solid var(--border); border-bottom: 0; border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .9, .3, 1); }
.sheet-wrap.open .sheet-back { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px 18px; min-width: 0; }
.sheet-head h2 { min-width: 0; overflow: hidden; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + var(--safe-b)); overscroll-behavior: contain; }
.sheet .grid.in-sheet { margin-bottom: 8px; }
.sheet .subj-grid .tile.subj { min-height: 88px; }

/* ------------------------------------------------------------ misc */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + var(--safe-b)); transform: translateX(-50%); z-index: 80; max-width: calc(100% - 28px); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; font-weight: 600; font-size: 15px; box-shadow: var(--sh-sm); animation: pop .2s ease both; text-align: center; }
.toast.out { opacity: 0; transition: opacity .3s; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 2.2s cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes fall { to { top: 110%; transform: rotate(720deg) translateX(40px); } }

/* ------------------------------------------------------------ breakpoints (by available width) */
@container main (min-width: 560px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .span-4 { grid-column: span 4; }
  .home .recent { grid-column: span 2; }
  .topic-grid, .page-grid, .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pol-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .me-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container main (min-width: 980px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home .recent { grid-column: span 4; }
  .topic-grid, .page-grid, .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pol-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .subj-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile.act { min-height: 156px; }
}

/* tiny cover screens (folding phones closed, e.g. 280–340px) */
@media (max-width: 340px) {
  :root { --gap: 10px; --r: 16px; }
  .tile { padding: 11px; }
  .t-icon { width: 36px; height: 36px; border-radius: 11px; }
  .t-icon .i { width: 20px; height: 20px; }
  .tile.act { min-height: 118px; }
  .nav-btn { font-size: 10.5px; }
  .btn { padding: 0 14px; }
  .wiz-nav .btn.primary { min-width: 0; flex: 1; }
  .codes { grid-template-columns: minmax(0, 1fr); }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .board-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .board-row > span:first-child { grid-column: 1 / -1; font-weight: 700; }
}

/* tablets & desktops: navigation rail */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; padding: calc(18px + var(--safe-t)) 14px 18px calc(14px + var(--safe-l)); border-right: var(--bw) solid var(--border); background: var(--surface); }
  .rail-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 21px; margin: 0 6px 18px; }
  .rail .nav-btn { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 16px; padding: 0 14px; min-height: 50px; }
  .rail-foot { margin-top: auto; display: grid; gap: 10px; padding: 10px 4px 0; font-weight: 700; min-width: 0; }
  .rail-me { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border-radius: 12px; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
  .rail-me:hover { background: var(--soft); }
  .rail-out { justify-content: center; width: 100%; }
  .mob-bar { display: none !important; }
  .tabbar { display: none; }
  .main { padding: 24px 28px 40px; }
  .shell.focus .main { padding: 0; }
  .toast { bottom: 28px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: var(--bw) solid var(--border); box-shadow: var(--sh); max-height: 84dvh; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
  .sheet-wrap.open .sheet { transform: none; opacity: 1; }
}
@media (min-width: 1200px) { .shell { grid-template-columns: 240px minmax(0, 1fr); } .main { padding: 28px 40px 48px; } }
@container main (min-width: 1040px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .chat-side { display: block; order: 2; padding: 18px 18px 18px 0; overflow-y: auto; height: 100dvh; }
}

/* landscape phones: keep the composer compact */
@media (max-height: 500px) and (orientation: landscape) {
  .mode-row { padding-bottom: 6px; }
  .topic-line { display: none; }
  .tile.act { min-height: 112px; }
}

/* dual-screen / foldables spanning a hinge (Surface Duo, Galaxy Fold, Pixel Fold) */
@media (horizontal-viewport-segments: 2) {
  .shell { display: block; }
  .rail { display: none; }
  .tabbar { display: grid; right: auto; width: env(viewport-segment-width 0 0); }
  .shell.focus .tabbar { display: none; }
  .main { padding-right: calc(env(viewport-segment-right 1 0) - env(viewport-segment-left 1 0) + 12px); max-width: env(viewport-segment-width 0 0); }
  .shell.focus .main { max-width: none; padding: 0; }
  .chat-layout { grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0); column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); }
  .chat-side { display: block; order: 0; padding: 16px; overflow-y: auto; height: 100dvh; }
  .solo { margin: 0; max-width: env(viewport-segment-width 0 0); }
}
@media (vertical-viewport-segments: 2) {
  .thread { max-height: calc(env(viewport-segment-height 0 0) - 120px); }
  .solo { justify-content: flex-start; }
}
@media (spanning: single-fold-vertical) {
  .chat-layout { grid-template-columns: env(fold-left) env(fold-width) 1fr; }
  .chat-side { display: block; grid-column: 1; overflow-y: auto; height: 100vh; padding: 16px; }
  .chat-main { grid-column: 3; }
}

@media (hover: none) { button.tile:hover, .btn:hover, .who-tile:hover { transform: none; box-shadow: var(--sh); } .btn:hover { box-shadow: var(--sh-sm); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  body { background: #fff; }
  .rail, .tabbar, .page-head .icon-btn, .row2, .foot-links { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; }
}

/* ---- small-screen refinements ---- */
@media (max-width: 360px) {
  .top .btn span { display: none; }
  .top .btn { width: 44px; padding: 0; }
  .subj-chip { font-size: 15px; padding: 0 12px; }
}
@container main (max-width: 419px) {
  .pol-grid { grid-template-columns: minmax(0, 1fr); }
  .pol-grid .tile.act { min-height: 84px; padding-left: 72px; justify-content: center; }
  .pol-grid .t-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin: 0; }
  .pol-grid .tile.act .t-icon + .t-title { margin-top: 0; }
}
@media (max-width: 520px) {
  .board-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .board-row > span:first-child { grid-column: 1 / -1; font-weight: 700; margin-top: 6px; }
}
.wipe-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wipe-acts .btn { min-width: 0; padding: 0 10px; }
@media (max-width: 340px) { .wipe-acts { grid-template-columns: minmax(0, 1fr); } }
.row-item .clamp2 { line-height: 1.25; margin: 6px 0; }


/* ==========================================================================
   Prep Room 3 additions
   ========================================================================== */
.hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 6px; line-height: 1.35; }
.stack { display: grid; gap: 0; }
.sub-h { font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.sub-h:first-child { margin-top: 0; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.brand .logo { width: 40px; height: 40px; flex: none; }
.brand-txt { display: grid; min-width: 0; }
.brand-txt b { font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 22px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.brand-txt b span { color: var(--c-electric); }
html[data-dark] .brand-txt b span { color: var(--c-sky); }
.brand-txt small { font-size: 14px; color: var(--ink-2); line-height: 1.3; margin-top: 4px; font-weight: 500; }
.brand.big { flex-direction: column; text-align: center; gap: 12px; }
.brand.big .logo { width: clamp(76px, 22vw, 104px); height: clamp(76px, 22vw, 104px); transform: rotate(-4deg); }
.brand.big .brand-txt b { font-size: clamp(34px, 11vw, 52px); }
.brand.big .brand-txt small { font-size: clamp(14px, 4vw, 17px); max-width: 30ch; margin: 6px auto 0; }
.rail-brand .brand .logo { width: 36px; height: 36px; }
.rail-brand .brand-txt b { font-size: 20px; }

/* welcome */
.welcome-hero { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 10px 0; }
.hero-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.hero-tiles .mini { align-items: center; text-align: center; gap: 6px; padding: 12px 8px; }
.hero-tiles .mini .i { width: 26px; height: 26px; }
.hero-tiles .mini b { font-size: 15px; }
.hero-acts { display: grid; gap: 12px; width: 100%; max-width: 420px; }
.btn.big { min-height: 58px; font-size: 18px; border-radius: var(--r); }
@container main (max-width: 359px) { .hero-tiles { grid-template-columns: minmax(0, 1fr); } .hero-tiles .mini { flex-direction: row; text-align: left; } }

/* sign in / sign up */
.auth h1 { margin: 6px 0 10px; }
.auth-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; width: 100%; }
.auth-top .brand .logo { width: 34px; height: 34px; }
.auth-top .brand-txt b { font-size: 19px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 14px; }
.auth.center .auth-top { justify-content: flex-start; }
.auth .brand.big { margin: 0 auto 14px; }
.badge-i.ok { background: var(--c-mint); color: var(--on-mint); }
.steps-mini { display: grid; gap: 8px; width: 100%; margin: 6px 0 12px; text-align: left; }
.steps-mini span { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 600; min-width: 0; }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 6px 0 12px; }
.otp input { min-width: 0; width: 100%; text-align: center; font-size: 24px; font-weight: 800; min-height: 54px; border: var(--bw) solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.otp input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* styles picker */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@container main (min-width: 520px) { .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container main (min-width: 760px) { .theme-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sheet .theme-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.theme-card { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px 8px 10px; min-width: 0; background: var(--bg); background-image: var(--bg-img); background-size: var(--bg-size); color: var(--ink); border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh-sm); font-family: var(--f-body); }
.theme-card[aria-pressed="true"] { outline: 4px solid var(--c-electric); outline-offset: 3px; }
.tp-prev { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; align-items: end; margin-bottom: 6px; position: relative; }
.tp-tile { height: 34px; background: var(--t); border: var(--bw) solid var(--border); border-radius: var(--r-sm); box-shadow: var(--sh-sm); }
.tp-head { position: absolute; left: 6px; top: 2px; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: 18px; color: var(--on-electric); pointer-events: none; }
.tp-name { font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-weight: 800; font-size: 17px; line-height: 1.1; overflow-wrap: anywhere; }
.tp-sub { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.icon-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.onboard .ob-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; min-width: 0; }
.onboard .ob-head h1 { font-size: clamp(24px, 6vw, 34px); margin-bottom: 4px; overflow-wrap: anywhere; }
@container main (max-width: 419px) { .onboard .ob-head { flex-direction: column; align-items: flex-start; } }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; min-width: 0; }
.seg-btn[disabled] { opacity: .45; }
.seg-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* home */
.home { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.home .hello { min-height: 0; }
.home .hello h1 { font-size: clamp(22px, 9cqi, 38px); }
.acts { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home .lockt { min-height: 0; flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; }
.home .lockt .t-icon { margin: 0; }
.home .lockt .t-title { margin: 0; }
.home .lockt .t-cap { margin-left: auto; text-align: right; }
@container main (max-width: 419px) { .home .lockt { flex-wrap: wrap; } .home .lockt .t-cap { margin-left: 0; text-align: left; flex-basis: 100%; } }
@container main (min-width: 560px) {
  .home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .words-tile, .home .acts { grid-column: 1 / -1; }
  .acts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container main (min-width: 980px) {
  .home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home .ask { grid-column: span 2; }
  .home .recent { grid-column: span 2; }
}

/* five words */
.words-tile { padding-bottom: 10px; }
.words-tile .tile-head { flex-wrap: wrap; }
.words-tile .tile-head h2 { flex: 1 1 200px; }
.words-row { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 4px 8px; margin: 0 -4px; overscroll-behavior-x: contain; }
.words-row::-webkit-scrollbar { display: none; }
@container main (min-width: 560px) { .words-row { grid-auto-columns: 46%; } }
@container main (min-width: 980px) { .words-row { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; } .w-dots { display: none !important; } }
.word { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--surface); color: var(--ink); border: var(--bw) solid var(--border); border-radius: var(--r-sm); padding: 12px; box-shadow: var(--sh-sm); border-top: 8px solid var(--wc); }
.word.skeleton { min-height: 220px; background: var(--surface-2); border-top-color: var(--soft); }
.w-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.w-subj { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--wc); color: var(--won); border-radius: 999px; padding: 2px 10px; border: 1.5px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.w-hear { flex: none; }
.w-word { font-size: clamp(22px, 7cqi, 30px); line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.w-say { margin: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.w-pr { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.w-mean { margin: 0; font-weight: 600; line-height: 1.4; }
.w-ex { margin: 0; font-size: 14.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; line-height: 1.4; overflow-wrap: anywhere; }
.w-ex b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.w-got { margin-top: auto; align-self: flex-start; }
.w-got[aria-pressed="true"] { background: var(--c-mint); color: var(--on-mint); }
.w-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 4px; }
.w-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); border: 1px solid var(--border); }
.w-dots i.on { background: var(--accent); width: 20px; border-radius: 9px; }
.w-count { text-align: center; margin: 2px 0 0; }
.q-mean { font-size: 1.05em; }
.q-opts { display: grid; gap: 4px; }
.q-opt.right { background: var(--c-mint); color: var(--on-mint); }
.q-opt.wrong { background: var(--c-coral); color: var(--on-coral); }
.q-opt[disabled] { opacity: 1; }
.q-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 48px; margin-top: 10px; }
.quiz-end { text-align: center; }
.big-score { display: block; font-family: var(--f-head); font-size-adjust: var(--head-adjust); font-size: 54px; margin: 6px 0; }

/* parent + mailbox */
.status.warn-note { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--c-sun) 26%, var(--surface)); }
.status.warn-note .i { flex: none; margin-top: 2px; }
.status.warn-note span { min-width: 0; }
.tile.learner .status { margin: 0; }
.mail { padding: 14px; }
.mail-head { display: grid; gap: 2px; min-width: 0; }
.mail-code { font-family: ui-monospace, Menlo, monospace; font-size: 30px; font-weight: 800; letter-spacing: .2em; background: var(--surface-2); border: var(--bw) solid var(--border); border-radius: 12px; text-align: center; padding: 8px; margin: 10px 0; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--f-body); font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 10px; margin: 8px 0 0; }
.mail-body a { word-break: break-all; }

/* themes: small finishing touches */
html[data-theme="arcade"] .tile, html[data-theme="arcade"] .card { image-rendering: pixelated; }
html[data-theme="street"] .hello h1, html[data-theme="street"] .t-title { letter-spacing: .01em; }
html[data-theme="clean"] .tile.act:hover, html[data-theme="clean"] button.tile:hover { transform: translateY(-2px); }
html[data-theme="ocean"] button.tile:hover { transform: translateY(-2px); }
.solo .card.center .wiz-top, .solo .card.center .auth-top { width: 100%; }

/* date of birth: day / month / year (unambiguous UK order on every device) */
fieldset.field { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.dob-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dob-row select.input { min-width: 0; padding-right: 34px; background-position: right 9px center; }
.dob-row select:nth-child(1) { flex: 1 1 86px; }
.dob-row select:nth-child(2) { flex: 2 1 150px; }
.dob-row select:nth-child(3) { flex: 1 1 88px; }

/* Street: marker font for big headings only, so small labels stay easy to read */
html[data-theme="street"] :is(h2, h3, h4, .mini b, .t-name, .subj-chip, .drop, .prose th, .top, .otp input, .rail-brand, .year-badge b) { font-family: "Bricolage Grotesque", "Lexend", system-ui, sans-serif; font-size-adjust: none; letter-spacing: -.01em; }
html[data-theme="street"] .word h3 { font-family: var(--f-head); font-size-adjust: var(--head-adjust); }

/* ---------------- the star in the logo: administrator sign-in (welcome page) */
.logo .admin-star { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .2s ease; outline: none; }
.logo .admin-star:hover { transform: rotate(18deg) scale(1.18); }
.logo .admin-star:focus-visible path { stroke: var(--c-electric); stroke-width: 3px; }
@media (prefers-reduced-motion: reduce) { .logo .admin-star { transition: none; } .logo .admin-star:hover { transform: none; } }

/* ---------------- teacher diagrams */
.diagram { margin: 12px 0; padding: 10px; background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-sm, 12px); max-width: 100%; overflow: hidden; }
.diagram svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.diagram figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.diagram.bad, .diagram.drawing { font-size: 14px; color: var(--muted); }
.diagram.drawing .typing { display: inline-flex; vertical-align: middle; margin-right: 6px; }

/* ---------------- best picks found in the background */
.res-slot:empty { display: none; }
.found { margin: 12px 0 4px; display: grid; gap: 8px; }
.found-h { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.found-h svg { width: 18px; height: 18px; fill: var(--c-sun); stroke: var(--border); stroke-width: 1.5; }
.pick { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; border-radius: 14px; border: var(--bw) solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 2px 2px 0 var(--shadow-c); }
.pick:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-c); }
.pick-ic { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--t); color: var(--on); border: var(--bw) solid var(--border); }
.pick-ic svg { width: 18px; height: 18px; }
.pick-t { min-width: 0; display: grid; line-height: 1.25; }
.pick-t b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pick-t small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finding { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.finding .typing { display: inline-flex; }
/* read answers aloud toggle */
.speaker-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.speaker-toggle[aria-pressed="false"] { opacity: .75; }
.speaker-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 2.5px; background: currentColor; transform: rotate(-40deg); border-radius: 2px; }
.speaker-toggle { position: relative; }
/* learning library */
.lib-slot:empty { display: none; }
.lib-card { border: 2px solid var(--border); border-radius: 14px; padding: 10px 12px; margin: 10px 0 0; background: var(--surface); overflow: hidden; }
.lib-card.read img { float: right; width: 84px; height: 84px; object-fit: cover; border-radius: 10px; margin: 0 0 6px 10px; border: 2px solid var(--border); }
.lib-card p { margin: 4px 0; }
.lib-h { display: flex; align-items: center; gap: 6px; margin: 0 0 4px !important; }
.lib-h svg { width: 18px; height: 18px; flex: none; }
.lib-lic { font-size: 12px; color: var(--muted); clear: both; }
.lib-lic a { color: inherit; }
.lib-points, .lib-defs, .lib-ex { margin: 4px 0 6px; padding-left: 1.2em; }
.lib-ex { list-style: none; padding: 0; } .lib-ex li { margin: 4px 0; } .lib-ex small, .lib-defs small { display: block; color: var(--muted); }
.lib-keys { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 14px; } .lib-keys dt { font-weight: 700; }
.lib-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; } .lib-pics img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.poem-text { white-space: pre-wrap; font: inherit; line-height: 1.5; margin: 8px 0; }
.lib-search { display: flex; gap: 6px; margin: 6px 0; } .lib-search .input { min-width: 0; flex: 1; }
.lib-card .pick { margin-top: 6px; }
/* videos and pictures inside Prep Room */
body.viewing { overflow: hidden; }
.viewer-wrap { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.viewer-back { position: absolute; inset: 0; background: rgba(20, 20, 43, .72); }
.viewer { position: relative; width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--surface); border: var(--bw, 2px) solid var(--border); border-radius: var(--r, 20px); box-shadow: var(--sh); overflow: hidden; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 2px solid var(--border); background: var(--accent); color: var(--on-accent); }
.viewer-head .brand { flex: none; color: inherit; } .viewer-head .brand-txt b, .viewer-head .brand-txt b span, html[data-dark] .viewer-head .brand-txt b span { color: inherit; } .viewer-head .brand .logo { width: 34px; height: 34px; }
.viewer-title { flex: 1; min-width: 0; font-weight: 700; }
.viewer-head .icon-btn { background: var(--surface); color: var(--ink); }
.viewer-media.video { position: relative; aspect-ratio: 16 / 9; background: #000; max-height: calc(100vh - 160px); }
.viewer-media.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-media.pic { background: var(--bg); display: grid; place-items: center; max-height: calc(100vh - 160px); overflow: auto; }
.viewer-media.pic img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; display: block; }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; }
.pick.vid { align-items: center; }
.pick-thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: #000; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .25); }
.pick-play svg { width: 26px; height: 26px; }
.lib-card.read img { cursor: zoom-in; }
@media (max-width: 600px) { .viewer-head .brand-txt { display: none; } .pick-thumb { width: 76px; } }

/* phones: brand and Sign out above every page */
.mob-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.mob-bar .brand .logo { width: 32px; height: 32px; } .mob-bar .brand-txt b { font-size: 19px; }
.shell.focus .mob-bar { display: none; }
/* parent page: one big tile per child */
.kid-list { display: grid; gap: 22px; margin: 8px 0 24px; }
.kid-card { background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); padding: clamp(18px, 3vw, 30px); display: grid; gap: 16px; }
.kid-head { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 24px); }
.kid-head h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); line-height: 1.1; overflow-wrap: anywhere; }
.kid-head .ava-xl { flex: none; width: clamp(72px, 14vw, 96px); height: clamp(72px, 14vw, 96px); }
.kid-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 15px; }
.kid-meta .pill { background: var(--soft); color: var(--ink); font-size: 13px; }
.kid-meta .pill.ok { background: color-mix(in srgb, var(--c-mint) 45%, var(--surface)); }
.kid-meta .pill.wait { background: color-mix(in srgb, var(--c-sun) 45%, var(--surface)); }
.kid-sub { margin: 6px 0 -4px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kid-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.kid-act { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px; text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: var(--bw) solid var(--border); border-radius: calc(var(--r) * .7); box-shadow: var(--sh-sm); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kid-act:hover { transform: translate(-2px, -2px); box-shadow: var(--sh); }
.kid-act:active { transform: translate(1px, 1px); box-shadow: none; }
.kid-act-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: var(--bw) solid var(--border); background: var(--surface); }
.kid-act-ic svg { width: 22px; height: 22px; }
.kid-act-t { display: grid; gap: 2px; min-width: 0; }
.kid-act-t b { font-size: 17px; }
.kid-act-t small { color: var(--muted); font-size: 14px; line-height: 1.3; }
.kid-act.main { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.kid-act.main .kid-act-ic { background: var(--accent); color: var(--on-accent); }
.kid-act.danger .kid-act-ic { color: var(--c-coral); }
.kid-act.danger:hover { border-color: var(--c-coral); }
.help-card { padding: clamp(16px, 2.5vw, 24px); }
.help-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.help-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.help-lines div { display: grid; gap: 4px; padding: 12px 14px; border: var(--bw) solid var(--border); border-radius: 14px; background: var(--bg); }
.help-lines small { color: var(--muted); font-size: 14px; }
.help-lines a { font-family: var(--f-head); font-size: 22px; font-weight: 800; color: var(--ink); text-decoration: none; }
/* the teacher at work: a progress bar with light-hearted captions */
.think { display: grid; gap: 8px; margin-top: 4px; min-width: min(420px, 100%); }
.body:empty + .think { margin-top: 2px; }
.body:not(:empty) + .think { margin-top: 12px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--ink) 20%, transparent); }
.think-bar { position: relative; height: 10px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: var(--bw) solid var(--border); }
.think-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--c-electric), var(--c-mint), var(--c-sun), var(--c-coral)); background-size: 300% 100%; animation: think-hue 6s linear infinite; transition: width .4s ease-out; }
.think-sweep { position: absolute; top: 0; bottom: 0; width: 30%; left: -30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: think-sweep 1.6s ease-in-out infinite; }
@keyframes think-sweep { to { left: 100%; } }
@keyframes think-hue { to { background-position: 300% 0; } }
.think-cap { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); min-height: 1.4em; transition: opacity .22s, transform .22s; }
.think-cap.out { opacity: 0; transform: translateY(4px); }
.think-note { display: block; }
@media (prefers-reduced-motion: reduce) { .think-sweep { display: none; } .think-fill { animation: none; } .think-cap { transition: none; } }
.tap-listen { position: fixed; left: 50%; bottom: calc(var(--tab-h, 0px) + 20px + var(--safe-b, 0px)); transform: translateX(-50%); z-index: 150; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 16px; background: var(--accent); color: var(--on-accent); border: var(--bw) solid var(--border); box-shadow: var(--sh); cursor: pointer; animation: tap-pop .3s ease-out; }
.tap-listen svg { width: 22px; height: 22px; }
@keyframes tap-pop { from { transform: translate(-50%, 12px); opacity: 0; } }
.status.ok-note { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--c-mint) 26%, var(--surface)); margin-bottom: 12px; }
.tick.remember { text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.think.done { opacity: 0; transition: opacity .5s .2s; }
/* tappable key words */
strong.term { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 4px; }
strong.term:hover, strong.term:focus-visible { background: color-mix(in srgb, var(--accent) 18%, transparent); text-decoration-style: solid; }
.term-card { display: grid; gap: 14px; }
.term-big { margin: 0; font-family: var(--f-head); font-size: clamp(28px, 6vw, 40px); font-weight: 800; line-height: 1.1; }
.term-ph { font-family: var(--f-body); font-size: 18px; font-weight: 500; }
.term-sec { border: var(--bw) solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--bg); }
.term-sec p { margin: 4px 0; }
.term-card .row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.term-card .btn svg { width: 20px; height: 20px; }
.qr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0; }
.qr-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px; border: var(--bw) solid var(--border); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; }
.qr-chip svg { width: 16px; height: 16px; flex: none; }
/* Prep Room's own microphone */
.mic-btn { flex: none; width: 50px; height: 50px; border-radius: 16px; }
.mic-btn svg { width: 24px; height: 24px; }
.mic-btn.on { background: var(--c-coral); color: #fff; border-color: var(--border); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c-coral) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .mic-btn.on { animation: none; } }
.ask-row .mic-btn { align-self: flex-end; }
/* the "now reading" bar: pause, resume, stop */
.now-reading { position: fixed; z-index: 210; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h, 0px) + 18px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; max-width: calc(100vw - 24px); background: var(--surface); color: var(--ink); border: var(--bw) solid var(--border); border-radius: 999px; box-shadow: var(--sh); animation: tap-pop .25s ease-out; }
.nr-txt { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nr-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 999px; border: var(--bw) solid var(--border); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.nr-btn.ghost { background: var(--bg); color: var(--ink); }
.nr-btn svg { width: 18px; height: 18px; }
.nr-wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; flex: none; }
.nr-wave i { width: 4px; border-radius: 2px; background: var(--accent); animation: nr-wave 1s ease-in-out infinite; }
.nr-wave i:nth-child(2) { animation-delay: .15s; } .nr-wave i:nth-child(3) { animation-delay: .3s; }
@keyframes nr-wave { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.now-reading.paused .nr-wave i { animation: none; height: 6px; opacity: .5; }
@media (prefers-reduced-motion: reduce) { .nr-wave i { animation: none; height: 10px; } }
@media (max-width: 480px) { .nr-btn span { display: none; } .nr-btn { padding: 9px; } }
@media (min-width: 900px) { .now-reading { left: calc(50% + 130px); } }
.now-reading { gap: 8px; }
.now-reading.done .nr-wave i { animation: none; height: 6px; opacity: .4; }
.nr-back { min-width: 2.4em; text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .now-reading .nr-btn span:not(.nr-back) { display: none; } .now-reading .nr-btn { padding: 9px 10px; } .nr-txt { max-width: 34vw; } }
body:has(.comp-row) .now-reading { bottom: calc(var(--tab-h, 0px) + 132px + env(safe-area-inset-bottom, 0px)); }
.now-reading.docked { position: static; transform: none; left: auto; bottom: auto; margin: 0 0 8px; width: max-content; max-width: 100%; animation: none; box-shadow: var(--sh-sm); }
body:has(.comp-row) .now-reading:not(.docked) { bottom: calc(var(--tab-h, 0px) + 18px + env(safe-area-inset-bottom, 0px)); }
/* a quiz is just the quiz: no side panel */
.chat-layout.no-side { grid-template-columns: minmax(0, 1fr) !important; }
.chat-layout.no-side .chat-main { grid-column: 1 / -1 !important; }
/* multiple-choice answer buttons */
.choices { display: grid; gap: 10px; margin: 12px 0 6px; }
@media (min-width: 700px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: var(--bw) solid var(--border); border-radius: 14px; box-shadow: var(--sh-sm); cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.choice b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: var(--bw) solid var(--border); background: var(--surface); font-family: var(--f-head); font-size: 17px; }
.choice:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--sh); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.choice:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.choices.done .choice { cursor: default; opacity: .55; box-shadow: none; }
.choices.done .choice.picked { opacity: 1; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.choices.done .choice.picked b { background: var(--accent); color: var(--on-accent); }
.choices.loading { min-height: 40px; }
/* "Back to …" — return to the page or quiz in progress */
.resume-bar { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 16px; padding: 12px 16px; text-align: left; font: inherit; color: var(--on-accent); background: var(--accent); border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.resume-bar:hover { transform: translate(-2px, -2px); }
.resume-bar:active { transform: translate(1px, 1px); box-shadow: none; }
.resume-bar svg { flex: none; width: 22px; height: 22px; }
.resume-bar span { flex: 1; display: grid; gap: 2px; min-width: 0; }
.resume-bar b { font-size: 17px; }
.resume-bar small { font-size: 14px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* syllabus: units and sub-topics open on tap */
details.unit { margin: 6px 0 14px; }
details.unit > summary { list-style: none; cursor: pointer; }
details.unit > summary::-webkit-details-marker { display: none; }
details.unit > summary .group-h { display: flex; align-items: baseline; gap: 10px; }
details.unit > summary .group-h::before { content: '▸'; font-size: .8em; transition: transform .15s; }
details.unit[open] > summary .group-h::before { transform: rotate(90deg); }
details.unit > summary small { font-size: 14px; font-weight: 600; color: var(--muted); }
details.subs { margin: 4px 0 2px; }
details.subs > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; color: var(--muted); padding: 4px 0; }
details.subs > summary::-webkit-details-marker { display: none; }
details.subs > summary svg { width: 16px; height: 16px; transition: transform .15s; }
details.subs[open] > summary svg { transform: rotate(90deg); }
details.subs ul { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 6px; }
details.subs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 10px; background: var(--bg); font-size: 15px; }
.sub-acts { display: inline-flex; gap: 6px; }
.chip.sm { padding: 4px 10px; font-size: 13px; }
.topic-grid { align-items: start; }
/* a picture inside a quiz question */
figure.q-pic { margin: 10px 0; }
.q-pic-box { display: grid; place-items: center; min-height: 120px; max-width: 360px; border: var(--bw) solid var(--border); border-radius: 14px; background: var(--bg); overflow: hidden; }
.q-pic-box img { display: block; width: 100%; max-height: 280px; object-fit: contain; background: #fff; }
figure.q-pic.none .q-pic-box { min-height: 0; padding: 10px; border-style: dashed; }
figure.q-pic figcaption { margin-top: 4px; }
