/* Class Dash kid view. Four themes share one layout; each theme only sets tokens. */
:root, [data-theme="midnight"] {
  --bg: #120D26; --surface: #1E1740; --surface2: #2A2152; --lunch: #191336; --track: #3A3360; --navb: #241C48;
  --text: #FFF7EC; --muted: #B8AEDD; --dim: #9389BF; --ink: #160F2E;
  --accent: #C6FF3D; --link: #C6FF3D; --pink: #FF4FA3; --amber: #FFC83D; --coral: #FF8A5C; --green: #4CD964;
  --game: #16301F; --alert-bg: #2E2614; --alert-fg: #FFE39A;
  --inv-bg: #FFF7EC; --inv-fg: #160F2E; --outline: #120D26; --scrim: rgba(8,5,18,.65);
  --card-sh: 0 4px 0 #0A0718; --row-sh: none; --acc-sh: 0 4px 0 #6E9A00; --pink-sh: 0 4px 0 #9E1F5F;
  --card-line: none;
  --r-card: 22px; --r-row: 16px; --r-pill: 999px; --r-btn: 14px;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif;
  --d-weight: 800; --d-case: none; --d-track: -0.03em; --tilt: rotate(-3deg); --tilt2: rotate(3deg);
  --c0: #7C8CFF; --c1: #B98CFF; --c2: #FFD65C; --c3: #FF9A7A; --c4: #5EE0A8; --c5: #6CD3FF;
  color-scheme: dark;
}
[data-theme="zine"] {
  --bg: #FFF3DC; --surface: #FFFFFF; --surface2: #FFE7B8; --lunch: #F7E9CC; --track: #E6D9BE; --navb: #1A1A1A;
  --text: #1A1A1A; --muted: #5A5246; --dim: #7A705F; --ink: #1A1A1A;
  --accent: #FF5A1F; --link: #C93A06; --pink: #FF7EB6; --amber: #FFD23F; --coral: #FF6B6B; --green: #2BD47D;
  --game: #D6F5E3; --alert-bg: #FFF0B3; --alert-fg: #5A4300;
  --inv-bg: #1A1A1A; --inv-fg: #FFF3DC; --outline: #1A1A1A; --scrim: rgba(26,26,26,.5);
  --card-sh: 4px 4px 0 #1A1A1A; --row-sh: 3px 3px 0 #1A1A1A; --acc-sh: 4px 4px 0 #1A1A1A; --pink-sh: 4px 4px 0 #1A1A1A;
  --card-line: 2px solid #1A1A1A;
  --r-card: 18px; --r-row: 14px; --r-pill: 999px; --r-btn: 12px;
  --display: "Archivo", "Work Sans", system-ui, sans-serif; --body: "Work Sans", system-ui, sans-serif;
  --d-weight: 900; --d-case: none; --d-track: -0.02em; --tilt: rotate(-3deg); --tilt2: rotate(3deg);
  --c0: #5468FF; --c1: #A35CFF; --c2: #F2B705; --c3: #FF7A50; --c4: #19B87A; --c5: #20A9E8;
  color-scheme: light;
}
[data-theme="arcade"] {
  --bg: #07070C; --surface: #12121C; --surface2: #1C1C2B; --lunch: #0E0E17; --track: #2A2A3D; --navb: #1C1C2B;
  --text: #F2F2FF; --muted: #A0A0C0; --dim: #8484A8; --ink: #04040A;
  --accent: #00F0FF; --link: #00F0FF; --pink: #FF2BD6; --amber: #FFE600; --coral: #FF5470; --green: #39FF88;
  --game: #0A2416; --alert-bg: #221F00; --alert-fg: #FFF27A;
  --inv-bg: #F2F2FF; --inv-fg: #04040A; --outline: #07070C; --scrim: rgba(0,0,0,.72);
  --card-sh: 0 4px 0 #000, 0 0 0 1px #24243A; --row-sh: none; --acc-sh: 0 4px 0 #007A85, 0 0 18px rgba(0,240,255,.35);
  --pink-sh: 0 4px 0 #8A0072; --card-line: none;
  --r-card: 6px; --r-row: 6px; --r-pill: 3px; --r-btn: 4px;
  --display: "Chakra Petch", system-ui, sans-serif; --body: "Chakra Petch", system-ui, sans-serif;
  --d-weight: 700; --d-case: uppercase; --d-track: -0.01em; --tilt: skewX(-10deg); --tilt2: skewX(-10deg);
  --c0: #6E7BFF; --c1: #C77DFF; --c2: #FFE600; --c3: #FF7A5C; --c4: #39FF88; --c5: #00C8FF;
  color-scheme: dark;
}
[data-theme="bubble"] {
  --bg: #F4EEFF; --surface: #FFFFFF; --surface2: #EDE4FF; --lunch: #F0EAFB; --track: #E2D8F7; --navb: #E6DCFA;
  --text: #2B1E57; --muted: #6E62A0; --dim: #857AB3; --ink: #1E1442;
  --accent: #6EF0C2; --link: #6A3DF0; --pink: #FF7AC6; --amber: #FFD66B; --coral: #FF9C8A; --green: #5FE3A1;
  --game: #E3FAEF; --alert-bg: #FFF4D6; --alert-fg: #6B4E00;
  --inv-bg: #2B1E57; --inv-fg: #FFFFFF; --outline: #FFFFFF; --scrim: rgba(43,30,87,.35);
  --card-sh: 0 8px 24px rgba(80,50,160,.10); --row-sh: 0 4px 14px rgba(80,50,160,.06);
  --acc-sh: 0 6px 18px rgba(60,200,150,.35); --pink-sh: 0 6px 18px rgba(255,122,198,.35); --card-line: none;
  --r-card: 28px; --r-row: 20px; --r-pill: 999px; --r-btn: 18px;
  --display: "Fredoka", "Nunito", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
  --d-weight: 700; --d-case: none; --d-track: -0.01em; --tilt: rotate(-3deg); --tilt2: rotate(3deg);
  --c0: #7C8CFF; --c1: #B48CFF; --c2: #FFC94D; --c3: #FF8F73; --c4: #4FD49A; --c5: #5CC4F5;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; }
body { overscroll-behavior-y: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.hide { display: none !important; }

#app { position: relative; max-width: 560px; margin: 0 auto; min-height: 100%; }
.screen { padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 168px) max(16px, env(safe-area-inset-left, 0px)); }
.disp { font-family: var(--display); font-weight: var(--d-weight); text-transform: var(--d-case); letter-spacing: var(--d-track); }
h1.disp { margin: 0; font-size: 34px; line-height: 36px; text-wrap: balance; }
h2.disp { margin: 0; font-size: 17px; line-height: 22px; }
.micro { font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meta { font-size: 13px; line-height: 18px; color: var(--muted); }
.sticker { display: inline-block; transform: var(--tilt); background: var(--accent); color: var(--ink); border: 2px solid var(--outline);
  border-radius: var(--r-pill); padding: 1px 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.sticker.pink { background: var(--pink); } .sticker.amber { background: var(--amber); } .sticker.coral { background: var(--coral); }
.sticker.green { background: var(--green); transform: var(--tilt2); }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--card-sh); outline: var(--card-line); outline-offset: -2px; }
[data-theme="zine"] .card { outline-offset: 0; }
.press { transition: transform 220ms cubic-bezier(.34,1.56,.64,1), box-shadow 220ms; }
.press:active { transform: translateY(3px); transition-duration: 90ms; }
.link { border: 0; background: none; padding: 8px 0; color: var(--link); font-weight: 700; cursor: pointer; }

/* header */
.head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin: 0 -16px; padding: 2px 16px 6px; border-radius: 0 0 var(--r-card) var(--r-card); }
.head.game { background: var(--game); }
.head .left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.head .micro { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.headbtns { display: flex; gap: 2px; flex: none; }
.bell { position: relative; width: 44px; height: 44px; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.bell .badge { top: 4px; right: 2px; }
.heads { display: flex; flex-direction: column; gap: 6px; }
.headup { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 0; border-radius: var(--r-row); background: var(--surface); color: var(--text);
  padding: 8px 14px; text-align: left; cursor: pointer; box-shadow: var(--row-sh); }
[data-theme="zine"] .headup { outline: 2px solid #1A1A1A; outline-offset: -2px; }
.headup .lab, .ntc .lab { flex: none; border-radius: var(--r-pill); padding: 1px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface2); color: var(--muted); }
.headup.need .lab, .ntc.need .lab { background: var(--amber); color: var(--ink); }
.headup .t { font-size: 13px; font-weight: 700; line-height: 18px; }
.ntc { display: flex; flex-direction: column; gap: 4px; border-radius: var(--r-row); background: var(--surface2); padding: 12px 14px; }
.ntc .ntop, .ntc .nbot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ntc .nbot .link { padding: 6px 0 0 14px; font-size: 13px; }
.ntc .src { font-size: 11px; color: var(--dim); }
.avatar { flex: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.avatar span { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface2); display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; }
[data-theme="arcade"] .avatar span { border-radius: 6px; }
.greet { transition: transform 260ms cubic-bezier(.2,.9,.3,1.2), opacity 200ms; }
.greet.roll { transform: translateY(-14px); opacity: 0; transition: none; }

/* day rail */
.rail { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 12px 16px 14px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.rail::-webkit-scrollbar { display: none; }
.pill { flex: none; width: 44px; height: 64px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; cursor: pointer; scroll-snap-align: start;
  transition: transform 200ms cubic-bezier(.34,1.56,.64,1), background 150ms; box-shadow: var(--row-sh); }
[data-theme="zine"] .pill { outline: 2px solid #1A1A1A; outline-offset: -2px; box-shadow: none; }
.pill .dow { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.pill .num { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 22px; }
.pill .dot { width: 5px; height: 5px; border-radius: 3px; background: transparent; }
.pill .dot.team { background: var(--green); } .pill .dot.warn { background: var(--amber); } .pill .dot.off { background: var(--dim); }
.pill.on { background: var(--accent); color: var(--ink); box-shadow: var(--acc-sh); transform: translateY(-2px); }
.pill.on .dot.team, .pill.on .dot.off, .pill.on .dot.warn { background: var(--ink); }

.stack { display: flex; flex-direction: column; gap: 18px; }
.now { display: flex; gap: 8px; }
.chip { min-width: 0; height: 44px; border: 0; border-radius: var(--r-pill); background: var(--surface2); color: var(--text); padding: 0 14px;
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.chip > .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.chip .cdot { flex: none; width: 10px; height: 10px; border-radius: 5px; }
.chip.soon { background: var(--amber); color: var(--ink); }
.chip.grow { flex: 1; }

/* tonight */
.tonight { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tonight .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tonight .title { font-size: 24px; line-height: 28px; }
.segs { display: flex; gap: 5px; }
.segs span { flex: 1; height: 8px; border-radius: 4px; background: var(--track); transition: background 200ms, transform 300ms cubic-bezier(.34,1.56,.64,1); }
.segs span.done { background: var(--accent); } .segs span.pop { transform: scaleY(1.7); }
[data-theme="zine"] .segs span.done { background: #1A1A1A; }
.mini { display: grid; grid-template-columns: 6px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 52px; border: 0; border-radius: var(--r-row);
  background: var(--surface2); padding: 8px 12px 8px 8px; text-align: left; cursor: pointer; width: 100%; }
.tab { width: 6px; height: 32px; border-radius: 3px; }
.tab.idea { background: transparent !important; border: 2px dashed currentColor; }
.t1 { font-size: 15px; line-height: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t1.wrap { white-space: normal; }
.alldone { background: var(--accent); color: var(--ink); padding: 20px; box-shadow: var(--acc-sh); display: flex; flex-direction: column; gap: 6px; }
.alldone .micro { color: var(--ink); }
.alldone .big { font-size: 28px; line-height: 30px; }
.recap { background: var(--pink); color: var(--ink); padding: 20px; box-shadow: var(--pink-sh); display: flex; flex-direction: column; gap: 8px; }
.recap .micro { color: var(--ink); } .recap .big { font-size: 30px; line-height: 32px; }
.banner { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.banner .big { font-size: 24px; line-height: 28px; }

/* schedule rows */
.sched-head { display: flex; justify-content: space-between; align-items: baseline; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.rowwrap { position: relative; overflow: hidden; border-radius: var(--r-row); }
.rowwrap.slant { clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.rowact { position: absolute; top: 0; right: 0; bottom: 0; width: 92px; border: 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.rowact.hide-a { background: var(--track); color: var(--text); } .rowact.del-a { background: var(--coral); color: var(--ink); }
.row { position: relative; width: 100%; min-height: 64px; border: 0; border-radius: var(--r-row); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 6px 44px minmax(0,1fr) auto; gap: 0 10px; align-items: stretch; padding: 0 0 0 8px; touch-action: pan-y;
  transition: transform 240ms cubic-bezier(.34,1.56,.64,1); box-shadow: var(--row-sh); }
[data-theme="zine"] .row { outline: 2px solid #1A1A1A; outline-offset: -2px; box-shadow: none; }
.row.dragging { transition: none; }
.row > .tab { align-self: center; height: 40px; }
.row .time { align-self: center; display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.row .time b { font-size: 10px; letter-spacing: .06em; color: var(--link); }
.row .main { align-self: center; min-width: 0; padding: 8px 0; display: flex; flex-direction: column; }
.row .line1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row .tag { flex: none; border-radius: var(--r-pill); padding: 1px 7px; font-size: 11px; font-weight: 700; color: var(--ink); }
.row.lunch { min-height: 40px; background: var(--lunch); box-shadow: none; outline: none; }
.row.lunch .t1 { font-size: 13px; font-weight: 500; color: var(--dim); }
.row.lunch > .tab { height: 0; }
.row.now-row > .tab { background: var(--accent) !important; }
[data-theme="zine"] .row.now-row > .tab { background: #1A1A1A !important; width: 6px; }
.stripes { display: flex; align-items: stretch; transform: skewX(-16deg); margin-right: 9px; transition: transform 320ms cubic-bezier(.2,.9,.3,1.2), opacity 200ms; }
.stripes.deal { transform: skewX(-16deg) translateX(70px); opacity: 0; transition: none; }
.stripe { flex: none; width: 40px; display: flex; color: #160F2E; }
.stripe > span { flex: 1; transform: skewX(16deg); display: flex; flex-direction: column; align-items: center; padding: 5px 0 7px; }
.stripe .k { position: relative; flex: 1; width: 100%; }
.stripe .k i { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-74deg); white-space: nowrap; font-style: normal;
  font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stripe .n { font-size: 12px; line-height: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.s0 { background: #4CD964; } .s1 { background: #FFCC00; } .s2 { background: #FF9500; }
.unhide { align-self: center; }

/* homework */
.hw-head { display: flex; justify-content: space-between; align-items: center; }
.streak { transform: var(--tilt); background: var(--amber); color: var(--ink); border: 2px solid var(--outline); border-radius: var(--r-pill); padding: 4px 10px 4px 8px;
  font-family: var(--display); font-weight: 800; font-size: 15px; box-shadow: var(--card-sh); display: flex; gap: 4px; align-items: center; }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filt { flex: none; height: 36px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--muted); padding: 0 14px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; cursor: pointer; }
[data-theme="zine"] .filt { outline: 2px solid #1A1A1A; outline-offset: -2px; }
.filt.on { background: var(--accent); color: var(--ink); box-shadow: var(--acc-sh); }
.filt i { width: 8px; height: 8px; border-radius: 4px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group h2 { display: flex; justify-content: space-between; align-items: baseline; }
.group h2 small { font-family: var(--body); font-size: 13px; color: var(--dim); text-transform: none; letter-spacing: 0; }
.group.g-catchup h2 span { color: var(--coral); }
[data-theme="zine"] .group.g-catchup h2 span, [data-theme="bubble"] .group.g-catchup h2 span { color: #D2402F; }
.hwwrap { position: relative; overflow: hidden; border-radius: var(--r-row); max-height: 160px;
  transition: max-height 260ms cubic-bezier(.2,.8,.2,1) 120ms, opacity 200ms 120ms, transform 120ms; }
.hwwrap.leaving { max-height: 0; opacity: 0; transform: scale(.96,.9); margin-top: -8px; }
.hwunder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: var(--surface); }
.hwunder.r { background: var(--accent); } .hwunder.l { background: var(--track); }
.hwunder svg { transition: transform 180ms cubic-bezier(.34,1.56,.64,1); }
.hw { position: relative; width: 100%; min-height: 68px; border: 0; border-radius: var(--r-row); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 6px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 8px; touch-action: pan-y;
  transition: transform 240ms cubic-bezier(.34,1.56,.64,1); box-shadow: var(--row-sh); }
[data-theme="zine"] .hw { outline: 2px solid #1A1A1A; outline-offset: -2px; box-shadow: none; }
.hw.dragging { transition: none; }
.hw > .tab { height: 40px; }
.hw .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.due { border-radius: var(--r-pill); padding: 2px 9px; font-size: 11px; line-height: 14px; font-weight: 700; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.due.hot { background: var(--amber); color: var(--ink); } .due.late { background: var(--coral); color: var(--ink); }
.src { font-size: 11px; line-height: 14px; color: var(--dim); white-space: nowrap; }
.src.idea { color: var(--link); }
.note { margin: -2px 0 2px; }
.empty { text-align: center; padding: 56px 12px; font-size: 28px; line-height: 32px; }
.donebtn { height: 44px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--muted); font-weight: 700; cursor: pointer; }
.doneitem { min-height: 48px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--dim); text-align: left; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 0 14px; cursor: pointer; width: 100%; }
.doneitem s { text-decoration: line-through; } .doneitem b { font-size: 13px; color: var(--link); }

/* classes */
.clist { display: flex; flex-direction: column; gap: 8px; }
.crow { width: 100%; min-height: 72px; border: 0; border-radius: var(--r-row); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 6px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 0 16px 0 8px; box-shadow: var(--card-sh); }
[data-theme="zine"] .crow { outline: 2px solid #1A1A1A; outline-offset: -2px; }
.crow > .tab { height: 44px; }
.grade { display: flex; align-items: baseline; gap: 6px; }
.grade b { font-size: 20px; font-variant-numeric: tabular-nums; } .grade span { font-size: 13px; font-weight: 700; color: var(--muted); }
.flag-coral { color: var(--coral); } .flag-amber { color: var(--amber); }
[data-theme="zine"] .flag-coral, [data-theme="bubble"] .flag-coral { color: #C8372D; }
[data-theme="zine"] .flag-amber, [data-theme="bubble"] .flag-amber { color: #9A6A00; }
.plain { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: var(--r-row); background: var(--surface); }

/* class page */
.back { height: 44px; border: 0; background: none; padding: 0 8px 0 0; color: var(--link); font-weight: 700; cursor: pointer; }
.chead { margin: 0 -16px; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.alert { border-radius: var(--r-row); background: var(--alert-bg); color: var(--alert-fg); padding: 14px 16px; font-size: 13px; line-height: 19px; }
.up { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 60px; padding-left: 16px; border-radius: var(--r-row); overflow: hidden;
  background: var(--surface); text-decoration: none; }
.up .w { align-self: stretch; width: 64px; display: grid; place-items: center; color: #160F2E; font-size: 13px; font-weight: 700; }
.bigbtn { display: flex; align-items: center; justify-content: center; height: 52px; border: 0; border-radius: var(--r-btn); background: var(--accent); color: var(--ink);
  font-size: 15px; font-weight: 700; text-decoration: none; box-shadow: var(--acc-sh); cursor: pointer; width: 100%; }
.bigbtn.soft { background: var(--surface2); color: var(--text); box-shadow: none; }
.bigbtn.danger { background: var(--coral); color: var(--ink); box-shadow: none; }
.bigbtn[disabled] { background: var(--surface2); color: var(--dim); box-shadow: none; cursor: default; }

/* nav + fab */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); background: var(--bg);
  border-top: 1px solid var(--navb); padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.tabs > div { display: contents; }
.tabbtn { height: 64px; border: 0; background: none; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; cursor: pointer; }
.tabbtn .ic { position: relative; display: grid; place-items: center; width: 52px; height: 28px; border-radius: var(--r-pill); }
.tabbtn.on { color: var(--text); } .tabbtn.on .ic { background: var(--surface2); }
.badge { position: absolute; top: -6px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: var(--ink);
  border: 2px solid var(--bg); font-size: 10px; line-height: 14px; text-align: center; }
.fab { position: fixed; z-index: 21; right: max(16px, calc(50vw - 264px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); width: 60px; height: 60px; border-radius: 20px;
  border: 2px solid var(--outline); background: var(--accent); color: var(--ink); display: grid; place-items: center; box-shadow: var(--acc-sh); transform: var(--tilt); cursor: pointer; }
.fab:active { transform: var(--tilt) translateY(3px); }

/* toast, confetti, sheets */
.toast { position: fixed; z-index: 30; left: 16px; right: 92px; max-width: 420px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); min-height: 48px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 0 16px; border-radius: var(--r-row); background: var(--inv-bg); color: var(--inv-fg);
  box-shadow: var(--card-sh); font-weight: 700; transform: translateY(20px); opacity: 0; transition: transform 220ms cubic-bezier(.34,1.56,.64,1), opacity 160ms; pointer-events: none; }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast button { height: 36px; border: 0; border-radius: 10px; background: var(--inv-fg); color: var(--inv-bg); font-size: 13px; font-weight: 700; padding: 0 10px; cursor: pointer; }
.confetti { position: fixed; z-index: 40; width: 10px; height: 6px; border-radius: 2px; pointer-events: none;
  transition: transform 650ms cubic-bezier(.15,.6,.3,1), opacity 650ms ease-in; }
.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); border: 0; opacity: 0; transition: opacity 200ms; }
.scrim.show { opacity: 1; }
.sheet { position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface);
  border-radius: 28px 28px 0 0; padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 26px); display: flex; flex-direction: column; gap: 14px;
  transform: translateY(100%); transition: transform 280ms cubic-bezier(.2,.9,.3,1.05); }
[data-theme="arcade"] .sheet { border-radius: 8px 8px 0 0; }
[data-theme="zine"] .sheet { border: 2px solid #1A1A1A; border-bottom: 0; }
.sheet.show { transform: none; }
.grab { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--track); }
.sheet h2 { font-size: 24px; line-height: 28px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: var(--r-row); background: var(--surface2); padding: 14px 16px; }
.mic { align-self: center; width: 104px; height: 104px; margin: 6px 0; border: 0; border-radius: 42% 58% 55% 45% / 50% 44% 56% 50%; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--acc-sh); cursor: pointer; transition: all 220ms cubic-bezier(.34,1.56,.64,1); }
.mic.live { border-radius: 58% 42% 45% 55% / 44% 56% 50% 50%; transform: scale(1.06); }
.typed { display: flex; gap: 8px; }
.typed input { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--track); border-radius: var(--r-btn); padding: 0 16px; background: var(--bg); color: var(--text); font: inherit; }
.typed button { flex: none; height: 52px; padding: 0 18px; border: 0; border-radius: var(--r-btn); background: var(--inv-bg); color: var(--inv-fg); font-weight: 700; cursor: pointer; }
.heard { font-size: 19px; line-height: 26px; font-weight: 700; min-height: 26px; }
.fields { display: flex; flex-wrap: wrap; gap: 8px; }
.field { border-radius: 12px; padding: 8px 12px; background: var(--surface2); display: flex; flex-direction: column; gap: 1px; }
.field small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.field b { font-size: 15px; }
.field.missing { background: var(--amber); color: var(--ink); } .field.missing small { color: var(--ink); opacity: .7; }
.ask { font-size: 19px; line-height: 24px; margin: 4px 0 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opt { height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--row-sh); }
.opt.mini-mic { width: 44px; padding: 0; display: grid; place-items: center; background: var(--accent); color: var(--ink); }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme { border: 3px solid transparent; border-radius: 18px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; background: none; }
.theme.on { border-color: var(--link); }
.theme .sw { height: 64px; display: flex; align-items: flex-end; gap: 6px; padding: 10px; }
.theme .sw i { width: 18px; height: 18px; border-radius: 6px; }
.theme .nm { display: block; padding: 8px 10px; font-weight: 700; font-size: 13px; background: var(--surface2); color: var(--text); }
.seg { display: flex; gap: 6px; background: var(--surface2); border-radius: var(--r-btn); padding: 4px; }
.seg button { flex: 1; height: 40px; border: 0; border-radius: calc(var(--r-btn) - 4px); background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--row-sh); }
.err { padding: 24px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 1ms !important; } }
@media (min-width: 900px) { .screen { padding-top: 28px; } }

/* teacher materials */
.mat { display: flex; flex-direction: column; gap: 6px; border-radius: var(--r-row); background: var(--surface); padding: 10px 12px; box-shadow: var(--row-sh); }
[data-theme="zine"] .mat { outline: 2px solid #1A1A1A; outline-offset: -2px; }
.mat-main { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.ftype { flex: none; min-width: 46px; text-align: center; border-radius: 8px; padding: 3px 6px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface2); color: var(--muted); }
.ft-doc { background: #4F8CFF; color: #0B1A33; } .ft-slides { background: #FFC83D; color: #2B1D00; } .ft-sheet { background: #34C77B; color: #06261A; }
.ft-pdf { background: #FF6B5E; color: #2B0905; } .ft-video { background: #FF4F6D; color: #2B0510; } .ft-form { background: #B98CFF; color: #1C0B3A; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 58px; }
.att { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 12px; color: var(--muted); text-decoration: none; background: var(--surface2);
  border-radius: var(--r-pill); padding: 3px 10px 3px 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.att .ftype { min-width: 0; padding: 2px 6px; border-radius: var(--r-pill); }
.study { display: block; margin: -2px 0 2px 16px; color: var(--link); font-size: 13px; font-weight: 700; text-decoration: none; }
