/* Wren School app (admin CRM, teacher and parent portals).
   Preply-style patterns: white canvas, card layout, bold sans headings, one strong accent. */
:root {
  --oxford: #002147; --oxford-2: #0b2e5c; --tint: #eef2f8; --tint-2: #f6f8fb;
  --gold: #c8a24a; --gold-soft: #fbf4e2;
  --text: #121826; --muted: #5b6474; --line: #e4e8ef; --bg: #ffffff;
  --ok: #157f3b; --ok-soft: #e7f6ec; --warn: #9a6700; --warn-soft: #fff4d6; --err: #b42318; --err-soft: #fdecea;
  --radius: 14px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --top: 60px; --side: 232px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--oxford); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 .75em; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .small { font-size: 13px; }
:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }

/* ---------- top bar + shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--oxford); font: 600 19px/1 var(--display); }
.role-chip { font-size: 12px; font-weight: 600; color: var(--oxford); background: var(--tint); padding: 4px 10px; border-radius: 999px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 999px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .uname { font-weight: 500; }
.usermenu .menu { position: absolute; right: 0; top: 46px; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--tint-2); }
.menu-email { font-size: 13px; color: var(--muted); padding: 6px 10px; margin: 0; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--oxford); color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidenav { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav-item:hover { background: var(--tint-2); }
.nav-item.is-active { background: var(--tint); color: var(--oxford); font-weight: 600; }
.badge { margin-left: auto; background: var(--gold); color: #1b1300; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.content { padding: 28px 32px 64px; max-width: 1180px; width: 100%; }
.content.wide { max-width: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabbar { display: none; }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--tint-2); }
.btn-primary { background: var(--oxford); border-color: var(--oxford); color: #fff; }
.btn-primary:hover { background: var(--oxford-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1b1300; }
.btn-danger { color: var(--err); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--oxford); font: inherit; text-decoration: underline; cursor: pointer; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.tint { background: var(--tint-2); box-shadow: none; }
.grid { display: grid; gap: 20px; }
.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, 2fr) minmax(280px, 1fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { border-color: #c9d3e1; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--oxford); }
.stat-label { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--oxford); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); } .pill.gold { background: var(--gold-soft); color: #6b5212; }
.pill.grey { background: #f1f2f4; color: #4b5563; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); } .flash.err { background: var(--err-soft); color: var(--err); }
.notice { background: var(--tint); padding: 10px 14px; border-radius: 10px; }
.form-error { background: var(--err-soft); color: var(--err); padding: 10px 14px; border-radius: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--tint-2); padding: 10px 14px; white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: #fbfcfe; }
.table a { font-weight: 600; text-decoration: none; }

/* forms */
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: #344054; }
input, select, textarea { font: 15px/1.4 var(--font); color: var(--text); padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff; width: 100%; min-height: 42px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--oxford); box-shadow: 0 0 0 3px rgba(0,33,71,.12); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--oxford); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 160px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented a { padding: 8px 14px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 14px; }
.segmented a.is-active { background: var(--oxford); color: #fff; }

/* ---------- CRM pipeline (kanban) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--tint-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drop { outline: 2px dashed var(--oxford); outline-offset: -4px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; font-size: 14px; }
.col-head .count { color: var(--muted); font-weight: 600; }
.lead-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); cursor: grab; }
.lead-card:hover { border-color: #c9d3e1; }
.lead-card.dragging { opacity: .5; }
.lead-card .name { font-weight: 600; } .lead-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.lead-card .move { margin-top: 8px; }
.lead-card .move select { min-height: 30px; padding: 4px 8px; font-size: 12px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; color: var(--oxford); }
.timeline .dot .ico { width: 15px; height: 15px; }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .body { white-space: pre-wrap; }
dl.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; } dl.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* lessons (Preply-like lesson cards) */
.lesson { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.lesson:first-child { border-top: 0; }
.lesson .date { text-align: center; background: var(--tint); border-radius: 12px; padding: 8px 4px; color: var(--oxford); }
.lesson .date b { display: block; font-size: 20px; line-height: 1; } .lesson .date span { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.lesson .title { font-weight: 600; } .lesson .sub { color: var(--muted); font-size: 13px; }
.next-lesson { background: linear-gradient(135deg, var(--oxford), #183e70); color: #fff; border: 0; }
.next-lesson .card-title, .next-lesson a:not(.btn) { color: #fff; }
.next-lesson .muted { color: #c9d3e1; }

/* talk time bars */
.talk { display: grid; gap: 8px; }
.talk-row { display: grid; grid-template-columns: 140px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.talk-bar { height: 10px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.talk-bar i { display: block; height: 100%; background: var(--oxford); border-radius: 999px; }
.talk-row.teacher .talk-bar i { background: var(--gold); }
.summary-block h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 6px; }
.summary-block ul { margin: 0; padding-left: 20px; }

/* chat */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 190px); min-height: 460px; background: #fff; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.chat-list a.is-active { background: var(--tint); }
.chat-list .who { font-weight: 600; } .chat-list .last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.chat-list .unread { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--tint-2); }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--oxford); color: #fff; border-color: var(--oxford); }
.msg .t { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.msg.flagged { border-color: var(--warn); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; height: 44px; }
.chat-note { font-size: 12px; color: var(--muted); padding: 0 12px 10px; }

/* classroom */
.classroom { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; height: calc(100vh - 170px); min-height: 480px; }
.call-frame { width: 100%; height: 100%; border: 0; border-radius: var(--radius); background: #0b1220; }
.call-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b1220; }
.rec-dot { position: absolute; top: 12px; left: 12px; z-index: 5; background: rgba(180,35,24,.92); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.side-panel { overflow-y: auto; }

/* auth */
body.auth { background: var(--tint-2); display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card .brand { margin-bottom: 20px; }
.auth-card h1 { font-size: 24px; margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid-main, .grid-3 { grid-template-columns: 1fr; }
  .classroom { grid-template-columns: 1fr; height: auto; }
  .call-wrap { height: 70vh; }
}
@media (max-width: 760px) {
  :root { --top: 56px; }
  .shell { display: block; }
  .sidenav { display: none; }
  .content { padding: 18px 16px 96px; }
  .page-head h1 { font-size: 23px; }
  .usermenu .uname, .role-chip { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 0; min-height: 44px; }
  .tabbar a.is-active { color: var(--oxford); font-weight: 600; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 210px); }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-main { display: none; }
  .msg { max-width: 88%; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; } dl.kv dd { margin-bottom: 8px; }
  .lesson { grid-template-columns: 56px 1fr; } .lesson > :last-child { grid-column: 1 / -1; }
  .talk-row { grid-template-columns: 100px 1fr 56px; }
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; }
  .toolbar input, .toolbar select { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- agent B: portals + chat (teacher.js, parent.js, chat.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 18px; border-radius: 10px; background: var(--gold-soft); border: 1px solid #ecd9a6; font-size: 14px; }
.preview-bar .segmented { background: #fff; } .preview-bar .segmented a { padding: 6px 10px; font-size: 13px; }
.hero-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-row .date, .lesson .date { text-align: center; background: var(--tint); border-radius: 12px; padding: 8px 4px; color: var(--oxford); min-width: 64px; }
.hero-row .date b { display: block; font-size: 22px; line-height: 1.1; } .hero-row .date span, .lesson .date span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.next-lesson .hero-row .date { background: rgba(255,255,255,.14); color: #fff; }
.hero-act, .lesson-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.people li:first-child { border-top: 0; }
.note-item { padding: 12px 0; border-top: 1px solid var(--line); } .note-item:first-child { border-top: 0; padding-top: 0; }
.note-item .title { font-weight: 600; margin-bottom: 4px; } .note-item p { margin: 4px 0; }
.att-row { border: 0; padding: 8px 0; margin: 0; border-top: 1px solid var(--line); } .att-row legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
details.period { border-top: 1px solid var(--line); padding: 10px 0; } details.period summary { cursor: pointer; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.period[open] summary { margin-bottom: 10px; }
.child-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.child-enr { padding: 8px 0; border-top: 1px solid var(--line); }
.sub-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 8px; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.trend-col i { display: block; width: 100%; max-width: 28px; background: var(--oxford); border-radius: 6px 6px 2px 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-list { list-style: none; margin: 0; padding: 0; } .hw-list li { padding: 8px 0; border-top: 1px solid var(--line); } .hw-list li:first-child { border-top: 0; }
.plan-list { list-style: none; margin: 0; padding: 0; } .plan-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); } .plan-list li:first-child { border-top: 0; }
.consent-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.chat-list-head { margin: 0; padding: 10px 14px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--tint-2); }
.chat-back { display: none; text-decoration: none; font-size: 20px; padding: 0 6px; }
.flag-label { font-weight: 600; }
@media (max-width: 760px) {
  .chat-back { display: inline-block; }
  .chat-list .last { max-width: 70vw; }
  .hero-act { width: 100%; } .hero-act .btn { flex: 1; }
}

/* ---------- admin-ops (agent A): tables stack into label/value rows on phones ---------- */
.ops-rt details > summary { list-style: none; }
@media (max-width: 760px) {
  .ops-rt thead { display: none; }
  .ops-rt, .ops-rt tbody, .ops-rt tr, .ops-rt td { display: block; width: 100%; }
  .ops-rt tr { border-top: 1px solid var(--line); padding: 8px 0; }
  .ops-rt tr:first-child { border-top: 0; }
  .ops-rt td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; border: 0; padding: 4px 14px; }
  .ops-rt td::before { content: attr(data-label); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 3px; }
  .ops-rt td[data-label=""] { grid-template-columns: 1fr; } .ops-rt td[data-label=""]::before { display: none; }
  .ops-rt tr:hover td { background: none; }
}

/* ---------- classroom (agent C: src/app/classroom.js, public/js/classroom.js) ---------- */
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roster li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.roster .dot { width: 10px; height: 10px; border-radius: 50%; background: #d0d5dd; flex: none; }
.roster li.joined .dot { background: var(--ok); }
.class-off { display: grid; place-items: center; min-height: 320px; }
.class-off-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; color: #fff; }
.class-off-msg h2 { font-size: 20px; } .class-off-msg a.btn { margin: 4px; }
.side-panel .talk-row { grid-template-columns: 80px 1fr 64px; font-size: 13px; }
@media (max-width: 760px) { .call-wrap { height: 62vh; min-height: 300px; } .classroom { gap: 12px; } }

/* ---- main session: teacher snapshots grid (admin session page) ---- */
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.snap-grid a { display: block; text-decoration: none; color: var(--muted, #667); font-size: 12px; }
.snap-grid img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #eef1f5; }

/* ---------- whiteboard (public/js/board.js) ---------- */
.stage-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stage-tab { border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 14px var(--font); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.stage-tab.active { background: var(--oxford); border-color: var(--oxford); color: #fff; }
.classroom.has-board { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tabs side" "call side"; }
.classroom.has-board > .stage-tabs { grid-area: tabs; }
.classroom.has-board > .call-wrap { grid-area: call; }
.classroom.has-board > .board-wrap { grid-area: board; display: none; }
.classroom.has-board > .side-panel { grid-area: side; }
.classroom.has-board.mode-board, .classroom.has-board.mode-notes { grid-template-rows: auto 190px minmax(0, 1fr); grid-template-areas: "tabs call" "board call" "board side"; }
.mode-board > .board-wrap[data-board], .mode-notes > .board-wrap[data-notes] { display: flex; }
.board-page { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 210px); min-height: 460px; }
.board-page > .board-wrap { display: none; flex: 1; }
.board-private-note { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 6px 10px; }
.board-wrap { flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.board-bar[hidden] { display: none; }
.board-group { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.board-group[hidden] { display: none; }
.board-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: var(--radius-sm); cursor: pointer; }
.board-btn .ico { width: 18px; height: 18px; }
.board-btn.active { background: var(--tint); border-color: var(--oxford); color: var(--oxford); }
.board-btn:disabled { opacity: .4; cursor: default; }
.board-size i { display: block; border-radius: 50%; background: currentColor; }
.board-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.board-swatch.active { box-shadow: 0 0 0 2px var(--oxford); }
.board-bar select { width: auto; min-width: 0; margin: 0; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 8px; font: 14px var(--font); background: #fff; }
.board-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.board-status { margin-left: auto; }
.board-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.board-canvas { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); touch-action: none; box-shadow: var(--shadow); }
.board-editor { position: absolute; z-index: 3; min-width: 120px; min-height: 1.6em; padding: 2px 4px; margin: 0; border: 1px dashed var(--oxford); background: rgba(255,255,255,.9); font-family: var(--font); line-height: 1.25; resize: both; outline: none; }
.board-editor.note { background: #fff1a8; border: 0; box-shadow: var(--shadow-lg); padding: 10px; resize: none; }
.board-saved { margin: 0 0 14px; }
.board-saved canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
.board-saved figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
@media (max-width: 1000px) {
  .classroom.has-board, .classroom.has-board.mode-board { grid-template-columns: 1fr; grid-template-rows: none; }
  .classroom.has-board { grid-template-areas: "tabs" "call" "side"; }
  .classroom.has-board.mode-board, .classroom.has-board.mode-notes { grid-template-areas: "tabs" "board" "call" "side"; }
  .classroom.mode-board > .call-wrap, .classroom.mode-notes > .call-wrap { height: 34vh; min-height: 200px; }
  .board-page { height: auto; }
  .board-stage { flex: none; }
}
.board-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.board-pages .board-saved { margin: 0; }
.mode-notes [data-tab-hint] { display: none; }
.board-check[hidden] { display: none; }
