/* ห้องเรียนเพื่อนครู — warm cream pages, navy headings, orange call-to-actions, rounded white cards.
   Type: Noto Sans Thai Looped (Thai, looped letters read easily for children and older eyes) + Plus Jakarta Sans (Latin/numbers),
   one family "Kru Sans" so weights 400–900 work everywhere. */
@font-face { font-family: 'Kru Sans'; font-weight: 400; font-display: swap; src: url(/assets/fonts/noto-sans-thai-looped-thai-400-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kru Sans'; font-weight: 500; font-display: swap; src: url(/assets/fonts/noto-sans-thai-looped-thai-500-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kru Sans'; font-weight: 700; font-display: swap; src: url(/assets/fonts/noto-sans-thai-looped-thai-700-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kru Sans'; font-weight: 900; font-display: swap; src: url(/assets/fonts/noto-sans-thai-looped-thai-900-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kru Sans'; font-weight: 400; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Kru Sans'; font-weight: 500; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Kru Sans'; font-weight: 700; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Kru Sans'; font-weight: 800; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --brand: #f97316;      /* orange call-to-action */
  --brand-deep: #ea580c;
  --brand-700: #c2410c;
  --brand-200: #fed7aa;
  --brand-100: #ffedd5;
  --brand-50: #fff7ed;
  --ink: #10234a;        /* navy: headings, dark surfaces */
  --ink-deep: #10234a;
  --ink-2: #c2410c;      /* links and hover accents */
  --ink-soft: #ffedd5;
  --ink-mist: #fff7ed;
  --paper: #fffcf7;      /* warm cream page */
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #10234a;
  --muted: #475569;
  --faint: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --rule: #c7d8f1;
  --margin: #f0a3a3;
  --pen: #dc2626;        /* the teacher's red pen */
  --pen-soft: #fee2e2;
  --star: #fbbf24;       /* gold stars */
  --star-deep: #b45309;
  --star-soft: #fef3c7;
  --ok: #059669; --ok-bg: #d1fae5;
  --late: #b45309; --late-bg: #fef3c7;
  --bad: #dc2626; --bad-bg: #fee2e2;
  --sky: #2563eb; --sky-bg: #dbeafe;
  --violet: #7c3aed; --violet-bg: #ede9fe;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sidebar: 264px;
  --top: 62px;
  --font: 'Kru Sans', 'Leelawadee UI', 'Thonburi', 'Noto Sans Thai Looped', system-ui, sans-serif;
  --hand: 'Kru Sans', 'Leelawadee UI', 'Thonburi', system-ui, sans-serif;
  --doc: 'Sarabun', 'TH Sarabun New', 'Kru Sans', serif;
  --pop: 0 24px 48px -20px rgba(16, 35, 74, .28), 0 2px 6px rgba(16, 35, 74, .08);
  --soft: 0 1px 2px rgba(16, 35, 74, .05);
  --chunky: 0 4px 0 var(--brand-200);
  --focus: 0 0 0 3px rgba(249, 115, 22, .24);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15.5px; font-weight: 400; line-height: 1.7; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
b, strong, th { font-weight: 600; }
a { color: var(--ink-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-family: var(--hand); font-weight: 900; font-size: 30px; letter-spacing: -.01em; color: var(--ink-deep); }
h2 { font-size: 18.5px; }
h3 { font-size: 16px; }
p { margin: 0 0 .7em; }
small, .small { font-size: 13.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.hand { font-family: var(--hand); font-weight: 800; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid #2f6be0; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; overflow-y: auto; overscroll-behavior: contain; background: var(--ink-deep); color: #dbe4f5; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 16px 18px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 40px; height: 40px; flex: none; }
.brand b { display: block; color: #fff; font-family: var(--hand); font-weight: 800; font-size: 19px; line-height: 1.2; }
.brand span { display: block; font-size: 12.5px; color: #9fb0d3; line-height: 1.35; }
.nav { padding: 4px 10px 28px; flex: 1; }
.nav-group { margin-top: 12px; }
.nav-label { font-size: 12.5px; color: #8fa1c8; padding: 0 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: var(--r); color: #c9d5ec; font-size: 14.5px; text-decoration: none; position: relative; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active svg { color: var(--star); }
.nav .count { margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--pen); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
/* classroom list in the sidebar: notebook index tabs */
.nav a.cls { padding-left: 14px; }
.nav a.cls .tab { width: 8px; height: 22px; border-radius: 2px 5px 5px 2px; background: var(--c, var(--ink-2)); flex: none; }
.nav a.cls .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.cls small { color: #8fa1c8; margin-left: auto; font-size: 12px; }
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 26px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .menu-btn, .topbar .title-sm { display: none; }
.topbar .today { color: var(--muted); font-size: 14px; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: var(--r); border: 1px solid transparent; background: none; display: grid; place-items: center; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--ink-mist); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--pen); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.user-chip .who { line-height: 1.25; font-size: 13.5px; text-align: left; }
.user-chip .who small { display: block; color: var(--muted); font-size: 12px; }
.view { padding: 24px 28px 64px; max-width: 1280px; width: 100%; }
.bottom-nav { display: none; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 26px; font-size: 14.5px; background: var(--sky-bg); color: #1b4f86; border-bottom: 1px solid #c6dbf3; }
.banner.warn { background: var(--late-bg); color: #7d4e00; border-color: #f1d9a3; }
.banner svg { width: 18px; height: 18px; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-soft); color: var(--ink); display: inline-grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.crumb svg { width: 15px; height: 15px; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel > .panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel > .panel-head h2, .panel > .panel-head h3 { flex: 1; }
.panel > .panel-body { padding: 16px 18px; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; border: 0; }
.note { padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); font-size: 14.5px; }
.note.ok { background: var(--ok-bg); border-color: #bfe3cf; }
.note.warn { background: var(--late-bg); border-color: #f1d9a3; }
.note.bad { background: var(--bad-bg); border-color: #f4c3bd; }
.note.ink { background: var(--ink-mist); border-color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn { --bg: var(--surface); --fg: var(--text); --bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--bd); background: var(--bg); color: var(--fg); font: 500 14.5px/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { --bd: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn-primary:hover { --bg: var(--ink-deep); --bd: var(--ink-deep); }
.btn-star { --bg: var(--star); --fg: #3b2a00; --bd: var(--star); }
.btn-star:hover { --bg: #f6bd3c; --bd: #f6bd3c; }
.btn-green { --bg: var(--ok); --fg: #fff; --bd: var(--ok); }
.btn-green:hover { --bg: #1b7049; --bd: #1b7049; }
.btn-pen { --fg: var(--pen); --bd: #f0bdb7; }
.btn-pen:hover { --bg: var(--pen-soft); --bd: var(--pen); }
.btn-danger { --fg: var(--bad); --bd: #f0bdb7; }
.btn-danger:hover { --bg: var(--bad-bg); --bd: var(--bad); }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { --bg: var(--ink-mist); --bd: transparent; }
.btn-light { --bg: rgba(255,255,255,.1); --fg: #fff; --bd: rgba(255,255,255,.35); }
.btn-light:hover { --bg: rgba(255,255,255,.18); --bd: rgba(255,255,255,.6); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .65; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; background: var(--line-2); color: var(--muted); white-space: nowrap; line-height: 1.85; }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.amber { background: var(--late-bg); color: var(--late); }
.badge.red { background: var(--bad-bg); color: var(--bad); }
.badge.blue { background: var(--sky-bg); color: var(--sky); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.ink { background: var(--ink-soft); color: var(--ink); }
.badge.star { background: var(--star-soft); color: var(--star-deep); }

/* the gold star sticker — used wherever stars (coins) are counted */
.star { display: inline-flex; align-items: center; gap: 5px; font-family: var(--hand); font-weight: 800; font-size: 17px; color: var(--star-deep); line-height: 1; white-space: nowrap; }
.star::before { content: ''; width: 1.05em; height: 1.05em; flex: none; background: var(--star); clip-path: polygon(50% 0%, 61.8% 35.4%, 100% 38.2%, 69.1% 61.8%, 80.9% 100%, 50% 76.4%, 19.1% 100%, 30.9% 61.8%, 0% 38.2%, 38.2% 35.4%); }
.star.neg { color: var(--pen); }
.star.neg::before { background: var(--pen); }
.star.lg { font-size: 34px; gap: 8px; }
.sticker { position: relative; display: inline-grid; place-items: center; width: 74px; height: 74px; flex: none; font-family: var(--hand); font-weight: 800; font-size: 25px; color: #3b2a00; transform: rotate(-8deg); }
.sticker::before { content: ''; position: absolute; inset: 0; background: var(--star); clip-path: polygon(50% 0%, 61.8% 35.4%, 100% 38.2%, 69.1% 61.8%, 80.9% 100%, 50% 76.4%, 19.1% 100%, 30.9% 61.8%, 0% 38.2%, 38.2% 35.4%); filter: drop-shadow(0 2px 0 var(--star-deep)); }
.sticker span { position: relative; margin-top: 8px; }
@keyframes stickerPop { 0% { transform: scale(.3) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.15) rotate(-4deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
.sticker.pop { animation: stickerPop .45s cubic-bezier(.2,.9,.3,1.3); }
/* red-pen marks */
.pen { font-family: var(--hand); font-weight: 500; color: var(--pen); font-size: 17px; line-height: 1.45; }
.pen-score { display: inline-grid; place-items: center; min-width: 58px; padding: 2px 10px; border: 2px solid var(--pen); border-radius: 50% / 45%; color: var(--pen); font-family: var(--hand); font-weight: 800; font-size: 20px; transform: rotate(-4deg); white-space: nowrap; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 14px; color: var(--muted); }
.field > label .req { color: var(--pen); }
.field .help { font-size: 12.5px; color: var(--faint); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font: 400 15.5px/1.4 var(--font); color: var(--text); }
textarea.input { min-height: 100px; resize: vertical; line-height: 1.65; }
.input:focus { outline: none; border-color: var(--ink-2); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); }
.input.code { font-family: var(--hand); font-weight: 800; font-size: 26px; letter-spacing: 6px; text-align: center; text-transform: uppercase; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search .input { padding-left: 36px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar .search .input { width: 100%; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: var(--r); padding: 8px 12px; font-size: 14px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #c3cbd9; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 32px; height: 32px; border-radius: 8px; background: var(--c); cursor: pointer; position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches input:checked + i { position: absolute; inset: -4px; border: 2px solid var(--c); border-radius: 11px; }
.emoji-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.emoji-pick label { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-size: 21px; cursor: pointer; border: 1px solid transparent; }
.emoji-pick input { position: absolute; opacity: 0; }
.emoji-pick label:has(input:checked) { border-color: var(--ink-2); background: var(--ink-mist); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); border: 0; background: none; font: 500 14.5px var(--font); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tabs a svg, .tabs button svg { width: 17px; height: 17px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--ink-deep); border-bottom-color: var(--ink); }
.tabs .count { font-size: 12px; background: var(--pen); color: #fff; padding: 0 7px; border-radius: 10px; line-height: 1.6; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; min-height: 34px; }
.seg button.active { background: #fff; color: var(--ink-deep); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--ink-mist); }
.tbl .t-sub { color: var(--faint); font-size: 13px; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td.no, .tbl th.no { width: 44px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.panel .tbl th:first-child, .panel .tbl td:first-child { padding-left: 18px; }
.panel .tbl th:last-child, .panel .tbl td:last-child { padding-right: 18px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list > li.link { cursor: pointer; }
.list > li.link:hover { background: var(--ink-mist); }
.list .title { font-weight: 500; }
.list .meta { color: var(--faint); font-size: 13px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: #c2cbdb; margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }
.loader { padding: 50px; display: grid; place-items: center; }
.spin { width: 26px; height: 26px; border: 3px solid var(--ink-soft); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- notebook covers (classroom cards) ---------- */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.cover { position: relative; display: flex; flex-direction: column; min-height: 214px; padding: 16px 16px 14px 26px; border-radius: 6px 14px 14px 6px; background: var(--c, var(--ink)); color: #fff; text-decoration: none; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 22px -16px rgba(0,0,0,.6); overflow: hidden; transition: transform .12s; }
.cover:hover { text-decoration: none; transform: translateY(-2px); }
.cover::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: rgba(0,0,0,.22); }
.cover::after { content: ''; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.18); }
.cover .emo { font-size: 30px; line-height: 1; }
.cover .label { margin-top: auto; background: #fff; color: var(--text); border-radius: 8px; padding: 9px 12px 8px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.cover .label .ln { display: flex; gap: 6px; align-items: baseline; border-bottom: 1px dashed #b8c3d6; padding: 1px 0; font-size: 12.5px; color: var(--faint); }
.cover .label .ln:last-child { border-bottom: 0; }
.cover .label .ln b { font-family: var(--hand); font-weight: 800; font-size: 18px; color: var(--ink-deep); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cover .flag { background: rgba(255,255,255,.2); border-radius: 999px; padding: 0 9px; font-size: 12.5px; line-height: 1.8; }
.cover .flag.hot { background: #fff; color: var(--pen); font-weight: 600; }
.cover.add { background: transparent; color: var(--ink); border: 2px dashed #b5c3dc; box-shadow: none; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.cover.add::before, .cover.add::after { display: none; }
.cover.add svg { width: 34px; height: 34px; }
.cover.archived { filter: grayscale(.7); opacity: .75; }

/* classroom header */
.class-head { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 20px 16px 30px; border-radius: 6px 14px 14px 6px; background: var(--c, var(--ink)); color: #fff; margin-bottom: 0; overflow: hidden; flex-wrap: wrap; }
.class-head::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: rgba(0,0,0,.22); }
.class-head .emo { font-size: 36px; line-height: 1; }
.class-head h1 { color: #fff; font-size: 30px; }
.class-head .sub { color: rgba(255,255,255,.85); font-size: 14px; }
.class-head .jc { margin-left: auto; text-align: center; background: #fff; color: var(--text); border-radius: 10px; padding: 6px 14px 4px; cursor: pointer; border: 0; font: inherit; }
.class-head .jc small { display: block; color: var(--faint); font-size: 12px; line-height: 1.3; }
.class-head .jc b { font-family: var(--hand); font-weight: 800; font-size: 26px; letter-spacing: 3px; color: var(--ink-deep); line-height: 1.2; }
.class-tabs { margin-top: 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; padding: 0 10px; margin-bottom: 18px; }
.class-tabs.tabs { border-bottom: 1px solid var(--line); }

/* ---------- KPIs & strips ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 14px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--ink-2); text-decoration: none; }
.kpi b { display: block; font-family: var(--hand); font-weight: 800; font-size: 30px; color: var(--ink-deep); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.hot b { color: var(--pen); }
.kpi.ok b { color: var(--ok); }
.kpi.gold b { color: var(--star-deep); }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.meter.gold i { background: var(--star); }
.meter.ok i { background: var(--ok); }
.meter.bad i { background: var(--pen); }
.attbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); }
.attbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.c-present { background: var(--ok); } .c-late { background: var(--star); } .c-absent { background: var(--pen); } .c-leave { background: var(--sky); } .c-sick { background: var(--violet); } .c-none { background: #d3dae6; }

/* ---------- attendance ---------- */
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line-2); }
.att-list .no { width: 26px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.att-list .nm { flex: 1; min-width: 0; }
.att-list .nm small { color: var(--faint); }
.att-list .when { font-size: 12.5px; color: var(--faint); min-width: 70px; text-align: right; }
.att-pick { display: flex; gap: 4px; }
.att-pick button { min-width: 48px; height: 38px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; font: 500 13.5px var(--font); cursor: pointer; color: var(--muted); }
.att-pick button.on[data-s=present] { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-pick button.on[data-s=late] { background: var(--star); border-color: var(--star); color: #3b2a00; }
.att-pick button.on[data-s=absent] { background: var(--pen); border-color: var(--pen); color: #fff; }
.att-pick button.on[data-s=leave] { background: var(--sky); border-color: var(--sky); color: #fff; }
.att-pick button.on[data-s=sick] { background: var(--violet); border-color: var(--violet); color: #fff; }
.sticky-save { position: sticky; bottom: 0; background: rgba(243,245,250,.95); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; align-items: center; z-index: 5; flex-wrap: wrap; }
.mk { display: inline-block; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; line-height: 24px; text-align: center; color: #fff; font-weight: 600; }
.mk.present { background: var(--ok); } .mk.late { background: var(--star); color: #3b2a00; } .mk.absent { background: var(--pen); } .mk.leave { background: var(--sky); } .mk.sick { background: var(--violet); } .mk.none { background: var(--line-2); color: var(--faint); }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.matrix th, .matrix td { padding: 4px 4px; border-bottom: 1px solid var(--line-2); text-align: center; white-space: nowrap; }
.matrix th { font-weight: 500; color: var(--muted); font-size: 12px; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.matrix td.nm, .matrix th.nm { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 190px; padding-left: 14px; border-right: 1px solid var(--line-2); }
.matrix th.nm { background: var(--surface-2); z-index: 3; }
.matrix tr.risk td.nm { box-shadow: inset 3px 0 0 var(--pen); }
.matrix .vert { writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 2px; }
.matrix td.cell { cursor: pointer; }
.matrix td.cell:hover .mk { outline: 2px solid var(--ink-2); outline-offset: 1px; }

/* projector: the front-of-class screen */
.board { position: fixed; inset: 0; z-index: 90; background: #14234a; color: #eef3ff; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3vw; padding: 3.2vw 3.6vw; overflow: hidden; }
.board .left { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 0; }
.board .cls { font-family: var(--hand); font-weight: 800; font-size: clamp(24px, 2.6vw, 44px); color: #fff; line-height: 1.2; }
.board .cls small { display: block; font-family: var(--font); font-size: clamp(13px, 1.1vw, 18px); color: #a9b9de; }
.board .qr { background: #fff; border-radius: 18px; padding: 1.4vw; margin: 1.6vw 0 1.1vw; width: min(36vw, 62vh); aspect-ratio: 1; position: relative; }
.board .qr svg { width: 100%; height: 100%; display: block; }
.board .ring { position: absolute; inset: -9px; border-radius: 24px; pointer-events: none; }
.board .code { font-family: var(--hand); font-weight: 800; font-size: clamp(40px, 5.6vw, 96px); letter-spacing: .14em; line-height: 1; color: var(--star); }
.board .hint { color: #b9c7e6; font-size: clamp(13px, 1.15vw, 19px); margin-top: .6vw; }
.board .right { display: flex; flex-direction: column; min-height: 0; }
.board .tally { display: flex; gap: 2vw; align-items: baseline; }
.board .tally b { font-family: var(--hand); font-weight: 800; font-size: clamp(44px, 6vw, 110px); line-height: 1; color: #fff; }
.board .tally span { color: #a9b9de; font-size: clamp(14px, 1.3vw, 22px); }
.board .names { margin-top: 1.4vw; display: flex; flex-wrap: wrap; gap: .7vw; align-content: flex-start; overflow: hidden; flex: 1; }
.board .nm { background: rgba(255,255,255,.1); border-radius: 999px; padding: .35vw 1.1vw .35vw .5vw; display: inline-flex; align-items: center; gap: .55vw; font-size: clamp(14px, 1.35vw, 24px); }
.board .nm i { width: 1.25em; height: 1.25em; background: var(--star); clip-path: polygon(50% 0%, 61.8% 35.4%, 100% 38.2%, 69.1% 61.8%, 80.9% 100%, 50% 76.4%, 19.1% 100%, 30.9% 61.8%, 0% 38.2%, 38.2% 35.4%); flex: none; }
.board .nm.late i { background: #f29a6a; }
.board .nm.fresh { animation: stickerPop .5s cubic-bezier(.2,.9,.3,1.3); }
.board .bar { position: absolute; top: 1.4vw; right: 1.6vw; display: flex; gap: 8px; z-index: 2; }
.board .closed { font-family: var(--hand); font-weight: 800; font-size: 4vw; color: var(--star); }

/* ---------- gradebook ---------- */
.gb { border-collapse: separate; border-spacing: 0; font-size: 14px; }
.gb th, .gb td { border-bottom: 1px solid var(--line-2); padding: 0; white-space: nowrap; text-align: center; }
.gb thead th { background: var(--surface-2); font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 6px; vertical-align: bottom; position: sticky; top: 0; z-index: 2; }
.gb thead th.colh { cursor: pointer; max-width: 120px; min-width: 70px; white-space: normal; line-height: 1.3; }
.gb thead th.colh:hover { background: var(--ink-mist); }
.gb thead th .mx { display: block; color: var(--faint); font-weight: 400; }
.gb thead tr.kinds th { font-size: 12px; padding: 3px 6px; color: var(--ink); background: var(--ink-mist); border-bottom: 1px solid var(--line); }
.gb td.nm, .gb th.nm { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 6px 12px; min-width: 200px; border-right: 1px solid var(--line-2); }
.gb th.nm { background: var(--surface-2); z-index: 3; }
.gb td.no, .gb th.no { width: 38px; color: var(--faint); padding: 6px 4px; text-align: right; }
.gb td input { width: 64px; height: 36px; border: 1px solid transparent; background: transparent; text-align: center; font: 400 15px var(--font); font-variant-numeric: tabular-nums; color: var(--text); border-radius: 6px; }
.gb td input:hover { border-color: var(--line); }
.gb td input:focus { outline: none; border-color: var(--ink-2); box-shadow: var(--focus); background: #fff; }
.gb td input.bad { border-color: var(--pen); background: var(--pen-soft); }
.gb td input.dirty { background: var(--star-soft); }
.gb td.sum { background: var(--surface-2); padding: 6px 8px; font-variant-numeric: tabular-nums; color: var(--muted); }
.gb td.total { font-weight: 600; color: var(--ink-deep); padding: 6px 10px; }
.gb th.pub::after { content: ' •'; color: var(--ok); }
.grade { display: inline-block; min-width: 36px; text-align: center; font-family: var(--hand); font-weight: 800; font-size: 19px; border-radius: 7px; padding: 0 6px; line-height: 1.45; }
.grade.g4, .grade.g35 { background: var(--ok-bg); color: var(--ok); }
.grade.g3, .grade.g25, .grade.g2 { background: var(--ink-mist); color: var(--ink); }
.grade.g15, .grade.g1 { background: var(--late-bg); color: var(--late); }
.grade.g0, .grade.gมส, .grade.gร { background: var(--pen-soft); color: var(--pen); }

/* ---------- work ---------- */
.work-card { display: flex; gap: 14px; align-items: flex-start; padding: 13px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.work-card:last-child { border-bottom: 0; }
a.work-card:hover { background: var(--ink-mist); text-decoration: none; }
.work-card .due { flex: none; width: 54px; text-align: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; line-height: 1.2; background: #fff; }
.work-card .due small { display: block; background: var(--ink); color: #fff; font-size: 11.5px; padding: 1px 0; }
.work-card .due b { display: block; font-family: var(--hand); font-weight: 800; font-size: 22px; padding: 2px 0 1px; }
.work-card .due.over small { background: var(--pen); }
.work-card .due.none b { font-size: 15px; padding: 6px 0; color: var(--faint); }
.work-card .t { font-weight: 600; }
.work-card .m { color: var(--faint); font-size: 13px; }
.subm { display: flex; flex-wrap: wrap; gap: 8px; }
.subm-tile { width: 112px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; cursor: pointer; font: inherit; color: inherit; position: relative; }
.subm-tile:hover { border-color: var(--ink-2); }
.subm-tile .no { position: absolute; top: 4px; left: 7px; font-size: 11.5px; color: var(--faint); }
.subm-tile .nm { font-size: 13.5px; line-height: 1.3; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subm-tile.none { background: var(--surface-2); color: var(--faint); }
.subm-tile.submitted { border-color: var(--sky); box-shadow: inset 0 -3px 0 var(--sky); }
.subm-tile.returned { border-color: var(--late); box-shadow: inset 0 -3px 0 var(--late); }
.subm-tile.graded { border-color: #bfe3cf; }
.subm-tile .sc { font-family: var(--hand); font-weight: 800; font-size: 18px; color: var(--pen); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { width: 92px; height: 92px; border-radius: 9px; border: 1px solid var(--line); background: #fff center/cover no-repeat; display: grid; place-items: center; cursor: pointer; position: relative; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; padding: 4px; text-decoration: none; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; }
.thumb svg { width: 26px; height: 26px; }
.file-link { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); background: #fff; font-size: 14px; }
.file-link:hover { border-color: var(--ink-2); text-decoration: none; }
.file-link svg { width: 18px; height: 18px; color: var(--ink-2); }
.answer { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; background-image: repeating-linear-gradient(transparent 0 27px, var(--rule) 27px 28px); background-position: 0 6px; line-height: 28px; }
.feedback-box { border: 1px solid #f4c3bd; background: #fffaf9; border-radius: 10px; padding: 10px 14px; }
.ai-box { border: 1px dashed #9fb3da; background: var(--ink-mist); border-radius: 10px; padding: 10px 14px; font-size: 14.5px; }
.matrix-work td.cell { min-width: 34px; }
.wk { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.wk.none { background: transparent; color: #c5cddb; }
.wk.over { background: var(--pen-soft); color: var(--pen); }
.wk.submitted { background: var(--sky-bg); color: var(--sky); }
.wk.returned { background: var(--late-bg); color: var(--late); }
.wk.graded { background: var(--ok-bg); color: var(--ok); }
.wk.late { box-shadow: inset 0 0 0 1.5px var(--late); }

/* annotation canvas */
.annot { position: relative; background: #2a3242; border-radius: 10px; overflow: auto; max-height: 68vh; touch-action: none; display: grid; place-items: center; }
.annot canvas { display: block; max-width: 100%; touch-action: none; cursor: crosshair; }
.annot-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.annot-tools .clr { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.annot-tools .clr.on { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- rewards ---------- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.award { position: relative; padding: 10px 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; cursor: pointer; font: inherit; color: inherit; transition: border-color .1s; }
.award:hover { border-color: var(--ink-2); }
.award.sel { border-color: var(--ink); background: var(--ink-mist); box-shadow: 0 0 0 2px var(--ink) inset; }
.award .av { width: 44px; height: 44px; margin: 0 auto 4px; border-radius: 50%; background: var(--ink-soft); color: var(--ink); display: grid; place-items: center; font-family: var(--hand); font-weight: 800; font-size: 21px; }
.award .nm { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award .no { position: absolute; top: 5px; left: 9px; font-size: 11.5px; color: var(--faint); }
.award .lv { position: absolute; top: 5px; right: 8px; font-size: 11px; color: var(--ink-2); }
.award .bal { margin-top: 2px; }
.award .fly { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); pointer-events: none; font-family: var(--hand); font-weight: 800; font-size: 22px; color: var(--star-deep); animation: fly .9s ease-out forwards; }
.award .fly.neg { color: var(--pen); }
@keyframes fly { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, -38px) scale(1.4); } }
.behaviors { display: flex; flex-wrap: wrap; gap: 8px; }
.bh { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: 500 14.5px var(--font); color: var(--text); }
.bh:hover { border-color: var(--ink-2); }
.bh .e { font-size: 19px; }
.bh.neg { border-color: #f0c9c4; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.prize { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.prize .e { font-size: 34px; line-height: 1.1; }
.prize .n { font-weight: 600; }
.prize .d { color: var(--muted); font-size: 13.5px; flex: 1; }
.prize.off { opacity: .55; }
.podium { display: flex; flex-direction: column; gap: 6px; }
.podium .r { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); }
.podium .r.me { background: var(--star-soft); box-shadow: inset 0 0 0 1px #f3d48a; }
.podium .rk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--hand); font-weight: 800; font-size: 17px; background: #fff; border: 1px solid var(--line); flex: none; }
.podium .r:nth-child(1) .rk { background: var(--star); border-color: var(--star); color: #3b2a00; }
.podium .r:nth-child(2) .rk { background: #d9dee8; }
.podium .r:nth-child(3) .rk { background: #efc9a6; }
.mission { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.mission:last-child { border-bottom: 0; }
.mission .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--ink-mist); display: grid; place-items: center; font-size: 21px; flex: none; }
.mission.done .ic { background: var(--ok-bg); }

/* ---------- student home ---------- */
.kid-hero { position: relative; background: var(--ink); color: #fff; border-radius: 16px; padding: 18px 18px 16px; overflow: hidden; }
.kid-hero::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(transparent 0 31px, rgba(255,255,255,.07) 31px 32px); pointer-events: none; }
.kid-hero > * { position: relative; z-index: 1; }
.kid-hero h1 { color: #fff; font-size: 28px; }
.kid-hero .sub { color: #c8d4ee; font-size: 14px; }
.kid-hero .sticker { position: absolute; right: 14px; top: 12px; }
.kid-hero .lvl { margin-top: 12px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: #dbe4f7; }
.kid-hero .lvl .meter { flex: 1; background: rgba(255,255,255,.2); height: 10px; border-radius: 5px; }
.kid-hero .lvl .meter i { background: var(--star); }
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: 16px; border: 0; background: var(--star); color: #3b2a00; font: 600 18px var(--font); cursor: pointer; text-align: left; text-decoration: none; box-shadow: 0 3px 0 var(--star-deep); }
.scan-cta:hover { text-decoration: none; filter: brightness(1.03); }
.scan-cta svg { width: 34px; height: 34px; flex: none; }
.scan-cta small { display: block; font-weight: 400; font-size: 13.5px; opacity: .85; }
.scan-cta.done { background: var(--ok-bg); color: var(--ok); box-shadow: 0 3px 0 #a9d8bd; }
.mini-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mini-cover { position: relative; padding: 10px 12px 10px 20px; border-radius: 5px 11px 11px 5px; background: var(--c); color: #fff; text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-height: 96px; }
.mini-cover::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: rgba(0,0,0,.22); border-radius: 5px 0 0 5px; }
.mini-cover:hover { text-decoration: none; filter: brightness(1.05); }
.mini-cover b { font-family: var(--hand); font-weight: 800; font-size: 18px; line-height: 1.2; }
.mini-cover .star { color: #fff; margin-top: auto; font-size: 16px; }
.mini-cover .star::before { background: var(--star); }
.result-big { text-align: center; padding: 22px 10px 6px; }
.result-big .sticker { width: 110px; height: 110px; font-size: 34px; }
.result-big h2 { font-family: var(--hand); font-weight: 800; font-size: 30px; margin-top: 10px; }

/* scanner */
.scanner { position: relative; background: #000; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3/4; max-height: 58vh; margin: 0 auto; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 17%; border: 3px solid var(--star); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.38); }
.scan-result { text-align: center; padding: 14px; border-radius: var(--r-lg); margin-top: 12px; }
.scan-result.ok { background: var(--ok-bg); color: var(--ok); }
.scan-result.err { background: var(--bad-bg); color: var(--bad); }

/* ---------- parent ---------- */
.report-card { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.report-card .rc-head { display: flex; gap: 14px; align-items: center; padding: 14px 18px; background: var(--ink-mist); border-bottom: 1px solid var(--line-2); }
.report-card .rc-head h2 { font-family: var(--hand); font-weight: 800; font-size: 25px; color: var(--ink-deep); }
.report-card .rc-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.report-card .rc-row:last-child { border-bottom: 0; }
.report-card .rc-row .ic { width: 30px; font-size: 19px; flex: none; text-align: center; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; background: var(--paper); }
.lnav { display: flex; align-items: center; gap: 16px; padding: 12px max(20px, calc(50vw - 570px)); background: var(--ink-deep); color: #dbe4f5; position: sticky; top: 0; z-index: 20; }
.lbrand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.lbrand:hover { text-decoration: none; }
.lbrand .mark { width: 36px; height: 36px; }
.lbrand b { font-family: var(--hand); font-weight: 800; font-size: 22px; }
.llinks { display: flex; gap: 4px; margin-left: 10px; }
.llinks a { color: #c9d5ec; font-size: 14.5px; padding: 6px 10px; border-radius: 8px; }
.llinks a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.lacts { margin-left: auto; display: flex; gap: 8px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 420px); gap: 3.2rem; align-items: center; padding: 3rem max(20px, calc(50vw - 570px)) 3.6rem; background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
/* exercise-book page: blue rules and the red margin line */
.hero::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(transparent 0 35px, var(--rule) 35px 36px); opacity: .55; pointer-events: none; }
.hero::after { content: ''; position: absolute; top: 0; bottom: 0; left: max(8px, calc(50vw - 600px)); width: 2px; background: var(--margin); opacity: .7; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.15; color: var(--ink-deep); margin-bottom: 14px; text-wrap: balance; }
.hero .lead { font-size: 17.5px; max-width: 32em; color: var(--muted); line-height: 36px; }
.hero .who { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; }
.hero .who div { display: flex; gap: 9px; align-items: baseline; font-size: 15px; }
.hero .who b { font-family: var(--hand); font-weight: 800; font-size: 20px; color: var(--ink); }
.hero .marks { position: absolute; right: max(20px, calc(50vw - 600px)); top: 18px; }
.login-card { background: #fff; color: var(--text); border-radius: 16px; padding: 22px 22px 18px; box-shadow: var(--pop); border: 1px solid var(--line); position: relative; }
.login-card h2 { font-family: var(--hand); font-weight: 800; font-size: 26px; color: var(--ink-deep); }
.login-card .seg { width: 100%; margin: 12px 0 14px; }
.login-card .seg button { flex: 1; }
.login-card .alt { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 14px; display: grid; gap: 6px; }
.demo-box { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--star-soft); font-size: 13.5px; }
.demo-box .chips { margin-top: 6px; }
.lsec { padding: 3.2rem 0; }
.lsec.white { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.lsec h2 { font-family: var(--hand); font-weight: 800; font-size: 32px; color: var(--ink-deep); margin-bottom: 6px; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.flow .col { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.flow .col h3 { font-family: var(--hand); font-weight: 800; font-size: 23px; color: var(--ink-deep); margin-bottom: 8px; }
.flow .col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.flow .col li { display: grid; grid-template-columns: 26px 1fr; gap: 6px; font-size: 14.5px; color: var(--muted); }
.flow .col li b { color: var(--text); font-weight: 600; display: block; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tool-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.tool-card:hover { border-color: var(--ink-2); text-decoration: none; }
.tool-card .e { font-size: 28px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ink-mist); flex: none; }
.tool-card b { display: block; }
.tool-card span { font-size: 13px; color: var(--muted); }
.lfoot { background: var(--ink-deep); color: #a9b9de; padding: 1.8rem 0; font-size: 14px; }
.lfoot b { color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 16px; background: #fff; font: 500 13.5px var(--font); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(st); width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); color: var(--ink); display: grid; place-items: center; font-family: var(--hand); font-weight: 800; font-size: 18px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14.5px; }
.maint { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }

/* ---------- modal & toast & dropdown ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 28, 52, .48); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px 14px; overflow-y: auto; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 8vh - 14px); display: flex; flex-direction: column; box-shadow: var(--pop); animation: pop .16s ease-out; }
.modal.lg { width: min(860px, 100%); }
.modal.xl { width: min(1100px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 8px; }
.modal-head h2 { flex: 1; font-size: 18.5px; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { background: var(--ink-deep); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14.5px; box-shadow: var(--pop); animation: pop .16s ease-out; }
.toast.ok { box-shadow: var(--pop), inset 4px 0 0 var(--star); }
.toast.err { background: #8b2219; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--pop); min-width: 310px; z-index: 50; overflow: hidden; animation: pop .12s ease-out; }
.dropdown .list > li { padding: 10px 14px; }
.notif.unread .title { font-weight: 600; }
.notif.unread::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pen); flex: none; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.prose { white-space: pre-wrap; line-height: 1.75; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: inline-block; }
.qr-box svg { width: 180px; height: 180px; display: block; }
.big-code { font-family: var(--hand); font-weight: 800; font-size: 44px; letter-spacing: 8px; color: var(--ink-deep); line-height: 1.1; }
.md h2 { font-size: 18px; margin: 18px 0 6px; color: var(--ink-deep); }
.md h3 { font-size: 16px; margin: 14px 0 4px; }
.md ul, .md ol { margin: 4px 0 10px; padding-left: 22px; }
.md p { margin: 0 0 8px; }

/* ---------- tools ---------- */
.tool-stage { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.wheel-wrap { position: relative; width: min(520px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; }
.wheel-wrap .pointer { position: absolute; top: 50%; right: -6px; transform: translateY(-50%); width: 0; height: 0; border-top: 18px solid transparent; border-bottom: 18px solid transparent; border-right: 34px solid var(--pen); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.picked { font-family: var(--hand); font-weight: 800; font-size: clamp(30px, 5vw, 64px); color: var(--ink-deep); text-align: center; min-height: 1.3em; }
.timer-face { font-family: var(--hand); font-weight: 800; font-size: clamp(80px, 18vw, 240px); line-height: 1; text-align: center; color: var(--ink-deep); font-variant-numeric: tabular-nums; }
.timer-face.warn { color: var(--late); }
.timer-face.done { color: var(--pen); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.noise-meter { height: 46px; border-radius: 23px; background: var(--line-2); overflow: hidden; position: relative; }
.noise-meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--ok) 0 55%, var(--star) 55% 78%, var(--pen) 78%); transition: width .08s linear; }
.noise-meter .lim { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink-deep); }
.noise-face { font-size: clamp(90px, 16vw, 200px); text-align: center; line-height: 1.1; }
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.group-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.group-card h3 { padding: 8px 14px; background: var(--c, var(--ink)); color: #fff; font-family: var(--hand); font-weight: 800; font-size: 20px; }
.group-card ol { margin: 0; padding: 8px 14px 10px 34px; font-size: 14.5px; }
.seats { display: grid; gap: 8px; }
.seat { border: 1px solid var(--line); border-radius: 9px; background: #fff; min-height: 56px; padding: 6px; text-align: center; font-size: 13.5px; display: grid; place-items: center; cursor: grab; user-select: none; }
.seat.empty { background: var(--surface-2); color: var(--faint); border-style: dashed; }
.seat.drag { opacity: .4; }
.seat.over { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink-soft); }
.teacher-desk { text-align: center; margin: 0 auto 14px; width: 40%; min-width: 160px; padding: 6px; border-radius: 8px; background: var(--ink); color: #fff; font-family: var(--hand); font-weight: 800; font-size: 18px; }
.tt { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13.5px; }
.tt th, .tt td { border: 1px solid #9aa7bd; padding: 0; text-align: center; height: 62px; }
.tt th { background: var(--ink-mist); font-weight: 600; height: 40px; }
.tt td[contenteditable] { padding: 4px; outline: none; vertical-align: middle; line-height: 1.3; }
.tt td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--ink-2); }
.tt td.brk { background: var(--surface-2); color: var(--faint); font-size: 12px; writing-mode: vertical-rl; }
.bubble-sheet { font-family: var(--font); color: #000; }

/* ---------- print ---------- */
#print-root { display: none; }
.print-a4 { width: 210mm; min-height: 297mm; padding: 14mm 14mm; margin: 0 auto; background: #fff; color: #000; font-family: var(--font); font-size: 11pt; line-height: 1.5; }
.print-a4.land { width: 297mm; min-height: 210mm; }
.print-a4 h1 { font-family: var(--font); font-size: 16pt; font-weight: 600; color: #000; text-align: center; margin-bottom: 4mm; }
.print-a4 table { width: 100%; border-collapse: collapse; }
.print-a4 th, .print-a4 td { border: 1px solid #444; padding: 2px 5px; }
.print-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; padding: 8mm; font-family: var(--font); }
.print-cards .card { border: 1px dashed #777; border-radius: 3mm; padding: 3mm 4mm; break-inside: avoid; font-size: 9.5pt; line-height: 1.4; display: grid; grid-template-columns: 26mm 1fr; gap: 3mm; align-items: center; }
.print-cards .card svg { width: 26mm; height: 26mm; display: block; }
.print-cards .card b { font-size: 11pt; }
.print-cards .card .big { font-family: var(--hand); font-weight: 800; font-size: 15pt; letter-spacing: 1px; }
.exam-print { font-size: 12pt; line-height: 1.6; }
.exam-print .q { break-inside: avoid; margin-bottom: 4mm; }
.exam-print .ch { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8mm; padding-left: 6mm; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block; }
  .print-break { break-after: page; }
  .mk, .badge, .grade { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; padding-bottom: 2.6rem; }
  .flow { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 16px; }
  .board .qr { width: min(70vw, 46vh); }
}
@media (max-width: 900px) {
  :root { --top: 56px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(300px, 86vw); }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .shell.nav-open .scrim { position: fixed; inset: 0; background: rgba(10,18,40,.45); z-index: 35; }
  .main { margin-left: 0; padding-bottom: 70px; }
  .topbar { padding: 0 8px; gap: 4px; background: var(--ink-deep); border-bottom: 0; color: #fff; }
  .topbar .icon-btn { color: #fff; }
  .topbar .icon-btn:hover { background: rgba(255,255,255,.08); }
  .topbar .menu-btn { display: grid; }
  .topbar .today, .user-chip .who { display: none; }
  .topbar .title-sm { display: block; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
  .user-chip { border: 0; padding: 0; background: none; }
  .banner { padding: 9px 16px; }
  .view { padding: 14px 14px 40px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 30; }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11.5px; color: var(--faint); text-decoration: none; position: relative; }
  .bottom-nav a svg { width: 23px; height: 23px; }
  .bottom-nav a.active { color: var(--ink-deep); font-weight: 600; }
  .bottom-nav a.active svg { color: var(--ink); }
  .bottom-nav a.scan { color: #3b2a00; }
  .bottom-nav a.scan span.b { width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; background: var(--star); display: grid; place-items: center; box-shadow: 0 3px 0 var(--star-deep), 0 6px 14px -6px rgba(0,0,0,.4); }
  .bottom-nav a .dot { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--pen); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; }
  h1 { font-size: 26px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .tbl.stack-sm thead { display: none; }
  .tbl.stack-sm, .tbl.stack-sm tbody, .tbl.stack-sm tr, .tbl.stack-sm td { display: block; width: 100%; }
  .tbl.stack-sm tr { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl.stack-sm td { border: 0; padding: 2px 0 !important; display: flex; gap: 10px; }
  .tbl.stack-sm td[data-label]::before { content: attr(data-label); color: var(--faint); font-size: 13px; min-width: 96px; flex: none; }
  .tbl.stack-sm td.actions { justify-content: flex-start; padding-top: 6px !important; }
  .tbl.stack-sm td.actions::before { display: none; }
  .att-list li { flex-wrap: wrap; padding: 9px 12px; }
  .att-list .nm { flex-basis: calc(100% - 40px); }
  .att-pick { width: 100%; padding-left: 38px; }
  .att-pick button { flex: 1; min-width: 0; }
  .sticky-save { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .class-head { padding: 12px 14px 12px 24px; gap: 10px; }
  .class-head h1 { font-size: 24px; }
  .class-head .jc { margin-left: 0; }
  .class-tabs { padding: 0 4px; }
  .kv { grid-template-columns: 110px 1fr; }
  .overlay { padding: 8px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 16px); border-radius: 16px 16px 12px 12px; }
  .dropdown { position: fixed; left: 8px; right: 8px; top: 60px; min-width: 0; }
  .llinks { display: none; }
  .lnav { padding: 10px 14px; }
  .hero { padding: 1.6rem 18px 2.2rem 26px; }
  .hero::after { left: 12px; }
  .hero .lead { font-size: 16px; line-height: 32px; }
  .covers { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .cover { min-height: 176px; padding: 12px 12px 11px 22px; }
  .cover .label .ln b { font-size: 16px; }
  .award-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .kpi b { font-size: 26px; }
}

/* =====================================================================
   Refresh: cream + orange + navy, rounded cards (applies on top of the base rules above)
   ===================================================================== */
body { background: var(--paper); color: var(--text); }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); }
h2, h3 { font-weight: 800; color: var(--ink-deep); }
a:hover { color: var(--brand-deep); }

/* shell: light sidebar, glassy top bar */
.sidebar { background: #fff; color: var(--text); border-right: 1px solid var(--line); }
.brand { padding: 18px 18px 12px; }
.brand b { color: var(--ink-deep); font-weight: 900; font-size: 18px; }
.brand span { color: var(--faint); }
.nav-label { color: #94a3b8; font-weight: 700; font-size: 12px; letter-spacing: .02em; padding-top: 4px; }
.nav a { color: #475569; font-weight: 500; border-radius: 12px; padding: 9px 12px; }
.nav a svg { color: #94a3b8; }
.nav a:hover { background: var(--brand-50); color: var(--ink-deep); text-decoration: none; }
.nav a.active { background: var(--brand-100); color: var(--brand-700); font-weight: 700; }
.nav a.active svg { color: var(--brand-deep); }
.nav a.cls small { color: #94a3b8; }
.nav a.cls .tab { width: 10px; height: 10px; border-radius: 4px; }
.topbar { background: rgba(255, 252, 247, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: var(--brand-50); }
.user-chip { border-radius: 999px; border-color: var(--line); background: #fff; }
.avatar { background: var(--brand-100); color: var(--brand-700); font-weight: 800; }
.view { padding: 26px 30px 70px; }
.page-head h1 { font-size: 30px; }
.crumb { font-weight: 600; }

/* buttons */
.btn { --bd: #dbe2ec; border-radius: 12px; font-weight: 700; min-height: 42px; }
.btn:hover { --bd: #cbd5e1; }
.btn-primary { --bg: var(--brand); --fg: #1a1a1a; --bd: var(--brand); font-weight: 800; }
.btn-primary:hover { --bg: var(--brand-deep); --bd: var(--brand-deep); --fg: #1a1a1a; color: #1a1a1a; }
.btn-star { --bg: var(--ink-deep); --fg: #fff; --bd: var(--ink-deep); font-weight: 800; }
.btn-star:hover { --bg: #1b3a75; --bd: #1b3a75; color: #fff; }
.btn-green { --bg: #ecfdf5; --fg: #047857; --bd: #6ee7b7; font-weight: 800; }
.btn-green:hover { --bg: #d1fae5; --bd: #34d399; color: #047857; }
.btn-pen:hover, .btn-danger:hover { color: var(--bad); }
.btn-ghost:hover { --bg: var(--brand-50); }
.btn-sm { border-radius: 10px; min-height: 34px; }
.btn-lg { border-radius: 16px; min-height: 54px; font-weight: 800; }
.btn-light { --bg: rgba(255,255,255,.1); --fg: #fff; --bd: rgba(255,255,255,.3); }
.btn-light:hover { color: #fff; }
a.btn:hover { color: var(--fg); }
.link-btn { font-weight: 600; }

/* surfaces */
.panel { border-radius: var(--r-lg); border-color: var(--line); box-shadow: var(--soft); }
.panel > .panel-head { padding: 14px 20px; }
.panel > .panel-head h3 { font-size: 16.5px; }
.panel > .panel-body { padding: 18px 20px; }
.note { border-radius: 14px; }
.note.ink { background: var(--brand-50); border-color: var(--brand-200); }
.kpi { border-radius: 18px; padding: 14px 16px; box-shadow: var(--soft); }
.kpi b { font-weight: 900; font-size: 30px; }
.kpi span { font-weight: 500; }
.kpi.gold b { color: var(--brand-deep); }
a.kpi:hover { border-color: var(--brand-200); box-shadow: var(--chunky); }
.meter { border-radius: 999px; }
.meter i { background: var(--brand); border-radius: 999px; }
.meter.gold i { background: #f59e0b; }
.badge { font-weight: 700; padding: 0 10px; }
.badge.ink { background: var(--brand-100); color: var(--brand-700); }
.chip { border-radius: 999px; font-weight: 600; padding: 4px 12px; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #1a1a1a; }
.input, select.input, textarea.input { border-radius: 12px; border-color: #d9e0ea; }
.input:focus { border-color: var(--brand); }
.check input { accent-color: var(--brand); }
.switch input:checked { background: var(--brand); }
.emoji-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.tabs a, .tabs button { font-weight: 600; }
.tabs a.active, .tabs button.active { color: var(--brand-700); border-bottom-color: var(--brand); }
.tabs a.active svg { color: var(--brand); }
.seg { background: #eef2f6; border-radius: 14px; padding: 4px; }
.seg button { border-radius: 10px; font-weight: 600; }
.seg button.active { color: var(--ink-deep); font-weight: 800; box-shadow: 0 1px 3px rgba(16,35,74,.14); }
.tbl th { background: #f8fafc; color: var(--faint); }
.list > li.link:hover, .tbl tbody tr.link:hover td { background: var(--brand-50); }
.spin { border-color: var(--brand-100); border-top-color: var(--brand); }
.empty svg { color: #fdba74; }
.steps li::before { border: 0; background: var(--ink-deep); color: #fff; border-radius: 12px; font-weight: 900; font-size: 16px; }
.overlay { background: rgba(16, 35, 74, .42); }
.modal { border-radius: 22px; }
.modal-head h2 { font-weight: 800; }
.dropdown { border-radius: 18px; }
.toast { border-radius: 14px; font-weight: 500; }
.toast.ok { box-shadow: var(--pop), inset 4px 0 0 var(--brand); }
.form-error { border-radius: 12px; }
.grade { font-weight: 800; border-radius: 10px; }
.big-code { font-weight: 900; }
.qr-box { border-radius: 18px; }

/* classroom cards (were notebook covers): colour band + emoji tile + label */
.covers { gap: 18px; }
.cover { background: linear-gradient(135deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 70%, #fff)) top / 100% 92px no-repeat, #fff;
  color: var(--text); border: 1px solid var(--line); border-radius: 22px; padding: 122px 18px 16px; min-height: 0; overflow: hidden;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c, var(--brand)) 26%, #fff); }
.cover::before, .cover::after { display: none; }
.cover:hover { transform: translateY(-3px); color: var(--text); }
.cover .flags { order: 3; margin: 10px 0 0; gap: 6px; }
.cover .flags:empty { display: none; }
.cover .flag { background: var(--brand-50); color: var(--brand-700); font-weight: 700; border: 1px solid var(--brand-100); }
.cover .flag.hot { background: #fee2e2; color: var(--pen); border-color: #fecaca; }
.cover .emo { position: absolute; top: 60px; left: 16px; width: 58px; height: 58px; display: grid; place-items: center; background: #fff; border-radius: 18px; box-shadow: 0 6px 16px -6px rgba(16,35,74,.3); font-size: 30px; }
.cover .label { margin-top: 0; background: none; box-shadow: none; padding: 0; border-radius: 0; }
.cover .label .ln { border: 0; padding: 0; font-size: 13px; color: var(--faint); }
.cover .label .ln:first-child { font-size: 0; margin-bottom: 4px; }
.cover .label .ln:first-child b { flex: 1; min-width: 0; font-size: 18px; font-weight: 900; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cover .label .ln:not(:first-child) b { font-size: 14px; font-weight: 700; color: var(--ink-deep); flex: none; }
.cover .label .ln span { margin-left: auto; }
.cover.add { background: var(--brand-50); border: 2px dashed var(--brand-200); color: var(--brand-700); box-shadow: none; padding: 18px; min-height: 230px; }
.cover.add:hover { border-color: var(--brand); }
.class-head { border-radius: var(--r-xl); padding: 18px 22px; background: radial-gradient(circle at 92% 0%, rgba(255,255,255,.28), transparent 42%), linear-gradient(120deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 86%, #000)); box-shadow: 0 4px 0 color-mix(in srgb, var(--c, var(--brand)) 30%, #fff); }
.class-head::before { display: none; }
.class-head .emo { width: 58px; height: 58px; display: grid; place-items: center; background: #fff; border-radius: 18px; font-size: 30px; }
.class-head h1 { font-size: 28px; }
.class-head .jc { border-radius: 16px; padding: 8px 16px 6px; }
.class-head .jc b { font-weight: 900; }
.class-tabs { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 0 8px; box-shadow: var(--soft); }
.class-tabs.tabs { border-bottom: 1px solid var(--line); }
.mini-cover { border-radius: 20px; padding: 14px 16px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 86%, #000)); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 28%, #fff); }
.mini-cover::before { display: none; }
.mini-cover b { font-weight: 900; }

/* attendance, work, gradebook */
.att-pick button { border-radius: 10px; font-weight: 600; }
.matrix th, .gb thead th { background: #f8fafc; }
.gb thead tr.kinds th { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.gb td input:focus { border-color: var(--brand); }
.gb td input.dirty { background: var(--brand-50); }
.work-card .due { border-radius: 12px; }
.work-card .due b { font-weight: 900; }
.subm-tile { border-radius: 14px; }
.subm-tile:hover, .award:hover, .bh:hover, .tool-card:hover, .file-link:hover { border-color: var(--brand); }
.answer { border-radius: 14px; }
.feedback-box, .ai-box { border-radius: 14px; }
.ai-box { background: #f5f3ff; border-color: #c4b5fd; }

/* projector screen */
.board { background: radial-gradient(circle at 15% 0%, rgba(249,115,22,.22), transparent 40%), #10234a; }
.board .qr { border-radius: 26px; }
.board .code { color: #fdba74; font-weight: 900; }
.board .tally b { font-weight: 900; }
.board .nm { font-weight: 600; }

/* rewards */
.award { border-radius: 18px; }
.award.sel { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand) inset; }
.award .av { background: var(--brand-100); color: var(--brand-700); font-weight: 900; }
.award .lv { color: var(--brand-700); font-weight: 700; }
.bh { font-weight: 600; }
.prize { border-radius: 20px; box-shadow: var(--soft); }
.prize .n { font-weight: 800; }
.podium .r { border-radius: 14px; }
.mission .ic { border-radius: 14px; background: var(--brand-100); }
.group-card { border-radius: 18px; }
.group-card h3 { font-weight: 800; }

/* student & parent */
.kid-hero { background: radial-gradient(circle at 88% 0%, rgba(249,115,22,.55), transparent 48%), radial-gradient(circle at 0% 100%, rgba(52,211,153,.25), transparent 40%), #10234a; border-radius: var(--r-xl); padding: 20px 20px 18px; }
.kid-hero::after { display: none; }
.kid-hero h1 { font-weight: 900; }
.kid-hero .lvl .meter i { background: var(--brand); }
.scan-cta { background: var(--brand); color: #1a1a1a; border-radius: 20px; box-shadow: 0 4px 0 var(--brand-700); font-weight: 800; }
.scan-cta:hover { color: #1a1a1a; }
.scan-cta.done { background: #ecfdf5; color: #047857; box-shadow: 0 4px 0 #a7f3d0; }
.report-card { border-radius: var(--r-xl); box-shadow: var(--soft); }
.report-card .rc-head { background: linear-gradient(120deg, var(--brand-50), #fff); }
.report-card .rc-head h2 { font-weight: 900; }
.result-big h2 { font-weight: 900; }

/* tools */
.tool-card { border-radius: 18px; box-shadow: var(--soft); }
.tool-card .e { background: var(--brand-100); border-radius: 14px; }
.tool-card b { font-weight: 800; }
.tool-stage { border-radius: 22px; box-shadow: var(--soft); }
.teacher-desk { background: var(--ink-deep); border-radius: 12px; }
.seat { border-radius: 12px; }
.seat.over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }

/* landing (public pages) */
.landing { background: var(--paper); }
.lnav { background: rgba(255, 252, 247, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text); border-bottom: 1px solid var(--brand-100); }
.lbrand, .lbrand:hover { color: var(--ink-deep); }
.lbrand b { font-weight: 900; font-size: 20px; }
.llinks a { color: #475569; font-weight: 600; }
.llinks a:hover { color: var(--ink-deep); background: var(--brand-50); }
.hero { background: linear-gradient(180deg, rgba(255, 237, 213, .65), var(--paper) 55%, #fff); border-bottom: 1px solid var(--brand-100); padding-top: 3.4rem; padding-bottom: 4rem; }
.hero::before { inset: auto; left: -80px; top: 64px; width: 260px; height: 260px; border-radius: 50%; background: rgba(254, 215, 170, .45); background-image: none; filter: blur(50px); opacity: 1; }
.hero::after { left: auto; right: -96px; top: -20px; bottom: auto; width: 340px; height: 340px; border-radius: 50%; background: rgba(254, 243, 199, .8); filter: blur(60px); opacity: 1; }
.hero h1 { font-weight: 900; letter-spacing: -.02em; line-height: 1.18; color: var(--ink-deep); }
.hero h1 .hl { display: block; color: var(--brand); }
.hero .lead { color: var(--muted); line-height: 1.8; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid #fdba74; background: rgba(255,255,255,.9); color: var(--brand-700); font-weight: 800; font-size: 14px; margin-bottom: 16px; }
.pill svg { width: 16px; height: 16px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.ticks span { display: inline-flex; align-items: center; gap: 6px; }
.ticks svg { width: 18px; height: 18px; color: var(--ok); }
.hero .who { margin-top: 22px; }
.hero .who b { font-weight: 900; color: var(--brand-700); }
.login-card { border-radius: var(--r-xl); border: 2px solid var(--brand-200); box-shadow: var(--chunky), 0 30px 50px -30px rgba(249, 115, 22, .45); }
.login-card h2 { font-weight: 900; }
.demo-box { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 16px; }
.demo-box .chip { border-color: #6ee7b7; }
.lsec { padding: 4rem 0; }
.lsec h2 { font-weight: 900; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.01em; }
.eyebrow { display: block; color: var(--brand-deep); font-weight: 800; font-size: 13px; letter-spacing: .14em; margin-bottom: 8px; }
.flow .col { border-radius: var(--r-xl); padding: 22px; box-shadow: var(--soft); }
.flow .col h3 { font-weight: 900; }
.flow .col li { grid-template-columns: 42px 1fr; gap: 10px; align-items: start; }
.flow .col li > span { width: 42px; height: 42px; border-radius: 14px; background: var(--brand-100); display: grid; place-items: center; font-size: 20px; }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.feat { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--soft); transition: transform .12s, box-shadow .12s; }
.feat:hover { transform: translateY(-2px); box-shadow: var(--chunky); border-color: var(--brand-200); }
.feat .no { position: absolute; top: 18px; right: 20px; font-weight: 900; color: #fdba74; font-size: 14px; }
.feat .ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-700); margin-bottom: 14px; }
.feat .ic svg { width: 24px; height: 24px; }
.feat .ic.blue { background: #dbeafe; color: #2563eb; } .feat .ic.green { background: #d1fae5; color: #059669; } .feat .ic.amber { background: #fef3c7; color: #b45309; }
.feat .ic.violet { background: #ede9fe; color: #7c3aed; } .feat .ic.rose { background: #ffe4e6; color: #e11d48; }
.feat h3 { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.feat p { margin: 0; color: var(--muted); font-size: 14.5px; }
.cta-band { border-radius: 32px; background: radial-gradient(circle at 90% 10%, rgba(249,115,22,.45), transparent 45%), #10234a; color: #fff; padding: clamp(28px, 5vw, 52px); display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c7d2e5; margin: 6px 0 0; }
.cta-band .row { gap: 10px; }
.lfoot { background: var(--ink-deep); color: #a9b9de; }

/* mobile */
@media (max-width: 900px) {
  .topbar { background: rgba(255, 252, 247, .94); color: var(--text); border-bottom: 1px solid var(--line); }
  .topbar .icon-btn { color: var(--text); }
  .topbar .icon-btn:hover { background: var(--brand-50); }
  .topbar .title-sm { color: var(--ink-deep); font-weight: 800; }
  .view { padding: 16px 14px 40px; }
  .bottom-nav { background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
  .bottom-nav a.active { color: var(--brand-700); }
  .bottom-nav a.active svg { color: var(--brand); }
  .bottom-nav a.scan { color: #1a1a1a; }
  .bottom-nav a.scan span.b { background: var(--brand); box-shadow: 0 3px 0 var(--brand-700), 0 6px 14px -6px rgba(0,0,0,.4); }
  .cover { padding: 112px 14px 14px; background-size: 100% 84px; }
  .cover .emo { top: 54px; width: 52px; height: 52px; font-size: 26px; }
  .cover .label .ln:first-child b { font-size: 16px; }
  .cover.add { min-height: 200px; }
  .class-head { padding: 14px 16px; }
  .class-head .emo { width: 48px; height: 48px; font-size: 26px; border-radius: 14px; }
  .feats { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .hero { padding: 2rem 18px 2.6rem; }
}
@media (min-width: 901px) and (max-width: 1100px) { .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
