:root {
  --navy: #1B4D6B;
  --sky: #C5DCEA;
  --powder: #E8F2F8;
  --teal: #2E8B9B;
  --teal-dark: #23707D;
  --gold: #E9A23B;
  --sage: #7FA88B;
  --rose: #D98E8E;
  --amber-soft: #FBEBD0;
  --white: #FFFFFF;
  --muted: #5E7F93;
  --line: #D6E6F0;
  --shadow: 0 4px 16px rgba(27, 77, 107, 0.08);
  --shadow-lift: 0 8px 28px rgba(27, 77, 107, 0.16);
  --radius: 18px;
  --radius-sm: 14px;
  --head: 'Quicksand', 'Baloo 2', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--navy);
  background-color: var(--powder);
  /* Gingham at ~5% — echoes the Canvas homepage. */
  background-image:
    linear-gradient(90deg, rgba(46, 139, 155, 0.05) 50%, transparent 50%),
    linear-gradient(rgba(46, 139, 155, 0.05) 50%, transparent 50%);
  background-size: 28px 28px;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75em; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Layout ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.topbar a.brand:hover .brand-logo { transform: scale(1.06); }
.brand-logo { transition: transform .15s; }
.topbar .brand svg { width: 34px; height: 34px; }
.brand-logo { height: 34px; width: auto; max-width: 64px; object-fit: contain; }
.topbar .spacer { flex: 1; }
.topbar .brand, .topbar .btn { white-space: nowrap; }
@media (max-width: 520px) { #fund-total { display: none; } }
main { max-width: 1080px; margin: 0 auto; padding: 16px 16px 140px; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 0; max-width: 1080px; margin: 0 auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: 0; background: transparent; padding: 9px 14px; border-radius: 999px;
  font-family: var(--head); font-weight: 700; color: var(--muted); cursor: pointer; position: relative;
}
.tab[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: var(--shadow); }
/* Dropdown menus (top bar). */
.menu-bar { flex-wrap: wrap; overflow: visible; position: relative; z-index: 15; justify-content: center; }
.menu-group { position: relative; }
.menu-btn {
  flex: none; border: 0; background: transparent; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  font-family: var(--head); font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 2px;
}
.menu-btn:hover, .menu-group.open > .menu-btn { color: var(--navy); background: rgba(255, 255, 255, 0.6); }
.menu-group.active > .menu-btn, .menu-btn[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: var(--shadow); }
.menu-btn .caret { font-size: 0.7rem; margin-left: 4px; transition: transform .15s; }
.menu-group.open .caret { transform: rotate(180deg); }
.menu-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; max-width: calc(100vw - 24px);
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: 6px; z-index: 30;
  flex-direction: column; gap: 2px;
}
.menu-group.open .menu-panel { display: flex; }
.menu-panel .menu-link { display: block; padding: 10px 12px; border-radius: 10px; font-family: var(--head); font-weight: 700; color: var(--teal-dark); text-decoration: none; border-top: 1px solid var(--line); margin-top: 2px; }
.menu-panel .menu-link:hover, .menu-panel .menu-link:focus-visible { background: var(--powder); outline: none; }
.menu-panel .tab { text-align: left; border-radius: 10px; padding: 10px 12px; color: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-panel .tab:hover, .menu-panel .tab:focus-visible { background: var(--powder); outline: none; }
.menu-panel .tab[aria-selected="true"] { background: var(--powder); box-shadow: inset 3px 0 0 var(--teal); }
@media (max-width: 520px) {
  .menu-bar { gap: 4px; padding: 10px 10px 0; }
  .menu-btn { padding: 8px 11px; font-size: 0.92rem; }
}
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--gold); color: var(--white); font-size: 0.78rem; font-weight: 800; margin-left: 6px;
}
.badge.quiet { background: var(--sky); color: var(--navy); }

.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ── Buttons & fields ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 2px solid transparent;
  background: var(--teal); color: var(--white); font-weight: 800; cursor: pointer; text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--teal-dark); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.approve { background: var(--sage); }
.btn.approve:hover { background: #6B957A; }
.btn.deny { background: var(--white); color: #A85757; border-color: var(--rose); }
.btn.deny:hover { background: #FBEFEF; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: var(--powder); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #DD9530; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn.block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--white);
  font-size: 1.05rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.ok { color: #4F7E5E; }
.icon-btn.ok:hover { background: #EEF5F0; border-color: var(--sage); }
.icon-btn.no { color: #A85757; }
.icon-btn.no:hover { background: #FBEFEF; border-color: var(--rose); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--white);
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; }
textarea { min-height: 80px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--teal); cursor: pointer; flex: none; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.error { color: #A85757; font-weight: 700; min-height: 1.4em; }

/* ── Clearance queue ────────────────────────────────────── */
.queue-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.queue-head h1 { margin: 0; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filters label.field { margin: 0; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(6, 1fr); } }
.select-bar {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 16px; margin: 12px 0;
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.select-bar select { width: auto; min-height: 38px; padding: 4px 10px; }

.qrow {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px;
  border: 2px solid transparent; transition: border-color 0.12s ease, background 0.12s ease;
}
.qrow.selected { border-color: var(--teal); background: #F4FAFC; }
.qrow.stale { background: var(--amber-soft); }
.qrow.stale.selected { background: #FCF2E0; }
.qrow .who { font-weight: 800; }
.qrow .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.85rem; color: var(--muted); }
.qrow .desc { margin: 2px 0; }
.qrow .amount { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.qrow .amount.in { color: #B27515; }
.qrow .amount.out { color: var(--navy); }
.qrow .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.qrow .quick { display: flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 800;
  background: var(--powder); color: var(--navy);
}
.chip.type-purchase, .chip.type-gift, .chip.type-trade, .chip.type-donation { background: #EAF0F5; }
.chip.type-earn, .chip.type-bonus, .chip.type-streak, .chip.type-refund { background: #FCF0DC; color: #8A5A10; }
.chip.stale { background: var(--gold); color: var(--white); }
.chip.warn { background: #F8E6E6; color: #A85757; }
.chip.ok { background: #E6F0E9; color: #47705A; }
.chip.gold { background: #FCF0DC; color: #8A5A10; }
.chip.auto { background: var(--sky); }
@media (min-width: 760px) {
  .qrow { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 18px; }
}

.action-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, calc(100% + 40px)); z-index: 30; visibility: hidden;
  width: min(760px, calc(100% - 24px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between;
  padding: 12px 14px; border-radius: var(--radius); background: var(--navy); color: var(--white); box-shadow: var(--shadow-lift);
  transition: transform 0.2s ease, visibility 0.2s;
}
.action-bar.show { transform: translate(-50%, 0); visibility: visible; }
.action-bar .summary { font-weight: 800; font-size: 1.02rem; }
.action-bar .summary .total { color: var(--gold); }
.action-bar .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.action-bar .btn.ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.3); }
.action-bar .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.action-bar .btn.deny { background: transparent; color: #F4C4C4; border-color: var(--rose); }
@media (max-width: 520px) {
  .action-bar .buttons { width: 100%; }
  .action-bar .buttons .btn { flex: 1; padding: 10px; }
}

/* ── Toasts & modal ─────────────────────────────────────── */
.toasts {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column-reverse; gap: 8px;
  width: min(520px, calc(100% - 24px)); pointer-events: none; transition: bottom 0.2s ease;
}
.toasts > * { pointer-events: auto; }
body.bar-open .toasts { bottom: 104px; }
@media (max-width: 520px) { body.bar-open .toasts { bottom: 150px; } }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--white); box-shadow: var(--shadow-lift); border-left: 6px solid var(--sage);
  animation: drop 0.2s ease;
}
.toast.warn { border-left-color: var(--rose); }
.toast .msg { flex: 1; }
.toast .count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
@keyframes drop { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(27, 77, 107, 0.35);
  display: flex; align-items: flex-end; justify-content: center; padding: 12px;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; } }
.modal {
  background: var(--white); border-radius: 20px; box-shadow: var(--shadow-lift); width: min(560px, 100%);
  max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: hidden;
}
.modal header { padding: 18px 20px 6px; }
.modal .body { padding: 6px 20px; overflow-y: auto; }
.modal footer { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal ul.list { list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.modal ul.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.modal ul.list li:first-child { border-top: 0; }
.modal .why { background: var(--powder); border-radius: 12px; padding: 8px 12px; font-size: 0.9rem; }

/* ── Tables (teacher lists) ─────────────────────────────── */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 800; padding: 6px 10px; }
.table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

/* ── Student-facing ─────────────────────────────────────── */
.balance-card { text-align: center; padding: 26px 18px; }
.balance-card .coin { width: 72px; height: 72px; margin: 0 auto 4px; display: block; }
.balance { font-family: var(--body); font-weight: 900; font-size: clamp(2.8rem, 12vw, 4rem); color: var(--gold); line-height: 1; letter-spacing: -0.02em; }
.ledger-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ledger-item:first-child { border-top: 0; }
.ledger-item .math { font-size: 0.82rem; color: var(--muted); }
.item-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.item-card:first-child { border-top: 0; }
.price { font-weight: 900; color: var(--gold); white-space: nowrap; }

.empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px; color: var(--muted); }
.empty p { margin: 0; }
.empty svg, .empty .kraken-img { width: auto; height: 34px; max-width: 52px; opacity: 0.85; object-fit: contain; }
.loading { display: flex; justify-content: center; padding: 60px 0; }
.loading svg, .loading .kraken-img { width: auto; height: 72px; max-width: 120px; object-fit: contain; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }

.login-wrap { max-width: 420px; margin: 0 auto; padding: 40px 16px; }
.login-wrap .logo { height: 130px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 8px; }
.login-wrap h1 { text-align: center; }
.seg { display: flex; background: var(--powder); padding: 4px; border-radius: 999px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; font-weight: 800; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--navy); box-shadow: var(--shadow); }

/* Login slips: cut-apart cards. */
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.slip { background: var(--white); border: 2px dashed var(--sky); border-radius: 14px; padding: 12px 14px; break-inside: avoid; }
.slip-head { display: flex; align-items: center; gap: 6px; font-family: var(--head); font-weight: 700; color: var(--teal-dark); }
.slip-name { font-size: 1.15rem; font-weight: 900; margin: 4px 0; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; letter-spacing: .02em; }
/* Master login list prints cleanly (teacher-only view). */
@media print {
  body { background: none; }
  .topbar, .tabs, .no-print, .action-bar, .toasts { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-section { break-inside: avoid; margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Seating (teacher) ──────────────────────────────────── */
:root {
  --lvl-hard: #C46A6A; --lvl-teacher: #E9A23B; --lvl-prize: #9B7CC4; --lvl-monitor: #6FA8C9; --lvl-must_pair: #7FA88B;
}
.seat-layout { display: grid; gap: 16px; }
@media (min-width: 1000px) { .seat-layout { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; } }
.room-card { overflow-x: auto; }
.room {
  display: grid; min-width: 560px; gap: 6px;
  grid-template-columns: 1fr 1fr 18px 1fr 1fr 18px 1fr 1fr 14px 1fr;
  grid-template-rows: auto repeat(8, 34px) auto auto;
}
.room .feature {
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.78rem; font-weight: 800;
  color: var(--muted); background: var(--powder); border-radius: 12px; padding: 6px; min-height: 30px;
}
.room .feature.desk { background: #EEE6D8; color: #7A6440; }
.seat {
  position: relative; border: 2px solid var(--line); background: var(--white); border-radius: 12px; padding: 4px 6px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; cursor: pointer;
  font-size: 0.82rem; line-height: 1.15; min-width: 0;
}
.seat .num { font-size: 0.68rem; font-weight: 800; color: var(--muted); }
.seat .who { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seat .marks { position: absolute; top: 2px; right: 4px; font-size: 0.7rem; }
.seat.empty { background: transparent; border-style: dashed; color: var(--muted); }
.seat.sel { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27, 77, 107, 0.2); }
.seat.rel-hard { border-color: var(--lvl-hard); background: #F8E6E6; }
.seat.rel-teacher { border-color: var(--lvl-teacher); background: #FCF0DC; }
.seat.rel-prize { border-color: var(--lvl-prize); background: #EFE8F8; }
.seat.rel-monitor { border-color: var(--lvl-monitor); background: #E6F1F8; }
.seat.rel-must_pair { border-color: var(--lvl-must_pair); background: #E6F0E9; }
.unseated { font-size: 0.85rem; padding-top: 6px; }
.lvl { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }
.lvl-hard { background: var(--lvl-hard); } .lvl-teacher { background: var(--lvl-teacher); } .lvl-prize { background: var(--lvl-prize); }
.lvl-monitor { background: var(--lvl-monitor); } .lvl-must_pair { background: var(--lvl-must_pair); }
.chip.lvl-chip-hard { background: var(--lvl-hard); color: #fff; }
.chip.lvl-chip-teacher { background: var(--lvl-teacher); color: var(--navy); }
.chip.lvl-chip-prize { background: var(--lvl-prize); color: #fff; }
.chip.lvl-chip-monitor { background: var(--lvl-monitor); color: #fff; }
.chip.lvl-chip-must_pair { background: var(--lvl-must_pair); color: #fff; }

/* ── Student seat card & bingo ──────────────────────────── */
.seat-card { display: flex; align-items: center; gap: 14px; }
.seat-card .seat-num {
  flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--teal); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 900; font-size: 1.7rem; font-family: var(--body);
}
.bingo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bingo .sq {
  min-height: 96px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; border-radius: 14px; background: var(--powder); border: 2px solid var(--line); padding: 6px; font-size: 0.72rem;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left; line-height: 1.15; cursor: default;
}
.bingo .sq .k { font-weight: 900; color: #B27515; font-size: 0.85rem; margin-top: 4px; }
@media (max-width: 420px) { .bingo { gap: 4px; } .bingo .sq { font-size: 0.66rem; padding: 5px; border-radius: 10px; } }
.bingo .sq.claimed { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.bingo .sq.claimed .k { color: var(--navy); }
.bingo .sq.pending { background: #FCF0DC; border-color: var(--gold); border-style: dashed; }
button.sq { cursor: pointer; font: inherit; color: inherit; }
@media (min-width: 640px) { .bingo .sq { font-size: 0.82rem; } }
.thermo { height: 22px; border-radius: 999px; background: var(--powder); overflow: hidden; border: 2px solid var(--line); }
.thermo > div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 999px; transition: width 0.4s ease; }
.notice { border-left: 6px solid var(--gold); }
.copy-block { white-space: pre-wrap; font-family: var(--body); background: var(--powder); border-radius: 14px; padding: 14px; font-size: 0.92rem; }
.quick-find { position: relative; flex: 0 1 240px; min-width: 0; }
.quick-find input { min-height: 38px; padding: 6px 12px; }
.quick-results {
  position: absolute; top: 44px; right: 0; width: min(340px, 90vw); background: var(--white); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift); padding: 6px; z-index: 40;
}
.quick-results .qr { padding: 8px 10px; border-radius: 10px; }
.quick-results .qr + .qr { border-top: 1px solid var(--line); }
.quick-results .qr-seat { float: right; font-weight: 900; color: var(--teal); }
@media (max-width: 520px) {
  body.teacher .topbar .brand span, body.teacher .topbar .spacer { display: none; }
  .quick-find { flex: 1 1 auto; }
  .quick-find input { width: 100%; }
  .topbar .btn { flex: none; }
}
.privacy-banner { max-width: 1080px; margin: 10px auto 0; padding: 10px 16px; border-radius: var(--radius-sm); background: #EFE8F8; color: var(--navy); font-size: 0.92rem; }
.privacy-banner a { font-weight: 800; }
.big-choice { border: 2px dashed var(--teal); text-align: center; padding: 28px 18px; }

/* Challenges & leaderboards */
.chip-btn { border: 1.5px solid var(--sky); background: var(--white); color: var(--navy); border-radius: 999px; padding: 5px 11px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--teal); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; }
.hard-card { border-left: 6px solid var(--gold); }
.board { margin: 0; padding: 0; list-style: none; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board .place { width: 30px; text-align: center; font-weight: 900; font-size: 1.05rem; }
.board .who { flex: 1; font-weight: 700; }
.board .val { font-weight: 900; color: var(--teal-dark); white-space: nowrap; }
.board li.me { background: var(--amber-soft); border-radius: 10px; }
.my-place { margin: 8px 0 0; padding: 8px 10px; background: var(--powder); border-radius: 10px; font-weight: 700; }
.match-ok { color: var(--teal-dark); font-weight: 800; }
.paste { width: 100%; min-height: 160px; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }

/* Public home page */
.home-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 10px 16px 0; max-width: 1080px; margin: 0 auto; }
.home-nav a { text-decoration: none; font-family: var(--head); font-weight: 700; color: var(--navy); background: rgba(255,255,255,.7); padding: 7px 13px; border-radius: 999px; }
.home-nav a:hover { background: var(--white); box-shadow: var(--shadow); }
.home-main section { margin-top: 26px; scroll-margin-top: 80px; }
.hero { display: grid; grid-template-columns: minmax(200px, 380px) 1fr; gap: 24px; align-items: center; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.hero-logo { width: 100%; height: auto; max-height: 260px; object-fit: contain; }
.hero h1 { font-size: 2.2rem; margin-bottom: 2px; }
.hero-sub { color: var(--muted); font-weight: 800; }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero .inline { justify-content: center; } .hero-logo { max-height: 200px; } }
.sec-title { font-size: 1.45rem; margin: 0 0 10px; }
.spot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.spot-grid .spot { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 14px; border-top: 0; }
.spot { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.card .spot:first-of-type { border-top: 0; }
.spot-emoji { font-size: 1.6rem; line-height: 1; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.board-grid .card { margin: 0; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
/* Kraken Bucks fills the rest of the last row, next to “It’s really about learning” (9 cards + this one). */
.how-grid .how-kb { grid-column: span 3; background: #FFF8EC; border: 2px solid #F3D9A6; }
@media (max-width: 999px) { .how-grid { grid-template-columns: repeat(3, 1fr); } .how-grid .how-kb { grid-column: 1 / -1; } }
@media (max-width: 699px) { .how-grid { grid-template-columns: repeat(2, 1fr); } .how-grid .how-kb { grid-column: span 1; } }
@media (max-width: 479px) { .how-grid { grid-template-columns: 1fr; } .how-grid .how-kb { grid-column: auto; } }
.how-grid .card { margin: 0; }
.how-emoji { font-size: 1.8rem; }
.contact-card .btn { text-decoration: none; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
body.home .topbar .btn { white-space: nowrap; }
@media (max-width: 420px) { body.home .topbar .brand span { display: none; } }
.picker { display: grid; gap: 8px; margin-bottom: 12px; }
.grade-chips { gap: 6px; }
.chip-btn.on { background: var(--teal); border-color: var(--teal); color: var(--white); }

.paste.drop { outline: 3px dashed var(--teal); background: var(--powder); }

/* Store & Prizes */
.prize-row { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.class-toggles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.class-toggles .chip-btn { padding: 2px 8px; font-size: 0.75rem; }
.class-toggles .chip-btn:not(.on) { background: #F8E6E6; border-color: var(--rose); color: #8A4545; text-decoration: line-through; }

.linkish { background: none; border: 0; padding: 0; color: var(--teal-dark); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* Seating chart printout for a substitute */
.sub-sheet { display: none; }
@media print {
  body.printing-sub > *:not(.sub-sheet) { display: none !important; }
  body.printing-sub .sub-sheet { display: block; color: #000; }
  body.printing-sub .sub-sheet .room { min-width: 0; }
  body.printing-sub .sub-sheet .seat { border: 1px solid #555; background: #fff; }
  body.printing-sub .sub-sheet .unseated { display: none; }
}

/* Advisory gradebook */
.ci-table td, .ci-table th { text-align: center; padding: 6px; }
.ci-table td:first-child, .ci-table th:first-child { text-align: left; }
.ci { width: 36px; height: 32px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--white); font-weight: 900; cursor: pointer; }
.ci.dirty { outline: 3px solid var(--gold); }
.ci-completed { background: #E6F0E9; border-color: var(--sage); color: #3E6B4C; }
.ci-partial { background: #FCF0DC; border-color: var(--gold); color: #8A5A10; }
.ci-missing { background: #F8E6E6; border-color: var(--rose); color: #8A4545; }
.ci-absent, .ci-excused, .ci-unavailable, .ci-not_yet_due, .ci-exempt { background: var(--powder); color: var(--muted); }

/* Teacher Home */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px 16px; color: inherit; text-decoration: none; display: block; }
.tile-label { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.tile-value { font-size: 1.6rem; font-weight: 900; color: var(--navy); }
.dash-classes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 700px) { .dash-classes { grid-template-columns: 1fr; } }
.dash-classes .card { margin: 0; }
.todo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.todo { background: var(--amber-soft); color: #7A4E0E; border-radius: 999px; padding: 6px 12px; font-weight: 800; text-decoration: none; font-size: 0.9rem; }

/* Student Home */
.page-title { margin: 6px 0 10px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-grid .card { margin: 0; }
.dash-grid .balance-card .coin { width: 48px; height: 48px; }
.dash-grid .balance { font-size: 2.2rem; }

/* Gradebook */
.g-missing { color: var(--rose); font-weight: 900; }
.g-wrap { max-height: 70vh; overflow: auto; }
.g-table th, .g-table td { white-space: nowrap; text-align: center; }
.g-table th:first-child, .g-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--white); z-index: 1; }
.g-cell { border: 0; background: transparent; min-width: 38px; min-height: 30px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.g-cell:hover { background: var(--powder); }
.std-pick { margin: 8px 0; }
.std-pick label.chip-btn { cursor: pointer; }
.missing-list li { margin-bottom: 4px; }
.home-nav a.on { background: var(--navy); color: var(--white); }

.chip.type-reset { background: #FBE4E4; color: #9A2B2B; }

/* ⚙️ Account & settings panel (teacher top bar) */
.acct { position: relative; }
.acct-btn { font-size: 1.15rem; width: 40px; height: 40px; }
.acct-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, 86vw); background: var(--white); border-radius: 16px;
  box-shadow: 0 12px 32px rgba(24, 48, 72, .18); padding: 12px; z-index: 60; }
.acct-head { display: flex; flex-direction: column; padding-bottom: 8px; border-bottom: 1px solid var(--powder); margin-bottom: 6px; }
.acct-row { margin: 6px 0; }
.acct-links { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--powder); margin-top: 8px; padding-top: 6px; }
.acct-links .menu-link { text-align: left; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
.acct-links .menu-link { display: block; padding: 9px 10px; border-radius: 10px; font-family: var(--head); font-weight: 700; color: var(--teal-dark); text-decoration: none; }
.acct-links .menu-link:hover, .acct-links .menu-link:focus-visible { background: var(--powder); outline: none; }

/* My Pay */
.pay-today { background: var(--powder); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .pay-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pay-grid > div { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.pay-grid .big { font-size: 1.2rem; display: block; margin: 2px 0; }
.pay-days { margin-top: 10px; }
.pay-days summary { cursor: pointer; }

/* Jobs */
.job-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.job-card { background: var(--white); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.job-card .inline:last-child { margin-top: auto; padding-top: 8px; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

/* Student Home: money strip, wide progress panel, even grids */
.money-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (min-width: 860px) { .money-strip { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.ms-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ms-balance { flex-direction: row; align-items: center; gap: 10px; }
.ms-balance .coin { width: 56px; height: 56px; flex: none; }
.ms-balance .coin svg, .ms-balance .coin .kraken-img { width: 84px; height: 56px; object-fit: contain; }
.ms-balance .coin { width: 84px; }
.money-strip .balance { font-size: 2rem; line-height: 1.1; }
.dash-grid.two-col { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .dash-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid .span-2 { grid-column: 1 / -1; } }
.progress-wide { margin-bottom: 16px; }
.pw-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.pw-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 760px) { .pw-body { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.3fr); align-items: center; } }
.pw-chart { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut circle[data-slice] { cursor: pointer; transition: stroke-width .15s; }
.donut circle[data-slice]:hover, .donut circle[data-slice]:focus { stroke-width: 24; outline: none; }
.donut-big { font: 900 26px var(--head, sans-serif); fill: var(--navy); }
.donut-small { font: 700 11px sans-serif; fill: var(--muted); }
.pw-legend { display: flex; flex-direction: column; gap: 4px; }
.pw-key { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 6px; border-radius: 8px; font: inherit; cursor: pointer; text-align: left; color: inherit; }
.pw-key:hover:not(:disabled) { background: var(--powder); }
.pw-key:disabled { opacity: .45; cursor: default; }
.pw-key b { margin-left: auto; padding-left: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.pbar { margin-bottom: 10px; }
.pbar-top { display: flex; justify-content: space-between; font-weight: 700; }
.pbar-track { height: 12px; background: var(--powder); border-radius: 999px; overflow: hidden; margin: 4px 0 2px; }
.pbar-track > div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 999px; }
.pw-alert { background: var(--amber-soft); border-radius: 12px; padding: 8px 12px; margin: 6px 0 0; }
.pw-ok { margin: 6px 0 0; }
.pw-detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

.kraken-img { display: block; object-fit: contain; }
.coin .kraken-img { width: 100%; height: 100%; }
.balance-card .coin { width: 120px; height: 80px; }
.brand-logo { width: auto; object-fit: contain; }
.ff-list { margin: 0; padding-left: 4px; list-style: none; } .ff-list li { margin: 6px 0; }

/* Trade Post, chat, checkbook practice */
.integrity { background: var(--powder); border-radius: 12px; padding: 8px 12px; margin-top: 8px; font-size: .92rem; }
.chat-log { max-height: 46vh; min-height: 120px; overflow: auto; background: var(--powder); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { background: var(--white); border-radius: 12px; padding: 6px 10px; max-width: 80%; align-self: flex-start; }
.chat-msg.me { align-self: flex-end; background: #E3F2F4; }
.cb-words { display: flex; flex-wrap: wrap; gap: 6px; }

/* Family portal */
.fam-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (min-width: 720px) { .fam-hero { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.fam-hero .big { font-size: 1.6rem; display: block; }
.todo-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; font: inherit; cursor: pointer; color: inherit; }
.todo-row:hover { background: var(--powder); }
.todo-row:last-child { border-bottom: 0; }

/* Payroll roll: completed / incomplete / absent */
.att-seg { display: flex; gap: 4px; margin-top: 6px; }
.att-seg label { flex: 1; cursor: pointer; }
.att-seg input { position: absolute; opacity: 0; pointer-events: none; }
.att-seg span { display: block; text-align: center; font-size: .74rem; font-weight: 800; padding: 5px 2px; border-radius: 8px; border: 1.5px solid var(--line, #d9e2ea); color: var(--muted); }
.att-seg input:focus-visible + span { outline: 3px solid var(--sky); }
.att-seg input[value="completed"]:checked + span { background: #E6F0E9; border-color: #47705A; color: #2F5A43; }
.att-seg input[value="incomplete"]:checked + span { background: #FCF0DC; border-color: #B27515; color: #8A5A10; }
.att-seg input[value="absent"]:checked + span { background: #F8E6E6; border-color: #A85757; color: #A85757; }

/* Jobs: voting poll */
.poll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.poll-row { padding: 8px 0; border-top: 1px solid var(--line); }
.poll-row:first-of-type { border-top: 0; }
.poll-row.hired b { color: var(--teal-dark); }
.poll-bar { position: relative; height: 22px; background: #EEF4F8; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.poll-bar > div { height: 100%; background: #BFD9E6; border-radius: 999px; transition: width .4s; }
.poll-bar > div.lead { background: var(--gold); }
.poll-bar span { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px; font-size: .75rem; font-weight: 800; color: var(--navy); }
/* Jobs: postings */
.job-pick { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; transition: transform .12s, box-shadow .12s; }
.job-pick:hover, .job-pick:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 60, 90, .12); }
.post-steps { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.post-steps button { flex: 1; min-width: 110px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 6px 8px; font: inherit; font-size: .78rem; font-weight: 800; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.post-steps button span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #EEF4F8; flex: none; }
.post-steps button.done { color: var(--teal-dark); }
.post-steps button.done span { background: #E6F0E9; }
.post-steps button.on { border-color: var(--teal); color: var(--navy); background: #F2F9FB; }
.post-steps button.on span { background: var(--teal); color: #fff; }
.post-hero { display: flex; gap: 14px; align-items: center; }
.post-icon { font-size: 2.6rem; width: 70px; height: 70px; display: grid; place-items: center; background: #F2F9FB; border-radius: 18px; }
.post-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.post-facts > div { background: #F6FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.post-timeline { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.post-timeline li { counter-increment: step; position: relative; padding: 8px 0 14px 44px; border-left: 3px solid var(--line); margin-left: 15px; }
.post-timeline li:last-child { border-left-color: transparent; }
.post-timeline li::before { content: counter(step); position: absolute; left: -17px; top: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 900; display: grid; place-items: center; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 4px 0; }
.post-list.fired li { color: #8A4A4A; }
.warn-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.warn-steps > div { background: #FFF8EC; border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.app-form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; margin: 0 0 12px; }
.app-form legend { font-family: var(--head); font-weight: 800; color: var(--navy); padding: 0 6px; }
/* Jobs: history boxes */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.history-box { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.history-box.current { border-color: var(--gold); box-shadow: 0 4px 14px rgba(178, 117, 21, .15); }
.history-box.done { border-color: #A9CBB6; }
.history-box.never { background: #FAFCFD; border-style: dashed; }
.history-box.never .history-icon { filter: grayscale(1); opacity: .6; }
.history-icon { font-size: 1.8rem; }
.history-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; text-align: center; }
.history-stats div { background: #F6FAFC; border-radius: 10px; padding: 6px 2px; display: flex; flex-direction: column; }
.history-stats b { font-size: 1.25rem; color: var(--navy); }
.history-stats span { font-size: .68rem; color: var(--muted); line-height: 1.15; }

/* Family "This Week" checklist */
.week-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; background: #fff; }
.week-item.done span { text-decoration: line-through; color: var(--muted); }
.week-item input { width: 20px; height: 20px; flex: none; }

/* About Your Class: class cards, grading donuts, class pages */
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.class-grid .card { margin: 0; }
.class-card { display: block; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; border-top: 6px solid var(--teal); }
.class-card:hover, .class-card:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20, 60, 90, .14); }
.class-emoji { font-size: 2.2rem; }
.class-emoji.big { font-size: 3.4rem; width: 84px; height: 84px; display: grid; place-items: center; background: #F2F9FB; border-radius: 22px; flex: none; }
.class-more { color: var(--teal-dark); font-weight: 800; }
.class-hero { display: flex; gap: 16px; align-items: center; }
.g-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.g-donut { border-radius: 50%; position: relative; flex: none; }
.g-donut span { position: absolute; inset: 22%; background: #fff; border-radius: 50%; }
.g-legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 180px; }
.g-legend li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.g-legend i { width: 12px; height: 12px; border-radius: 3px; margin-top: 5px; flex: none; }
/* Leaderboards with Students of the Week */
.lb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.lb-side .card { position: sticky; top: 12px; }
@media (max-width: 820px) { .lb-layout { grid-template-columns: 1fr; } .lb-side .card { position: static; } }
.sotw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sotw { margin: 0; display: flex; gap: 12px; align-items: center; border: 2px solid #F3D9A6; background: linear-gradient(135deg, #FFFDF6, #FFF3D6); }
.sotw-star { font-size: 2.2rem; }
.sotw-name { font-size: 1.15rem; }
.past-week { padding: 8px 0; border-top: 1px solid var(--line); }
.past-week:first-of-type { border-top: 0; }

/* Certificates: only the certificate layer prints */
#cert-print { display: none; }
.cert-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 8px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
@media print {
  @page { size: letter landscape; margin: 0.4in; }
  body.printing-certs > *:not(#cert-print) { display: none !important; }
  body.printing-certs { background: #fff !important; }
  body.printing-certs #cert-print { display: block; }
  .cert-page { page-break-after: always; break-after: page; height: 7.6in; display: flex; }
  .cert-page:last-child { page-break-after: auto; break-after: auto; }
}
.cert { flex: 1; border: 10px double #1B4D6B; border-radius: 18px; padding: 10px; font-family: 'Quicksand', 'Nunito', system-ui, sans-serif; color: #1B4D6B; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cert-inner { height: 100%; border: 2px solid #E9A23B; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px 40px; background: radial-gradient(circle at top, #FFF8EC, #fff 60%); }
.cert-logo { height: 80px; width: auto; object-fit: contain; }
.cert-kicker { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; color: #2E8B9B; margin-top: 6px; }
.cert-title { font-size: 40px; font-weight: 900; margin: 10px 0 6px; }
.cert-presented { font-size: 16px; color: #4A6B80; }
.cert-name { font-size: 46px; font-weight: 900; margin: 8px 0; padding: 0 30px 4px; border-bottom: 3px solid #E9A23B; min-width: 55%; }
.cert-why { font-size: 18px; margin-top: 6px; max-width: 80%; }
.cert-class { font-size: 13px; color: #4A6B80; margin-top: 4px; font-weight: 800; }
.cert-sigs { display: flex; gap: 40px; justify-content: center; width: 100%; margin-top: 34px; font-size: 14px; font-weight: 700; }
.cert-sigs > div { flex: 0 1 240px; }
.cert-line { border-bottom: 2px solid #1B4D6B; height: 34px; margin-bottom: 4px; display: flex; align-items: flex-end; justify-content: center; font-weight: 600; }
.cert-role { font-size: 12px; color: #4A6B80; font-weight: 600; }

/* ── 📺 Class Display (projector) ── sized by the screen so it reads from the back row */
.display-body { margin: 0; min-height: 100vh; background: linear-gradient(160deg, #0F3550, #1B4D6B 55%, #2E8B9B); color: #fff; overflow: hidden; font-family: var(--body, 'Nunito', system-ui, sans-serif); }
.display-body .modal { padding: 18px 20px; gap: 8px; color: var(--navy); }
.display-body .modal input { font-size: 1.1rem; }
.display-body main.screen { max-width: none; margin: 0; width: 100%; }
.screen { min-height: 100vh; box-sizing: border-box; padding: 2.2vh 2.4vw; display: flex; flex-direction: column; gap: 1.8vh; }
.screen-lock { position: fixed; right: 12px; bottom: 10px; background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: 50%; width: 40px; height: 40px; font-size: 18px; cursor: pointer; opacity: .45; }
.screen-lock:hover, .screen-lock:focus-visible { opacity: 1; }
.screen-connect { margin: auto; text-align: center; max-width: 560px; background: rgba(255, 255, 255, .08); border-radius: 24px; padding: 32px; }
.screen-connect-logo { height: 110px; }
.screen-connect form { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.screen-connect input { font-size: 2rem; letter-spacing: .2em; text-align: center; width: 260px; text-transform: uppercase; border-radius: 14px; border: 0; padding: 8px; }
.screen-error { color: #FFD3D3; font-weight: 800; }
.screen-start { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; background: none; border: 0; color: #fff; font: inherit; font-size: 2rem; font-weight: 900; cursor: pointer; }
.screen-start img { height: 30vh; animation: bob 1.4s ease-in-out infinite; }
.screen-top { display: flex; align-items: center; gap: 1.6vw; }
.screen-logo { height: 9vh; width: auto; }
.screen-class { font-family: var(--head); font-size: 5.2vh; font-weight: 800; line-height: 1; }
.screen-date { font-size: 2.6vh; opacity: .85; margin-top: .6vh; }
.screen-clock { margin-left: auto; font-size: 6vh; font-weight: 900; font-variant-numeric: tabular-nums; }
.screen-banner { background: #E9A23B; color: #1B2B38; border-radius: 16px; padding: 1.4vh 1.6vw; font-size: 3.6vh; font-weight: 900; }
.screen-grid { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 1.6vw; min-height: 0; }
.screen-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 22px; padding: 2.2vh 1.6vw; overflow: hidden; }
.screen-card h2 { font-size: 3vh; margin: 0 0 1vh; color: #FCE3B4; }
.screen-word { font-size: 9vh; font-weight: 900; line-height: 1.05; word-break: break-word; }
.screen-small { font-size: 2.3vh; opacity: .9; margin: .6vh 0 1.4vh; }
.screen-big { font-size: 6vh; font-weight: 900; }
.screen-star { font-size: 3.4vh; font-weight: 900; }
.screen-board { list-style: none; margin: 0; padding: 0; }
.screen-board li { display: grid; grid-template-columns: 6vh 1fr auto; align-items: center; gap: 1vw; font-size: 3.4vh; padding: 1vh 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.screen-board li span { font-size: 4vh; text-align: center; }
.screen-board li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-board li em { font-style: normal; font-weight: 900; color: #FCE3B4; }
.screen-thermo { height: 2.6vh; background: rgba(255, 255, 255, .18); border-radius: 999px; overflow: hidden; margin: .8vh 0; }
.screen-thermo div { height: 100%; background: linear-gradient(90deg, #E9A23B, #FCE3B4); border-radius: 999px; transition: width .6s; }
.screen-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1vw; margin-top: 1vh; }
.screen-split div { background: rgba(0, 0, 0, .15); border-radius: 14px; padding: 1vh .8vw; display: flex; flex-direction: column; }
.screen-split span { font-size: 1.9vh; opacity: .85; line-height: 1.2; }
.screen-split b { font-size: 3.6vh; }
.screen-crew { display: flex; flex-wrap: wrap; gap: .8vh .8vw; font-size: 2.1vh; }
.screen-crew span { background: rgba(255, 255, 255, .1); border-radius: 999px; padding: .6vh 1vw; }
.screen-crew b { color: #FCE3B4; margin-right: .4vw; }
.screen-empty { margin: auto; font-size: 5vh; opacity: .85; }
.screen-message { margin: auto; text-align: center; font-size: 9vh; font-weight: 900; line-height: 1.15; max-width: 90vw; white-space: pre-wrap; }
.screen-curtain { margin: auto; text-align: center; }
.screen-curtain img { height: 32vh; }
.screen-curtain h1 { font-size: 10vh; margin: 2vh 0 0; color: #fff; }
.screen-curtain p { font-size: 3.6vh; opacity: .85; }
/* The timer ring */
.screen-timer { display: flex; flex-direction: column; align-items: center; }
.screen-timer .ring { --p: 360deg; width: 34vh; height: 34vh; border-radius: 50%; background: conic-gradient(#E9A23B var(--p), rgba(255, 255, 255, .15) 0); display: grid; place-items: center; transition: background .25s; }
.screen-timer .ring-in { width: 86%; height: 86%; border-radius: 50%; background: #164560; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.screen-timer .t-label { font-size: 2.4vh; font-weight: 800; opacity: .85; max-width: 80%; }
.screen-timer .t-time { font-size: 9vh; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.screen-timer .t-sub { font-size: 2.2vh; font-weight: 800; min-height: 2.6vh; }
.screen-timer.big { margin: auto; }
.screen-timer.big .ring { width: 72vh; height: 72vh; }
.screen-timer.big .t-time { font-size: 20vh; }
.screen-timer.big .t-label { font-size: 4.4vh; }
.screen-timer.big .t-sub { font-size: 4vh; min-height: 4.6vh; }
.screen-timer .t-by { margin-top: 1.4vh; font-size: 2.4vh; opacity: .8; }
.screen-timer.paused .t-time { opacity: .6; }
.screen-timer.done .ring { background: #E46A6A; animation: timer-flash 1s ease-in-out infinite; }
@keyframes timer-flash { 50% { filter: brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { .screen-timer.done .ring, .screen-start img { animation: none; } }
@media (max-aspect-ratio: 4/3) { .screen-grid { grid-template-columns: 1fr; overflow: auto; } .display-body { overflow: auto; } }

/* Teacher remote (phone) */
.remote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.remote-grid .btn { min-height: 48px; }
.remote-grid.two { grid-template-columns: 1fr 1fr; }
.remote-time { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; color: var(--navy); }
.remote-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9AA9B4; margin-right: 4px; }
.live-dot.on { background: #3BA55C; box-shadow: 0 0 0 3px rgba(59, 165, 92, .25); }
.code-big { font-family: ui-monospace, monospace; font-size: 2rem; font-weight: 900; letter-spacing: .15em; color: var(--navy); }

/* Classroom Dashboard v2 */
.screen-lockchip { font-size: 3vh; vertical-align: middle; opacity: .8; }
.screen-tabs { display: flex; gap: .6vw; margin-left: auto; }
.screen-tabs button { font: inherit; font-size: 2.2vh; font-weight: 800; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: inherit; border-radius: 999px; padding: .7vh 1.2vw; cursor: pointer; }
.screen-tabs button.on { background: #E9A23B; border-color: #E9A23B; color: #1B2B38; }
.screen-tabs + .screen-clock { margin-left: 1.4vw; }
.screen-agenda { margin: 0 0 1vh; padding-left: 3.4vh; font-size: 2.9vh; line-height: 1.35; }
.screen-agenda li { padding: .3vh 0; }
.screen-agenda li::marker { font-weight: 900; color: #FCE3B4; }
.screen-thermo.slim { height: 1.6vh; margin: 0; flex: 1; }
.screen-pollrow { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr auto; align-items: center; gap: .8vw; font-size: 2.2vh; margin: .6vh 0; }
.screen-pollrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-roster { display: flex; flex-wrap: wrap; gap: .6vh .5vw; align-items: center; font-size: 2.1vh; background: rgba(0, 0, 0, .18); border-radius: 16px; padding: 1vh 1vw; }
.screen-roster b { margin-right: .6vw; }
.screen-roster span { background: rgba(255, 255, 255, .14); border-radius: 999px; padding: .4vh .9vw; }
.screen-roster span i { font-style: normal; font-weight: 900; margin-right: .4vw; }
.screen-roster span.absent { opacity: .55; text-decoration: line-through; }
.screen-roster span.present i { color: #8FE3A8; }
.screen-donow { flex: 1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.6vw; min-height: 0; }
.screen-donow-main { background: rgba(255, 255, 255, .1); border-radius: 22px; padding: 3vh 2.4vw; overflow: auto; }
.screen-donow-main h2 { font-size: 4.4vh; margin: 0 0 1.6vh; color: #FCE3B4; }
.screen-donow-text { font-size: 5vh; font-weight: 800; line-height: 1.3; white-space: pre-wrap; }
.screen-donow-text.dim { opacity: .6; font-size: 3.4vh; }
.screen-answer { margin-top: 2.4vh; background: rgba(143, 227, 168, .18); border-left: 8px solid #8FE3A8; border-radius: 14px; padding: 1.6vh 1.4vw; font-size: 3.4vh; white-space: pre-wrap; }
.screen-donow-side { display: flex; flex-direction: column; gap: 1.6vh; align-items: stretch; }

/* 7th grade: light blues */
body[data-theme="light"] { background: linear-gradient(160deg, #EAF6FB, #CFE8F3 55%, #B5DCEC); color: #16384F; }
body[data-theme="light"] .screen-card, body[data-theme="light"] .screen-donow-main { background: rgba(255, 255, 255, .78); border-color: rgba(27, 77, 107, .12); box-shadow: 0 6px 20px rgba(27, 77, 107, .08); }
body[data-theme="light"] .screen-card h2, body[data-theme="light"] .screen-donow-main h2 { color: #2E8B9B; }
body[data-theme="light"] .screen-agenda li::marker { color: #2E8B9B; }
body[data-theme="light"] .screen-thermo { background: rgba(27, 77, 107, .12); }
body[data-theme="light"] .screen-split div { background: rgba(46, 139, 155, .1); }
body[data-theme="light"] .screen-crew span, body[data-theme="light"] .screen-roster span { background: rgba(255, 255, 255, .8); }
body[data-theme="light"] .screen-roster { background: rgba(255, 255, 255, .5); }
body[data-theme="light"] .screen-crew b { color: #1B4D6B; }
body[data-theme="light"] .screen-tabs button { border-color: rgba(27, 77, 107, .25); background: rgba(255, 255, 255, .6); }
body[data-theme="light"] .screen-timer .ring { background: conic-gradient(#2E8B9B var(--p), rgba(27, 77, 107, .12) 0); }
body[data-theme="light"] .screen-timer .ring-in { background: #fff; }
body[data-theme="light"] .screen-timer.done .ring { background: #E46A6A; }
body[data-theme="light"] .screen-answer { background: rgba(71, 112, 90, .12); border-left-color: #47705A; }
body[data-theme="light"] .screen-lock { background: rgba(27, 77, 107, .12); color: #16384F; }

/* 📬 Inbox */
.inbox-btn { position: relative; margin-right: 6px; }
.inbox-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #D9534F; color: #fff; font-size: 11px; font-weight: 900; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.inbox-badge.hidden { display: none; }
.inbox-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #D9534F; color: #fff; font-size: 11px; font-weight: 900; margin-left: 4px; }
.inbox-row { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; cursor: pointer; }
.inbox-row:hover, .inbox-row:focus-visible { background: #F6FAFC; }
.inbox-row.unread { background: #FFF8EC; }
.inbox-row.unread .inbox-row-top > b::before { content: '● '; color: #D9534F; }
.inbox-row-top { display: flex; gap: 6px; align-items: center; }
.inbox-log { max-height: 55vh; }

/* Job crew names and colors */
.crew-title { font-family: var(--head); }
.crew-real { font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }
.crew-pitch { background: #F2F9FB; border-radius: 12px; padding: 8px 12px; font-weight: 700; color: var(--navy); }
.job-colored { border-top: 6px solid var(--job, var(--teal)); }
.job-swatch { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; color: var(--navy); }
.job-swatch i { width: 12px; height: 12px; border-radius: 4px; background: var(--job); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.history-box { border-color: color-mix(in srgb, var(--job, #ccc) 35%, #E3ECF1); }
.history-box.done, .history-box.current { background: color-mix(in srgb, var(--job) 13%, #fff); border-color: var(--job); }
.history-box.current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--job) 30%, transparent), 0 4px 14px rgba(0, 0, 0, .08); }
.history-box.never { border-left: 6px solid var(--job); }
.choice-desc { margin-top: 4px; }
.job-bank { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #FAFCFD; }
.job-bank > summary { cursor: pointer; }
.job-bank-item { border-top: 0; border-left: 5px solid var(--job); background: #fff; border-radius: 10px; padding: 6px 10px; margin-top: 6px; }
.job-bank-item summary { cursor: pointer; }
.job-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.job-color { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.job-color i { width: 28px; height: 28px; border-radius: 8px; background: var(--job); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
/* Home: Students of the Week beside Words of the Week */
.home-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .home-split { grid-template-columns: 1fr; } }
.home-split .spot-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.home-word { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.home-word b { font-size: 1.25rem; color: var(--navy); }
.home-grow { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--navy); background: linear-gradient(135deg, #F2FBF5, #E6F4EC); border-left: 6px solid var(--sage, #6FA785); margin-top: 12px; }
.job-pick { border: 1px solid var(--line); border-top: 6px solid var(--job, var(--teal)); background: #fff; }
.job-head .chip { white-space: nowrap; }

/* Classroom Dashboard v3: class + timer left, Do Now center, slim sidebar right */
.screen-bar { display: flex; align-items: center; gap: .8vw; font-size: 2vh; }
.screen-bar-logo { height: 5vh; width: auto; }
.screen-bar-name { font-family: var(--head); font-weight: 800; font-size: 2.4vh; opacity: .9; }
.screen-bar .screen-lockchip { font-size: 1.7vh; font-weight: 800; background: rgba(255, 255, 255, .12); padding: .4vh .9vw; border-radius: 999px; }
.screen-bar .screen-tabs { margin-left: auto; }
.screen-bar-clock { font-size: 3.6vh; font-weight: 900; font-variant-numeric: tabular-nums; margin-left: 1vw; }
.screen-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, .9fr); gap: 1.4vw; min-height: 0; }
.screen-main.donow-only { grid-template-columns: minmax(0, 1fr) minmax(0, 2.65fr); }
.screen-left { display: flex; flex-direction: column; gap: 1.6vh; align-items: stretch; min-height: 0; }
.screen-head { text-align: center; }
.screen-classpill { display: inline-block; font-family: var(--head); font-weight: 900; font-size: 6vh; line-height: 1; padding: 1vh 2.2vw; border-radius: 999px; background: linear-gradient(135deg, #E9A23B, #F6C76E); color: #1B2B38; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.screen-period { margin-top: 1.2vh; font-size: 2.4vh; font-weight: 800; color: #FCE3B4; }
.screen-day { font-size: 4vh; font-weight: 900; margin-top: .6vh; line-height: 1.1; }
.screen-datel { font-size: 2.2vh; opacity: .9; }
.screen-left .screen-timer .ring { width: 30vh; height: 30vh; margin: 0 auto; }
.screen-left .screen-timer .t-time { font-size: 7vh; }
.screen-timer.period .ring { background: conic-gradient(#7BC6DE var(--p), rgba(255, 255, 255, .15) 0); }
.screen-timer.idle .t-time { font-size: 6vh; }
.screen-card.slim { padding: 1.6vh 1.2vw; }
.screen-card.slim h2 { font-size: 2.4vh; }
.screen-card.slim .screen-agenda { font-size: 2.3vh; }
.screen-center { display: flex; min-height: 0; }
.screen-paper { flex: 1; position: relative; background: #FFFDF6; color: #1E2A33; border-radius: 22px; padding: 6vh 2.6vw 3vh; box-shadow: 0 12px 34px rgba(0, 0, 0, .25);
  background-image: repeating-linear-gradient(transparent 0, transparent calc(6.2vh - 2px), #DCE8F2 calc(6.2vh - 2px), #DCE8F2 6.2vh); background-position: 0 4.6vh; overflow: auto; border-left: 10px solid #E46A6A; }
.paper-tag { position: absolute; top: 1.4vh; left: 2.4vw; font-family: var(--head); font-weight: 900; font-size: 2.6vh; letter-spacing: .1em; color: #C0392B; }
.paper-text { font-size: 4.6vh; font-weight: 800; line-height: 6.2vh; white-space: pre-wrap; }
.paper-text.dim { opacity: .55; font-size: 3vh; }
.paper-word { font-size: 12vh; font-weight: 900; line-height: 1.1; margin: 2vh 0; color: #1B4D6B; word-break: break-word; }
.screen-paper.big .paper-text { font-size: 5.4vh; line-height: 7vh; }
.screen-paper .screen-answer { color: #1E2A33; background: #EAF6EE; }
.screen-side { display: flex; flex-direction: column; gap: 1.1vh; min-height: 0; overflow: hidden; }
.side-card { display: flex; gap: .8vw; align-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 1.1vh .9vw; }
.side-card.col { flex-direction: column; align-items: stretch; gap: .5vh; }
.side-row { display: flex; gap: .8vw; align-items: center; }
.side-ic { width: 4.6vh; height: 4.6vh; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 2.6vh; flex: none; }
.side-card span { font-size: 1.9vh; font-weight: 800; opacity: .9; display: block; }
.side-card b { font-size: 2.6vh; }
.side-card small { font-size: 1.7vh; opacity: .85; }
.side-word { font-size: 3.6vh !important; display: block; line-height: 1.1; }
.side-star { font-size: 2.4vh !important; }
.side-card .screen-thermo { height: 1.6vh; margin: .5vh 0; }
.side-card .screen-pollrow { font-size: 1.8vh; margin: .2vh 0; }
.side-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6vw; }
.side-pair div { background: rgba(0, 0, 0, .15); border-radius: 14px; padding: 1vh .7vw; display: flex; flex-direction: column; }
.side-pair span { font-size: 1.6vh; opacity: .85; line-height: 1.2; }
.side-pair b { font-size: 2.8vh; }
.screen-picker { padding: 18px 20px; gap: 8px; max-width: 620px; }
.screen-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.screen-picker-grid .btn { min-height: 56px; font-size: 1.1rem; }
body[data-theme="light"] .side-card { background: rgba(255, 255, 255, .8); border-color: rgba(27, 77, 107, .12); }
body[data-theme="light"] .side-ic { background: #E3F2F8; }
body[data-theme="light"] .side-pair div { background: rgba(46, 139, 155, .12); }
body[data-theme="light"] .screen-period { color: #2E8B9B; }
body[data-theme="light"] .screen-bar .screen-lockchip { background: rgba(27, 77, 107, .1); }
body[data-theme="light"] .screen-timer.period .ring { background: conic-gradient(#7BC6DE var(--p), rgba(27, 77, 107, .12) 0); }
body[data-theme="light"] .screen-tabs button.on { background: #E9A23B; border-color: #E9A23B; color: #1B2B38; }
.screen-timer.idle .t-time { font-size: 5vh; }
.sched-row { padding: 10px 12px; }

/* 🗓️ Lesson Planner */
.table.planner th, .table.planner td { vertical-align: top; min-width: 120px; }
.table.planner thead th.today { background: #FFF8EC; }
.pl-off { color: var(--muted); text-align: center; background: #F6F8FA; }
.pl-open { text-align: center; }
.pl-chip { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); border-left: 6px solid var(--cat); border-radius: 10px; background: color-mix(in srgb, var(--cat) 10%, #fff); padding: 6px 8px; color: var(--navy); }
.pl-chip span { font-weight: 800; font-size: .85rem; }
.pl-chip small { font-size: .72rem; }
.pl-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--cat); margin: 0 4px 0 10px; vertical-align: middle; }

/* ── 🎞️ Slides (editor, practice view, dashboard) ── */
.slide { container-type: inline-size; position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 14px; overflow: hidden;
  background: linear-gradient(150deg, #0F2B3D, #1B4D6B 60%, #2E8B9B); background-size: cover; background-position: center; color: #fff; }
.slide.on-light { color: #16384F; }
.slide.has-bg.on-dark .slide-inner { text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.slide-inner { position: absolute; inset: 9% 9% 10%; display: flex; flex-direction: column; justify-content: center; gap: 2.4cqw; }
.slide-title { margin: 0; font-family: 'Quicksand', 'Nunito', sans-serif; font-size: 5.2cqw; line-height: 1.12; font-weight: 700; }
.slide-title.big { font-size: 7.4cqw; text-align: center; }
.slide-title + .slide-sub { text-align: center; }
.slide-sub { margin: 0; font-size: 3cqw; font-weight: 700; opacity: .85; }
.slide-list { margin: 0; padding-left: 1.1em; font-size: 3.3cqw; line-height: 1.32; font-weight: 700; display: grid; gap: 1.2cqw; }
.slide-list.small { font-size: 2.6cqw; }
.slide-list.notes { list-style: decimal; }
.slide-q { font-size: 4.4cqw; line-height: 1.25; font-weight: 800; padding: 2.4cqw 3cqw; border-radius: 2cqw; background: rgba(255, 255, 255, .14); }
.slide.on-light .slide-q { background: rgba(255, 255, 255, .72); }
.slide-blank { display: inline-block; width: 9em; border-bottom: .14em solid currentColor; margin: 0 .2em; vertical-align: -.1em; }
.slide-timer-ic { font-size: 7cqw; line-height: 1; }
.slide-num { position: absolute; right: 2.2cqw; bottom: 1.6cqw; font-size: 1.6cqw; font-weight: 800; opacity: .7; }

.deck-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #E3ECF1; flex-wrap: wrap; }
.deck-row:last-child { border-bottom: 0; }
.sl-editor { display: grid; gap: 12px; }
.sl-card { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 12px; align-items: start; }
@media (max-width: 760px) { .sl-card { grid-template-columns: 1fr; } }
.sl-card .slide { box-shadow: 0 4px 14px rgba(15, 43, 61, .18); }
.sl-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.tpl-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.tpl-pages figure { margin: 0; display: grid; gap: 4px; }
.tpl-pages img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid #D5E3EA; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tpl-pick button { padding: 4px; border-radius: 10px; border: 2px solid transparent; background: #F2F7FA; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800; }
.tpl-pick button.on { border-color: #2E8B9B; }
.tpl-pick img, .tpl-pick .tpl-none { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; }
.tpl-pick .tpl-none { background: linear-gradient(150deg, #0F2B3D, #1B4D6B 60%, #2E8B9B); }

.sl-practice { position: fixed; inset: 0; z-index: 60; background: #0B1F2C; color: #fff; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 12px 16px; }
.sl-practice-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sl-practice-main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); gap: 14px; min-height: 0; }
@media (max-width: 760px) { .sl-practice-main { grid-template-columns: 1fr; overflow: auto; } }
.sl-practice-stage { display: flex; align-items: center; justify-content: center; min-height: 0; }
.sl-practice-stage .slide { max-height: 100%; width: auto; max-width: 100%; height: auto; }
.sl-practice-side { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: 12px; overflow: auto; }
.sl-practice-side h3 { margin: 0 0 6px; font-size: .9rem; color: #9FD7E0; }
.sl-practice-notes { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.45; }
.sl-practice-next { margin-top: 12px; opacity: .8; }
.sl-practice-next .slide { border-radius: 8px; }
.sl-practice-bar { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sl-practice-clock { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.3rem; }

.screen-slides { flex: 1; display: flex; align-items: center; justify-content: center; gap: 1.4vw; padding: 1vh 1.4vw 2vh; min-height: 0; }
.screen-slides .slide { width: min(100%, calc((100vh - 12vh) * 16 / 9)); border-radius: 1.4vw; box-shadow: 0 1.4vh 4vh rgba(0, 0, 0, .35); }
.screen-slides .slide-arrow { flex: none; width: 4.2vw; height: 4.2vw; border-radius: 50%; border: 0; font-size: 2vw; cursor: pointer; background: rgba(255, 255, 255, .16); color: inherit; }
.screen-slides .slide-arrow:disabled { opacity: .25; cursor: default; }
body[data-theme="light"] .screen-slides .slide-arrow { background: rgba(27, 77, 107, .12); }
.mode-slides .screen-bar { padding-bottom: 0; }

/* ── 📈 Grades & trends ── */
.g-good { color: #23855A; } .g-ok { color: #2E7C8B; } .g-warn { color: #B07A12; } .g-bad { color: #B84C4C; }
.spark { display: block; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.help-card { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid #F0D5D5; background: #FFF8F8; cursor: pointer; font: inherit; color: inherit; }
.help-card:hover { border-color: #D99; }
.help-grade { font-weight: 900; font-size: 1.15rem; }
.band-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.band { padding: 3px 10px; border-radius: 999px; font-size: .85rem; background: #EEF4F7; }
.band-A { background: #DDF3E7; } .band-B { background: #E2F1F4; } .band-C { background: #FFF3D6; } .band-D { background: #FDE6D3; } .band-F { background: #F9DCDC; }
.show-grid { display: grid; gap: 4px; }
.show-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #EEF3F6; }
.show-row:last-child { border-bottom: 0; }
.side-note b { font-size: 1.05em; line-height: 1.3; }
.todo-line { display: flex; align-items: center; gap: 8px; }
.todo-line .todo-row { flex: 1; }
.todo-line.done .todo-row { opacity: .55; text-decoration: line-through; }
.req-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #EEF3F6; }
.req-row.done { opacity: .6; }
.day-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 12px; max-height: 260px; overflow: auto; }
/* 👀 Test Area preview */
.preview-frames { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.pv-frame { margin: 0; display: grid; gap: 6px; justify-items: center; }
.pv-frame figcaption { font-weight: 800; font-size: .9rem; }
.pv-frame iframe { border: 10px solid #1B2F3D; border-radius: 28px; background: #fff; box-shadow: 0 10px 30px rgba(15, 43, 61, .2); }
.preview-frames.phone iframe { width: 390px; height: 760px; max-width: calc(100vw - 60px); }
.preview-frames.laptop iframe { width: min(100%, 1100px); height: 720px; border-radius: 14px; border-width: 8px; }
.preview-frames.laptop .pv-frame { flex: 1 1 520px; justify-items: stretch; }
.preview-frames.laptop .pv-frame iframe { width: 100%; }
/* Phones: the balance gets its own row so the big number never runs into "This week". */
@media (max-width: 520px) { .money-strip .ms-balance { grid-column: 1 / -1; } }
/* 🙋 All About Me */
.aboutme { max-width: 640px; margin: 0 auto; }
.aboutme fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.aboutme legend { font-weight: 800; margin-bottom: 6px; }
.feel-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel { cursor: pointer; }
.feel input { position: absolute; opacity: 0; }
.feel span { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 2px solid var(--line); text-align: center; }
.feel b { font-size: 1.6rem; }
.feel small { font-size: .7rem; line-height: 1.2; }
.feel input:checked + span { border-color: var(--teal); background: #E8F6F7; }
.feel input:focus-visible + span { outline: 3px solid var(--teal); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 10px; }
/* 📋 Attendance = pay: here/absent, today's tasks, exit ticket */
.att-seg input[value="here"]:checked + span { background: #E6F0E9; border-color: #47705A; color: #2F5A43; }
.att-tasks, .att-exit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.att-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; margin-top: 6px; }
.att-checks .check { margin: 0; min-height: 0; padding: 2px 0; }
.att-tile.away { opacity: .7; background: #FBF4F4; }
.att-answer { margin-top: 4px; padding: 4px 6px; border-radius: 8px; background: #F2F7FA; max-height: 4.2em; overflow: auto; }
.att-sum { margin-top: 6px; }
.exit-card { border-left: 6px solid var(--gold); }
.pay-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.pw-day { display: grid; gap: 3px; align-content: start; padding: 6px; border-radius: 10px; background: #F4F8FA; border: 1.5px solid transparent; min-width: 0; }
.pw-day.today { border-color: var(--teal); background: #EAF6F7; }
.pw-day.off { opacity: .55; }
.pw-day small { color: var(--muted); font-size: .7rem; }
.pw-day .chip { font-size: .7rem; white-space: normal; }
@media (max-width: 520px) { .pay-week { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; } }
.wg-in { width: 64px; text-align: center; font-weight: 800; padding: 6px; }
/* Phones: the top bar always fits — the title shortens instead of pushing Sign out off screen. */
@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 8px 10px; }
  .topbar .brand { min-width: 0; flex: 1 1 auto; }
  .topbar .brand span { overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 1rem; }
  .topbar .spacer { display: none; }
  .topbar #logout { padding-left: 10px; padding-right: 10px; }
}
/* Tab bars wrap onto two lines on small screens instead of running off the side. */
.seg { flex-wrap: wrap; }
@media (max-width: 600px) { .seg { border-radius: 18px; } .seg button { flex: 1 1 auto; padding: 8px 10px; } }
.fb-btn { position: fixed; right: 14px; bottom: 14px; z-index: 30; border: 0; border-radius: 999px; padding: 10px 14px; font: inherit; font-weight: 900; background: #1B4D6B; color: #fff; box-shadow: 0 6px 18px rgba(15, 43, 61, .3); cursor: pointer; }
.fb-btn:hover { background: #2E8B9B; }
@media print { .fb-btn { display: none; } }
.slip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.slip-grid .slip { display: grid; gap: 4px; }
