/* Book Feedback · MIT English Learning Centers
   Colors come from the school crest: the blue disc (#4E6AA9, deepened for text contrast) and the gold tree (#FCD209). */

:root {
  --brand: #2F4B8A;
  --brand-hover: #253D72;
  --brand-50: #EEF2FA;
  --brand-100: #DCE4F4;
  --gold: #FCD209;

  --ink: #141B2D;
  --text: #1F2937;
  --muted: #566072;
  --subtle: #8A93A2;

  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --canvas: #E8EBF0;
  --border: #E2E5EB;
  --border-strong: #CBD1DB;

  --ok: #0B8A4E;
  --ok-50: #E8F6EE;
  --warn-bg: #FFF8E3;
  --warn-ink: #7A5200;
  --error: #B42318;
  --error-50: #FEF1EF;

  --t-mistake: #C8372D;
  --t-too_hard: #C2410C;
  --t-too_easy: #1D64C8;
  --t-boring: #64748B;
  --t-loved: #15803D;
  --t-idea: #7C3AED;
  --t-all: #2F4B8A;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 28px rgba(16, 24, 40, .09);
  --shadow-lg: 0 24px 56px rgba(16, 24, 40, .2);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
.t-mistake { --tc: var(--t-mistake); }
.t-too_hard { --tc: var(--t-too_hard); }
.t-too_easy { --tc: var(--t-too_easy); }
.t-boring { --tc: var(--t-boring); }
.t-loved { --tc: var(--t-loved); }
.t-idea { --tc: var(--t-idea); }
.t-all { --tc: var(--t-all); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; color: var(--ink); margin: 0 0 6px; }
h2 { font-size: 16px; line-height: 1.35; font-weight: 650; color: var(--ink); margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 15px; max-width: 76ch; }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0; }
.hint.small { font-size: 12.5px; }
.hint.center { text-align: center; }
.empty { color: var(--muted); padding: 32px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; margin: 8px 0 0; }
.empty.small { padding: 16px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--brand)); flex: none; display: inline-block; }
.ui-icon { display: inline-flex; flex: none; }
.ui-icon svg { width: 16px; height: 16px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 24px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 38px; height: 38px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--subtle); letter-spacing: .01em; }
.tabs { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.tabs a {
  display: flex; align-items: center; padding: 0 14px; margin-bottom: -1px;
  color: var(--muted); font-weight: 550; font-size: 14.5px;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-btn {
  height: 34px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-weight: 600; font-size: 13px;
}
.lang-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.who {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; text-align: left;
  border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer;
}
.who:hover { background: var(--surface-2); border-color: var(--border); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.who-text { display: flex; flex-direction: column; line-height: 1.2; }
.who-text strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.who-text small { font-size: 12px; color: var(--subtle); }
main { max-width: 1440px; margin: 0 auto; padding: 28px 28px 56px; }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1.25; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #B7BECA; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ok, .btn.send { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover, .btn.send:hover { background: #08703F; border-color: #08703F; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.big { min-height: 50px; font-size: 15.5px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.link-btn {
  background: none; border: 0; padding: 2px 4px; min-height: 28px; cursor: pointer;
  color: var(--subtle); font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--error); }

textarea, input[type="text"], input[type="search"], input[type="number"], input[type="password"], select {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  font-size: 15px; color: var(--ink); box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
::placeholder { color: #9CA3AF; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
input[type="search"] {
  padding-left: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
  background-repeat: no-repeat; background-position: 12px center; background-size: 16px;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: 13.5px; color: var(--ink); margin: 0 0 4px; }
.form-error {
  padding: 10px 12px; margin: 10px 0; border-radius: 10px;
  background: var(--error-50); color: var(--error); border: 1px solid #F6C8C2;
  font-weight: 550; font-size: 14px;
}
.warn { margin: 6px 0; padding: 8px 12px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #F1DDA0; border-radius: 10px; font-size: 13.5px; }
.error-box {
  max-width: 520px; margin: 56px auto; padding: 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.error-box p { margin: 0 0 16px; font-weight: 550; color: var(--ink); }

/* ---------- sign-in ---------- */
.signin {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  max-width: 1040px; min-height: min(640px, calc(100vh - 140px)); margin: 8px auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow-md);
}
.signin-aside {
  position: relative; overflow: hidden; padding: 52px 48px;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; background: linear-gradient(155deg, #33518F 0%, #253E75 52%, #1A2D57 100%);
}
.signin-aside::after {
  content: ''; position: absolute; right: -140px; bottom: -140px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(252, 210, 9, .22), transparent 66%);
}
.aside-logo { width: 88px; height: 88px; margin-bottom: 30px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .28)); }
.aside-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .68); }
.aside-title { margin: 0 0 14px; font-size: 36px; line-height: 1.12; font-weight: 750; letter-spacing: -.02em; color: #fff; }
.aside-lead { margin: 0 0 28px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .86); max-width: 40ch; }
.aside-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.aside-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .94); }
.aside-points li::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--gold) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A2D57' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center / 12px no-repeat;
}
.signin-card { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.signin-card > .btn.small { align-self: flex-start; }
.signin-card .lead { margin: 0; }
.card-brand { display: none; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-brand img { width: 40px; height: 40px; }
.card-brand strong { font-size: 17px; color: var(--ink); }
.card-title, .role-title { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.role-choices { display: grid; gap: 12px; margin: 6px 0 4px; }
.role-choice {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.role-choice:hover { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.role-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.role-choice.editor .role-icon { background: #FFF5CC; color: #7A5B00; }
.role-icon .ui-icon svg { width: 22px; height: 22px; }
.role-choice-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.role-choice strong { font-size: 16px; color: var(--ink); }
.role-choice small { font-size: 13.5px; color: var(--muted); }
.chev { color: var(--subtle); }
.chev .ui-icon svg { width: 18px; height: 18px; }
.role-choice:hover .chev { color: var(--brand); }
.setup-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #F1DDA0; font-size: 13.5px; }
.google-slot:empty { display: none; }
.test-signin { display: grid; gap: 6px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); }
.test-signin .hint { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.test-signin .btn { margin-top: 8px; }
.school-picker { width: 100%; }
.school-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 4px; }
.school-btn {
  min-height: 52px; padding: 10px; cursor: pointer; font-weight: 600; color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.school-btn:hover { border-color: var(--brand); }
.school-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.account-line { margin: 8px 0 16px; line-height: 1.6; }
.role-badge { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.role-badge.editor { background: #FFF5CC; color: #7A5B00; }

/* ---------- dialogs ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; padding: 20px; display: grid; place-items: center;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 26px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal h2 { font-size: 19px; }
.modal.wide { width: min(1120px, 100%); height: calc(100vh - 40px); display: flex; flex-direction: column; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.confirm-list { list-style: none; margin: 14px 0 22px; padding: 0; display: grid; gap: 8px; max-height: 45vh; overflow: auto; counter-reset: note; }
.confirm-list li {
  position: relative; counter-increment: note; padding: 10px 12px 10px 44px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  font-size: 14px; overflow-wrap: anywhere;
}
.confirm-list li::before {
  content: counter(note); position: absolute; left: 12px; top: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
}
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .confirm-no { order: -1; }
.thumb-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; padding: 4px; align-content: start; }
.thumb { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; }
.thumb:hover { background: var(--surface-2); }
.thumb.current { border-color: var(--brand); background: var(--brand-50); }
.thumb-img { display: block; width: 100%; background: var(--canvas); border-radius: 3px; overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 4px 10px rgba(16, 24, 40, .08); }
.thumb-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb-label { display: flex; justify-content: center; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.thumb-count { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; }

/* ---------- books ---------- */
.books > h1 { margin-bottom: 4px; }
/* Editors: the Dropbox folder the books come from. */
.library-note {
  display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 18px; padding: 14px 16px;
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px;
}
.library-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--brand); }
.library-icon .ui-icon svg { width: 20px; height: 20px; }
.library-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.library-text strong { font-size: 14px; color: var(--ink); }
.library-path {
  align-self: flex-start; max-width: 100%; padding: 6px 10px; border-radius: 8px; overflow-wrap: anywhere; user-select: all;
  font: 600 13.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand);
  background: var(--surface); border: 1px solid var(--brand-100);
}
.library-text small { font-size: 13px; color: var(--muted); }
.books-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
}
.section-select { width: auto; min-width: 260px; }
.search { flex: 1 1 280px; width: auto !important; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; white-space: nowrap; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 550; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 24px; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13.5px;
}
.chip:hover { border-color: var(--border-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.book-group { margin-bottom: 28px; }
.group-note { margin: -6px 0 10px; font-size: 13px; color: var(--muted); }
.group-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--subtle); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.book-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 74px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.book-card:hover { text-decoration: none; border-color: #C1C8D4; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.book-icon {
  flex: none; width: 38px; height: 48px; display: grid; place-items: center; border-radius: 3px 8px 8px 3px;
  background: linear-gradient(135deg, #37548F, #213A6B); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: inset 4px 0 0 var(--gold), 0 2px 5px rgba(16, 24, 40, .18);
}
.book-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.book-card-text strong { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.book-card-text small { color: var(--subtle); font-size: 12.5px; }
.count-badge { flex: none; min-width: 26px; height: 26px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 12.5px; }
.sent-badge { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--ok-50); color: var(--ok); font-weight: 650; font-size: 12.5px; white-space: nowrap; }

/* ---------- the page viewer ---------- */
.viewer-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
}
.back { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px 7px 6px; border-radius: 8px; white-space: nowrap; font-weight: 600; font-size: 14px; color: var(--muted); }
.back:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.viewer-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; padding-left: 16px; border-left: 1px solid var(--border); }
.viewer-title small { color: var(--subtle); font-size: 12.5px; }
.viewer-title strong { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.page-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jump { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.jump label { font-weight: 550; font-size: 14px; color: var(--muted); }
.page-input { width: 64px !important; min-height: 38px !important; padding: 6px !important; text-align: center; }
.of { color: var(--subtle); white-space: nowrap; font-size: 14px; }
.fb-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 2px 0; font-size: 13px; }
.fb-pages-label { color: var(--subtle); font-weight: 600; margin-right: 2px; }
.unsent-label { margin-left: 12px; color: #8A5A00; }
.fb-page {
  min-width: 32px; height: 26px; padding: 0 9px; display: grid; place-items: center; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-weight: 600; font-size: 12.5px;
}
.fb-page:hover { border-color: var(--border-strong); text-decoration: none; }
.fb-page.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.fb-page.unsent { border: 1px dashed #D9A441; background: #FFF8E6; color: #7A5200; }
.viewer-body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; margin-top: 16px; align-items: start; }
.page-col { min-width: 0; padding: 14px 20px 28px; background: var(--canvas); border: 1px solid var(--border); border-radius: 16px; }
.page-tools { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 12px; }
.page-tools .btn { white-space: nowrap; flex: none; }
.page {
  position: relative; margin: 0 auto; background: #fff; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 14px 36px rgba(16, 24, 40, .16);
  width: min(100%, max(620px, calc((100vh - 270px) * var(--ar, .77))));
  cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.page-col.zoomed .page { width: 100%; }
/* A finger can still scroll the page while marking; a tap places the box. Only the box itself captures drags. */
.page.marking { touch-action: manipulation; outline: 3px solid var(--tc, var(--brand)); outline-offset: 6px; }
/* While marking, earlier notes' numbers must not block a new box drawn over the same words. */
.page.marking .pin { pointer-events: none; }
.page-img { display: block; width: 100%; height: 100%; border-radius: 3px; }
.page-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: 14px; color: var(--subtle); }
.page-status .error-box { margin: 0; }

.pin {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  width: 28px; height: 28px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 2px solid #fff; background: var(--tc, var(--brand)); color: #fff;
  font-weight: 700; font-size: 12.5px; box-shadow: 0 2px 6px rgba(16, 24, 40, .35);
}
.pin.corner { width: 24px; height: 24px; font-size: 11.5px; }
.pin.s-done, .pin.s-dismissed, .mark-box.s-done, .mark-box.s-dismissed { opacity: .45; }
.pin.focus { opacity: 1; z-index: 3; animation: pulse 1.3s ease-out 3; }
.pin.draft { background: #fff; color: var(--tc, var(--brand)); border: 2px dashed var(--tc, var(--brand)); pointer-events: none; }
.pin.unsent { background: #fff; color: var(--tc); border: 2px dashed var(--tc); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tc, var(--brand)) 60%, transparent); }
  100% { box-shadow: 0 0 0 22px transparent; }
}
.mark-box {
  position: absolute; z-index: 1; pointer-events: none; border-radius: 3px;
  border: 2px solid var(--tc, var(--brand)); background: color-mix(in srgb, var(--tc, var(--brand)) 10%, transparent);
}
.mark-box.focus { opacity: 1; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--tc, var(--brand)); }
.mark-box.draft, .mark-box.temp, .mark-box.unsent { border-style: dashed; }
.page.marking .mark-box.draft { pointer-events: auto; cursor: move; touch-action: none; }
/* Corner handles: a small visible dot inside a finger-sized target. */
.mark-handle { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; touch-action: none; pointer-events: auto; }
.mark-handle::after {
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--tc, var(--brand)); box-shadow: 0 1px 4px rgba(16, 24, 40, .35);
}
.mark-handle.nw { left: 0; top: 0; cursor: nwse-resize; }
.mark-handle.ne { left: 100%; top: 0; cursor: nesw-resize; }
.mark-handle.sw { left: 0; top: 100%; cursor: nesw-resize; }
.mark-handle.se { left: 100%; top: 100%; cursor: nwse-resize; }

/* The right-hand sidebar: one card, sections divided by lines. */
.side {
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.panel-stack { display: block; }
.panel { padding: 20px; background: var(--surface); }
.panel-stack > .panel + .panel { border-top: 1px solid var(--border); }
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.menu h2 { font-size: 17px; letter-spacing: -.01em; }

.tool-list { display: grid; gap: 8px; }
.tool-list.nudge { animation: nudge .45s ease-in-out 2; }
@keyframes nudge { 50% { transform: translateX(-6px); } }
.tool-btn {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 40px 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tool-btn::after {
  content: ''; position: absolute; right: 17px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid #A9B0BC; border-top: 2px solid #A9B0BC; transform: translateY(-50%) rotate(45deg);
}
.tool-btn:hover {
  border-color: color-mix(in srgb, var(--tc) 50%, white);
  background: color-mix(in srgb, var(--tc) 4%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 10%, transparent);
}
.tool-btn:hover::after { border-color: var(--tc); }
.tool-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 11%, white); color: var(--tc); }
.tool-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tool-text strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.tool-text small { font-size: 12.5px; color: var(--muted); }
.kind-list .tool-btn { min-height: 52px; padding-left: 16px; }

.step { border-top: 4px solid var(--tc); }
.step-kind { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-kind strong { font-size: 15px; color: var(--ink); }
.step-big { display: block; margin: 12px 0 10px; font-size: 19px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.step textarea { font-size: 16px; min-height: 112px; }
.step .btn.big { margin-top: 14px; }
.step .btn.ghost.wide { margin-top: 8px; }
.step-actions { display: grid; gap: 8px; margin-top: 16px; }

.sent-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--ok-50); border: 1px solid #BFE4CE; color: var(--ok);
}
.sent-note strong { font-size: 14.5px; }
.already-sent { margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand); font-weight: 550; font-size: 13.5px; }
.dup-warn { display: grid; gap: 6px; margin: 10px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid #F1DDA0; color: var(--warn-ink); font-size: 14px; }
.dup-text { color: var(--ink); overflow-wrap: anywhere; }
.dup-warn .btn { justify-self: start; margin-top: 4px; }

.my-list { background: #FFFCF3; }
.draft-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
/* Scoped to the list: marks drawn on the page also carry the class "draft". */
.draft-list .draft {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 10px 12px; background: var(--surface); border: 1px solid #EEE2C1; border-radius: 12px;
}
.draft-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.draft-body strong { font-size: 13.5px; color: var(--ink); }
.draft-text { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.pin-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tc, var(--brand)); color: #fff; font-weight: 700; font-size: 12px; }
.pin-num.dashed { background: #fff; color: var(--tc, #8A5A00); border: 2px dashed var(--tc, #D9A441); }
/* Keep the send button in view at the bottom of the sidebar, however long the list gets. */
.my-list .send-all { position: sticky; bottom: 10px; z-index: 2; box-shadow: 0 8px 22px rgba(11, 138, 78, .3); }

.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; box-shadow: inset 3px 0 0 var(--tc); }
.note.focus { border-color: var(--tc); box-shadow: inset 3px 0 0 var(--tc), 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); }
.note.s-done, .note.s-dismissed { background: var(--surface-2); }
.note.compact { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; cursor: default; }
.note.compact .status-chip { align-self: flex-start; margin-top: 2px; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--tc); }
.status-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: #EEF1F6; color: #475467; font-weight: 600; font-size: 12px; }
.status-chip.s-open { background: var(--brand-50); color: var(--brand); }
.status-chip.s-done { background: var(--ok-50); color: var(--ok); }
.status-chip.s-dismissed { background: #F1F2F4; color: #667085; }
.demo-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: #FFF1C7; color: #6B4E00; font-weight: 700; font-size: 12px; }
.spot-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: #FFEFD2; color: #8A5300; font-weight: 650; font-size: 12px; }
.note > .spot-chip { margin-top: 6px; }
.whole-tag { font-size: 12px; font-weight: 600; color: var(--subtle); }
.note-text { margin: 6px 0 4px; font-size: 14.5px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-fix { margin: 4px 0; padding: 6px 10px; border-radius: 8px; background: #F1F8F3; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.note-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--subtle); }
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.editor-actions { display: contents; }
/* Editor tools on a note: four statuses, same-for-the-spot, private note (Richard 2026-09-16). */
.editor-tools { flex-basis: 100%; display: grid; gap: 8px; }
.status-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 3px; background: #EDEFF3; border-radius: 10px; }
.status-btn { min-height: 38px; padding: 0 6px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; font-size: 13px; line-height: 1.2; color: var(--muted); }
.status-btn:hover { color: var(--ink); }
.status-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); cursor: default; }
.status-btn.s-open[aria-pressed="true"] { color: var(--brand); }
.status-btn.s-in_progress[aria-pressed="true"] { color: #8A5300; }
.status-btn.s-done[aria-pressed="true"] { color: var(--ok); }
.status-btn.s-dismissed[aria-pressed="true"] { color: #667085; }
.spot-all { justify-self: start; }
.editor-note-label { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.editor-note-row { display: flex; gap: 6px; align-items: flex-start; }
.editor-note-box { flex: 1; min-height: 44px; font-size: 14px; }
.status-by { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.status-chip.s-in_progress { background: #FFF1D6; color: #8A5300; }
.status-counts { flex-wrap: wrap; }
.seg-count { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: rgba(20, 27, 45, .08); font-size: 12px; }
.seg-btn[aria-pressed="true"] .seg-count { background: var(--brand-50); color: var(--brand); }
.next-note { white-space: nowrap; }

/* ---------- Teacher Feedback (editor summary) ---------- */
.summary-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 20px; }
.summary-head .lead { margin: 0; }
.summary-tools { display: flex; gap: 8px; }
.type-cards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.type-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 14px 12px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.type-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); }
.type-card:hover { border-color: #C1C8D4; }
.type-card-n { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.type-card-label { font-size: 13px; font-weight: 550; color: var(--muted); }
.type-card[aria-pressed="true"] { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 6%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 14%, transparent); }
.type-card[aria-pressed="true"] .type-card-n { color: var(--tc); }
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
}
.filters select { width: auto; min-width: 150px; font-size: 14px; }
.filters input[type="search"] { flex: 1 1 220px; width: auto; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #EDEFF3; border-radius: 10px; }
.seg-btn { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.count-line { margin: 10px 2px 16px; font-size: 13.5px; color: var(--subtle); }
.sum-group { margin-bottom: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); }
.sum-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sum-group-head .book-icon { width: 32px; height: 40px; font-size: 13px; }
.sum-group-title { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; }
.sum-group-title strong { font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.sum-group-title small { font-size: 12.5px; color: var(--subtle); }
.page-tag { font-weight: 600; font-size: 13px; color: var(--muted); }

/* Side by side: the list on the left, the chosen note's page on the right. */
.triage { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.summary-list { min-width: 0; }
.summary-list .sum-group { margin-bottom: 14px; }
.summary-list .sum-group-head { padding: 10px 14px; }
.sum-row { padding: 12px 14px 12px 17px; cursor: pointer; box-shadow: inset 3px 0 0 var(--tc); transition: background .12s; }
.sum-row + .sum-row { border-top: 1px solid var(--border); }
.sum-row:hover { background: var(--surface-2); }
.sum-row.shared-spot { background: #FFFCF4; }
.sum-row.s-done, .sum-row.s-dismissed { background: #FBFBFC; }
.sum-row.selected { background: var(--brand-50); box-shadow: inset 4px 0 0 var(--brand); }
.sum-row:focus-visible { outline-offset: -3px; }
.note-text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 2px; }
.sum-row .note-meta { margin-top: 2px; }
.detail {
  position: sticky; top: 84px; height: calc(100vh - 100px); min-height: 480px;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.detail-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.detail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.detail-title small { font-size: 12.5px; color: var(--subtle); }
.detail-title strong { font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.detail-frame { flex: 1 1 auto; min-height: 200px; overflow: auto; padding: 16px; background: var(--canvas); }
.detail-page { position: relative; max-width: 920px; margin: 0 auto; overflow: hidden; background: #fff; border-radius: 3px; box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 10px 28px rgba(16, 24, 40, .14); }
.detail-page img { display: block; width: 100%; height: auto; }
/* The spot stays bright; the rest of the page dims slightly. */
.detail-box, .detail-pin { position: absolute; pointer-events: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .95), 0 0 0 9999px rgba(20, 27, 45, .16); }
.detail-box { border: 3px solid var(--tc); border-radius: 4px; }
.detail-pin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--tc); transform: translate(-50%, -50%); }
.detail-missing { display: grid; place-items: center; height: 100%; margin: 0; color: var(--subtle); font-size: 14px; }
.detail-body { flex: none; max-height: 46%; overflow: auto; padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.detail-body .note-text { font-size: 15.5px; }
.same-spot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.same-spot h3 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.same-spot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.same-spot-item { width: 100%; display: grid; gap: 2px; padding: 8px 10px; text-align: left; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.same-spot-item:hover { border-color: var(--border-strong); }
.same-spot-item strong { font-size: 13.5px; color: var(--ink); }
.same-spot-item span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }

/* Phones and tablets: bottom bar and sliding sheet (see drawBar in app.js). Hidden on computers. */
.mobile-bar, .sheet-head { display: none; }

/* ---------- Editors page ---------- */
.editors-page { max-width: 760px; margin: 0 auto; }
.editors-page .panel { padding: 22px; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.editor-add { margin-bottom: 6px; }
.editor-add-row { display: flex; gap: 8px; }
.editor-add-row .btn { white-space: nowrap; flex: none; }
.editor-list { list-style: none; margin: 18px 0 0; padding: 0; }
.editor-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 2px; border-top: 1px solid var(--border); }
.editor-email { flex: 1 1 240px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.editor-meta { font-size: 12.5px; color: var(--subtle); }
.you { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 12px;
  background: #1F2937; color: #fff; font-weight: 550; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 8px); opacity: 0; } }
.toast.error { background: var(--error); }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .type-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .viewer-body { grid-template-columns: 1fr; padding-bottom: 92px; }
  .page { width: 100%; }
  .side {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40;
    max-height: 64vh; overflow: auto; border-radius: 20px 20px 0 0; border-bottom: 0;
    box-shadow: 0 -14px 40px rgba(16, 24, 40, .22); padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up .22s ease-out;
  }
  .viewer-body[data-step="menu"][data-sheet="closed"] .side { display: none; }
  .viewer-body[data-step="menu"][data-sheet="menu"] .sent-list { display: none; }
  .viewer-body[data-step="menu"][data-sheet="list"] .menu { display: none; }
  .viewer-body[data-step="write"] .side { max-height: 56vh; }
  .viewer-body[data-step="write"] { padding-bottom: 58vh; }
  .viewer-body[data-step="kind"], .viewer-body[data-step="menu"]:not([data-sheet="closed"]) { padding-bottom: 66vh; }
  .viewer-body[data-step="mark"] { padding-bottom: 260px; }
  .viewer-body[data-step="mark"] .step-actions { grid-template-columns: 1fr 1fr; }
  .sheet-head {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 3;
    padding: 8px 12px 8px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); }
  .mobile-bar {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08);
  }
  .viewer-body:not([data-step="menu"]) .mobile-bar, .viewer-body:not([data-sheet="closed"]) .mobile-bar { display: none; }
  .mobile-bar .btn { min-height: 54px; padding: 0 8px; font-size: 15px; }
  .mark-handle { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .mark-handle::after { inset: 13px; }
  .toast { bottom: 100px; }
  .triage { grid-template-columns: 1fr; }
  .detail { display: none !important; }
}
@keyframes sheet-up { from { transform: translateY(40px); } }
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; min-height: 0; margin: 0; border-radius: 18px; }
  .signin-aside { display: none; }
  .card-brand { display: flex; }
  .signin-card { padding: 28px 22px; }
}
@media (max-width: 720px) {
  main { padding: 16px 12px 40px; }
  h1 { font-size: 22px; }
  .topbar { height: 58px; gap: 12px; padding: 0 12px; }
  .brand-text, .who-text { display: none; }
  .who { padding: 2px; }
  .tabs a { padding: 0 8px; font-size: 13.5px; }
  .viewer-title { padding-left: 0; border-left: 0; }
  .page-col { padding: 10px 8px 16px; }
  .type-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-select { min-width: 0; width: 100%; }
}
