/* Erdem Online-Klasse — style C: navy sidebar, calm canvas, indigo + gold accents */
:root {
  --side: #0B1F3A;
  --side-2: #132B4D;
  --side-text: #C9D3E6;
  --side-muted: #8FA0BF;
  --bg: #F4F6FB;
  --paper: #FFFFFF;
  --ink: #121A2E;
  --muted: #5F6982;
  --line: #E2E7F1;
  --line-2: #EEF1F7;
  --indigo: #3B4BC8;
  --indigo-d: #2C399E;
  --indigo-soft: #E7EAFB;
  --gold: #E5A93C;
  --gold-d: #9A6A12;
  --gold-soft: #FFF1D9;
  --green: #1F8A5B;
  --green-btn: #22A06B;
  --green-soft: #DFF3EA;
  --red: #B3261E;
  --red-soft: #FBE7E5;
  --rose-soft: #FCE8EC;
  --rose: #A8325A;
  --radius: 18px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; color: var(--ink); text-wrap: balance; }
h2 { font-size: 1.12rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 800; }
p { margin: 0 0 .6em; }
a { color: var(--indigo); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ico { flex: none; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.pad { padding: 3rem 1rem; }
.mt { margin-top: 1rem; }
.mn { font-weight: 700; }
.late { color: var(--red) !important; font-weight: 700; }
.eyebrow { margin: 0 0 .25rem; font-size: .86rem; font-weight: 700; color: var(--muted); }
.mobile-only { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--side) 252px, var(--bg) 252px); }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; gap: 6px; padding: 22px 16px 16px;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; flex: none; }
.brand strong { display: block; font-weight: 800; font-size: 1rem; white-space: nowrap; }
.brand small { display: block; color: var(--side-muted); font-size: .76rem; font-weight: 600; }
.side-mobile-actions { display: none; gap: 6px; align-items: center; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--side-text); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 800; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: var(--side); font-size: .75rem; text-align: center; }
.side-live { margin-top: auto; padding: 16px; border-radius: 16px; background: var(--side-2); display: grid; gap: 8px; }
.side-live-label { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
.side-live strong { color: #fff; font-size: 1.15rem; }
.side-live small { color: var(--side-muted); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 6px 4px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.side-live + .side-user { margin-top: 10px; }
.side-nav + .side-user { margin-top: auto; }
.side-user-text { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.side-user-text strong { color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { color: var(--side-muted); font-size: .75rem; font-weight: 600; }
.lang { background: transparent; color: var(--side-text); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: .2rem .6rem; font-weight: 800; font-size: .74rem; cursor: pointer; }
.lang:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--side-text); cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.content { min-width: 0; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 40px 24px; display: grid; gap: 22px; flex: 1; align-content: start; }
.wrap > * { min-width: 0; }
#rosterOut { display: grid; gap: 16px; }
#rosterOut:empty { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.page-title { font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.count { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .5rem; border-radius: 999px; background: var(--gold); color: var(--side); font-size: .95rem; font-weight: 800; vertical-align: middle; letter-spacing: 0; }
.foot { text-align: center; padding: 1rem 1rem 1.6rem; font-size: .82rem; color: var(--muted); }
.foot a { color: var(--muted); }
.demo-banner { background: var(--gold-soft); color: var(--gold-d); font-size: .84rem; font-weight: 700; text-align: center; padding: .45rem 1rem; }

/* solo (login) */
.solo { min-height: 100vh; display: flex; flex-direction: column; }
.solo-top { display: flex; align-items: center; justify-content: space-between; padding: 14px max(16px, calc((100% - 1080px) / 2)); background: var(--side); }
.solo .wrap { max-width: 500px; }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .4rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 4px; }
.row-gap { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row-gap.center { justify-content: center; }
.grow { flex: 1 1 180px; }
.push { margin-left: auto; }
.align-end { align-self: end; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1.15rem; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 800; text-decoration: none; cursor: pointer; min-height: 44px; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .45rem .9rem; min-height: 38px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-gold { background: var(--indigo); color: #fff; }       /* primary action */
.btn-gold:hover { background: var(--indigo-d); }
.btn-navy { background: var(--side); color: #fff; }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-live { background: var(--green-btn); color: #fff; }
.btn-live:hover { filter: brightness(1.07); }
.btn-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .3rem .5rem; border-radius: 8px; }
.btn-x:hover { color: var(--red); background: var(--red-soft); }
.link { background: none; border: 0; color: var(--indigo); font-weight: 800; cursor: pointer; text-decoration: none; padding: 0; }

/* ---------- forms ---------- */
label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 700; color: var(--ink); }
label.inline { display: flex; align-items: center; gap: .5rem; }
input, select, textarea { width: 100%; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 500; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); outline: none; box-shadow: 0 0 0 3px var(--indigo-soft); }
.form { display: grid; gap: .75rem; align-content: start; }
.form-msg { font-weight: 700; color: var(--green); margin: 0; }
.form-msg.bad { color: var(--red); }

/* ---------- login ---------- */
.login { display: grid; gap: 1rem; margin-top: 1.5rem; }
.login-hero { background: var(--side); color: #fff; border-radius: var(--radius); padding: 2rem 1.6rem; }
.login-hero h1 { color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.login-hero p { color: var(--side-text); margin: 0; }
.login-card { display: grid; gap: .85rem; }
.demo-roles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.role-btn { padding: 1rem .5rem; border-radius: 14px; background: var(--bg); border: 1.5px solid var(--line); cursor: pointer; font-weight: 800; color: var(--ink); min-height: 56px; }
.role-btn:hover { border-color: var(--indigo); background: var(--indigo-soft); }

/* ---------- avatars ---------- */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--indigo-soft); color: var(--indigo); font-weight: 800; font-size: .95rem; flex: none; }
.side .avatar { background: var(--gold); color: var(--side); }
.avatar.xl { width: 56px; height: 56px; font-size: 1.4rem; }
.user-cell { display: flex; align-items: center; gap: .55rem; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.kpi-label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.kpi-note { font-size: .82rem; font-weight: 700; color: var(--muted); }
.kpi-note.accent { color: var(--indigo); }
.kpi-note.bad { color: var(--red); }
.meter { display: block; height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* ---------- goals ---------- */
.goal-list { display: grid; }
.goal { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); border-radius: 8px; }
.goal:hover { background: var(--bg); }
.goal .check { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid #C9D1E2; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .85rem; }
.goal.done .check { background: var(--green-btn); border-color: var(--green-btn); }
.goal.done b { color: var(--muted); text-decoration: line-through; }
.goal-text { display: grid; flex: 1; min-width: 0; }
.goal-text small { font-size: .82rem; color: var(--muted); font-weight: 600; }
.goal-go { color: var(--muted); }

/* ---------- week chart ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 150px; margin-top: .6rem; }
.week-col { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; gap: .35rem; }
.week-bar { display: flex; align-items: end; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.week-bar span { display: block; width: 100%; background: var(--indigo); border-radius: 8px; min-height: 0; transition: height .4s; }
.week-col small { font-size: .75rem; color: var(--muted); font-weight: 700; }
.week-col.is-today small { color: var(--indigo); }

/* ---------- games ---------- */
.game-row, .game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: .5rem; }
.game-tile {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1.5px solid transparent;
  text-decoration: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; transition: transform .12s, border-color .12s;
}
.game-tile:hover { transform: translateY(-2px); border-color: currentColor; }
.game-glyph { width: 54px; height: 54px; flex: none; border-radius: 14px; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; }
.game-text { display: grid; min-width: 0; }
.game-text b { color: var(--ink); }
.game-text small { color: var(--muted); font-weight: 600; font-size: .82rem; }
.tone-indigo { background: var(--indigo-soft); color: var(--indigo); }
.tone-gold { background: var(--gold-soft); color: var(--gold-d); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-rose { background: var(--rose-soft); color: var(--rose); }
.game-box { max-width: 600px; width: 100%; margin: 0 auto; display: grid; gap: 1rem; }
.game-progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.game-progress span { display: block; height: 100%; background: var(--indigo); transition: width .3s; }

.flashcard { perspective: 900px; border: 0; background: none; padding: 0; height: 250px; cursor: pointer; width: 100%; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 18px; display: grid; place-content: center; justify-items: center; gap: .4rem; }
.face.front { background: var(--indigo-soft); border: 2px solid var(--indigo); color: var(--ink); }
.face.back { background: var(--side); color: #fff; transform: rotateY(180deg); }
.face .emoji { font-size: 3.2rem; }
.face .word { font-size: 2.2rem; font-weight: 800; }
.face .hint { font-size: .85rem; opacity: .7; }

.quiz-q { text-align: center; font-weight: 800; margin: 0; }
.quiz-big { text-align: center; }
.quiz-big.letter { font-size: 5.5rem; font-weight: 800; line-height: 1; }
.quiz-big.letter small { font-size: 3rem; margin-left: .4rem; color: var(--gold-d); }
.quiz-big.word { font-size: 2.6rem; }
.quiz-big.sentence { font-size: 1.7rem; line-height: 1.4; }
.blank { display: inline-block; min-width: 2.4em; border-bottom: 3px solid var(--indigo); color: var(--indigo); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.quiz-opt { min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 1.25rem; font-weight: 800; color: var(--ink); cursor: pointer; }
.emoji-opts .quiz-opt { font-size: 2.5rem; min-height: 88px; }
.quiz-opt:hover:not(:disabled) { border-color: var(--indigo); }
.quiz-opt.right { background: var(--green-soft); border-color: var(--green); }
.quiz-opt.wrongpick { background: var(--red-soft); border-color: var(--red); }
.quiz-feedback { text-align: center; font-weight: 800; min-height: 1.6em; margin: 0; }
.quiz-feedback.ok { color: var(--green); }
.quiz-feedback.bad { color: var(--red); }

.build-hint { text-align: center; color: var(--muted); font-weight: 700; margin: -.4rem 0 0; }
.build-answer { min-height: 64px; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: .4rem; padding: .7rem; border-radius: 14px; border: 2px dashed var(--line); background: var(--bg); cursor: pointer; }
.build-answer.is-right { border-color: var(--green); background: var(--green-soft); }
.build-answer.is-wrong { border-color: var(--red); background: var(--red-soft); }
.build-empty { color: var(--muted); }
.build-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.tile { min-width: 48px; min-height: 48px; padding: .5rem .8rem; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-size: 1.3rem; font-weight: 800; color: var(--ink); cursor: pointer; }
.tile:hover:not(:disabled) { border-color: var(--indigo); }
.tile:disabled { opacity: .25; cursor: default; }
.tile.placed { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo); cursor: inherit; }
.words .tile { font-size: 1.1rem; }

.game-end { text-align: center; display: grid; justify-items: center; gap: .3rem; padding: 1rem 0; }
.game-end-icon { font-size: 3.6rem; }
.game-end-score { font-size: 2.4rem; font-weight: 800; margin: 0; }

/* ---------- lessons & homework ---------- */
.lesson { display: flex; gap: 1rem; padding: .9rem 0; }
.stack > .lesson { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.lesson-date { flex: none; width: 70px; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center; text-align: center; font-weight: 800; font-size: .8rem; line-height: 1.15; padding: .5rem .3rem; align-self: start; min-height: 60px; }
.lesson-body { min-width: 0; flex: 1; }
.lesson-body p { color: var(--muted); }
.hw { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; }
.hw-main { flex: 1 1 260px; min-width: 0; }
.hw-main h3 { margin-bottom: .2rem; }
.hw-side { display: flex; align-items: center; gap: .5rem; }
.hw-form { flex-basis: 100%; display: grid; gap: .7rem; padding-top: .8rem; border-top: 1px solid var(--line-2); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.recording { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.file-list:empty { display: none; }
.file-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.file-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.file-item audio { height: 36px; max-width: 220px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--muted); }
.feedback { background: var(--green-soft); border-radius: 10px; padding: .55rem .75rem; margin-top: .4rem; font-size: .92rem; }
.chip { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.chip-open { background: var(--gold-soft); color: var(--gold-d); }
.chip-sent { background: var(--indigo-soft); color: var(--indigo); }
.chip-done { background: var(--green-soft); color: var(--green); }
.file-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: .82rem; color: var(--muted); text-decoration: none; }

/* ---------- badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.badge { display: grid; justify-items: center; text-align: center; gap: .3rem; background: var(--paper); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.2rem .8rem; color: var(--muted); }
.badge.on { border: 1.5px solid var(--gold); background: var(--gold-soft); color: var(--ink); }
.badge-icon { font-size: 2.3rem; filter: grayscale(1); opacity: .45; }
.badge.on .badge-icon { filter: none; opacity: 1; }
.badge small { font-size: .78rem; }

/* ---------- parent ---------- */
.child-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.child-head h2 { font-size: 1.35rem; margin: 0; }
.child-head p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kpi { background: var(--bg); border-radius: 14px; padding: .75rem .9rem; display: grid; gap: .1rem; }
.kpi span { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-weight: 700; font-size: .78rem; }
.kpi.warn { background: var(--gold-soft); }
h3.sub { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1rem 0 .4rem; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.mini-row:last-child { border-bottom: 0; }

/* ---------- staff ---------- */
.review-head { display: flex; align-items: center; gap: .7rem; }
.review-head p { margin: 0; }
blockquote { margin: .8rem 0; padding: .7rem 1rem; background: var(--bg); border-radius: 12px; white-space: pre-wrap; }
.media-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0; }
.media img { width: 140px; height: 105px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.media audio { height: 40px; max-width: 280px; }
.review-form, .group-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .8rem; }
.review-form label:first-child { width: 90px; }
.group-form .full { flex-basis: 100%; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .45rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem .45rem; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.table td .avatar { width: 28px; height: 28px; font-size: .8rem; vertical-align: middle; margin-right: .3rem; }
.table select { padding: .35rem .5rem; font-size: .9rem; min-width: 120px; }
.row-pending td { background: var(--gold-soft); }
details summary { cursor: pointer; font-weight: 800; }
.pending { max-width: 520px; margin: 2rem auto; }

.live-card { display: grid; gap: .3rem; }
.live-card h2 { font-size: 1.4rem; margin: 0; }


/* ---------- family tasks ---------- */
.chip-family { display: inline-flex; align-items: center; gap: .3rem; background: var(--rose-soft); color: var(--rose); }
.chip-new { background: var(--green-soft); color: var(--green); }
.chip-muted { background: var(--line-2); color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .1rem 0 .4rem; }
.family-box { border: 1.5px solid #F3C9D6; background: #FFF8FA; border-radius: 16px; padding: 14px 16px; margin-bottom: 1rem; display: grid; gap: .6rem; }
.family-head { display: flex; gap: .7rem; align-items: flex-start; color: var(--rose); }
.family-head h3 { margin: 0; color: var(--ink); }
.family-head p { margin: 0; }
.family-task { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-start; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.family-task-main { flex: 1 1 260px; min-width: 0; }
.family-task-main p { margin: .2rem 0 0; }
.family-form { flex-basis: 100%; display: grid; gap: .6rem; padding-top: .6rem; border-top: 1px solid var(--line-2); }
.check-line { display: flex; align-items: center; gap: .55rem; font-weight: 700; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--indigo); }

/* ---------- roster ---------- */
.lead { max-width: 68ch; margin-top: .4rem; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-no { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center; font-weight: 800; }
.step-body { display: grid; gap: .5rem; min-width: 0; }
.step-body h2 { margin: 0; }
.step-body p { margin: 0; }
.rules summary { font-size: .88rem; color: var(--indigo); }
.rules p { margin: .4rem 0 0; }
.alert-bad { border-color: #F2B8B5; background: #FFF7F6; }
.alert-warn { border-color: #F0D58A; background: var(--gold-soft); }
.alert-ok { border-color: #A9DDC3; background: #F4FBF7; }
.err-list { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .25rem; font-size: .92rem; }
.alert-ok .err-list, .alert-bad .err-list { list-style: none; padding-left: 0; }
.row-dim td { color: var(--muted); }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .86rem; }
.apply-bar { display: flex; justify-content: flex-end; }
.apply-bar .btn { min-width: 260px; }

/* ---------- account / team ---------- */
a.side-user-text { text-decoration: none; }
a.side-user-text:hover strong { text-decoration: underline; }
.avatar.team { background: var(--gold-soft); font-size: 1.15rem; }
.avatar.team.xl { font-size: 1.9rem; }
.onboard { max-width: 560px; margin: 1rem auto; display: grid; gap: .6rem; }
.team-form { display: grid; gap: .8rem; }
.icon-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .45rem; }
.icon-pick legend { font-size: .85rem; font-weight: 700; margin-bottom: .35rem; padding: 0; }
.icon-opt { position: relative; display: block; cursor: pointer; }
.icon-opt input { position: absolute; opacity: 0; inset: 0; }
.icon-opt span { display: grid; place-items: center; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-size: 1.5rem; }
.icon-opt input:checked + span { border-color: var(--indigo); background: var(--indigo-soft); }
.icon-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.avatar.img { background: var(--gold-soft) center / cover no-repeat; }
.avatar.xs { width: 20px; height: 20px; vertical-align: -5px; display: inline-block; }
.avatar.fill { width: 100%; height: 100%; border-radius: 10px; }
.icon-upload span { color: var(--indigo); border-style: dashed; overflow: hidden; padding: 0; }
.team-preview { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 14px; background: var(--bg); font-size: 1.1rem; }
.team-box { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 1rem; }

/* ---------- WhatsApp ---------- */
.btn-wa { background: #1FA855; color: #fff; }
.btn-wa:hover { background: #178A45; }
.btn-xs { padding: .25rem .6rem; min-height: 30px; font-size: .8rem; border-radius: 9px; gap: .3rem; }
.btn-xs .ico { width: 15px; height: 15px; }
.row-actions { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.wa-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .8rem; margin-bottom: .2rem; border-bottom: 1px solid var(--line-2); }
.share-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; border-color: #A9DDC3; background: #F4FBF7; }
.share-banner p { margin: .2rem 0 0; }
td.right { text-align: right; }

.report-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
@media (max-width: 1200px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #F4F6FB; }

/* ---------- insights ---------- */
.insights { display: grid; gap: 14px; }
.ins-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ins-card { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.ins-card .kpi-value { font-size: 1.6rem; }
.stack-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.stack-bar span { min-width: 0; }
.b-ok { background: var(--green-btn); } .b-mid { background: var(--gold); } .b-none { background: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: .2rem .6rem; font-size: .72rem; color: var(--muted); font-weight: 600; align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 2px; }
.acc-row { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) 2.6rem; align-items: center; gap: .4rem; font-size: .82rem; font-variant-numeric: tabular-nums; }
.acc-row b { text-align: right; }
.acc-track { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.acc-track span { display: block; height: 100%; background: var(--indigo); border-radius: 999px; }
.acc-track.bad span { background: var(--red); }
.mini-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; height: 70px; align-items: end; }
.mb-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; font-size: .66rem; color: var(--muted); }
.mb-col .mb-bar { align-self: end; background: var(--indigo); border-radius: 4px 4px 0 0; min-height: 2px; }
.mb-n { font-weight: 800; color: var(--ink); }
.ins-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ins-lists h4 { margin: 0 0 .4rem; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.wchip { display: inline-flex; align-items: baseline; gap: .3rem; padding: .2rem .55rem; border-radius: 8px; font-weight: 700; font-size: .88rem; }
.wchip.ok { background: var(--green-soft); color: var(--green); }
.wchip.weak { background: var(--red-soft); color: var(--red); }
.wchip small { font-weight: 600; color: var(--muted); font-size: .72rem; }
.ins-row { cursor: pointer; }
.ins-row:hover td, .ins-row.open td { background: var(--bg); }
.ins-detail td { background: #FBFCFE; padding: 14px; }
.mini-meter { display: inline-block; width: 50px; height: 6px; border-radius: 999px; background: var(--line); vertical-align: middle; margin-left: .3rem; overflow: hidden; }
.mini-meter span { display: block; height: 100%; background: var(--green-btn); }
.hard-list { display: grid; gap: .45rem; }
.hard-item { display: grid; grid-template-columns: 7rem 7rem minmax(0, 1fr) 3rem 4.5rem; align-items: center; gap: .6rem; font-variant-numeric: tabular-nums; }
.hard-word { font-weight: 800; font-size: 1.05rem; }
@media (max-width: 1000px) { .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .ins-grid, .ins-lists { grid-template-columns: minmax(0, 1fr); }
  .hard-item { grid-template-columns: 5.5rem minmax(0, 1fr) 2.6rem; }
  .hard-item > :nth-child(2), .hard-item > :nth-child(5) { display: none; }
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--side); color: #fff; padding: .8rem 1.2rem; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: .25s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { background: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .game-row, .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { position: sticky; top: 0; height: auto; z-index: 20; padding: 10px 12px 8px; gap: 4px; overflow: visible; }
  .side-top { padding: 0 2px 6px; }
  .brand small { display: none; }
  .side-mobile-actions { display: flex; }
  .side-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 -12px; padding: 0 12px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { padding: 8px 12px; font-size: .9rem; gap: 8px; flex: none; }
  .side-live, .side-user { display: none; }
  .mobile-only { display: block; }
  .wrap { padding: 20px 16px 16px; gap: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .apply-bar .btn { width: 100%; min-width: 0; }
  .game-row, .game-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 1.6rem; }
  .lesson { flex-direction: column; gap: .5rem; }
  .lesson-date { width: auto; min-height: 0; justify-self: start; padding: .3rem .7rem; }
  .quiz-big.letter { font-size: 4.5rem; }
  .quiz-big.sentence { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
h3.sub .chip { text-transform: none; letter-spacing: 0; margin-left: .4rem; }

/* ---------- student progress ---------- */
.prog-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; background: var(--side); color: #fff; border-radius: var(--radius); padding: 20px 24px; }
.prog-hero h2 { color: #fff; font-size: 1.35rem; margin: 0; }
.prog-hero .eyebrow { color: var(--side-muted); }
.prog-hero .muted { color: var(--side-text); margin: .4rem 0 0; }
.prog-hero > div:last-child { flex: 1 1 260px; min-width: 0; }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring > span { width: 86px; height: 86px; border-radius: 50%; background: var(--side); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring b { font-size: 1.9rem; } .ring small { color: var(--side-muted); font-weight: 700; }
.meter.green span { background: var(--green-btn); }
.review-nudge { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); border-color: #F2B8B5; background: #FFF7F6; }
.review-nudge span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.review-nudge small { color: var(--muted); font-weight: 600; }
.nudge-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.practice-note { margin: 0 auto .6rem; max-width: 600px; font-weight: 800; color: var(--red); }

/* ---------- announcements ---------- */
.ann { display: flex; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.ann-date { flex: none; width: 58px; height: 62px; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ann-date b { font-size: 1.5rem; } .ann-date small { font-size: .7rem; font-weight: 700; }
.ann-meeting .ann-date { background: var(--gold-soft); color: var(--gold-d); }
.ann-event .ann-date { background: var(--rose-soft); color: var(--rose); }
.ann-body { min-width: 0; flex: 1; display: grid; gap: .25rem; }
.ann-body h3, .ann-body p { margin: 0; }
.ann-kind { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ann .row-gap { margin-top: .35rem; }

/* ---------- multi-class ---------- */
.gtag { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); }
.gtag-dance { background: var(--rose-soft); color: var(--rose); }
.gtag-music { background: var(--gold-soft); color: var(--gold-d); }
.gtag-sport { background: #E3F4EA; color: #1F7A4D; }
.link-field { display: grid; gap: .3rem; font-size: .88rem; font-weight: 700; }
.link-field.is-main { background: var(--gold-soft); border-radius: 12px; padding: .7rem .8rem; }
.stack-xs { display: grid; gap: .4rem; justify-items: end; }
.side-live + .side-live { margin-top: .5rem; }
details.multi summary { cursor: pointer; font-size: .85rem; color: var(--indigo); font-weight: 700; list-style: none; }
details.multi summary::-webkit-details-marker { display: none; }
.link-field-head { display: inline-flex; align-items: center; gap: .4rem; }
details.multi { position: relative; }
.multi-list { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 240px; display: grid; gap: .35rem; padding: .7rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(11,31,58,.14); font-size: .85rem; }
.multi-list label { display: flex !important; gap: .5rem; align-items: center; font-weight: 600; white-space: nowrap; margin: 0; }
.multi-list input[type=checkbox] { width: auto; flex: none; margin: 0; }

/* ---------- class assignment ---------- */
.cl-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.cl-sum { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .55rem; padding: .7rem .85rem; border-radius: 14px; background: var(--indigo-soft); color: var(--indigo); }
.cl-sum span { grid-row: span 2; font-size: 1.35rem; } .cl-sum b { font-size: 1.35rem; line-height: 1; } .cl-sum small { font-size: .74rem; font-weight: 700; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-sum.gtag-dance { background: var(--rose-soft); color: var(--rose); } .cl-sum.gtag-music { background: var(--gold-soft); color: var(--gold-d); } .cl-sum.gtag-sport { background: #E3F4EA; color: #1F7A4D; }
.cl-sum.warn { background: var(--red-soft); color: var(--red); } .cl-sum:not(.warn):last-child { background: var(--bg, #F3F4F8); color: var(--muted); }
.cl-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.cl-tools input[type=search] { flex: 1 1 220px; min-width: 0; }
.cl-tools select { width: auto; max-width: 240px; }
.cl-table th.cl-col { text-align: center; min-width: 108px; font-size: .74rem; line-height: 1.25; vertical-align: bottom; }
.cl-table th.cl-col span { display: block; font-size: 1.2rem; }
.cl-table th.cl-col small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; }
.cl-table td.cl-cell { text-align: center; position: relative; white-space: nowrap; }
.cl-table td.cl-cell.on { background: color-mix(in srgb, var(--indigo-soft) 70%, transparent); }
.cl-box input { width: 20px; height: 20px; margin: 0; cursor: pointer; accent-color: var(--indigo); }
.cl-star { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--line); padding: 0 .2rem; vertical-align: middle; }
.cl-star.prim { color: var(--gold); }
.cl-sel { width: 34px; } .cl-sel input { width: 18px; height: 18px; margin: 0; }
.cl-name { white-space: nowrap; } .cl-name > span { display: inline-grid; vertical-align: middle; } .cl-name small { font-size: .74rem; }
.row-changed td { box-shadow: inset 0 -2px 0 var(--gold); }
.cl-tools label.inline { display: inline-flex; gap: .45rem; align-items: center; white-space: nowrap; font-weight: 600; margin: 0; }
.cl-tools label.inline input { width: 18px; height: 18px; margin: 0; flex: none; }
.cl-box { display: inline-flex; vertical-align: middle; margin: 0; }
.cl-summary { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 640px) { .cl-summary { grid-template-columns: 1fr 1fr; } .cl-sum { padding: .55rem .65rem; } }
