/* Ebbes plugg – mobil först. Fotbollsplan-grönt + is-blått. */
:root {
  --pitch: #0b7a43;
  --pitch-2: #12a150;
  --ice: #0ea5e9;
  --ice-2: #7dd3fc;
  --navy: #0b1b33;
  --bg: #eef3f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6b80;
  --line: #dbe3ec;
  --good: #16a34a;
  --bad: #e11d48;
  --mid: #f59e0b;
  --gold: #fbbf24;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --card: #131c2e; --text: #e8eef7; --muted: #94a3b8; --line: #23314a; --shadow: 0 2px 10px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
p { margin: 0 0 .6em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: block; margin: .6em 0 .3em; }

.screen { max-width: 560px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px 24px; }
.screen.with-tabs { padding-bottom: calc(96px + var(--safe-b)); }
.screen.center { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.page-title { font-size: 1.6rem; margin: 6px 0 12px; }
.section-title { font-size: 1.05rem; margin: 22px 0 10px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.note { display: block; line-height: 1.35; background: #fff7ed; color: #9a3412; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .note { background: #3b2412; color: #fdba74; } }

/* Knappar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--pitch-2), var(--pitch)); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #075a31; }
.btn.primary:active { box-shadow: 0 1px 0 #075a31; transform: translateY(3px); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* Hero / header */
.hero {
  background: linear-gradient(135deg, var(--pitch) 0%, var(--pitch-2) 45%, var(--ice) 100%);
  color: #fff; border-radius: 22px; padding: 18px 18px 14px; margin-bottom: 14px; position: relative; overflow: hidden;
  box-shadow: 0 10px 24px rgba(11, 122, 67, .25);
}
.hero::after { /* mittcirkel som på en fotbollsplan */
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border: 3px solid rgba(255,255,255,.18); border-radius: 50%;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.hero-hi { font-size: 1.35rem; font-weight: 800; }
.hero-div { font-weight: 700; opacity: .95; }
.hero-sub { font-size: .85rem; margin-top: 6px; opacity: .95; }
.chips-row { display: flex; gap: 6px; position: relative; z-index: 1; }
.pill { background: rgba(255,255,255,.2); border-radius: 999px; padding: 4px 10px; font-weight: 800; white-space: nowrap; }
.pill.fire { background: rgba(251, 191, 36, .35); }

/* Progress-bar */
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; flex: 1; }
.bar.thin { height: 6px; }
.bar.light { background: rgba(255,255,255,.25); }
.bar-fill { height: 100%; background: var(--ice); border-radius: 999px; transition: width .4s ease; }
.bar.light .bar-fill { background: #fff; }
.bar.green .bar-fill, .bar.good .bar-fill, .bar.master .bar-fill { background: var(--good); }
.bar.mid .bar-fill { background: var(--mid); }
.bar.low .bar-fill { background: #fb7185; }

/* Dagens match */
.match-card { border: 2px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--pitch-2), var(--ice)) border-box; }
.match-card h2 { font-size: 1.35rem; }
.match-card.done { text-align: center; }
.mc-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.kicker { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: var(--pitch-2); }
.big-emoji { font-size: 3.2rem; line-height: 1.1; }
.big-emoji.sm { font-size: 2rem; }
.link-card { display: flex; gap: 12px; align-items: center; }
.tip { background: var(--card); border-left: 5px solid var(--ice); border-radius: 12px; padding: 12px 14px; margin-top: 18px; font-size: .95rem; color: var(--muted); }

/* Lektionsrader */
.list { display: flex; flex-direction: column; gap: 8px; }
.lesson-row { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.lr-emoji { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.lr-main { flex: 1; min-width: 0; }
.lr-title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lr-sub { font-size: .8rem; color: var(--muted); }
.lr-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pct { font-size: .8rem; font-weight: 800; color: var(--muted); min-width: 34px; text-align: right; }
.pct.big { font-size: 1.1rem; color: var(--text); }
.lr-due { text-align: right; font-size: .8rem; font-weight: 800; flex: none; display: flex; flex-direction: column; }
.lr-due small { font-weight: 500; color: var(--muted); }
.late { color: var(--bad); } .today { color: #ea580c; } .soon { color: #d97706; } .later { color: var(--muted); }
.due-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--bg); font-weight: 700; font-size: .85rem; }
.due-chip.small { font-size: .75rem; padding: 2px 8px; }
.status { font-weight: 800; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); }
.status.master { background: #fef3c7; color: #92400e; } .status.good { background: #dcfce7; color: #166534; }

/* Ämnen */
.subject { margin-bottom: 18px; }
.subject-head { display: flex; align-items: center; gap: 10px; border-left: 6px solid; padding-left: 10px; margin: 14px 0 10px; }
.subject-head h2 { flex: 1; margin: 0; font-size: 1.25rem; }
.subject-emoji { font-size: 1.6rem; }
.chapter { margin-bottom: 12px; }
.chapter-head { display: flex; justify-content: space-between; font-weight: 700; margin: 6px 2px 8px; }
.stats-row { display: flex; justify-content: space-around; text-align: center; }
.stats-row > div { display: flex; flex-direction: column; }
.stats-row strong { font-size: 1.4rem; }
.stats-row span { font-size: .8rem; color: var(--muted); }

/* Lektion */
.back { display: inline-block; color: var(--muted); font-weight: 700; margin: 4px 0 8px; padding: 6px 0; }
.lesson-head { border-top: 6px solid; }
.lesson-head h1 { font-size: 1.4rem; margin: 4px 0 10px; }
.crumbs { font-size: .8rem; color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); border: 2px solid transparent; }
.step.highlight { border-color: var(--pitch-2); }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: .8rem; font-weight: 800; flex: none; }
.step.highlight .step-n { background: var(--pitch-2); color: #fff; }
.step-emoji { font-size: 1.5rem; }
.step > div { flex: 1; }
.chev { font-size: 1.6rem; color: var(--muted); }
.history summary { font-weight: 700; cursor: pointer; }
.qhist { list-style: none; padding: 0; margin: 10px 0 0; }
.qhist li { padding: 8px 0; border-top: 1px solid var(--line); }
.qh-text { font-size: .95rem; }
.qh-meta { display: flex; gap: 10px; align-items: center; font-size: .8rem; margin-top: 2px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.dots i.on { background: var(--good); }

/* Läsvy */
.reading { font-size: 1.08rem; line-height: 1.6; }
.reading .intro { font-size: 1.15rem; font-weight: 600; }
.rsec { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.rsec h2 { font-size: 1.1rem; }
.rsec-emoji { font-size: 1.5rem; vertical-align: middle; }
.timeline { list-style: none; padding: 0 0 0 14px; margin: 0; border-left: 3px solid var(--ice); }
.timeline li { padding: 4px 0 4px 10px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--ice); border: 2px solid var(--card); }
.rimg { margin: 10px 0 0; text-align: center; }
.rimg img { max-width: 100%; border-radius: 12px; background: #fff; padding: 6px; }
.rimg figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.concept { background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); font-size: .9rem; }
.concept p { margin: 4px 0 0; color: var(--muted); }
.c-emoji { font-size: 1.6rem; }
.cta { text-align: center; margin-top: 16px; }
.gate .row { flex-wrap: wrap; }

/* Match */
.screen.play, .screen.result, .screen.interstitial { padding-bottom: calc(30px + var(--safe-b)); }
.scoreboard {
  display: grid; grid-template-columns: 36px 1fr auto 1fr; align-items: center; gap: 6px;
  background: var(--navy); color: #fff; border-radius: 16px; padding: 8px 12px; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 rgba(255,255,255,.08);
}
.sb-exit { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.sb-team { display: flex; align-items: center; gap: 8px; justify-content: flex-start; }
.sb-team.away { justify-content: flex-end; }
.sb-name { font-size: .75rem; font-weight: 800; letter-spacing: .08em; opacity: .85; }
.sb-score { font-size: 1.6rem; font-weight: 900; background: rgba(255,255,255,.1); border-radius: 8px; padding: 0 10px; min-width: 38px; text-align: center; }
.sb-min { font-weight: 800; color: var(--gold); font-size: .9rem; }
.progress-row { display: flex; align-items: center; gap: 10px; margin: 12px 2px; }
.count { font-size: .8rem; font-weight: 800; color: var(--muted); }
.qcard { background: var(--card); border-radius: 22px; padding: 18px 16px; box-shadow: var(--shadow); }
.qcard.retry { border: 2px dashed var(--mid); }
.qmeta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.qlesson { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: #e0f2fe; color: #075985; white-space: nowrap; }
.tag.why { background: #fef3c7; color: #92400e; }
.tag.own { background: #ede9fe; color: #5b21b6; }
.qprompt { font-size: 1.25rem; font-weight: 800; margin-bottom: 14px; }
.blank { display: inline-block; border-bottom: 3px solid var(--ice); color: transparent; min-width: 60px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.options.tf { flex-direction: row; }
.options.tf .opt { flex: 1; }
.opt {
  text-align: left; min-height: 54px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.opt.big { text-align: center; font-size: 1.1rem; min-height: 64px; }
.opt:active { transform: scale(.98); }
.opt.right, .chip.right, .ordered li.right .chip { border-color: var(--good); background: #dcfce7; color: #14532d; }
.opt.wrong, .ordered li.wrong .chip { border-color: var(--bad); background: #ffe4e6; color: #881337; animation: shake .35s; }
.fill-input, .free-input, .pin-input {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--bg); color: var(--text); margin-bottom: 10px;
}
.fill-input:focus, .free-input:focus, .pin-input:focus { outline: none; border-color: var(--ice); }
.fill-input.right { border-color: var(--good); background: #dcfce7; color: #14532d; }
.fill-input.wrong { border-color: var(--bad); background: #ffe4e6; color: #881337; animation: shake .35s; }
.fill .row, .free .row { justify-content: flex-end; }
.free-input { resize: vertical; min-height: 120px; font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 12px; font: inherit;
  font-weight: 600; cursor: pointer; min-height: 46px; text-align: left;
}
.chip.sel { border-color: var(--ice); background: #e0f2fe; color: #075985; }
.chip.picked { border-color: var(--ice); width: 100%; }
.chip.wrong-flash { border-color: var(--bad); background: #ffe4e6; animation: shake .35s; }
.chip.nudge { animation: shake .35s; }
.ordered { padding-left: 24px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.ordered li.hint { list-style: none; margin-left: -24px; }
.hint { color: var(--muted); font-size: .9rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.col .chip { width: 100%; font-size: .95rem; }
.reveal-list { margin: 4px 0 0; padding-left: 22px; }

/* Flashcard */
.fc-wrap { perspective: 1000px; }
.flashcard { width: 100%; min-height: 240px; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.fc-inner { position: relative; width: 100%; min-height: 240px; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; gap: 8px; text-align: center;
}
.fc-front { background: linear-gradient(135deg, #0ea5e9, #0b7a43); color: #fff; }
.fc-back { background: var(--bg); border: 2px solid var(--ice); transform: rotateY(180deg); }
.fc-emoji { font-size: 3rem; }
.fc-text { font-size: 1.3rem; font-weight: 800; }
.fc-hint { font-size: .85rem; opacity: .9; }
.rate { margin-top: 12px; }
.rate-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate-btns.three { grid-template-columns: repeat(3, 1fr); }
.rate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.rate-btn span { font-size: 1.5rem; }
.rate-btn.suggest { border-color: var(--ice); box-shadow: 0 0 0 3px #bae6fd; }
.rate-btn.g0:active { background: #ffe4e6; } .rate-btn.g2:active, .rate-btn.g3:active { background: #dcfce7; }

/* Fritext */
.free-after .model { background: #ecfdf5; border-radius: 14px; padding: 12px; margin-top: 12px; color: #064e3b; }
@media (prefers-color-scheme: dark) { .free-after .model { background: #0f2e22; color: #a7f3d0; } }
.kp { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: .95rem; }
.kp input { width: 22px; height: 22px; flex: none; accent-color: var(--pitch-2); }

/* Återkoppling */
.feedback { display: none; margin-top: 12px; border-radius: 18px; padding: 14px 16px; }
.feedback.show { display: block; animation: pop .25s ease; }
.feedback.good { background: #dcfce7; color: #14532d; }
.feedback.mid { background: #fef3c7; color: #78350f; }
.feedback.bad { background: #ffe4e6; color: #881337; }
.fb-head { font-size: 1.3rem; font-weight: 900; margin-bottom: 6px; }
.fb-reveal, .fb-expl, .fb-note, .fb-small { margin: 6px 0; }
.fb-small { font-size: .85rem; opacity: .85; }
.feedback .label { display: inline; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; }
.feedback .btn { margin-top: 8px; }

/* Resultat */
.final-board { background: var(--navy); color: #fff; border-radius: 22px; padding: 22px 16px; text-align: center; margin-bottom: 12px; }
.final-board.win { background: linear-gradient(135deg, #0b1b33, #0b7a43); }
.fb-label { font-size: .75rem; letter-spacing: .15em; opacity: .7; font-weight: 800; }
.fb-score { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 8px 0; }
.fb-score strong { font-size: 2.8rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.fb-score span { font-weight: 700; opacity: .85; }
.fb-result { font-size: 1.3rem; font-weight: 900; color: var(--gold); }
.promo { text-align: center; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; }
.badge-row { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.badge-emoji { font-size: 2rem; }
.missed { padding-left: 20px; margin: 0; font-size: .95rem; }
.missed li { margin: 4px 0; }
.interstitial { text-align: center; }
.interstitial .scoreboard { margin-bottom: 30px; }

/* Märken */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.badge { background: var(--card); border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; opacity: .55; }
.badge.got { opacity: 1; border: 2px solid var(--gold); }
.badge small { font-size: .72rem; color: var(--muted); }
.ladder { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ladder li { display: flex; justify-content: space-between; background: var(--card); padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.ladder li.passed { opacity: .6; }
.ladder li.current { background: linear-gradient(135deg, var(--pitch-2), var(--ice)); color: #fff; font-weight: 900; }
.ladder li.current .muted { color: #fff; }

/* Mer */
.how { padding-left: 4px; list-style: none; margin: 0; }
.how li { margin: 6px 0; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.login-hero { text-align: center; margin-bottom: 18px; }
.login-logo { width: 110px; height: 110px; border-radius: 26px; box-shadow: 0 10px 30px rgba(11,122,67,.35); }
.login-hero h1 { font-size: 2rem; margin-top: 12px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.pin-input { text-align: center; font-size: 1.6rem; letter-spacing: .3em; }
.login-msg { min-height: 1.4em; text-align: center; color: var(--bad); font-weight: 700; }

/* Föräldravy */
.parent .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-e { font-size: 1.4rem; }
.stat strong { font-size: 1.2rem; }
.stat small { color: var(--muted); font-size: .75rem; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 2px; }
.chart-bar { width: 100%; background: #fecdd3; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; min-height: 2px; }
.chart-ok { width: 100%; background: var(--good); border-radius: 4px 4px 0 0; }
.chart-col small { font-size: .65rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ptable th { text-align: left; font-size: .75rem; color: var(--muted); padding: 6px 4px; }
.ptable td { border-top: 1px solid var(--line); padding: 8px 4px; vertical-align: middle; }
.mini { display: flex; align-items: center; gap: 6px; min-width: 90px; }
.weak, .summaries, .sessions { list-style: none; padding: 0; margin: 0; }
.weak li, .summaries li, .sessions li { border-top: 1px solid var(--line); padding: 8px 0; }
.sessions li { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.summaries .q { font-weight: 700; margin-top: 2px; }
.summaries blockquote { margin: 4px 0 0; padding: 8px 12px; background: var(--bg); border-radius: 10px; font-style: italic; }

/* Flikrad */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); z-index: 10;
}
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px; border-radius: 12px; }
.tabbar a.active { color: var(--pitch-2); background: color-mix(in srgb, var(--pitch-2) 12%, transparent); }
.tab-emoji { font-size: 1.4rem; }

/* Toast + konfetti */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; opacity: 0; transition: all .25s; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti span { position: absolute; top: -40px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.note.urgent { border: 2px solid #fb923c; }

.tag.teacher { background: #fee2e2; color: #991b1b; }
.notice { background: #fef9c3; color: #713f12; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: .92rem; }
@media (prefers-color-scheme: dark) { .notice { background: #3a3410; color: #fde68a; } }
.plan { background: var(--card); border: 2px solid #fb923c; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.plan h3 { margin: 0 0 6px; }
.plan ul { margin: 6px 0 8px; padding-left: 0; list-style: none; }
.plan li { padding: 6px 0; border-top: 1px solid var(--line); }
.plan li:first-child { border-top: 0; }
.plan li strong { display: inline-block; min-width: 72px; }
.plan .row { flex-wrap: wrap; }
.chapter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.chapter-actions .btn { flex: 1; min-width: 140px; }
.tag.teacher { text-transform: none; }
