/* Source: styles.css */
:root {
  --bg: #e7eee8;
  --paper: #f7faf7;
  --ink: #142019;
  --muted: #5a675e;
  --line: #d0ddd4;
  --accent: #1a6b48;
  --accent-ink: #f3f8f4;
  --accent-soft: #d7eadf;
  --rush: #9a3412;
  --rush-bg: #ffedd5;
  --steady: #14532d;
  --steady-bg: #dcfce7;
  --safe: #1e3a8a;
  --safe-bg: #dbeafe;
  --fight: #854d0e;
  --fight-bg: #fef3c7;
  --hard: #3f3f46;
  --hard-bg: #e4e4e7;
  --danger: #9f1239;
  --radius: 16px;
  --shadow: 0 8px 24px rgb(20 32 25 / 7%);
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
  --tab: 44px;
  --top: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --paper: #1b211d;
    --ink: #e7eee9;
    --muted: #9aa89f;
    --line: #2c352f;
    --accent: #3d9a6e;
    --accent-ink: #062015;
    --accent-soft: #1d3a2d;
    --rush: #fdba74;
    --rush-bg: #3b2412;
    --steady: #86efac;
    --steady-bg: #163424;
    --safe: #93c5fd;
    --safe-bg: #1b2d4a;
    --fight: #fde68a;
    --fight-bg: #3a2e12;
    --hard: #d4d4d8;
    --hard-bg: #2a2a2e;
    --danger: #fb7185;
    --shadow: 0 10px 28px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(820px 260px at 50% -90px, rgb(26 107 72 / 12%), transparent 62%),
    var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px;
  background: var(--paper);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.top-row .brand { flex-shrink: 0; }
.user-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.user-org {
  font-size: 12px;
  color: var(--muted);
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-name {
  font-size: 13px;
  font-weight: 650;
  max-width: 6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-out {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  transition: background 0.15s ease, transform 0.12s ease;
}
.user-out:active { transform: scale(0.97); }

.auth {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: 20px 16px 32px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #cfe4d7, transparent 55%),
    var(--bg);
}
body.auth-on .auth {
  display: grid;
}
.auth-card {
  width: min(440px, 100%);
  margin: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.auth-apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-apps button {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  font-weight: 700;
  font-size: 13px;
}
.auth-apps button:active { transform: scale(0.98); }
.auth-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ico-tqz { background: #1a6b48; }
.ico-zsb { background: #1e334d; }
.ico-sanyi { background: #a6843d; }
.ico-jobs { background: #8b1e2d; }
.ico-live { background: #0f766e; }
.ico-iv { background: #5b4bb4; }
.ico-bank { background: #c23b2a; }
.ico-ace { background: #b45309; }
.ico-hist { background: #1e40af; }
.auth-apps b {
  text-align: center;
  line-height: 1.25;
  font-size: 12px;
}
.auth-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
}
.auth-brand .mark { width: 48px; height: 48px; font-size: 18px; border-radius: 14px; }
.auth-brand h1 { font-size: 20px; }
.auth-brand p { font-size: 13px; color: var(--muted); }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
}
.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
}
.auth-tabs button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 4px rgb(23 33 27 / 8%);
}
.auth-form { display: grid; gap: 12px; }
.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}
.auth-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--bg);
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--paper);
}
.auth-form .btn-primary { width: 100%; }
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.auth-switch button {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  padding: 0 4px;
  min-height: 0;
}
.auth-err {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}
.auth-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.auth-invite {
  margin: 0;
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.org-panel { display: grid; gap: 12px; }
.org-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.org-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
}
.org-logo.empty {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.org-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}
.org-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.org-dl dt { font-size: 12px; color: var(--muted); }
.org-dl dd { margin: 2px 0 0; font-weight: 650; }
.org-members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.org-members li {
  display: grid;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.org-members li.stu-on {
  background: #f6f8f6;
  margin: 0 -8px;
  padding: 8px;
  border-radius: 10px;
}
.org-members span { color: var(--muted); font-size: 12px; }
.stu-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stu-export {
  margin: 0 0 10px;
}
.stu-export .btn {
  min-height: 40px;
  flex: 1;
}
.stu-sec-h {
  font-size: 15px;
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#stu-sec-grades .stu-sec-h {
  border-top: 0;
  padding-top: 0;
  margin-top: 4px;
}
.lead-share {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 10px 0 4px;
}
.lead-qr {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.lead-share-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}
@media (max-width: 640px) {
  .lead-share { flex-direction: column; align-items: center; }
  .lead-share-main { width: 100%; }
}
.stu-plan-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.stu-plan-list li {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.stu-plan-list span { font-size: 13px; color: var(--muted); }
.viewas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  background: #fff8e8;
  border-bottom: 1px solid #e6c98a;
  font-size: 13px;
  flex-shrink: 0;
}
.stu-report {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stu-report h3 { font-size: 16px; margin: 0 0 8px; }
.stu-report h4 { font-size: 15px; margin: 12px 0 8px; }
.stu-report p { font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.stu-overall {
  background: #f6f8f6;
  border: 1px solid #d5e4d8;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.stu-overall h4 { margin-top: 0; }
.stu-overall .ov-item { margin: 0 0 10px; }
.stu-overall .ov-item b {
  display: block;
  color: #1f6b4a;
  font-size: 13px;
  margin-bottom: 2px;
}
.stu-overall .ov-verdict {
  background: #e8f4ea;
  border-radius: 8px;
  padding: 8px 10px;
}
.org-members em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--accent);
}
body.auth-on {
  padding: 0;
  overflow: hidden;
}
body.auth-on .top,
body.auth-on .tabbar,
body.auth-on #main,
body.auth-on #sheet { display: none !important; }
.brand { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 6px 14px rgb(26 107 72 / 22%);
}
.top h1 { font-size: 16px; font-weight: 720; letter-spacing: 0.01em; }
.sub { font-size: 12px; color: var(--muted); }
@media (max-width: 420px) {
  .sub { display: none; }
  .top h1 { font-size: 15px; }
  .mark { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
}

#main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 12px 16px 24px;
}
body.stu-mode #main {
  width: 100%;
  max-width: none;
  padding: 12px 18px 28px;
}
.stu-page { display: grid; gap: 14px; }
.stu-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.stu-head .lead { margin-bottom: 0; }
.stu-head .stu-export { margin: 0; display: flex; gap: 8px; }
.stu-head .stu-export .btn { flex: 0 0 auto; min-height: 36px; }
.stu-add h2,
.stu-board h2,
.stu-work h2 {
  font-size: 16px;
  margin: 0 0 10px;
}
.stu-add-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stu-grades-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}
.stu-sub {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.stu-sub select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--paper);
}
.stu-sub select.has-g {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
}
.stu-board { min-width: 0; }
.stu-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.stu-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 1080px;
}
.stu-table th,
.stu-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.stu-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8f0ea;
  font-size: 12px;
  font-weight: 700;
  color: #1a2b22;
  white-space: nowrap;
}
.stu-th-name,
.stu-td-name {
  text-align: left;
  white-space: nowrap;
  padding-left: 10px;
}
.stu-td-name { font-weight: 700; }
.stu-td-phone {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.stu-td-n { font-variant-numeric: tabular-nums; font-weight: 650; }
.stu-th-act,
.stu-td-act { text-align: left; }
.stu-table select {
  min-height: 32px;
  min-width: 54px;
  width: 100%;
  max-width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 4px;
  background: var(--paper);
  text-align: center;
  font-weight: 700;
}
.stu-table select.has-g {
  border-color: var(--accent);
  color: var(--accent);
}
.stu-table tr.stu-on td { background: var(--accent-soft); }
.stu-table .stu-acts { flex-wrap: wrap; }
.stu-work-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (min-width: 1280px) {
  .stu-grades-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .stu-add-meta { grid-template-columns: 1fr; }
  .stu-grades-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stu-work-grid { grid-template-columns: 1fr; }
}

.hero-line {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 8px 0 6px;
}
.lead { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgb(20 32 25 / 4%);
}
.panel + .panel { margin-top: 14px; }

.grade-row {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.grade-row + .grade-row { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sub-name { font-size: 14px; font-weight: 600; }
.pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.pills button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.pills button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 4px 10px rgb(26 107 72 / 18%);
}
.pills button:active { transform: scale(0.98); }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 650;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  width: 100%;
  font-size: 16px;
  box-shadow: 0 6px 16px rgb(26 107 72 / 22%);
}
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.seg button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  font-weight: 650;
  padding: 0 4px;
}
.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 4px 0 12px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 20px; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.steady b { color: var(--steady); }
.stat.safe b { color: var(--safe); }
.stat.rush b { color: var(--rush); }
.stat.hard b { color: var(--hard); }

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip, .search {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
.search {
  min-width: 140px;
  flex: 1;
  border-radius: 12px;
}
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}

.school {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.school-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
}
.school-name { font-size: 16px; font-weight: 700; }
.meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.best {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.major-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.major-name { font-weight: 650; }
.nums { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.need { margin-top: 4px; font-size: 13px; }

.band {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.band-rush { background: var(--rush-bg); color: var(--rush); }
.band-steady { background: var(--steady-bg); color: var(--steady); }
.band-safe { background: var(--safe-bg); color: var(--safe); }
.band-fight { background: var(--fight-bg); color: var(--fight); }
.band-hard { background: var(--hard-bg); color: var(--hard); }

.majors { margin-top: 8px; display: grid; gap: 8px; }
.major {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 48px;
}
.major:active { transform: scale(0.99); }

.tabbar {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 0 6px;
  overflow-x: auto;
  justify-content: center;
}
.tabbar:empty { display: none; }
.tabbar button {
  flex: 0 0 auto;
  min-height: 36px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.1;
  border-radius: 999px;
  padding: 0 8px;
}
.tabbar button[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
body.jobs-mode #main {
  width: 100%;
  max-width: none;
  padding: 0;
  height: calc(100dvh - var(--top) - var(--tab) - 24px);
}
.jobs-hub {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.jobs-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 0;
}
.jobs-hub-bar {
  display: none;
}
.jobs-hub-bar a { color: #0b57d0; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgb(16 26 20 / 46%);
  display: grid;
  align-items: end;
}
.sheet-card {
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  max-height: min(92dvh, 860px);
  overflow: auto;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgb(16 26 20 / 16%);
}
.grab {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 8px auto 12px;
}
.kv { display: grid; grid-template-columns: 5.5rem 1fr; gap: 6px 10px; font-size: 14px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.break { display: grid; gap: 6px; margin: 8px 0 12px; }
.break div {
  display: grid;
  grid-template-columns: 4.2rem 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.bar {
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 15;
  max-width: 90vw;
}

.empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}
.warn { color: var(--danger); font-size: 13px; margin-top: 8px; }
.plan {
  white-space: pre-wrap;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.65;
}

@media (min-width: 720px) {
  .hero-line { font-size: 26px; }
  .sheet {
    align-items: center;
    justify-content: center;
  }
  .sheet-card {
    border-radius: 16px;
    width: min(640px, 92vw);
    max-height: 88vh;
  }
}

.school-pop-title { font-size: 22px; margin: 4px 0 8px; }
.school-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  min-height: 32px;
}
.meta-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.meta-chip.meta-link { color: #0b57d0; font-weight: 600; }
.ext-link {
  color: #0b57d0;
  text-decoration: underline;
  font-weight: 600;
}
.muted { color: var(--muted); }
.pop-h { font-size: 14px; margin: 16px 0 8px; }
.time-axis {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -8px 12px;
  padding: 6px 8px 10px;
}
.time-axis-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 560px;
  position: relative;
}
.time-axis-track::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 30px;
  height: 2px;
  background: var(--accent-soft);
}
.time-node {
  flex: 1;
  min-width: 108px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.time-node b {
  display: block;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
}
.time-node i {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.time-node span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  padding: 0 4px;
  word-break: break-word;
}
.time-node.empty b { color: var(--muted); font-weight: 650; }
.time-node.empty i {
  background: var(--line);
  box-shadow: none;
}
.intro-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.job-chip em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  color: var(--accent);
  margin-top: 2px;
}
.salary-avg {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink);
}
.salary-avg b {
  font-size: 20px;
  color: var(--accent);
  margin: 0 4px;
}
a.job-chip-link {
  text-decoration: none;
  color: inherit;
}
.hire-card {
  display: block;
  padding: 12px 14px;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.hire-card:active { transform: scale(0.99); }
.hire-card b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #0b57d0;
}
.hire-card span {
  font-size: 12px;
  color: var(--muted);
}
.hire-more {
  margin: 8px 0 0;
  font-size: 13px;
}
.hire-more a, .linkish {
  color: #0b57d0;
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  font-weight: 650;
  cursor: pointer;
}
.zsb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0 4px;
}
.zsb-table th,
.zsb-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.zsb-table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tag-pill {
  background: #eef6ff;
  color: #1a56a0;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.adv-list { display: grid; gap: 8px; }
.ace-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 10px;
}
.ace-toolbar .xl-search { width: 100%; }
.ace-select {
  min-height: 32px;
  border: 1px solid #c5d4cb;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  min-width: 108px;
}
.ace-pills { margin-bottom: 4px; }
.ace-school { margin-bottom: 12px; }
.ace-school-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.ace-school-h h2 { font-size: 16px; margin: 0; }
.ace-school-h span { font-size: 12px; color: var(--muted); text-align: right; }
.ace-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.45;
}
.ace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .ace-grid { grid-template-columns: 1fr 1fr; }
}
.ace-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg);
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}
.ace-major {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}
.ace-major b { font-size: 15px; }
.ace-gk {
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.ace-gk strong { color: var(--accent); font-size: 18px; margin-left: 4px; }
.ace-dir { font-size: 13px; line-height: 1.45; margin: 0 0 8px; }
.ace-dir-empty { color: var(--muted); }
.ace-rec-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.ace-hy { font-size: 12px; color: var(--muted); margin: 0 0 8px; line-height: 1.45; }
.ace-hy b {
  display: inline;
  margin-right: 6px;
  color: var(--ink);
  font-weight: 700;
}
.rec-h { margin: 10px 0 6px; font-weight: 700; color: var(--ink); }
.dist-list { display: grid; gap: 6px; margin: 0 0 10px; }
.dist-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.dist-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-bar {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.dist-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.dist-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ace-tag {
  display: inline-block;
  margin-left: 0;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #8a5a12;
  background: #fff8e8;
  border: 1px solid #e6c98a;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 18px;
  vertical-align: middle;
}
.ace-tag-sg {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}
.hist-list { display: grid; gap: 8px; }
.hist-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg);
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}
.hist-dl {
  display: grid;
  gap: 6px 12px;
  margin: 8px 0 0;
  grid-template-columns: 1fr 1fr;
}
.hist-dl div { min-width: 0; }
.hist-dl dt {
  font-size: 11px;
  color: var(--muted);
}
.hist-dl dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.hist-dl div:first-child dd { color: var(--accent); font-size: 16px; }
.hist-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.hist-check input { width: 16px; height: 16px; }
.gk-major {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.gk-major b { font-size: 15px; }
.gk-major em { font-style: normal; font-size: 12px; color: var(--muted); }
.gk-dl { grid-template-columns: 1fr 1fr 1fr; }
.gk-dl div:first-child dd { color: inherit; font-size: 13px; font-weight: 650; }
.gk-dl div:nth-child(2) dd { color: var(--accent); font-size: 18px; font-weight: 800; }
@media (max-width: 520px) {
  .hist-dl { grid-template-columns: 1fr; }
  .gk-dl { grid-template-columns: 1fr; }
}
.feat-list {
  margin: 6px 0 10px;
  padding-left: 1.2em;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.chip-sg {
  border-color: #c4a35a;
  background: #fff8e8;
}
.dorm-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.dorm-photos img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
@media (max-width: 640px) {
  .dorm-photos { grid-template-columns: repeat(2, 1fr); }
}
.adv-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
}
.adv-item b { display: block; font-size: 14px; }
.adv-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.adv-item span { color: var(--accent); font-weight: 700; white-space: nowrap; }
.major-chips, .job-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.major-chip, .job-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}
.job-chip {
  border-radius: 12px;
  padding: 6px 10px;
  line-height: 1.25;
}
.major-chip { cursor: pointer; }
.qx-list { display: grid; gap: 8px; }
.qx-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 10px;
}
.qx-item b { display: block; font-size: 13px; margin-bottom: 4px; }
.qx-item p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.pop-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

body.live-mode {
  padding-bottom: 0;
  background: #101214;
  color: #f4f6f5;
}
body.live-mode .top {
  background: #161a1c;
  border-bottom: 1px solid #2a3034;
  color: #f4f6f5;
  min-height: 52px;
}
body.live-mode .sub { color: #c4cec8; }
body.live-mode #main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - 52px - env(safe-area-inset-top));
}
body.live-mode .xl-page { background: #101214; }
body.live-mode .live-bar {
  background: #1a1f22;
  border-bottom: 1px solid #2a3034;
  padding: 10px 12px;
  gap: 10px;
}
body.live-mode .xl-search {
  min-height: 44px;
  font-size: 18px;
  background: #101214;
  color: #fff;
  border-color: #4a555c;
}
body.live-mode .xl-meta { color: #c4cec8; font-size: 16px; }
body.live-mode .xl-expand {
  min-height: 44px;
  font-size: 16px;
  padding: 0 14px;
  background: #101214;
  color: #fff;
  border-color: #4a555c;
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.live-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgb(239 68 68 / 25%);
}
.live-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.live-g {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #101214;
  border: 1px solid #3a4348;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  color: #c4cec8;
}
.live-g b { color: #fff; font-size: 16px; }
.live-g.g-A b { color: #4ade80; }
.live-g.g-B b { color: #86efac; }
.live-g.g-C b { color: #fde047; }
.live-g.g-D b { color: #fb923c; }
.live-g.g-E b { color: #f87171; }
.live-app {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 12px;
  min-height: 100%;
  padding: 12px 16px 20px;
  color: #f4f6f5;
}
.live-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-n {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.live-n button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #4a555c;
  background: #101214;
  color: #fff;
  font-weight: 700;
}
.live-n button[aria-pressed="true"] {
  background: #1f6b4a;
  border-color: #1f6b4a;
}
.live-desk {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.live-paste-box {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #c4cec8;
  font-weight: 650;
}
.live-paste {
  min-height: 76px;
  resize: vertical;
  border: 1px solid #4a555c;
  border-radius: 12px;
  background: #161a1c;
  color: #fff;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.45;
  font-family: inherit;
}
.live-desk-side {
  display: grid;
  gap: 8px;
  align-content: end;
}
.live-run {
  width: auto !important;
  min-width: 140px;
  min-height: 44px;
}
.live-hint {
  margin: 0;
  color: #fde047;
  font-size: 14px;
}
.live-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  align-content: start;
}
.live-card {
  background: #1a2220;
  border: 1px solid #2e3a36;
  border-radius: 14px;
  padding: 12px 14px;
}
.live-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.live-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1f6b4a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.live-card h3 {
  font-size: 18px;
  margin: 0 0 4px;
}
.live-card-major { margin: 0; font-size: 15px; color: #d5e0da; }
.live-card-meta { margin: 6px 0 0; font-size: 13px; color: #9aa8a2; }
@media (max-width: 720px) {
  .live-desk { grid-template-columns: 1fr; }
}
body.live-mode .xl {
  font-size: 18px;
  background: #101214;
  color: #f4f6f5;
}
body.live-mode .xl th, body.live-mode .xl td {
  background: #161a1c;
  border-color: #2f383d;
  min-height: 52px;
  padding: 10px 12px;
  vertical-align: middle !important;
}
body.live-mode .xl thead th {
  background: #1e2529;
  color: #fff;
  font-size: 16px;
  height: 48px;
}
body.live-mode .xl .hd-orange { background: #14573a !important; }
body.live-mode .xl .hd-red { background: #0f3f2a !important; }
body.live-mode .xl tbody tr.sch-alt td,
body.live-mode .xl tbody tr.sch-alt td.sticky { background: #1c2428; }
body.live-mode .xl tbody tr:hover td,
body.live-mode .xl tbody tr:hover td.sticky { background: #243038; }
body.live-mode .xl .cell-green { color: #4ade80; font-size: 20px; }
body.live-mode .xl th.c-mine { background: #166534 !important; color: #fff; }
body.live-mode .xl td.c-mine,
body.live-mode .xl tbody tr.sch-alt td.c-mine { background: #14532d; }
body.live-mode .xl tbody tr:hover td.c-mine { background: #166534; }
body.live-mode .xl .cell-gap-neg { color: #f87171; font-size: 20px; }
body.live-mode .xl .cell-yes { color: #4ade80; font-size: 20px; }
body.live-mode .xl .cell-no { font-size: 20px; }
body.live-mode .xl .school-n { color: #93c5fd; font-size: 18px; }
body.live-mode .pick-btn {
  min-height: 44px;
  min-width: 88px;
  font-size: 18px;
  font-weight: 800;
  border-width: 2px;
  border-radius: 10px;
}
body.live-mode .pick-btn.on {
  background: #14532d;
  color: #bbf7d0;
  border-color: #4ade80;
}
.live-side {
  width: 300px;
  flex-shrink: 0;
  background: #161a1c;
  border-left: 1px solid #2a3034;
  padding: 14px;
  overflow: auto;
}
.live-side h3 {
  font-size: 18px;
  margin-bottom: 12px;
}
.live-side h3 b { color: #4ade80; }
.live-picks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.live-picks li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  background: #101214;
  border: 1px solid #2f383d;
  border-radius: 10px;
  padding: 10px;
}
.live-picks strong { display: block; font-size: 15px; }
.live-picks span { display: block; color: #c4cec8; font-size: 14px; margin-top: 2px; }
.live-picks button {
  border: 0;
  background: none;
  color: #f87171;
  font-size: 14px;
  min-height: 36px;
}
.live-empty { color: #c4cec8; font-size: 15px; line-height: 1.5; }
body.live-mode .xl-pop {
  width: 320px;
  font-size: 16px;
}
body.live-mode .xl-pop-q, body.live-mode .xl-check, body.live-mode .xl-pop-actions button {
  min-height: 40px;
  font-size: 16px;
}
@media (max-width: 900px) {
  body.live-mode .live-stage { flex-direction: column; }
  .live-side { width: 100%; max-height: 28vh; border-left: 0; border-top: 1px solid #2a3034; }
}

/* Excel sheet matching the volunteer table screenshot */
body.sheet-mode {
  overflow: hidden;
  height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: #f6f8f6;
}
body.sheet-mode .top {
  background: #fbfcfb;
  border-bottom: 1px solid #d5e0d8;
}
body.sheet-mode #main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100dvh - 56px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.xl-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #fff;
  color: #142019;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}
.xl-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #d5e0d8;
  background: #eef4f0;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.xl-expand {
  appearance: none;
  border: 1px solid #c5d4cb;
  background: #fff;
  color: #1a2b22;
  font-size: 12px;
  padding: 4px 10px;
  min-height: 32px;
  border-radius: 8px;
  white-space: nowrap;
}
.xl-expand:hover { border-color: #1a6b48; color: #1a6b48; }
.xl-expand[aria-pressed="true"] {
  background: #e8f4ea;
  border-color: #1a6b48;
  color: #1a6b48;
}
.xl-search {
  flex: 1;
  min-width: 140px;
  min-height: 32px;
  border: 1px solid #c5d4cb;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
}
.xl-search:focus {
  outline: none;
  border-color: #1a6b48;
  box-shadow: 0 0 0 3px #d7eadf;
}
.xl-meta {
  font-size: 12px;
  color: #5a675e;
  white-space: nowrap;
}
.xl-link {
  border: 0;
  background: none;
  color: #0b57d0;
  font-size: 12px;
  min-height: 28px;
  padding: 0 6px;
  text-decoration: underline;
}
.person-mask {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgb(23 33 27 / 42%);
  display: grid;
  place-items: center;
  padding: 16px;
}
.person-dialog {
  width: min(720px, 96vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  color: #17211b;
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 16px 40px rgb(0 0 0 / 18%);
  display: grid;
  gap: 12px;
}
.person-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.person-head h3 { font-size: 18px; }
.person-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
}
.person-group { min-width: 0; }
.person-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #333;
}
.person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow: auto;
}
.person-chip {
  border: 1px solid #c5cdc8;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 32px;
  font-size: 13px;
}
.person-chip[aria-pressed="true"] {
  background: #1f6b4a;
  border-color: #1f6b4a;
  color: #fff;
}
.ai-btn[aria-pressed="true"] {
  background: #fff4e5;
  border-color: #ed7d31;
}
.ai-dialog { width: min(640px, 96vw); }
.person-dialog.ai-chat-dialog {
  width: min(680px, 96vw);
  height: min(760px, 90vh);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 16px 12px;
}
.ai-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ai-tip {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin: 0;
}
.ai-prefs {
  flex-shrink: 0;
  padding: 10px 0 8px;
  border-bottom: 1px solid #e8ece9;
}
.ai-cond {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.ai-cond-k {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
}
.ai-cond-tags {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 52px;
  overflow: auto;
}
.ai-tag {
  background: #eef4f0;
  color: #1f6b4a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 20px;
}
.ai-tag-empty { font-size: 12px; color: #888; }
.ai-cond-edit {
  flex-shrink: 0;
  border: 1px solid #c5cdc8;
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  min-height: 28px;
  font-size: 12px;
}
.ai-pref-body {
  max-height: min(340px, 46vh);
  overflow: auto;
  padding: 10px 0 10px;
  display: grid;
  gap: 10px;
}
.ai-pref-body .ai-q-span .ai-chips {
  max-height: 60px;
  overflow: auto;
}
.ai-pref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.ai-q { min-width: 0; }
.ai-q-span { grid-column: 1 / -1; }
.ai-q .person-label { margin-bottom: 4px; font-size: 12px; }
.ai-q-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #66756c;
  line-height: 1.4;
}
.ai-survey {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}
.ai-steps {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ai-step {
  flex: 1;
  min-height: 28px;
  border: 1px solid #c5cdc8;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #555;
}
.ai-step.on {
  background: #1f6b4a;
  border-color: #1f6b4a;
  color: #fff;
}
.ai-step.filled:not(.on) {
  background: #eef4f0;
  border-color: #9cbcab;
  color: #1f6b4a;
}
.ai-survey-head h4 {
  font-size: 16px;
  margin: 0 0 4px;
}
.ai-survey-head p {
  margin: 0;
  font-size: 12px;
  color: #66756c;
}
.ai-survey-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 4px 2px 8px;
}
.ai-field .person-label {
  font-weight: 600;
  line-height: 1.4;
}
.ai-survey-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid #e8ece9;
}
.ai-survey-nav .ai-send {
  margin-left: auto;
}
.ai-chips {
  max-height: none;
  gap: 4px;
}
.ai-chips .person-chip {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12px;
}
.ai-gk {
  width: 100%;
  border: 1px solid #c5cdc8;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  min-height: 36px;
}
.ai-msgs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 2px;
}
.ai-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: normal;
}
.ai-bubble p { margin: 0 0 6px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble-text { word-break: break-word; }
.ai-skill-note { color: #52675b; font-size: 12px; }
.ai-bubble-user {
  align-self: flex-end;
  background: #1f6b4a;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-bubble-ai {
  align-self: flex-start;
  background: #f4f6f4;
  color: #17211b;
  border-bottom-left-radius: 4px;
  display: grid;
  gap: 8px;
  max-width: 100%;
}
.ai-bubble-ai .person-foot {
  justify-content: flex-start;
  padding: 0;
}
.ai-typing { color: #666; font-style: italic; }
.ai-dock {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #e8ece9;
}
.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-quick button {
  border: 0;
  background: #f3f6f4;
  color: #1f6b4a;
  border-radius: 999px;
  padding: 4px 10px;
  min-height: 28px;
  font-size: 12px;
}
.ai-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 44px;
  max-height: 96px;
  resize: none;
  border: 1px solid #c5cdc8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
}
.ai-send {
  width: auto !important;
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 44px;
  font-size: 15px;
  padding: 0 16px;
}
@media (max-width: 640px) {
  .ai-pref-grid { grid-template-columns: 1fr; }
  .person-dialog.ai-chat-dialog {
    width: 100%;
    height: 92vh;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
}
.ai-group { display: grid; gap: 6px; }
.ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f8f6;
  border-radius: 10px;
  padding: 8px 10px;
}
.ai-row-main { flex: 1; min-width: 0; }
.ai-row-main b { display: block; font-size: 13px; }
.ai-row-main span { display: block; font-size: 12px; color: #555; margin-top: 2px; }
.ai-row em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

.live-stage {
  display: flex;
  flex: 1;
  min-height: 0;
}
.live-stage .xl-scroll {
  flex: 1;
  min-width: 0;
}
.xl-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f7faf7;
  contain: content;
}
.xl {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
  font-size: 12.5px;
  line-height: 1.35;
}
.xl th, .xl td {
  border-right: 1px solid #dde8e1;
  border-bottom: 1px solid #dde8e1;
  padding: 8px 10px;
  vertical-align: middle !important;
  background: #fff;
  white-space: normal;
  overflow: hidden;
  word-break: break-word;
  height: auto;
  min-height: 44px;
}
.xl thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #1a6b48;
  font-weight: 650;
  text-align: center;
  color: #f4faf6;
  min-height: 44px;
  height: 48px;
  white-space: normal;
  line-height: 1.2;
  word-break: keep-all;
  box-shadow: 0 1px 0 #14573a;
}
.xl th.sticky, .xl td.sticky {
  position: sticky;
  z-index: 2;
}
.xl thead th.sticky {
  z-index: 6;
}
.xl td.sticky {
  background: #fff;
}
.xl tbody tr { cursor: default; }
.xl td.c-school, .xl td.c-major, .xl td.cell-link { cursor: pointer; }
.xl tbody tr.sch-alt td,
.xl tbody tr.sch-alt td.sticky {
  background: #f3f8f4;
}
.xl tbody tr:hover td {
  background: #e7f4ec;
}
.xl tbody tr:hover td.sticky {
  background: #e7f4ec;
}
.xl .hd-orange {
  background: #14573a !important;
  color: #fff;
}
.xl .hd-red {
  background: #0f3f2a !important;
  color: #fff;
}
.xl th {
  padding: 0;
}
.xl th .hd-text {
  display: inline-block;
  padding: 8px 22px 8px 8px;
  pointer-events: none;
}
.xl th .hd-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.88;
  margin-top: 1px;
}
.xl th.hd-admit .hd-text { padding-right: 4px; }
.sort-btns {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin: 0 2px 0 0;
  gap: 0;
}
.sort-btns button {
  width: 16px;
  height: 12px;
  border: 0;
  padding: 0;
  line-height: 10px;
  font-size: 9px;
  background: transparent;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
}
.sort-btns button.on { opacity: 1; font-weight: 900; }
.hd-filter {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 0;
  background: rgb(255 255 255 / 12%);
  color: inherit;
  padding: 0;
  display: grid;
  place-items: center;
  opacity: 0.85;
  border-radius: 6px;
}
.hd-filter::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.xl th.filtered .hd-filter {
  opacity: 1;
  background: #fff;
  color: #1a6b48;
}
.xl .num { text-align: right; font-variant-numeric: tabular-nums; }
.xl .cell-green {
  color: #147a45;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl th.c-mine {
  background: #c7edd6 !important;
  color: #14532d;
  box-shadow: none;
}
.xl th.c-mine .hd-filter { background: rgb(20 83 45 / 10%); color: #14532d; }
.xl td.c-mine,
.xl tbody tr.sch-alt td.c-mine {
  background: #eefaf3;
}
.xl tbody tr:hover td.c-mine {
  background: #d9f4e4;
}
.xl .cell-gap-neg {
  color: #c2410c;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl .rate-red {
  color: #be123c;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl .rate-orange {
  color: #c2410c;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl .rate-yellow {
  color: #a16207;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.xl .cell-no { text-align: center; color: #5a675e; }
.xl .cell-yes { text-align: center; color: #147a45; font-weight: 700; }
.xl .c-kind, .xl .c-city { text-align: center; white-space: normal; line-height: 1.2; font-size: 12px; }
.kind-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}
.kind-stack i { font-style: normal; color: #5a675e; font-size: 11px; }
.kind-stack b { font-weight: 700; color: #142019; }
.xl .c-formula { text-align: left; white-space: normal; line-height: 1.35; font-size: 12px; color: #3d4a42; }
.xl .c-xkText { text-align: left; white-space: normal; line-height: 1.35; font-size: 12px; }
.xl .score-year-line { display: block; white-space: nowrap; overflow-wrap: normal; word-break: normal; line-height: 1.35; }
.xl .c-school, .xl .c-major { text-align: left; }
.xl td.c-major { color: #1a6b48; font-weight: 650; }
.major-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.xl td.c-major .major-n { display: block; }
.xl td.c-major .major-leibie {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #5a675e;
  line-height: 1.35;
}
.xl .school-n { display: block; color: #1a6b48; cursor: pointer; font-weight: 700; }
.xl td.c-school:hover .school-n,
.xl td.c-major:hover .major-n { text-decoration: underline; text-underline-offset: 2px; }
.xl .school-tag {
  display: inline-block;
  font-size: 10px;
  color: #4d5e54;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 4px;
  margin-right: 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.xl .num, .xl .cell-green, .xl .cell-gap-neg, .xl .c-inn, .xl .c-gk, .xl .c-ztMax {
  white-space: nowrap;
}
.xl .c-plan {
  text-align: center;
  white-space: normal;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.xl .plan-current { color: #dc2626; }
.xl .plan-up { color: #147a45; font-weight: 700; }
.xl .plan-down { color: #c2410c; font-weight: 700; }
.xl th.c-major.sticky, .xl td.c-major.sticky {
  box-shadow: 4px 0 10px rgb(20 32 25 / 8%);
}
.xl .c-inn { text-align: center; }
.xl .c-band { text-align: center; }
.xl .c-band .band { font-size: 12px; min-height: 24px; min-width: 28px; padding: 0 8px; }
.xl .c-act { text-align: center; white-space: nowrap; }
.pick-btn {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #1a6b48;
  color: #1a6b48;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}
.pick-btn:hover { background: #e8f4ea; }
.pick-btn.on {
  background: #1a6b48;
  border-color: #1a6b48;
  color: #f3f8f4;
}
.xl .xl-empty {
  text-align: center;
  color: #666;
  padding: 24px;
}

.xl-pop {
  position: fixed;
  z-index: 20;
  width: 280px;
  max-height: min(420px, 75vh);
  background: #fff;
  border: 1px solid #c5d4cb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(20 32 25 / 16%);
  display: flex;
  flex-direction: column;
  color: #142019;
  overflow: hidden;
}
.xl-pop-title {
  padding: 8px 10px 4px;
  font-size: 12px;
  font-weight: 700;
}
.xl-pop-q {
  margin: 0 10px 8px;
  min-height: 34px;
  border: 1px solid #c5d4cb;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}
.xl-pop-list {
  overflow: auto;
  padding: 4px 0;
  max-height: 240px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.xl-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  min-height: 32px;
}
.xl-check.off { display: none; }
.xl-check input { width: 16px; height: 16px; }
.xl-pop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  justify-content: flex-start;
}
.xl-pop-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #c5d4cb;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .xl { min-width: 1280px; }
  .xl-toolbar { padding: 8px; }
  .xl-expand, .xl-search { min-height: 36px; }
}

@media (prefers-color-scheme: dark) {
  body.sheet-mode,
  body.sheet-mode .top,
  .xl-page,
  .xl-scroll,
  .xl th, .xl td,
  .xl td.sticky,
  .xl-pop {
    background: #fff;
    color: #000;
  }
}

body.iv-mode {
  background: #101614;
}
body.iv-mode .top {
  background: #121a16;
  color: #e7eee9;
  border-bottom-color: #243028;
}
body.iv-mode .sub { color: #9aa89f; }
body.iv-mode #main {
  background: #101614;
  color: #e7eee9;
  padding: 12px 12px 18px;
  min-height: calc(100dvh - var(--top));
}
.iv-room { max-width: 920px; margin: 0 auto; }
.iv-hero, .iv-setup, .iv-board {
  background: #18201c;
  border: 1px solid #2a3830;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.iv-hero { text-align: center; padding-top: 20px; }
.iv-hero .iv-bust { margin: 0 auto 14px; }
.iv-hero .iv-tag { position: static; display: inline-block; }
.iv-hero h2, .iv-board h2 { margin: 8px 0 6px; font-size: 20px; color: #f4f7f3; }
.iv-hero .lead { color: #c4cec8; }
.iv-photo-credit { margin: 10px 0 0; color: #aabbb0; font-size: 11px; line-height: 1.6; }
.iv-photo-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.iv-setup p { margin: 10px 0 6px; font-size: 13px; color: #9aa89f; }
.iv-setup .pills { grid-template-columns: repeat(5, 1fr); }
.iv-setup .pills button { color: #e7eee9; background: #243028; border-color: #33443b; }
.iv-err { color: #fb7185 !important; }
.iv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.iv-panel {
  position: relative;
  background: #141c18;
  border: 1px solid #2a3830;
  border-radius: 16px;
  overflow: hidden;
  min-height: 240px;
}
.iv-me video {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  transform: scaleX(-1);
  background: #0b0f0d;
}
.iv-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(16 22 20 / 72%);
  font-size: 12px;
  color: #e7eee9;
}
.iv-human { display: grid; place-items: center; padding: 24px 12px 40px; }
.iv-status {
  position: absolute;
  left: 10px;
  top: 10px;
  margin: 0;
  font-size: 12px;
  color: #86efac;
}
.iv-bust {
  position: relative;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
  isolation: isolate;
}
.iv-ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgb(127 214 175 / 55%);
  box-shadow: 0 0 0 5px rgb(65 143 104 / 9%);
  transition: border-color .2s, box-shadow .2s;
}
.iv-portrait {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #e8ece5;
  border: 3px solid rgb(232 245 236 / 85%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 20%);
}
.iv-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.iv-presence {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 16px;
  height: 16px;
  border: 3px solid #1b2820;
  border-radius: 50%;
  background: #83ddb0;
  box-shadow: 0 0 0 1px rgb(131 221 176 / 35%);
}
.iv-bust.talking .iv-ring {
  border-color: #a0edc4;
  animation: iv-presence-pulse 1.4s ease-in-out infinite;
}
.iv-bust.listen .iv-ring { border-color: #93c5fd; box-shadow: 0 0 0 5px rgb(147 197 253 / 12%); }
.iv-bust.listen .iv-presence { background: #93c5fd; }
@keyframes iv-presence-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgb(115 218 166 / 12%), 0 0 18px rgb(85 198 143 / 16%); }
  50% { box-shadow: 0 0 0 8px rgb(115 218 166 / 5%), 0 0 28px rgb(85 198 143 / 28%); }
}
@media (prefers-reduced-motion: reduce) {
  .iv-bust.talking .iv-ring { animation: none; }
}
.iv-step { margin: 0 0 4px; color: #86efac; font-size: 13px; font-weight: 650; }
.iv-caption {
  min-height: 44px;
  background: #101614;
  border-radius: 10px;
  padding: 8px 10px;
  color: #c4cec8;
  font-size: 14px;
}
.iv-timer { margin: 8px 0; color: #9aa89f; }
.iv-timer b { color: #f4f7f3; }
.iv-answer-box {
  width: 100%;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #2a3830;
  background: #101614;
  color: #e7eee9;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}
.iv-score-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.iv-score-card {
  background: #101614;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.iv-score-card b {
  display: block;
  font-size: 28px;
  color: #86efac;
}
.iv-score-card.total b { color: #fde68a; font-size: 32px; }
.iv-score-card span { font-size: 12px; color: #9aa89f; }
.iv-comment {
  background: #101614;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: #c4cec8;
  margin: 0 0 8px;
}
.iv-comment b { display: block; color: #86efac; font-size: 13px; margin-bottom: 4px; }
.iv-item-list { margin: 8px 0 0; padding-left: 18px; color: #c4cec8; }
.iv-item-list li { margin: 0 0 8px; }
.iv-item-list span, .iv-item-list em { display: block; font-style: normal; font-size: 13px; }
.iv-item-list em { color: #9aa89f; }
@media (max-width: 720px) {
  .iv-grid { grid-template-columns: 1fr; }
}
.shortlist-tag { display: block; font-size: 10px; font-weight: 400; color: #63766c; }

/* Source: polish.css */
/* Shared presentation layer: calm green, clear surfaces, compact data views. */
:root {
  --bg: #f3f6f5;
  --paper: #ffffff;
  --ink: #19342b;
  --muted: #60736b;
  --line: #dfe8e3;
  --accent: #18674d;
  --accent-ink: #ffffff;
  --accent-soft: #e7f2eb;
  --radius: 16px;
  --shadow: 0 12px 36px rgb(25 52 43 / 6%);
}
body { background: var(--bg); }
.brand .mark, .auth-brand .mark { overflow: hidden; background: var(--brand-color, var(--accent)); color: var(--brand-on, var(--accent-ink)); }
.mark img { width: 100%; height: 100%; object-fit: contain; background: white; }
.btn-primary { background: var(--brand-color, var(--accent)); border-color: var(--brand-color, var(--accent)); color: var(--brand-on, var(--accent-ink)); }
.org-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.org-heading h2 { font-size: 26px; margin: 8px 0; }
.org-role { flex-shrink: 0; color: var(--accent); background: var(--accent-soft); padding: 5px 9px; border-radius: 7px; font-size: 11px; }
.org-brand-preview { display: flex; gap: 18px; align-items: center; padding: 24px; border: 1px solid var(--line); border-left: 5px solid var(--brand-color, var(--accent)); border-radius: 14px; background: var(--paper); margin-bottom: 18px; }
.preview-mark, .admin-card-logo { flex-shrink: 0; display: grid; place-items: center; width: 64px; height: 64px; background: var(--accent-soft); color: var(--accent); border-radius: 12px; overflow: hidden; font-weight: 700; font-size: 26px; }
.preview-mark img, .admin-card-logo img { width: 100%; height: 100%; object-fit: contain; background: white; }
.org-brand-preview span { font-size: 11px; color: var(--muted); }
.org-brand-preview h2 { font-size: 23px; margin: 5px 0; }
.org-brand-preview p { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.org-logo { object-fit: contain; padding: 4px; background: white; }
.org-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.org-wide { grid-column: 1 / -1; }
.org-section-title { font-size: 17px; }
.org-field input[type="color"] { width: 100%; min-height: 42px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); cursor: pointer; }
.h5-limit-field { display: grid; gap: 8px; }
.h5-limit-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.h5-limit-chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}
.h5-limit-chip.is-on {
  background: var(--brand-color, var(--accent));
  border-color: var(--brand-color, var(--accent));
  color: var(--brand-on, var(--accent-ink));
}
.h5-limit-custom { display: grid; gap: 6px; max-width: 220px; font-size: 13px; font-weight: 650; }
.admin-editor .section-description { display: block; margin-top: 6px; font-weight: 400; color: var(--muted); }
.org-feedback { background: var(--accent-soft); color: var(--ink); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.org-workspace { width: 100%; }
.org-subnav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 24px; padding-bottom: 8px; }
.org-subnav button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.org-subnav button[aria-pressed="true"] { background: var(--workspace-soft); color: var(--brand-text, var(--accent)); }
.org-acquisition-prompt > .btn { margin-top: 16px; }
.lead-workspace { min-width: 0; }
.lead-workspace .btn-primary { width: auto; flex-shrink: 0; }
.lead-workspace a.btn { text-decoration: none; color: var(--brand-text, var(--accent)); }
.lead-workspace h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; margin: 0 0 8px; }
.lead-workspace h2 svg, .lead-empty svg { width: 24px; height: 24px; color: var(--brand-text, var(--accent)); }
.lead-workspace .org-section-head { flex-wrap: wrap; gap: 16px; }
.lead-workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-feedback { min-height: 22px; margin: 8px 0; font-size: 13px; color: var(--brand-text, var(--accent)); }
.lead-feedback.is-error, .lead-row-feedback.is-error { color: #b42318; }
.lead-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin-bottom: 20px; overflow: hidden; }
.lead-metrics > div { padding: 20px 24px; border-right: 1px solid var(--line); }
.lead-metrics > div:last-child { border: 0; background: var(--workspace-soft); }
.lead-metrics span { display: block; font-size: 13px; color: var(--muted); }
.lead-metrics b { display: block; margin-top: 8px; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lead-metrics small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.lead-metrics.lead-metrics-assigned { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.org-workspace .lead-entry { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 28px; align-items: center; margin-bottom: 24px; }
.lead-entry-copy h3 { margin: 8px 0 10px; }
.lead-entry-copy p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.lead-link-label { display: grid; gap: 8px; font-size: 13px; margin-top: 20px; }
.lead-entry-copy .row-actions { flex-wrap: wrap; }
.lead-entry-qr { margin: 0; text-align: center; }
.lead-entry-qr img { display: block; width: 180px; max-width: 100%; height: auto; border-radius: 8px; background: white; }
.lead-entry-qr figcaption, .lead-entry-qr p { font-size: 12px; color: var(--muted); margin-top: 10px; }
.lead-filters { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 16px; margin: 20px 0; }
.lead-filters.lead-filters-counselors { grid-template-columns: minmax(0,1fr) minmax(140px,.5fr) minmax(160px,.7fr); }
.lead-filters label, .lead-followup label { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.lead-assignment { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--workspace-soft); }
.lead-assignment-heading { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.lead-assignment-heading > strong { font-size: 14px; color: var(--ink); }
.lead-assignment-heading > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lead-selection { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1 0 auto; min-height: 44px; }
.lead-selection > span { font-size: 13px; color: var(--brand-text, var(--accent)); font-weight: 600; }
.lead-select-control { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; cursor: pointer; }
.lead-select-control input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-color, var(--accent)); cursor: inherit; }
.lead-select-control:has(input:disabled) { cursor: default; }
.lead-select-control input:focus-visible { outline: 2px solid var(--brand-text, var(--accent)); outline-offset: 3px; }
.lead-recipient { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 0 150px; max-width: 300px; gap: 5px; font-size: 12px; color: var(--muted); }
.lead-recipient select, .lead-assignment .btn-primary { min-height: 44px; }
.lead-recipient select { width: 100%; min-width: 0; font-size: 16px; }
.lead-sync-students { align-self: flex-end; }
.lead-sync-students-hint { flex-basis: 100%; margin: 0; }
.lead-assignment-feedback { flex-basis: 100%; color: var(--brand-text, var(--accent)); }
.lead-assignment-feedback:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.lead-assignment [data-act="lead-view-students"] { min-height: 44px; }
.lead-directory { scroll-margin-top: 12px; }
.lead-record { display: grid; grid-template-columns: minmax(150px,.85fr) minmax(160px,1fr) minmax(230px,1.4fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.lead-record-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lead-record-heading h3 { margin: 0; overflow-wrap: anywhere; }
.lead-record-select { justify-content: center; min-width: 44px; margin-right: -6px; margin-left: -12px; }
.lead-status { display: inline-flex; font-size: 11px; line-height: 1.5; padding: 4px 8px; background: var(--workspace-soft); color: var(--brand-text, var(--accent)); border-radius: 5px; }
.lead-status[data-status="new"] { color: #8a4b05; background: #fff2d6; }
.lead-status[data-status="closed"] { color: var(--muted); background: var(--bg); }
.lead-phone { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-text, var(--accent)); font-size: 17px; font-variant-numeric: tabular-nums; }
.lead-contact p { font-size: 12px; margin: 4px 0; color: var(--muted); overflow-wrap: anywhere; }
.lead-assignee strong { color: var(--ink); font-weight: 650; }
.lead-contact .lead-student-sync[data-synced="true"] { color: var(--brand-text, var(--accent)); font-weight: 600; }
.lead-record-time { line-height: 1.8; }
.lead-academics > b { font-size: 12px; color: var(--muted); font-weight: 400; }
.lead-academics > b span { color: var(--ink); font-weight: 600; margin-left: 8px; }
.lead-grade-list { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; margin: 12px 0; }
.lead-grade-list > span { display: flex; justify-content: center; gap: 6px; border-radius: 5px; background: var(--bg); padding: 6px 3px; font-size: 12px; color: var(--muted); }
.lead-grade-list strong { color: var(--ink); }
.lead-interest { font-size: 12px; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; }
.lead-followup { display: grid; gap: 10px; }
.lead-followup textarea, .lead-followup select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; }
.lead-followup textarea { resize: vertical; }
.lead-followup-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lead-followup-actions > span { flex: 1; min-width: 90px; }
.lead-row-feedback { margin: 0; font-size: 12px; }
.lead-empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.lead-empty p { font-size: 13px; max-width: 420px; margin: 10px auto 0; line-height: 1.8; }
.admin-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-acquisition .lead-record { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.admin-acquisition .lead-followup { grid-column: 1 / -1; }
@media (max-width: 1000px) {
  .lead-record { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .lead-followup { grid-column: 1 / -1; }
  .lead-metrics > div { padding: 18px 16px; }
}
@media (max-width: 600px) {
  .lead-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .lead-metrics > div:nth-child(2) { border-right: 0; }
  .lead-metrics.lead-metrics-assigned > div { border-bottom: 0; }
  .org-workspace .lead-entry { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .lead-entry-qr { width: 150px; justify-self: center; }
  .lead-filters, .lead-filters.lead-filters-counselors { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .lead-selection { flex-basis: 100%; justify-content: space-between; }
  .lead-recipient { flex-basis: 100%; max-width: none; }
  .lead-sync-students { flex: 1 0 auto; }
  .lead-record, .admin-acquisition .lead-record { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .lead-academics { padding: 12px; background: var(--bg); border-radius: 8px; }
  .lead-followup textarea, .lead-followup select { font-size: 16px; }
  .lead-followup-actions { align-items: flex-start; flex-wrap: wrap; }
  .lead-workspace h2 { font-size: 22px; }
}
@media (prefers-color-scheme: dark) {
  .lead-feedback.is-error, .lead-row-feedback.is-error { color: #ffa699; }
  .lead-status[data-status="new"] { color: #ffd395; background: #493219; }
}
.admin-overview { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.admin-overview span { padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.admin-overview b { display: block; font-size: 26px; color: var(--ink); margin-top: 4px; }
.org-section-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.org-section-head h3, .org-workspace h3 { font-size: 17px; }
.org-section-head input { max-width: 300px; }
.admin-org-list { display: grid; gap: 12px; }
.admin-org-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.admin-org-card > div:nth-child(2) { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.admin-org-card h4 { font-size: 15px; margin: 0 0 4px; }
.admin-org-card p { font-size: 12px; color: var(--muted); }
.admin-card-logo { width: 44px; height: 44px; font-size: 20px; }
.admin-setup { width: min(480px,100%); padding: 36px 16px; margin: auto; }
.admin-setup h1 { font-size: 24px; margin: 12px 0; }
@media (max-width: 620px) {
  .org-settings-grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .org-wide { grid-column: auto; }
  .org-brand-preview { padding: 18px; gap: 12px; }
  .org-brand-preview h2 { font-size: 18px; }
  .org-logo-row { align-items: flex-start; }
  .org-logo-row .btn { margin-bottom: 5px; padding: 0 10px; font-size: 12px; }
  .org-section-head { align-items: stretch; flex-direction: column; }
  .org-section-head input { max-width: none; }
  .admin-org-card { gap: 10px; padding: 10px; }
  .admin-org-card > button { padding: 0 10px; }
  .user-slot .org-role { display: none; }
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s; }
.top, body.sheet-mode .top { padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.top-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 20px; }
.brand { grid-area: 1 / 1; }
.brand .mark { width: 40px; height: 40px; box-shadow: none; border-radius: 12px; }
.top h1 { font-size: 17px; letter-spacing: .02em; }
.sub { margin-top: 2px; }
.user-slot { grid-area: 1 / 3; }
.user-out { min-height: 36px; border-radius: 8px; }
body:not(.auth-on) { display: flex; flex-direction: column; min-height: 100dvh; }
body:not(.auth-on) #main { flex: 1; }
.tabbar { grid-area: 1 / 2; position: static; min-width: 0; justify-content: safe flex-end; padding: 0; gap: 5px; background: var(--paper); scrollbar-width: none; -ms-overflow-style: none; }
.tabbar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.tabbar button { display: inline-flex; justify-content: center; align-items: center; position: relative; gap: 6px; min-height: 42px; padding: 5px 12px; border: 0; border-radius: 10px; font-size: 12px; }
.tabbar button[aria-current="page"] { background: var(--accent-soft); }
.nav-icon { width: 17px; height: 17px; display: inline-flex; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-count { background: var(--accent); color: var(--accent-ink); font-size: 10px; padding: 2px 5px; border-radius: 6px; }
#main table th, #main table td, #main table .major-link { text-align: center; vertical-align: middle; }
#main table .stu-acts { justify-content: center; }
.match-student { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 10px 18px; background: #fff; color: #19342b; border-bottom: 1px solid #dfe8e3; flex-shrink: 0; }
.match-student-info { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.match-student-info > strong { color: #18674d; font-size: 14px; }
.match-student-info > span { font-size: 12px; color: #52685c; }
.match-subjects { display: flex; flex-wrap: wrap; gap: 6px 12px; flex: 1; font-size: 12px; }
.match-subjects > span { white-space: nowrap; }
.match-grade-summary { color: #c2410c; font-weight: 700; font-variant-numeric: tabular-nums; }
.match-subjects b { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #eef3f0; font-variant-numeric: tabular-nums; }
.match-subjects b[data-grade="A"] { background: #dff3e5; color: #17603b; }
.match-subjects b[data-grade="B"] { background: #e5effc; color: #285b91; }
.match-subjects b[data-grade="E"] { background: #fce9e9; color: #9d3030; }
.gk-comparison { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.gk-comparison th, .gk-comparison td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.gk-comparison thead th { color: var(--muted); font-weight: 500; background: var(--bg); }
.gk-comparison tbody th { font-weight: 500; color: var(--muted); }
.gk-comparison .gk-score { font-weight: 750; color: var(--accent); font-size: 17px; }
.hist-more { display: grid; gap: 8px; justify-items: center; margin: 20px 0; }
.hist-more > span { color: var(--muted); font-size: 12px; }
.hist-tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 4px; margin: 20px 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.hist-tabs button { min-height: 44px; padding: 10px 16px; border-color: transparent; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.5; white-space: nowrap; }
.hist-tabs button[aria-pressed="true"] { box-shadow: none; }
.hist-tabs button:focus-visible { outline-offset: -3px; }
.hist-toolbar { flex-wrap: wrap; gap: 10px 16px; margin-top: 0; }
.hist-toolbar .xl-search { flex: 1 1 240px; width: auto; min-width: 0; min-height: 44px; }
.hist-toolbar .hist-check { min-height: 44px; }
.hist-toolbar .ace-select { min-height: 44px; color: var(--ink); background: var(--paper); }
.hist-list { grid-template-columns: minmax(0, 1fr); }
.hist-card { min-width: 0; }
@media (max-width: 620px) {
  .match-student { padding: 10px; gap: 8px; }
  .match-subjects { order: 3; flex-basis: 100%; gap: 6px 10px; }
  .match-student > button { margin-left: auto; min-height: 34px; }
}
.report-conflicts { margin: 16px 0; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.conflict-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.conflict-title h5 { margin: 0; font-size: 15px; color: var(--ink); }
.conflict-title > span { padding: 3px 9px; border-radius: 6px; font-size: 12px; color: var(--accent); background: var(--accent-soft); }
.has-conflicts .conflict-title > span { color: #9a3412; background: #fff0df; }
.stu-report .conflict-summary { margin-bottom: 6px; font-size: 14px; }
.conflict-summary strong { color: #a5411c; font-variant-numeric: tabular-nums; }
.stu-report .conflict-hint { font-size: 12px; color: var(--muted); line-height: 1.8; margin-bottom: 0; }
.conflict-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-top: 16px; align-items: start; }
.conflict-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.conflict-card > header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.conflict-card h6 { font-size: 16px; margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.conflict-card > header > span { font-size: 12px; color: var(--muted); }
.conflict-card > ul { list-style: none; padding: 0; margin: 0; }
.conflict-card li { padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.conflict-card li + li { border-top: 1px solid var(--line); }
.conflict-school { font-weight: 650; }
.conflict-major { color: var(--muted); }
.conflict-original { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
@media (max-width: 620px) {
  .report-conflicts { padding: 12px; }
  .conflict-card li { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
@media print {
  .tabbar { display: none; }
  .conflict-groups { display: block; }
  .conflict-card { margin-bottom: 12px; break-inside: avoid; }
}
#main { padding-top: 26px; }
.hero-line { font-size: 26px; letter-spacing: -.03em; margin-bottom: 8px; }
.lead { line-height: 1.8; }
.panel { box-shadow: 0 2px 8px rgb(25 52 43 / 2%); padding: 22px; }
.btn-primary { box-shadow: none; }
.btn, .pills button { border-radius: 10px; }
.sheet { background: rgb(14 36 27 / 42%); }
.sheet-card { padding: 12px 26px 28px; color: var(--ink); }
/* Detail surfaces keep their own readable palette inside the dark live page. */
.sheet-card :is(.major-chip, .job-chip) { background: var(--paper); color: var(--ink); }
.sheet-card .chip-sg { background: #fff8e8; color: #5b4218; }
.sheet-card .chip-sg em { color: #715016; }
.sheet-card .pop-text { color: var(--ink); }
.sheet-card :is(.meta-chip.meta-link, .ext-link) { color: var(--accent); }
.pop-h { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--accent); }
.stu-page { gap: 20px; }
body.stu-mode #main { padding: 26px 24px; }
.stu-sub { background: var(--bg); border-color: transparent; }
.stu-table thead th { background: var(--accent-soft); color: var(--ink); height: 48px; }
.stu-table td { padding-top: 12px; padding-bottom: 12px; }
.stu-table tbody tr:hover td { background: var(--accent-soft); }
.stu-table-wrap { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 0; }
body.sheet-mode, body.jobs-mode { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.sheet-mode .top, body.jobs-mode .top { flex: 0 0 auto; }
body.sheet-mode #main, body.jobs-mode #main { flex: 1; min-height: 0; height: auto; }
body.sheet-mode #main { padding: 18px 24px 20px; }
.xl-page { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 16px rgb(25 52 43 / 3%); }
.xl-toolbar { padding: 12px 18px; gap: 8px; background: #f8faf9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.xl-search, .xl-expand { min-height: 38px; border-color: #d6e2db; border-radius: 8px; }
.xl-search { min-width: 180px; font-size: 13px; }
.xl-toolbar .ai-btn { background: #18674d; border-color: #18674d; color: #fff; }
.xl-meta { font-variant-numeric: tabular-nums; }
.xl thead th { background: #245f4c; height: 52px; box-shadow: none; border-right-color: #407461; }
.xl .hd-orange { background: #205642 !important; }
.xl .hd-red { background: #194735 !important; }
.xl td { padding-top: 12px; padding-bottom: 12px; border-color: #e6ede8; }
.xl .c-kind, .xl .c-city { padding-left: 2px; padding-right: 2px; word-break: normal; }
.xl .c-plan { padding-left: 4px; padding-right: 4px; word-break: normal; }
.xl .c-act { padding-left: 2px; padding-right: 2px; }
.xl .c-act .pick-btn { padding-left: 7px; padding-right: 7px; font-size: 11px; }
.xl thead th.c-formula { color: #fff; }
.xl tbody tr.sch-alt td, .xl tbody tr.sch-alt td.sticky { background: #f5f9f6; }
.xl tbody tr:hover td, .xl tbody tr:hover td.sticky { background: #eaf4ee; }
.pick-btn { border-radius: 8px; min-height: 34px; }
.section-eyebrow { font-size: 12px; font-weight: 650; color: var(--accent); letter-spacing: .12em; }
.auth { background: #edf3ef; padding: 36px 24px; align-items: center; }
.auth-card { width: min(1080px, 100%); display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; padding: 0; overflow: hidden; border-radius: 24px; box-shadow: 0 24px 80px rgb(24 66 45 / 8%); margin: auto; }
.auth-discover { background: #f7faf7; padding: 36px 40px; min-width: 0; }
.auth-brand { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; text-align: left; justify-items: start; }
.auth-brand .mark { grid-row: 1 / 3; width: 44px; height: 44px; box-shadow: none; }
.auth-brand h1 { font-size: 18px; align-self: end; }
.auth-brand p { font-size: 11px; }
.auth-section-label { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auth-systems { margin: 26px 0 22px; }
.system-card {
  display: grid; justify-items: start; align-content: start; gap: 8px; min-width: 0;
  padding: 16px; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.system-card[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.system-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.system-card:disabled { cursor: progress; }
.system-name { font-size: 16px; line-height: 1.4; font-weight: 750; }
.system-description { font-size: 13px; color: var(--muted); line-height: 1.6; }
.systems-page { max-width: 840px; margin: clamp(20px, 6vh, 66px) auto 0; }
.systems-page h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 22px; }
.systems-page .system-card { padding: clamp(16px, 3vw, 28px); gap: 12px; grid-template-rows: auto auto 1fr auto; }
.systems-page .auth-ico { width: 40px; height: 40px; padding: 9px; }
.systems-page .system-name { font-size: clamp(19px, 2.5vw, 24px); }
.system-action { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--accent); }
.system-status { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 16px 0 0; }
.system-status:empty { display: none; }
.auth-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.auth-apps button { min-height: 82px; gap: 7px; border-radius: 12px; padding: 12px 4px; background: var(--paper); border-color: var(--line); }
.auth-apps b { font-size: 11px; font-weight: 600; }
.auth-ico { width: 30px; height: 30px; border-radius: 8px; padding: 5px; color: #18674d; background: #e7f2eb; }
.auth-ico svg { display: block; width: 100%; height: 100%; }
.ico-zsb, .ico-hist, .ico-bank { color: #365d88; background: #eaf0f8; }
.ico-ace { color: #8d621d; background: #f8f1e2; }
.ico-jobs { color: #7c5062; background: #f6edf0; }
.ico-iv { color: #66548a; background: #f0edf6; }
.auth-access { padding: 48px 36px 32px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.auth-welcome { margin-bottom: 28px; }
.auth-welcome h2 { font-size: 23px; margin: 9px 0; letter-spacing: -.02em; }
.auth-welcome p { font-size: 12px; line-height: 1.8; color: var(--muted); }
.auth-tabs { margin-bottom: 24px; background: var(--bg); border-radius: 10px; }
.auth-tabs button { min-height: 42px; font-size: 14px; border-radius: 7px; }
.auth-form { gap: 18px; }
.auth-form label { gap: 8px; font-size: 13px; }
.auth-form input { background: var(--paper); border-radius: 9px; min-height: 48px; font-size: 14px; }
.auth-form .btn-primary { min-height: 48px; margin-top: 4px; font-size: 15px; }
.auth-switch { font-size: 12px; line-height: 1.8; }
.auth-switch button { min-height: 36px; }
.auth-footnote { text-align: center; font-size: 11px; color: var(--muted); margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
@media (min-width: 621px) and (max-height: 800px) {
  .auth { padding-top: 20px; padding-bottom: 20px; }
  .auth-discover { padding-top: 26px; padding-bottom: 26px; }
  .auth-systems { margin-top: 20px; }
  .auth-apps button { min-height: 76px; padding-top: 9px; padding-bottom: 9px; }
  .auth-access { padding-top: 32px; padding-bottom: 24px; }
}
@media (hover: hover) {
  .auth-apps button:hover { border-color: #91b7a0; box-shadow: 0 3px 10px rgb(24 66 45 / 5%); background: #fff; }
  .system-card:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
  .tabbar button:hover:not([aria-current="page"]), .user-out:hover { background: var(--bg); color: var(--accent); }
}
@media (max-width: 850px) {
  .auth { padding: 20px; }
  .auth-card { grid-template-columns: 1.1fr 1fr; }
  .auth-discover { padding: 28px 24px; }
  .auth-access { padding: 28px 24px; }
  .auth-welcome h2 { font-size: 20px; }
  .top, body.sheet-mode .top { padding: 12px 16px; }
  .tabbar button { padding: 0 12px; }
  body.sheet-mode #main { padding: 12px; }
}
@media (max-width: 620px) {
  .auth { padding: 0; background: var(--paper); align-items: start; }
  .auth-card { width: 100%; grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; }
  .auth-discover { padding: calc(24px + env(safe-area-inset-top)) 22px 22px; }
  .auth-brand h1 { font-size: 18px; }
  .auth-systems { gap: 8px; margin: 20px 0; }
  .auth-systems .system-card { padding: 12px; }
  .auth-systems .system-name { font-size: 14px; }
  .auth-systems .system-description { font-size: 12px; }
  .systems-page .system-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-access { padding: 26px 22px calc(28px + env(safe-area-inset-bottom)); }
  .auth-welcome { margin-bottom: 20px; }
  .auth-welcome .section-eyebrow { display: none; }
  .auth-welcome h2 { font-size: 20px; margin-top: 0; }
  .auth-tabs { margin-bottom: 20px; }
  .auth-form input { font-size: 16px; }
  .auth-apps button { min-height: 76px; }
  .auth-footnote { margin-top: 22px; }
  .top, body.sheet-mode .top { padding: 10px 12px; }
  .top-row { gap: 10px 8px; grid-template-columns: 1fr auto; }
  .user-slot { grid-area: 1 / 2; }
  .tabbar { grid-area: 2 / 1 / 3 / -1; justify-content: flex-start; }
  .top h1 { font-size: 14px; }
  .brand { gap: 8px; }
  .brand .mark { width: 32px; height: 32px; border-radius: 9px; }
  .sub { display: none; }
  .user-slot { gap: 5px; }
  .user-org { display: none; }
  .user-name { font-size: 11px; max-width: 4em; }
  .user-out { padding: 0 7px; min-height: 34px; font-size: 11px; }
  .tabbar { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .tabbar button { min-height: 42px; padding: 5px 10px; font-size: 12px; }
  .nav-icon { display: inline-flex; }
  body.sheet-mode #main { padding: 8px; }
  .xl-page { border-radius: 10px; }
  .xl-toolbar { padding: 10px; gap: 8px; }
  .xl-toolbar .xl-search { order: -1; flex: 1 0 100%; min-height: 42px; font-size: 16px; }
  .xl-expand { min-height: 40px; }
  .xl-meta { white-space: normal; font-size: 11px; }
  .panel { padding: 16px; }
  body.stu-mode #main { padding: 20px 12px; }
  .hero-line { font-size: 23px; }
  .sheet-card { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121c17; --paper: #1a2720; --ink: #e6eee9; --muted: #afc0b5; --line: #34473b; --accent: #8bd4ae; --accent-ink: #102e20; --accent-soft: #273f30; }
  .auth { background: var(--bg); }
  .auth-discover { background: #17231c; }
  .auth-apps button:hover { background: #253a2d; }
  .auth-ico { color: #b8dec7; background: #2a4032; }
  .ico-zsb, .ico-hist, .ico-bank { color: #b4cbea; background: #273747; }
  .ico-ace { color: #e4cc99; background: #403925; }
  .ico-jobs { color: #e4bacb; background: #40313b; }
  .ico-iv { color: #d1c4ed; background: #393148; }
  .stu-table thead th { background: var(--accent-soft); color: var(--ink); }
  body.sheet-mode .top { background: var(--paper); color: var(--ink); }
  .xl-toolbar { background: #f8faf9; }
  .xl-page, .xl-scroll { background: #fff; color: #19342b; }
  .xl thead th { background: #245f4c; color: #fff; }
  .xl td { color: #19342b; }
  .xl .cell-green { color: #147a45; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Tenant brand overrides shared navigation and table colors. */
.tabbar button[aria-current="page"] { color: var(--brand-text, var(--accent)); background: color-mix(in srgb, var(--brand-color, var(--accent)) 12%, var(--paper)); }
.xl thead th { background: var(--brand-color, #245f4c); color: var(--brand-on, #fff); }
.xl .hd-orange { background: color-mix(in srgb, var(--brand-color, #205642) 85%, #000) !important; color: var(--brand-on, #fff); }
.xl .hd-red { background: color-mix(in srgb, var(--brand-color, #194735) 75%, #000) !important; color: var(--brand-on, #fff); }

/* Institution workspaces: a wider canvas and a clear reading order. */
body.management-mode #main { width: min(1240px, 100%); padding: 32px 28px 48px; }
body.management-mode .top { position: static; }
.org-workspace { --workspace-soft: color-mix(in srgb, var(--brand-color, var(--accent)) 6%, var(--paper)); }
.org-workspace .org-heading { margin-bottom: 20px; align-items: center; }
.org-workspace .org-heading h2 { font-size: clamp(25px, 2.3vw, 32px); margin: 8px 0; font-weight: 730; letter-spacing: -.035em; }
.org-workspace .org-heading .lead { margin: 0; font-size: 14px; }
.org-role { font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: 24px; }
.org-workspace .panel { padding: 24px; border-radius: 16px; box-shadow: 0 3px 12px rgb(25 52 43 / 2%); }
.org-workspace .panel + .panel { margin-top: 20px; }
.org-content-grid, .admin-content-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.org-primary-column, .org-secondary-column, .admin-primary-column, .admin-secondary-column { min-width: 0; }
.org-brand-preview { padding: 28px 32px; background: var(--workspace-soft); border: 1px solid var(--line); border-left: 4px solid var(--brand-color, var(--accent)); margin: 24px 0; gap: 20px; }
.preview-mark { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 18px; font-size: 30px; background: var(--paper); color: var(--brand-text, var(--accent)); }
.preview-copy { min-width: 0; flex: 1; }
.org-brand-preview h2 { margin: 6px 0; font-size: 26px; overflow-wrap: anywhere; }
.org-brand-preview p { margin: 0; font-size: 14px; }
.org-brand-preview span { font-size: 12px; }
.brand-touchpoints { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border-left: 1px solid var(--line); padding-left: 24px; }
.brand-touchpoints span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.brand-touchpoints span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-text, var(--accent)); }
.org-panel-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.panel-index { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: var(--workspace-soft); display: grid; place-items: center; color: var(--brand-text, var(--accent)); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel-index svg { width: 20px; height: 20px; }
.org-panel-heading p, .section-description { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; }
.org-section-title, .org-workspace h3 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.org-panel { gap: 0; }
.org-logo-row { padding: 18px; border: 1px dashed var(--line); background: var(--workspace-soft); border-radius: 12px; margin-bottom: 8px; }
.org-logo-row > div { min-width: 0; }
.org-logo-row .lead { font-size: 12px; line-height: 1.8; }
.org-logo.empty { font-size: 26px; font-weight: 650; background: var(--paper); color: var(--brand-text, var(--accent)); }
.org-logo { flex-shrink: 0; }
.org-settings-grid { gap: 20px 18px; margin-top: 18px; }
.org-workspace .org-field { gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.org-workspace .ai-gk, .org-field input[type="color"] { min-height: 46px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 9px; padding: 10px 12px; font-size: 14px; min-width: 0; width: 100%; }
.org-field input[type="color"] { padding: 5px 6px; }
.org-workspace .ai-gk::placeholder { color: var(--muted); opacity: .85; font-size: 13px; }
.org-workspace .ai-gk:focus { border-color: var(--brand-text, var(--accent)); }
.org-workspace .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; }
.org-workspace .btn svg { width: 17px; height: 17px; }
.org-workspace .row-actions { gap: 10px; margin-top: 20px; }
.org-panel > .row-actions { padding-top: 22px; border-top: 1px solid var(--line); margin-top: 26px; }
.org-secondary-column .lead { font-size: 13px; line-height: 1.9; margin: 12px 0; }
.org-secondary-column .lead-share { gap: 16px; align-items: center; }
.org-secondary-column .lead-qr { width: 116px; height: 116px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.org-secondary-column .lead-share-main { min-width: 0; }
.org-secondary-column .lead-share-main .row-actions { margin-top: 10px; }
.org-secondary-column .lead-share-main .btn { font-size: 12px; padding: 8px 10px; }
.org-secondary-column .ai-gk[readonly] { font-size: 12px; color: var(--muted); background: var(--bg); }
.org-members { margin-top: 12px; }
.org-members li { padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 5px 12px; }
.org-members li:last-child { border-bottom: 0; }
.org-member-count { padding: 3px 10px; border-radius: 20px; font-size: 12px; background: var(--workspace-soft); color: var(--muted); }
.org-feedback { border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); padding: 12px 16px; }
.admin-overview { margin: 26px 0; gap: 18px; }
.admin-overview article { display: flex; align-items: flex-start; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.metric-icon { width: 44px; height: 44px; background: var(--workspace-soft); color: var(--brand-text, var(--accent)); display: grid; place-items: center; border-radius: 12px; flex-shrink: 0; }
.metric-icon svg { width: 22px; height: 22px; }
.admin-overview article span { display: inline; padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); }
.admin-overview article b { margin: 4px 0; font-size: 34px; line-height: 1.3; letter-spacing: -.04em; font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-overview article b small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.admin-overview article p { font-size: 12px; color: var(--muted); }
.admin-content-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.admin-search { position: relative; flex: 1; max-width: 290px; }
.admin-search > svg { position: absolute; width: 17px; height: 17px; color: var(--muted); top: 15px; left: 12px; pointer-events: none; }
.admin-search .ai-gk { padding-left: 36px; }
.admin-org-list { gap: 0; }
.admin-org-card { padding: 20px 0; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); gap: 14px; }
.admin-org-card:first-child { padding-top: 10px; }
.admin-org-card:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-card-logo { width: 48px; height: 48px; background: var(--workspace-soft); color: var(--brand-text, var(--accent)); border: 1px solid var(--line); border-radius: 12px; }
.admin-org-card h4 { font-size: 15px; font-weight: 650; margin-bottom: 5px; }
.admin-org-card p { font-size: 12px; margin: 0; }
#admin-application-review .org-section-head { flex-direction: row; align-items: center; margin-bottom: 0; }
#admin-application-review .org-feedback, #admin-application-list:not(:empty) { margin-top: 16px; }
#admin-application-list .admin-card-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#admin-application-review .btn { flex-shrink: 0; }
.admin-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.org-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--brand-text, var(--accent)); }
.org-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.org-status.is-disabled { color: var(--muted); }
.admin-manage { background: var(--paper); border-color: var(--line); padding: 8px 12px; }
.admin-manage > span { color: var(--muted); }
.admin-org-card.is-selected .admin-manage { border-color: var(--brand-text, var(--accent)); color: var(--brand-text, var(--accent)); }
.admin-create-panel { border-top: 3px solid var(--brand-color, var(--accent)); }
.admin-create-panel .org-settings-grid { grid-template-columns: minmax(0, 1fr); }
.admin-create-panel .org-wide { grid-column: auto; }
.admin-create-panel .row-actions { margin-top: 4px; }
.admin-create-panel .btn { width: 100%; }
.admin-create-note { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.8; }
.admin-empty { padding: 40px 12px; text-align: center; color: var(--muted); }
.admin-empty > svg { width: 36px; height: 36px; margin-bottom: 12px; }
.admin-empty h4 { color: var(--ink); font-size: 15px; margin: 0 0 8px; }
.admin-empty p { font-size: 13px; line-height: 1.8; }
@media (hover: hover) {
  .org-workspace .btn:not(.btn-primary):hover { background: var(--workspace-soft); border-color: var(--brand-text, var(--accent)); }
}
/* Account setup uses the same brand language as the institution workspace. */
.setup-page { min-height: 100dvh; background: var(--bg); }
.admin-setup { width: min(1040px, calc(100% - 64px)); display: grid; grid-template-columns: 1fr 1fr; padding: 0; margin: auto; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--paper); box-shadow: 0 20px 70px rgb(18 62 44 / 7%); }
.setup-story { display: flex; flex-direction: column; background: #154f3e; color: #fff; padding: 36px 42px; }
.setup-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 15px; font-weight: 650; }
.setup-brand .mark { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: #154f3e; box-shadow: none; font-size: 19px; flex-shrink: 0; }
.setup-brand small { display: block; margin-top: 4px; color: #c0dace; font-size: 11px; font-weight: 400; letter-spacing: .08em; }
.setup-story-body { margin: auto 0; padding: 52px 0 38px; }
.setup-kicker { font-size: 12px; color: #c2dfd1; letter-spacing: .16em; }
.setup-story h2 { font-size: clamp(28px, 3vw, 37px); line-height: 1.5; margin: 14px 0 20px; font-weight: 650; letter-spacing: -.02em; }
.setup-description { color: #d0e3d9; font-size: 13px; line-height: 1.9; }
.setup-features { display: grid; gap: 22px; margin-top: 40px; }
.setup-features > div { display: flex; align-items: flex-start; gap: 14px; }
.setup-features > div > span { display: grid; place-items: center; width: 28px; height: 28px; color: #b4d7c6; border: 1px solid #4d7c68; border-radius: 8px; font-size: 10px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.setup-features b { font-size: 13px; font-weight: 600; }
.setup-features small { display: block; font-size: 12px; color: #c0dace; margin-top: 4px; line-height: 1.7; }
.setup-story-footer { border-top: 1px solid #41745e; padding-top: 20px; color: #c0dace; font-size: 12px; }
.setup-form-panel { padding: 36px 48px; }
.setup-step { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: .06em; margin-bottom: 32px; }
.setup-step span:last-child { font-variant-numeric: tabular-nums; }
.setup-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.setup-symbol svg { width: 27px; height: 27px; }
.admin-setup h1 { font-size: 27px; letter-spacing: -.04em; font-weight: 700; margin: 0 0 10px; }
.setup-form-intro { font-size: 13px; color: var(--muted); margin-bottom: 28px; line-height: 1.8; }
.setup-form-panel .auth-form { gap: 20px; }
.setup-form-panel .auth-form label { font-size: 13px; font-weight: 550; }
.setup-form-panel input:disabled { color: var(--muted); opacity: 1; background: var(--bg); font-variant-numeric: tabular-nums; }
.setup-field-hint { font-size: 11px; color: var(--muted); margin: -13px 0 -2px; }
.setup-form-panel .btn { display: flex; justify-content: center; gap: 16px; align-items: center; min-height: 48px; font-size: 14px; }
.setup-note { padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.8; color: var(--muted); }
.setup-message { font-size: 13px; line-height: 1.8; color: var(--ink); }
.setup-message:not(:empty) { margin: 16px 0; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); }
.setup-login { text-decoration: none; }
.auth-access { border-left: 1px solid var(--line); }
.auth-welcome h2 { font-size: 25px; }
.auth-apps button { min-height: 86px; }
.auth-apps b { font-size: 12px; }
@media (max-width: 1000px) {
  .org-content-grid, .admin-content-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .org-secondary-column { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 20px; }
  .org-secondary-column .panel + .panel { margin-top: 0; }
  .org-secondary-column > .panel:first-child { grid-column: 1 / -1; }
  .admin-create-panel .org-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-create-panel .org-wide { grid-column: 1 / -1; }
  .admin-overview article { padding: 20px; gap: 12px; }
  .admin-overview article p { display: none; }
  .setup-story { padding: 30px; }
  .setup-form-panel { padding: 30px; }
}
@media (max-width: 620px) {
  body.management-mode #main { padding: 24px 16px 32px; }
  .org-workspace .org-heading { align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  .org-workspace .org-heading h2 { font-size: 25px; }
  .org-heading .org-role { font-size: 11px; padding: 6px 10px; }
  .org-workspace .org-heading .lead { font-size: 13px; }
  .org-workspace .section-eyebrow { font-size: 11px; letter-spacing: .07em; }
  .org-workspace .panel { padding: 20px 16px; }
  .org-brand-preview { padding: 20px 16px; margin: 20px 0; gap: 14px; flex-wrap: wrap; }
  .preview-mark { width: 56px; height: 56px; border-radius: 13px; font-size: 24px; }
  .org-brand-preview h2 { font-size: 21px; }
  .org-brand-preview p { font-size: 12px; }
  .brand-touchpoints { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); gap: 8px 16px; }
  .brand-touchpoints span { font-size: 11px; }
  .org-secondary-column { display: block; }
  .org-secondary-column .panel + .panel { margin-top: 20px; }
  .org-logo-row { padding: 14px 10px; gap: 12px; align-items: center; }
  .org-logo-row .btn { padding: 8px; font-size: 12px; }
  .org-workspace .ai-gk { font-size: 16px; }
  .org-settings-grid, .admin-create-panel .org-settings-grid { grid-template-columns: minmax(0,1fr); }
  .org-wide, .admin-create-panel .org-wide { grid-column: auto; }
  .org-panel > .row-actions .btn { width: 100%; }
  .admin-overview { gap: 8px; margin: 22px 0; }
  .admin-overview article { display: block; padding: 14px 10px; border-radius: 12px; }
  .metric-icon { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 10px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .admin-overview article span { font-size: 11px; }
  .admin-overview article b { font-size: 27px; }
  .admin-overview article b small { margin-left: 4px; font-size: 10px; }
  .org-section-head { gap: 14px; }
  .admin-search { width: 100%; max-width: none; }
  .admin-org-card { gap: 10px; padding: 18px 0; flex-wrap: wrap; }
  .admin-card-logo { width: 40px; height: 40px; border-radius: 10px; }
  .admin-org-card h4 { font-size: 14px; }
  .admin-org-card > .btn { font-size: 12px; padding: 8px 10px; }
  .admin-card-meta { gap: 10px; margin-top: 8px; }
  .setup-page { display: block; }
  .admin-setup { width: 100%; margin: 0; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); box-shadow: none; }
  .setup-story { padding: calc(24px + env(safe-area-inset-top)) 24px 28px; }
  .setup-brand { font-size: 14px; }
  .setup-brand .mark { width: 36px; height: 36px; border-radius: 10px; }
  .setup-story-body { padding: 28px 0 0; }
  .setup-kicker { font-size: 11px; }
  .setup-story h2 { font-size: 27px; line-height: 1.45; margin: 10px 0 0; }
  .setup-description, .setup-features, .setup-story-footer { display: none; }
  .setup-form-panel { padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); }
  .setup-step { margin-bottom: 22px; }
  .setup-symbol { display: none; }
  .admin-setup h1 { font-size: 24px; }
  .setup-form-intro { margin-bottom: 24px; }
  .auth-access { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-height: 780px) and (min-width: 621px) {
  .admin-setup { margin: 24px auto; }
  .setup-story-body { padding-top: 32px; padding-bottom: 26px; }
  .setup-form-panel { padding-top: 28px; padding-bottom: 28px; }
  .setup-step { margin-bottom: 20px; }
  .setup-features { margin-top: 26px; gap: 18px; }
}
@media (prefers-color-scheme: dark) {
  .org-workspace { --workspace-soft: color-mix(in srgb, var(--brand-color, var(--accent)) 16%, var(--paper)); }
  .metric-icon, .panel-index, .preview-mark, .admin-card-logo, .org-status.is-enabled { color: color-mix(in srgb, var(--brand-text, var(--accent)) 45%, #fff); }
}

/* On phones, match results share the page's vertical scroll with the controls. */
@media (max-width: 850px) {
  body.sheet-mode { height: auto; min-height: 100dvh; overflow: visible; }
  body.sheet-mode .top { position: static; }
  body.sheet-mode #main { display: block; flex: none; height: auto; overflow: visible; }
  body.sheet-mode .xl-page { display: block; height: auto; }
  body.sheet-mode .live-stage { display: block; }
  body.sheet-mode .xl-scroll { flex: none; width: 100%; height: auto; max-height: none; overflow-x: auto; contain: none; }
  body.sheet-mode .xl thead th { position: static; }
}

/* Live commentary stays readable on camera and on a phone. */
body.live-mode .top { position: static; background: #161d1a; color: #f4f6f5; }
body.live-mode #main { height: auto; min-height: 0; padding: 0; }
body.live-mode .live-app { grid-template-rows: none; grid-auto-rows: auto; align-content: start; }
body.live-mode .live-ai-button { background: #c6f1da; color: #113b2a; border-color: #c6f1da; font-weight: 650; }
body.live-mode .xl-expand:disabled { opacity: .55; cursor: wait; }
.live-card { min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 1500px; }
body.sheet-mode .xl tfoot td { padding: 16px; text-align: center; background: #f2f6f4; }
.live-card .live-detail-link { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; line-height: 1.6; cursor: pointer; text-decoration: underline; text-decoration-color: #577464; text-underline-offset: 4px; }
.live-qualified { margin-left: auto; color: #b6e9c8; font-size: 12px; }
.live-school-tags { margin: 8px 0 0; color: #b5c8bc; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.live-score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 16px 0 0; border: 1px solid #3c5547; border-radius: 10px; overflow: hidden; background: #3c5547; }
.live-score-grid > div { min-width: 0; padding: 12px; background: #15221b; }
.live-score-grid dt { color: #b3c9bb; font-size: 12px; line-height: 1.6; }
.live-score-grid dd { margin: 5px 0 0; color: #f0f7f2; font-size: 19px; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.live-score-grid .live-score-mine { background: #234633; }
.live-score-grid .live-score-mine dd, .live-score-grid .live-score-gap dd { color: #a7f3c2; }
.live-info-section { margin-top: 18px; }
.live-info-section h4 { margin: 0 0 6px; color: #a5d7b7; font-size: 12px; font-weight: 650; letter-spacing: .08em; }
.live-info-list { margin: 0; }
.live-info-list > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #314239; font-size: 13px; line-height: 1.8; }
.live-info-list dt { color: #b1c2b7; }
.live-info-list dd { margin: 0; color: #e0eae4; white-space: pre-line; overflow-wrap: anywhere; }
.live-card-actions { display: flex; gap: 8px; margin-top: 16px; }
.live-card-actions > button { flex: 1; min-width: 0; }
.live-ai-panel { min-width: 0; padding: 24px; margin-top: 12px; border: 1px solid #40564a; border-radius: 16px; background: #18231d; scroll-margin-top: 16px; }
.live-ai-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.live-ai-label { color: #a9dabc; font-size: 12px; font-weight: 650; letter-spacing: .1em; }
.live-ai-heading h2 { font-size: 22px; margin: 8px 0; color: #f2f7f3; }
.live-ai-heading p { font-size: 13px; color: #bdccc1; }
.live-ai-heading .row-actions { margin: 0; gap: 10px; }
.live-ai-summary { margin-top: 24px; padding: 18px 20px; border-left: 3px solid #9bd1af; border-radius: 0 10px 10px 0; background: #20362a; font-size: 16px; line-height: 1.9; color: #ecf5ef; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-ai-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 20px; }
.live-ai-details article { padding: 20px; border-radius: 12px; border: 1px solid #3c4d41; background: #1c2a21; min-width: 0; }
.live-ai-details article > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.live-ai-details .live-no { flex-shrink: 0; margin-top: 2px; }
.live-ai-details h3 { font-size: 17px; line-height: 1.6; color: #eef7f1; margin: 0; }
.live-ai-details h4 { margin: 18px 0 6px; font-size: 12px; color: #a6d4b7; font-weight: 600; }
.live-ai-details p { color: #d1dfd5; font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-ai-risks { padding: 18px 20px; margin-top: 20px; border-radius: 10px; background: #302d20; color: #f2e6bb; }
.live-ai-risks h3, .live-ai-script h3 { font-size: 16px; margin: 0 0 10px; }
.live-ai-risks ul { padding-left: 20px; margin: 0; font-size: 14px; line-height: 1.9; }
.live-ai-risks li + li { margin-top: 6px; }
.live-ai-script { padding: 20px; margin-top: 20px; border-radius: 10px; background: #132219; border: 1px solid #3c5544; color: #dcece2; }
.live-ai-script p { font-size: 16px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-ai-footnote { margin-top: 18px; font-size: 12px; line-height: 1.8; color: #b2c4b8; }
.live-ai-status { padding: 24px 0 8px; font-size: 15px; color: #d1e5d8; line-height: 1.8; }
.live-ai-status button { margin-top: 14px; }
@media (max-width: 620px) {
  .live-app { padding: 12px 12px 24px; }
  .live-board { grid-template-columns: minmax(0, 1fr); }
  .live-ai-panel { padding: 20px 14px; }
  .live-ai-heading h2 { font-size: 20px; }
  .live-ai-heading .row-actions { width: 100%; }
  .live-ai-heading .row-actions button { flex: 1; font-size: 14px; padding: 0 10px; }
  .live-ai-summary, .live-ai-details article, .live-ai-script, .live-ai-risks { padding: 16px; }
  .live-desk-side { grid-template-columns: minmax(0, 1fr); }
  .live-n { margin-left: 0; }
}

body.live-mode .user-out { background: #161d1a; color: #e5f0e9; border-color: #4a5c50; }
body.live-mode .user-out:hover { background: #263c2e; color: #fff; }
.live-current-student { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border: 1px solid #3d5e49; border-radius: 10px; background: #20372a; color: #e5f4e9; font-size: 14px; }
.live-current-student > span { color: #b7cfbf; font-size: 12px; }
.live-current-student > b { margin-left: auto; font-size: 13px; color: #b7edc9; }
.student-picker { width: min(480px, calc(100% - 28px)); max-height: min(76dvh, 680px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / 24%); }
.student-picker[open] { display: flex; flex-direction: column; }
.student-picker::backdrop { background: rgb(10 23 16 / 64%); }
.student-picker-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 20px 12px; }
.student-picker-head h2 { margin: 0; font-size: 20px; }
.student-picker-head p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.student-picker-close { flex: 0 0 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-size: 24px; line-height: 1; }
.student-picker-search { display: grid; gap: 8px; margin: 0 20px 12px; font-size: 12px; color: var(--muted); }
.student-picker-search input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--ink); font-size: 16px; }
.student-picker-results { min-height: 100px; overflow: auto; overscroll-behavior: contain; padding: 0 20px 20px; }
.student-picker-empty { padding: 24px 0; color: var(--muted); font-size: 13px; line-height: 1.8; text-align: center; }
.student-picker-empty button { margin-top: 12px; }
.student-picker-count { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.student-picker-summary { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.student-picker-summary .student-picker-count { margin:0; }
.student-picker-refresh { padding:6px 0 6px 8px; border:0; background:transparent; color:var(--brand-text,var(--accent)); font:inherit; font-size:12px; cursor:pointer; }
.student-picker-refresh:disabled { opacity:.6; cursor:wait; }
.student-picker-feedback { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; font-size:12px; color:var(--danger); }
.student-picker-list { display: grid; gap: 8px; }
.student-picker-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 70px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); text-align: left; }
.student-picker-item > span { display: grid; gap: 6px; min-width: 0; }
.student-picker-item b { font-size: 14px; overflow-wrap: anywhere; }
.student-picker-item small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.student-picker-item em { flex-shrink: 0; font-size: 12px; color: var(--brand-text, var(--accent)); font-style: normal; }
.student-picker-item.is-selected { border-color: var(--brand-text, var(--accent)); background: var(--accent-soft); }
.student-picker-item:disabled { opacity: .6; cursor: default; }
body.live-mode .student-picker { --paper: #1b2820; --bg: #142019; --ink: #e6f0e9; --muted: #bbcdc1; --line: #42564a; --accent-soft: #294b35; --brand-text: #b5eac8; }

/* The candidate's complete camera frame is the primary interview view. */
body.iv-mode .top { position: static; }
body.iv-mode .iv-room { max-width: 1080px; }
body.iv-mode .iv-room .btn:not(.btn-primary) { color: #e7eee9; background: #24382d; border-color: #638371; }
body.iv-mode .iv-room .btn:not(.btn-primary):hover { background: #314c3d; }
body.iv-mode .iv-room .btn:focus-visible { outline-color: #a5e4bd; }
body.iv-mode .iv-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
body.iv-mode .iv-me { order: 0; min-height: 0; width: 100%; background: #080d0a; }
body.iv-mode .iv-me video { width: 100%; height: auto; aspect-ratio: var(--iv-camera-ratio, 4 / 3); max-height: min(65dvh, 680px); object-fit: contain; object-position: center; }
.iv-camera-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #17251c; color: #cee4d5; font-size: 13px; }
.iv-camera-expand { border: 1px solid #52735d; border-radius: 8px; min-height: 36px; padding: 6px 12px; background: #203c29; color: #e3f4e9; font-size: 13px; }
body.iv-mode .iv-human { order: 1; min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
body.iv-mode .iv-human .iv-bust { display: none; }
body.iv-mode .iv-human .iv-tag { position: static; padding: 0; background: transparent; font-size: 13px; }
body.iv-mode .iv-human .iv-status { position: static; margin-left: auto; max-width: 45%; text-align: right; line-height: 1.7; }
body.iv-mode .iv-me:fullscreen { display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; width: 100vw; height: 100dvh; }
body.iv-mode .iv-me:fullscreen video { flex: 1; min-height: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: contain; }
body.iv-mode .iv-me:fullscreen .iv-camera-toolbar { flex-shrink: 0; }
@media (max-width: 620px) {
  body.iv-mode .iv-human { gap: 10px; padding: 10px 12px; }
  body.iv-mode .iv-human .iv-bust { display: none; }
  body.iv-mode .iv-human .iv-status { font-size: 12px; }
}
/* Keep standalone live windows phone-sized even when opened in a full tab. */
body.live-popup .top { width: min(100%, 430px); margin-inline: auto; }
body.live-popup .top :is(.tabbar, .user-slot) { display: none; }
body.live-popup #main { width: min(100%, 430px); margin-inline: auto; }
body.live-popup .live-app { padding: 12px 12px 24px; }
body.live-popup :is(.live-board, .live-desk, .live-desk-side) { grid-template-columns: minmax(0, 1fr); }
body.live-popup .live-n { margin-left: 0; }
body.live-popup .live-grade-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 8px; }
body.live-popup .live-manual { padding: 16px 14px; }
body.live-popup .live-manual-heading { flex-wrap: wrap; }
body.live-popup .live-manual-heading h2 { font-size: 16px; }
body.live-popup .live-grade-field select { padding: 8px 4px; font-size: 16px; }
.live-app > *, .live-desk > * { min-width: 0; }
.live-paste { width: 100%; min-width: 0; }
.live-manual { padding: 20px; border: 1px solid #3c4d41; border-radius: 14px; background: #1a2220; }
.live-manual-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.live-manual-heading h2 { font-size: 17px; margin: 0 0 6px; color: #edf6f0; }
.live-manual-heading h2 > span { font-size: 12px; color: #a9dabc; font-weight: 500; margin-left: 8px; font-variant-numeric: tabular-nums; }
.live-manual-heading p { font-size: 13px; line-height: 1.8; color: #bdccc2; }
.live-manual-heading > button { flex-shrink: 0; }
.live-grade-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 12px; }
.live-grade-field { display: grid; gap: 8px; min-width: 0; color: #d4e2d9; font-size: 13px; }
.live-grade-field select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #52655b; border-radius: 9px; background: #111b16; color: #f0f6f2; padding: 8px 10px; font-size: 17px; font-weight: 600; color-scheme: dark; cursor: pointer; }
.live-grade-field select[data-grade-value="A"] { color: #86efac; border-color: #4e8362; }
.live-grade-field select[data-grade-value="B"] { color: #a9d3ff; }
.live-grade-field select[data-grade-value="C"] { color: #fde68a; }
.live-grade-field select[data-grade-value="D"] { color: #fdba74; }
.live-grade-field select[data-grade-value="E"] { color: #fda4af; }
@media (max-width: 1000px) { .live-grade-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 12px; } }
@media (max-width: 620px) {
  .live-manual { padding: 16px 14px; }
  .live-manual-heading { gap: 10px; flex-wrap: wrap; }
  .live-manual-heading h2 { font-size: 16px; }
  .live-manual-heading p { font-size: 12px; }
  .live-manual-heading > button { font-size: 13px !important; padding: 0 12px !important; }
  .live-grade-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 8px; }
  .live-grade-field { font-size: 12px; gap: 6px; }
  .live-grade-field select { padding: 8px 4px; font-size: 16px; border-radius: 7px; }
}

/* Grouped match-table headings keep labels and controls on a single line. */
body.sheet-mode .xl { min-width: var(--xl-table-min, 1880px); font-size: 13px; }
body.sheet-mode .xl thead { position: sticky; top: 0; z-index: 4; }
body.sheet-mode .xl thead th { position: static; padding: 0; height: auto; box-shadow: none; border-right: 1px solid #e0e7e3; white-space: normal; word-break: normal; }
body.sheet-mode .xl .xl-group-row th { background: var(--brand-color, #18674d); color: var(--brand-on, #fff); height: 34px; padding: 8px 12px; border-right-color: rgb(255 255 255 / 24%); border-bottom: 0; font-size: 12px; font-weight: 550; letter-spacing: .14em; }
body.sheet-mode .xl .xl-column-row th { background: #f2f6f4; color: #253c31; border-bottom: 1px solid #cfded5; }
body.sheet-mode .xl .xl-column-row th.hd-orange,
body.sheet-mode .xl .xl-column-row th.hd-red { background: #f2f6f4 !important; color: #253c31; }
body.sheet-mode .xl .xl-head-cell { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 6px; min-height: 52px; padding: 8px 6px; }
body.sheet-mode .xl .hd-text, body.sheet-mode .xl th.hd-admit .hd-text { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; white-space: nowrap; line-height: 1.45; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
body.sheet-mode .xl .hd-text > span { white-space: nowrap; }
body.sheet-mode .xl .hd-filter { position: static; transform: none; flex: 0 0 auto; width: 24px; height: 26px; border: 0; border-radius: 0; background: transparent; color: #63766a; opacity: 1; display: grid; place-items: center; }
body.sheet-mode .xl .hd-filter::after { display: none; }
body.sheet-mode .xl .hd-filter svg { width: 15px; height: 15px; }
body.sheet-mode .xl :is(.hd-filter, .sort-btns button):focus-visible { outline: 2px solid var(--brand-text, #18674d); outline-offset: 2px; }
body.sheet-mode .xl th.filtered .hd-filter { color: var(--brand-text, #18674d); background: transparent; }
body.sheet-mode .xl .sort-btns { flex: 0 0 auto; flex-direction: column; gap: 2px; margin: 0; }
body.sheet-mode .xl .sort-btns button { width: 24px; height: 18px; line-height: 16px; border: 1px solid #dce6e0; border-radius: 6px; background: #fff; color: #52685b; font-size: 9px; opacity: .8; }
body.sheet-mode .xl .sort-btns button.on { background: var(--brand-color, #18674d); border-color: var(--brand-color, #18674d); color: var(--brand-on, #fff); opacity: 1; }
body.sheet-mode .xl th.is-sorted .hd-text { text-decoration: underline; text-underline-offset: 4px; }
body.sheet-mode .xl th.c-mine { background: color-mix(in srgb, var(--brand-color, #18674d) 14%, white) !important; color: #173b2b; }
body.sheet-mode .xl td.c-mine,
body.sheet-mode .xl tbody tr.sch-alt td.c-mine { background: color-mix(in srgb, var(--brand-color, #18674d) 5%, white); }
body.sheet-mode .xl td { padding: 6px 8px; line-height: 1.4; border-right-color: #e4ebe6; }
body.sheet-mode .xl td.c-kind, body.sheet-mode .xl td.c-city { font-size: 12px; }
body.sheet-mode .xl .school-tag { line-height: 1.6; margin-top: 7px; padding: 0; font-size: 11px; }
body.sheet-mode .xl .c-plan { font-size: 12px; line-height: 1.65; }
body.sheet-mode .xl .c-act .pick-btn { min-height: 36px; padding: 5px 8px; font-size: 12px; }
body.sheet-mode .xl .xl-column-row th:is(.c-plan, .c-innGap, .c-totalpoint, .c-date),
body.sheet-mode .xl td:is(.c-plan, .c-innGap, .c-totalpoint, .c-date) { border-right: 1px solid #d2dfd7; }
@media (hover: hover) {
  body.sheet-mode .xl .hd-filter:hover { color: #253c31; background: transparent; }
}
@media (max-width: 850px) {
  body.sheet-mode .xl thead { position: static; }
  body.sheet-mode .xl .hd-filter { width: 32px; height: 40px; }
  body.sheet-mode .xl .sort-btns button { width: 32px; height: 34px; line-height: 34px; }
  body.sheet-mode .xl .xl-head-cell { min-height: 56px; }
}

/* Fast first paint and explicit startup recovery. */
.startup-card { margin: clamp(32px, 10vh, 100px) auto; padding: 28px 20px; max-width: 440px; text-align: center; color: var(--ink); }
.startup-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: #18674d; font-size: 24px; font-weight: 700; }
.startup-card h2 { margin: 20px 0 10px; font-size: 20px; }
.startup-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.startup-progress { display: block; width: 100px; height: 4px; margin: 22px auto; border-radius: 4px; background: #dceae2; overflow: hidden; }
.startup-progress::after { content: ""; display: block; width: 40%; height: 100%; background: #18674d; border-radius: inherit; animation: startup-slide 1.2s ease-in-out infinite alternate; }
@keyframes startup-slide { to { transform: translateX(150%); } }
@media (prefers-reduced-motion: reduce) { .startup-progress::after { animation: none; } }
.basket-clear-dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 60px #10251b26; }
.basket-clear-dialog::backdrop { background: #10251b70; }
.basket-clear-dialog h2 { font-size: 21px; margin: 0 0 12px; }
.basket-clear-dialog p { font-size: 15px; line-height: 1.7; }
.basket-clear-dialog .row-actions { justify-content: flex-end; margin-top: 22px; }
.btn.basket-delete { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn.basket-delete:hover { background: color-mix(in srgb, var(--danger) 8%, var(--paper)); }

body.basket-mode #main { width: 100%; max-width: none; padding-inline: clamp(10px, 1.4vw, 22px); }
.basket-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.basket-heading .hero-line, .basket-heading .lead { margin: 0; }
.basket-heading .lead { font-variant-numeric: tabular-nums; }
.basket-toolbar { margin-block: 14px; }
.basket-toolbar .btn { min-height: 44px; }
.basket-toolbar .btn-primary { width: auto; }
.basket-scroll-hint { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.basket-table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.basket-table-scroll:focus-visible, .basket-plan summary:focus-visible { outline: 2px solid var(--brand-color, var(--accent)); outline-offset: 2px; }
#main .basket-table { min-width: var(--xl-table-min); font-size: 13px; line-height: 1.55; }
#main .basket-table :is(th, td) { text-align: center; overflow-wrap: anywhere; }
#main .basket-table td { padding: 8px; border-color: var(--line); color: var(--ink); background: var(--paper); }
#main .basket-table tbody tr:nth-child(even) td { background: var(--bg); }
#main .basket-table tbody tr:focus-within td { background: var(--accent-soft); }
#main .basket-table .xl-group-row th { position: static; height: 32px; padding: 6px 8px; background: var(--brand-color, #18674d); color: var(--brand-on, #fff); box-shadow: none; }
#main .basket-table .xl-column-row th { position: static; height: 48px; padding: 0; background: var(--bg) !important; color: var(--ink); box-shadow: none; }
#main .basket-table .xl-head-cell { display: flex; align-items: center; justify-content: center; gap: 2px; padding: 3px; }
#main .basket-table .hd-text { padding: 0; white-space: nowrap; }
#main .basket-table .basket-sort { border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; min-height: 36px; pointer-events: auto; cursor: pointer; }
#main .basket-table .is-sorted .hd-text { color: var(--brand-text, var(--accent)); text-decoration: underline; text-underline-offset: 3px; }
#main .basket-table .hd-filter { position: static; transform: none; display: grid; place-items: center; flex: 0 0 24px; min-height: 36px; color: var(--muted); background: transparent; }
#main .basket-table .hd-filter::after { display: none; }
#main .basket-table .hd-filter svg { width: 15px; height: 15px; }
#main .basket-table .filtered .hd-filter { color: var(--brand-text, var(--accent)); background: var(--accent-soft); }
#main .basket-table .sort-btns { flex: none; margin: 0; color: inherit; }
#main .basket-table .sort-btns button.on { color: var(--brand-text, var(--accent)); background: var(--accent-soft); }
#main .basket-table .xl-cell-value { white-space: pre-line; }
#main .basket-table td:is(.c-major, .c-school, .c-formula, .c-spec, .c-testcontent, .c-remark) { text-align: left; }
#main .basket-table td:is(.c-testcontent, .c-remark) .xl-cell-value { max-height: 6.2em; overflow: auto; }
#main .basket-table td:is(.c-admit, .c-innRate) { background: #fff2cc; color: #493900; }
#main .basket-table .xl-empty { padding: 24px 10px; text-align: left; }
#main .basket-table tr > :last-child { border-right: 0; }
#main .basket-table tbody tr:last-child > * { border-bottom: 0; }
.basket-row-actions { display: flex; justify-content: center; gap: 4px; }
.basket-row-actions .btn { padding: 0 8px; min-width: 44px; min-height: 44px; font-size: 12px; white-space: nowrap; }
.basket-plan { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.basket-plan summary { min-height: 44px; padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 650; }
.basket-plan .plan { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; overflow-wrap: anywhere; }
.basket-empty { padding-block: 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.basket-empty strong { color: var(--ink); }
.basket-empty p { margin: 6px 0 0; font-size: 13px; }
.basket-filter-bar .match-active-filters { margin-bottom: 8px; }
.basket-mode .xl-field-tools { display: block; margin: 0 0 8px; }
.basket-mode .xl-field-tools summary { width: fit-content; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--brand-text, var(--accent)); background: var(--paper); font-size: 13px; cursor: pointer; }
.basket-mode .xl-field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 6px; margin-top: 7px; }
.basket-mode .xl-field-tool { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.basket-mode .xl-field-tool button { position: static; transform: none; width: auto; min-height: 44px; padding: 0 7px; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.basket-mode .xl-field-tool .hd-filter { color: var(--brand-text, var(--accent)); }
.basket-mode .xl-field-tool .hd-filter::after { display: none; }
.xl-pop { max-width: calc(100vw - 16px); }
.xl-pop .xl-check span { min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .basket-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .basket-toolbar .btn-primary { grid-column: 1 / -1; }
}

.match-subjects { align-items: center; }
.match-add-query { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--brand-color, #18674d); border-radius: 8px; background: var(--brand-color, #18674d); color: var(--brand-on, #fff); font: inherit; font-weight: 650; white-space: nowrap; cursor: pointer; }
.match-add-query:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.match-student-dialog { width: min(720px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
.match-student-dialog .match-student-form { padding: 0 20px 16px; overflow-y: auto; overscroll-behavior: contain; }
.match-student-form .stu-add-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.match-student-form .stu-grades-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.match-student-form .stu-sub { padding: 6px; gap: 4px; }
.match-student-form .row-actions { justify-content: flex-end; margin-top: 10px; }
.match-student-form input, .match-student-form select { font-size: 16px; min-height: 42px; }

.major-detail-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.major-detail-actions > .btn { width: 100%; min-width: 0; min-height: 44px; padding: 10px; white-space: nowrap; }
.match-student-form .row-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.match-student-form .row-actions > .btn { min-width: 0; width: 100%; }

/* Keep save results visible inside the AI/live result, without moving the conversation. */
.basket-batch { display: grid; gap: 10px; width: 100%; }
.basket-batch.person-foot { display: grid; }
.basket-batch .btn { min-width: 0; width: 100%; min-height: 44px; }
.batch-basket-status, .batch-basket-error { margin: 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.batch-basket-status { color: var(--brand-text, var(--accent)); }
.batch-basket-error { color: var(--danger); }
body.live-mode .batch-basket-status { color: #b5eac8; }
body.live-mode .batch-basket-error { color: #ffb5bc; }
.toast { z-index: 40; }

/* School accommodation: a readable guide, with evidence beside each facility. */
.school-card { scrollbar-width: none; overscroll-behavior: contain; }
.school-card::-webkit-scrollbar { display: none; }
.school-card button[data-act="school-dorm"] { min-height: 44px; color: var(--accent); }
.dorm-section { margin: 28px 0 32px; scroll-margin-top: 16px; color: var(--ink); }
.dorm-section h3, .dorm-section h4, .dorm-section p, .dorm-section dl, .dorm-section dd, .dorm-section figure { margin: 0; }
.dorm-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dorm-house { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.dorm-house svg { width: 25px; height: 25px; }
.dorm-heading p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 3px; }
.dorm-heading h3 { font-size: clamp(19px, 4.8vw, 23px); line-height: 1.4; letter-spacing: -.4px; }
.dorm-overview { border-radius: 14px; padding: 20px; background: var(--accent-soft); border: 1px solid var(--line); }
.dorm-eyebrow { display: inline-block; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--accent); }
.dorm-overview > p { font-size: 15px; line-height: 1.9; }
.dorm-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin-top: 16px; border-top: 1px solid var(--line); }
.dorm-highlights > div { padding-top: 14px; min-width: 0; }
.dorm-highlights span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.dorm-highlights strong { display: block; font-size: 14px; line-height: 1.7; font-weight: 600; overflow-wrap: anywhere; }
.dorm-group { margin-top: 24px; }
.dorm-group h4 { display: flex; align-items: baseline; gap: 10px; font-size: 16px; margin-bottom: 8px; }
.dorm-group h4 > span { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.dorm-fact { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 10px; padding: 13px 0 6px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.75; }
.dorm-fact dt { color: var(--muted); padding-top: 1px; }
.dorm-fact dd { min-width: 0; }
.dorm-fact dd > span { display: block; overflow-wrap: anywhere; }
.dorm-fact.is-unknown { padding-bottom: 13px; }
.dorm-fact.is-unknown dd { color: var(--muted); }
.dorm-ref { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 10px 4px 0; font-size: 12px; font-weight: 400; color: var(--accent); text-decoration: none; vertical-align: middle; }
.dorm-ref:hover, .dorm-sources a:hover { text-decoration: underline; }
.dorm-section a:focus-visible, .dorm-sources summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.dorm-section a:active { opacity: .75; }
.dorm-notes { padding: 16px; margin-top: 22px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; }
.dorm-notes h4 { font-size: 14px; margin-bottom: 8px; }
.dorm-notes ul { padding-left: 18px; margin: 0; font-size: 13px; line-height: 1.85; }
.dorm-notes li + li { margin-top: 6px; }
.dorm-gallery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.dorm-gallery-head h4 { font-size: 16px; }
.dorm-gallery-head > span { font-size: 12px; color: var(--muted); }
.dorm-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dorm-gallery figure { min-width: 0; }
.dorm-photo-link { position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--bg); }
.dorm-photo-link img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.dorm-photo-zoom { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; background: rgb(0 0 0 / 65%); color: white; border-radius: 4px; font-size: 11px; }
.dorm-gallery figcaption { padding-top: 8px; font-size: 13px; line-height: 1.7; }
.dorm-gallery .dorm-ref { display: flex; }
.dorm-photo-error, .dorm-empty { padding: 16px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; line-height: 1.8; color: var(--muted); background: var(--bg); }
.dorm-sources { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dorm-sources summary { min-height: 48px; padding: 14px 0; cursor: pointer; color: var(--ink); font-size: 14px; }
.dorm-sources summary > span { color: var(--muted); margin-left: 8px; font-size: 12px; }
.dorm-sources ol { padding: 0 0 12px 24px; margin: 0; color: var(--muted); }
.dorm-sources li { padding-left: 3px; }
.dorm-sources a { display: block; min-height: 44px; padding: 8px 0; color: var(--accent); font-size: 13px; line-height: 1.8; text-decoration: none; overflow-wrap: anywhere; }
.dorm-source-kind { display: block; color: var(--muted); font-size: 12px; }
.dorm-section .dorm-footnote { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 14px; }
@media (max-width: 420px) {
  .dorm-overview { padding: 16px; }
  .dorm-fact { grid-template-columns: 5.6em minmax(0, 1fr); }
  .dorm-gallery { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 800px) {
  .dorm-highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Matching results flow with the document; no nested scrolling or clipped columns. */
body.sheet-mode { display: block; height: auto; min-height: 100dvh; overflow: visible; }
body.sheet-mode .top { position: static; }
body.sheet-mode #main { display: block; height: auto; overflow: visible; padding-inline: 0; }
body.sheet-mode .xl-page { display: block; height: auto; overflow: visible; }
body.sheet-mode .live-stage { display: block; }
body.sheet-mode .xl-scroll { width: 100%; height: auto; max-height: none; overflow: visible; contain: none; container-type: inline-size; }
body.sheet-mode .xl { width: 100%; min-width: 0; }
body.sheet-mode .xl thead { position: static; }
body.sheet-mode .xl :is(th, td) { overflow: visible; overflow-wrap: anywhere; white-space: normal; text-align: center; }
body.sheet-mode .xl .xl-head-cell { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; justify-content: center; align-items: center; gap: .25em; padding: 8px 2px; font-size: 11px; font-size: clamp(11px, calc(1200cqw / var(--xl-header-width)), 12px); }
body.sheet-mode .xl .hd-text,
body.sheet-mode .xl th.hd-admit .hd-text { flex: 0 0 auto; min-width: 0; display: block; white-space: nowrap; overflow-wrap: normal; font-size: inherit; letter-spacing: 0; }
body.sheet-mode .xl .hd-text > span { white-space: nowrap; }
body.sheet-mode .xl td { padding: 7px 4px; }
body.sheet-mode .xl :is(.major-link, .school-tag, .band, .pick-btn) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
body.sheet-mode .xl .major-link { text-align: center; }
body.sheet-mode .xl .c-act .pick-btn { width: 100%; padding: 5px 1px; border-radius: 6px; }
body.sheet-mode .xl .sort-btns { flex-wrap: nowrap; flex-direction: column; justify-content: center; gap: .1em; font-size: inherit; }
body.sheet-mode .xl .xl-head-cell .hd-filter { width: 1.5em; height: 2.4em; font-size: inherit; }
body.sheet-mode .xl .xl-head-cell .hd-filter svg { width: 1.2em; height: 1.2em; }
body.sheet-mode .xl .xl-head-cell .sort-btns button { display: grid; place-items: center; width: 1.6em; height: 1.3em; padding: 0; line-height: 1; font-size: inherit; }
body.sheet-mode .xl .c-band .band { min-width: 0; padding-inline: 2px; }
.xl-field-tools { display: none; }

/* Keep matching results in the same table at every viewport width. */
body.sheet-mode .xl-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
body.sheet-mode .xl { min-width: 1400px; }

/* School groups share a neutral background and use dark outlines. */
body.sheet-mode .xl tbody tr[data-match-row] { --school-row-bg: #fff; background: var(--school-row-bg); }
body.sheet-mode .xl tbody tr[data-match-row] td,
body.sheet-mode .xl tbody tr[data-match-row] td.c-mine { background: var(--school-row-bg); }

/* Highlight the two rate columns while retaining their numeric status colors. */
body.sheet-mode .xl .xl-column-row th:is(.c-innRate, .c-admit) {
  background: #ffe699;
  color: #493900;
}
body.sheet-mode .xl tbody tr[data-match-row] td:is(.c-innRate, .c-admit) {
  background: #fff2cc;
}

body.sheet-mode .xl tbody td { border-color: #a7bcb0; }
.xl .c-formula .formula-line { display: block; overflow-wrap: anywhere; word-break: normal; }
.xl .c-formula .formula-line + .formula-line { margin-top: 1px; }
body.sheet-mode .xl .xl-column-row th { border-color: #a7bcb0; }
body.sheet-mode .xl .xl-column-row th:is(.c-plan, .c-innGap, .c-totalpoint, .c-date),
body.sheet-mode .xl tbody td:is(.c-plan, .c-innGap, .c-totalpoint, .c-date) { border-right-color: #a7bcb0; }
/* Preserve section boundaries and row heights across all screen widths. */
  body.sheet-mode .xl .xl-group-row th:is([data-group="院校招生"], [data-group="学考入围"], [data-group="录取测算"], [data-group="校测安排"]),
  body.sheet-mode .xl .xl-column-row th:is(.c-plan, .c-innRate, .c-totalpoint, .c-date),
  body.sheet-mode .xl tbody td:is(.c-plan, .c-innRate, .c-totalpoint, .c-date) { border-right: 2px solid #527462; }
  body.sheet-mode .xl tbody tr.school-start:first-child td { border-top: 1px solid #8fa79a; }
  body.sheet-mode .xl tbody tr.school-end td { border-bottom: 1px solid #8fa79a; }
  body.sheet-mode .xl tbody tr[data-match-row] td:first-child { border-left: 1px solid #8fa79a; }
  body.sheet-mode .xl tbody tr[data-match-row] td:last-child { border-right: 1px solid #8fa79a; }
body.sheet-mode .xl .c-act .pick-btn { width: auto; min-width: 56px; max-width: 100%; padding: 7px 8px; white-space: nowrap; }

  body.sheet-mode .xl tbody tr[data-match-row],
  body.sheet-mode .xl tbody tr[data-match-row] td { height: 96px; }
  body.sheet-mode .xl .xl-cell-content { display: grid; place-items: center; height: 80px; overflow: hidden; }
  body.sheet-mode .xl .xl-cell-value { width: 100%; max-height: 80px; overflow: hidden; }
/* Compact conversion text stays complete, including longer weighted formulas. */
body.sheet-mode .xl tbody td.c-formula { font-size: 11px; line-height: 1.2; }
body.sheet-mode .xl td.c-formula .xl-cell-content { height: auto; min-height: 80px; overflow: visible; }
body.sheet-mode .xl td.c-formula .xl-cell-value { max-height: none; overflow: visible; }


/* Subject editing gets the full work area; native selects stay inside their cards. */
.stu-grades-grid, .stu-sub { min-width: 0; }
.stu-sub select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.student-notes-field { display: grid; gap: 7px; margin: 16px 0; min-width: 0; }
.student-notes-field > span { font-size: 14px; font-weight: 650; }
.student-notes-field small { font-size: 12px; color: var(--muted); line-height: 1.6; font-weight: 400; }
.student-notes-field textarea { width: 100%; min-height: 96px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; box-sizing: border-box; }
.student-notes-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.match-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: #f2f6f4; color: #253c31; border-top: 1px solid #d0ddd4; font-size: 13px; }
.match-active-filters > span { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; padding: 0 0 0 9px; border: 1px solid #bdcec3; border-radius: 8px; background: #fff; }
.match-active-filters > span > span { min-width: 0; overflow-wrap: anywhere; padding: 5px 0; }
.match-clear-filter { flex: 0 0 36px; width: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; color: #52685b; font: inherit; font-size: 20px; cursor: pointer; }
.match-clear-filter:focus-visible { outline: 2px solid #18674d; outline-offset: -3px; }
@media (max-width: 850px) { .match-clear-filter { flex-basis: 44px; width: 44px; min-height: 44px; } }
.match-active-filters > button { margin-left: auto; min-height: 44px; background: #fff; color: #18674d; border-color: #9cb5a6; }
.stu-work-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.stu-work-grid > *, .stu-work-side > * { min-width: 0; }
#stu-sec-grades { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }

/* AI decisions: consulting room on the green workbench. */
html.ai-modal-open { overflow: hidden; }
.ai-mask {
  padding: 28px 24px;
  background: rgb(10 28 20 / 46%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ai-mask .ai-chat-dialog {
  width: min(1080px, 100%);
  height: calc(100dvh - 56px);
  max-height: calc(100dvh - 56px);
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  color: #19342b;
  border: 1px solid rgb(255 255 255 / 55%);
  background:
    radial-gradient(720px 220px at 8% -20%, rgb(24 103 77 / 14%), transparent 58%),
    linear-gradient(#fdfffe, #f6faf7 38%, #f3f7f5);
  box-shadow: 0 28px 80px rgb(12 32 22 / 22%), 0 2px 0 rgb(255 255 255 / 70%) inset;
}
/* Empty conversations stay close to the welcome and starter prompts. */
.ai-mask:has(.ai-chat-empty) { align-items: start; }
.ai-mask .ai-chat-dialog.ai-chat-empty { height: auto; }
.ai-chat-empty .ai-chat-content { flex: 0 1 auto; }
.ai-starters { padding: 6px 0 14px; }
.ai-starters-label { margin: 0 0 10px; font-size: 12px; color: #5b7266; }
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 16px 22px 14px;
  border-bottom: 1px solid #e3eee8;
  background: rgb(255 255 255 / 72%);
}
.ai-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-mark {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-color, #18674d);
  color: var(--brand-on, #fff);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}
.ai-head h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; line-height: 1.3; }
.ai-kicker { margin: 2px 0 0; font-size: 12px; color: #6a7d73; line-height: 1.4; }
.ai-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ai-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: #e8f0eb;
  gap: 2px;
}
.ai-switch-btn {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #4e675b;
  font-size: 13px;
  font-weight: 650;
}
.ai-switch-btn[aria-pressed="true"] {
  background: #fff;
  color: #18674d;
  box-shadow: 0 1px 3px rgb(25 52 43 / 12%);
}
.ai-text-btn, .ai-close {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4e675b;
  font-size: 13px;
  font-weight: 650;
}
.ai-text-btn:hover, .ai-switch-btn:hover, .ai-close:hover { background: rgb(24 103 77 / 8%); }
.ai-head-actions button { min-height: 44px; }
.ai-close { color: #3d5a4c; background: #fff; border: 1px solid #d5e3db; }
.ai-chat-content { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 18px 24px 8px; }
.ai-chat-content .ai-cond-tags { max-height: none; overflow: visible; }
.ai-prefs { padding: 0 0 4px; border-bottom: 0; }
.ai-cond { padding: 10px 12px; background: #fff; border: 1px solid #e3eee8; border-radius: 12px; }
.ai-cond-k { font-size: 11px; letter-spacing: .08em; color: #6a7d73; }
.ai-tag { background: #e7f3ec; color: #18674d; padding: 3px 9px; }
.ai-chat-content .ai-pref-body { max-height: none; overflow: visible; padding: 16px; margin-top: 10px; background: #fff; border: 1px solid #e3eee8; border-radius: 14px; }
.ai-chat-content .ai-pref-body .ai-chips { max-height: none; overflow: visible; }
.ai-chat-content .ai-pref-body .person-chip { min-height: 40px; }
.ai-chat-content .ai-msgs { flex: none; overflow: visible; padding: 14px 0 8px; gap: 12px; }
.ai-chat-content .ai-bubble { flex-shrink: 0; overflow-wrap: anywhere; }
.ai-chat-content .ai-welcome, .ai-welcome {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e3eee8;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgb(25 52 43 / 4%);
}
.ai-welcome-kicker {
  display: inline-flex;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f3ec;
  color: #18674d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.ai-chat-content .ai-bubble-ai { width: 100%; padding: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; background: #fff; border: 1px solid #e3eee8; border-radius: 16px; }
.ai-chat-content .ai-bubble-user { max-width: min(72%, 640px); padding: 12px 16px; background: #18674d; border-radius: 16px 16px 6px 16px; }
.ai-chat-content .ai-bubble-ai > :is(p, .ai-bubble-text, .ai-tip, .person-foot) { grid-column: 1 / -1; }
.ai-consultation { grid-column: 1 / -1; min-width: 0; padding: 12px; border: 1px solid #cbded2; border-radius: 10px; background: #f7faf8; overflow-wrap: anywhere; }
.ai-goal-heading, .ai-goal-actions, .ai-method { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-goal-heading { justify-content: space-between; color: #234c38; }
.ai-goal-heading span, .ai-method { font-size: 12px; color: #52675b; }
.ai-goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 8px 18px; margin: 10px 0; }
.ai-goal-grid dt { font-size: 12px; color: #52675b; }
.ai-goal-grid dd { margin: 2px 0 0; color: #183a29; }
.ai-goal-actions .btn { min-height: 44px; white-space: normal; }
.ai-followup, .ai-plan-warnings, .ai-check-details { margin-top: 10px; }
.ai-plan-warnings { color: #9a471b; }
.ai-check-details { font-size: 12px; color: #52675b; }
.ai-check-details summary { cursor: pointer; padding: 8px 0; }
.ai-method { margin: 4px 0 12px; }
.ai-method button { min-height: 44px; padding: 6px 12px; border: 1px solid #cbded2; border-radius: 8px; background: #fff; color: #234c38; }
.ai-method button[aria-pressed="true"] { background: #e0f0e6; border-color: #6b9e7d; }
.ai-chat-content .ai-group { min-width: 0; align-content: start; gap: 8px; padding: 12px; background: #f7fbf8; border-radius: 12px; }
.ai-chat-content .ai-group .person-label { font-size: 12px; color: #18674d; letter-spacing: .04em; }
.ai-chat-content .ai-row { align-items: flex-start; padding: 12px; border: 1px solid #e3eee8; background: #fff; border-radius: 12px; }
.ai-chat-content .ai-row .band { flex-shrink: 0; }
.ai-chat-content .ai-row-main b { font-size: 14px; }
.ai-chat-content .ai-row-main span { font-size: 13px; line-height: 1.6; }
.ai-recommendations { grid-column: 1 / -1; min-width: 0; }
.ai-results-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.ai-results-heading h4 { margin: 0; font-size: 16px; }
.ai-results-heading span, .ai-results-note { font-size: 12px; color: #5b7266; }
.ai-results-note { margin: 0 0 12px; line-height: 1.6; }
.ai-results-actions { justify-content: flex-start; margin: 0 0 12px; padding: 0; }
.ai-results-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 13px; text-align: left; }
.ai-results-table th, .ai-results-table td { position: static; padding: 10px 8px; text-align: left; vertical-align: top; border: 1px solid #d5e3db; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.ai-results-table th { background: #e7f3ec; color: #19342b; font-size: 12px; }
.ai-results-table .ai-row { display: table-row; background: #fff; }
.ai-results-table th:nth-child(1) { width: 6%; }
.ai-results-table th:nth-child(2), .ai-results-table th:nth-child(3) { width: 14%; }
.ai-results-table th:nth-child(4) { width: 10%; }
.ai-results-table th:nth-child(5) { width: 10%; }
.ai-results-table th:nth-child(6) { width: 22%; }
.ai-results-table th:nth-child(7) { width: 16%; }
.ai-results-table .band { white-space: normal; }
.ai-results-table .band-pending { color: #5b7266; background: #eef3f0; }
.ai-make-table { grid-column: 1 / -1; justify-self: start; min-height: 44px; }
@media (max-width: 780px) {
  .ai-results-table, .ai-results-table tbody { display: block; }
  .ai-results-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ai-results-table .ai-row { display: grid; gap: 0; margin-bottom: 12px; padding: 8px 10px; border: 1px solid #d5e3db; border-radius: 10px; }
  .ai-results-table td { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; border: 0; padding: 5px 0; }
  .ai-results-table td::before { content: attr(data-label); color: #5b7266; font-size: 12px; }
  .ai-results-table .band { justify-self: start; }
}
.ai-typing { color: #6a7d73; font-style: normal; }
.ai-chat-dialog .ai-dock {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 20px 16px;
  background: rgb(255 255 255 / 88%);
  border-top: 1px solid #e3eee8;
  box-shadow: 0 -10px 28px rgb(25 52 43 / 4%);
}
.ai-chat-dialog .ai-composer { min-width: 0; padding: 6px 6px 6px 14px; background: #fff; border: 1px solid #d5e3db; border-radius: 16px; }
.ai-chat-dialog .ai-input { background: transparent; border: 0; box-shadow: none; color: #19342b; font-size: 16px; min-height: 88px; max-height: 160px; padding: 10px 4px; }
.ai-chat-dialog .ai-input:focus { outline: none; }
.ai-chat-dialog .ai-composer:focus-within { border-color: #18674d; box-shadow: 0 0 0 3px rgb(24 103 77 / 14%); }
.ai-chat-dialog .ai-send { min-height: 40px; border-radius: 12px; }
@media (max-height: 500px) {
  .ai-chat-dialog .ai-input { min-height: 44px; max-height: 44px; }
}
.ai-quick { gap: 8px; }
.ai-chat-dialog .ai-quick button {
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #d5e3db;
  color: #18674d;
  font-weight: 650;
}
.ai-chat-dialog .ai-quick button:hover { background: #e7f3ec; border-color: #b7d2c4; }
.ai-survey { padding: 18px 24px 16px; gap: 14px; }
.ai-progress { display: grid; gap: 10px; }
.ai-progress-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-progress-meta h4 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.ai-progress-meta span { font-size: 12px; color: #6a7d73; }
.ai-progress-track { height: 6px; border-radius: 99px; background: #e4eee8; overflow: hidden; }
.ai-progress-track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1b7a58, #18674d); }
.ai-steps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ai-step {
  flex: 0 0 auto;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #d5e3db;
  background: #fff;
  color: #5b7266;
  font-size: 13px;
  font-weight: 700;
}
.ai-step.on { background: #18674d; border-color: #18674d; color: #fff; }
.ai-step.filled:not(.on) { background: #e7f3ec; border-color: #b7d2c4; color: #18674d; }
.ai-survey-goal { margin: 0; font-size: 14px; color: #5b7266; line-height: 1.6; }
.ai-survey-body { gap: 10px; padding: 0; align-content: start; }
.ai-survey .ai-field {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e3eee8;
  border-radius: 14px;
}
.ai-survey .ai-field .person-label { margin-bottom: 10px; font-size: 14px; color: #19342b; }
.ai-survey .person-chip { min-height: 40px; padding: 6px 14px; background: #f7fbf8; }
.ai-survey .person-chip[aria-pressed="true"] { background: #18674d; border-color: #18674d; }
.ai-survey .ai-gk { min-height: 44px; background: #f7fbf8; border-color: #d5e3db; }
.ai-survey-nav { padding-top: 12px; border-top: 1px solid #e3eee8; gap: 10px; }
.ai-survey-nav .xl-expand { min-height: 44px; background: #fff; }
.ai-chat-dialog .ai-survey-nav { flex-wrap: wrap; }
@media (max-width: 780px) {
  .ai-chat-content .ai-bubble-ai { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ai-mask { padding: 0; }
  .ai-mask .ai-chat-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .ai-head { flex-wrap: wrap; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .ai-head-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .ai-switch { flex: 1 1 auto; }
  .ai-switch-btn { flex: 1; }
  .ai-close { margin-left: auto; }
  .ai-chat-content { padding: 12px 16px; }
  .ai-chat-content .ai-bubble-ai { padding: 12px; }
  .ai-chat-content .ai-pref-body { padding: 12px; }
  .ai-chat-dialog .ai-dock { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .ai-survey { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .ai-progress-meta h4 { font-size: 17px; }
}
#stu-sec-grades .stu-grades-grid { gap: 12px; margin: 12px 0 16px; }
#stu-sec-grades .stu-sub { padding: 12px; }
#stu-sec-grades .stu-sub select { min-height: 44px; font-size: 16px; }
#stu-sec-grades .row-actions { justify-content: flex-end; margin-bottom: 0; }
#stu-sec-grades .row-actions .btn { flex: 0 1 auto; min-width: 160px; }
.stu-work-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stu-work-side > div { padding: 18px; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
@media (max-width: 850px) {
  .stu-work-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #stu-sec-grades { padding: 12px; }
  #stu-sec-grades .stu-grades-grid { gap: 8px; }
  #stu-sec-grades .row-actions .btn { width: 100%; }
}

/* Student management: find a student first, then work on one clear section. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.stu-mode .top { position: static; }
body.stu-mode #main { padding: 28px clamp(12px, 2vw, 32px) 40px; }
.stu-page { gap: 20px; }
.stu-page .stu-grades-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (min-width: 1280px) { .stu-page .stu-grades-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (prefers-color-scheme: dark) { .stu-page { --brand-text: var(--accent); } }
.stu-head { align-items: center; }
.stu-head h1 { margin: 3px 0 6px; font-size: 28px; letter-spacing: -.025em; }
.stu-head .lead { font-size: 14px; }
.stu-eyebrow { font-size: 12px; font-weight: 650; color: var(--brand-text, var(--accent)); }
.stu-head .stu-add-trigger { width: auto; min-height: 44px; padding: 0 20px; font-size: 14px; }
.stu-page .panel { margin: 0; box-shadow: none; }
.stu-page .btn { min-height: 44px; font-size: 14px; white-space: nowrap; }
.stu-page .btn-primary { width: auto; }
.stu-page .btn:not(.btn-primary) { color: var(--ink); }
.stu-add { display: block; padding: 0; border: 1px solid var(--line); }
.stu-add > summary { padding: 16px 20px; min-height: 56px; cursor: pointer; font-size: 15px; font-weight: 650; }
.stu-add > summary span { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.stu-add-body { padding: 4px 20px 20px; }
.stu-edit-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.stu-edit-fields:disabled { opacity: .65; }
.stu-add-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stu-add .stu-form-hint { font-size: 12px; margin: 10px 0 24px; color: var(--muted); }
.stu-add .student-notes-field { margin-top: 20px; }
.stu-add .row-actions { justify-content: flex-end; }
.stu-page .student-notes-field textarea { min-height: 100px; }
.stu-page .stu-form-error { font-size: 14px; color: var(--danger); padding: 12px 0 0; }
.stu-board { padding: 0; overflow: visible; }
.stu-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 22px 24px 16px; }
.stu-list-heading h2 { margin: 0 0 6px; font-size: 18px; }
.stu-list-heading h2 span { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stu-list-heading p, #stu-roster-count { font-size: 12px; color: var(--muted); }
.stu-roster-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 0 24px 20px; }
.stu-search { flex: 1 1 280px; max-width: 480px; }
.stu-search input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); }
.stu-counselor-filter { display: flex; flex: 0 1 250px; min-width: 0; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stu-counselor-filter span { flex: none; }
.stu-counselor-filter select { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); }
.stu-status-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.stu-status-tabs button { min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 13px; }
.stu-status-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--brand-text, var(--accent)); border-color: var(--line); font-weight: 650; }
.stu-board .stu-table-wrap { border: 0; border-radius: 0 0 16px 16px; overflow: visible; }
.stu-roster-table { table-layout: fixed; min-width: 0; }
.stu-roster-table thead th { position: static; background: var(--bg); font-weight: 550; }
.stu-roster-table th:nth-child(1) { width: 15%; }
.stu-roster-table th:nth-child(2) { width: 24%; }
.stu-roster-table th:nth-child(3) { width: 19%; }
.stu-roster-table th:nth-child(4) { width: 8%; }
.stu-roster-table th:nth-child(5) { width: clamp(440px, 47vw, 580px); }
.stu-roster-table td { padding: 18px 12px; overflow-wrap: anywhere; }
#main .stu-roster-table td.stu-roster-name { text-align: left; padding-left: 24px; }
.stu-name-button { display: block; min-height: 44px; padding: 0; max-width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.stu-roster-name > span { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stu-roster-grades > b { font-size: 14px; letter-spacing: .02em; }
.stu-incomplete { display: inline-block; margin: 0 6px; color: var(--danger); font-size: 12px; }
.stu-grade-preview { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 10px; }
.stu-grade-preview > span { white-space: nowrap; color: var(--muted); font-size: 12px; }
.stu-grade-preview b { margin-left: 2px; padding: 1px 3px; border-radius: 3px; background: var(--bg); color: var(--ink); }
.stu-grade-preview b[data-display-grade="A"] { background: #dff3e5; color: #17603b; }
.stu-grade-preview b[data-display-grade="B"] { background: #e5effc; color: #285b91; }
.stu-roster-notes p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: left; white-space: pre-wrap; color: var(--muted); font-size: 13px; line-height: 1.7; }
.stu-roster-count button { min-height: 44px; border: 0; background: transparent; color: var(--brand-text, var(--accent)); font-size: 19px; font-weight: 650; }
.stu-roster-count button span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
#main .stu-roster-actions .stu-acts { display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding: 3px; }
.stu-roster-management { display: flex; flex: none; gap: 4px; }
.stu-roster-actions .btn { flex: 0 0 auto; min-width: 0; padding: 0 7px; font-size: 12px; white-space: nowrap; }
.stu-page .stu-roster-management .btn.basket-delete { color: var(--danger); }
.stu-empty { padding: 44px 20px; text-align: center; }
.stu-empty h3 { font-size: 17px; margin-bottom: 8px; }
.stu-empty p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.stu-work { padding: 24px; scroll-margin-top: 16px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.stu-work-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.stu-work-heading h2 { margin: 5px 0 8px; font-size: 24px; }
.stu-work-heading p { font-size: 13px; color: var(--muted); }
.stu-work-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.stu-work-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.stu-work-nav button { min-height: 44px; border: 1px solid transparent; background: var(--bg); color: var(--muted); padding: 8px 16px; border-radius: 9px; font-size: 14px; }
.stu-work-nav button[aria-pressed="true"] { color: var(--brand-text, var(--accent)); background: var(--accent-soft); border-color: var(--line); font-weight: 650; }
.stu-work-nav span { font-size: 12px; margin-left: 4px; }
.stu-work-grid, .stu-work-side { display: block; }
.stu-work-side > div { border: 0; padding: 0; }
.stu-page #stu-sec-grades { border: 0; padding: 0; }
.stu-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stu-section-heading h3 { font-size: 16px; margin: 0; }
.stu-section-heading p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stu-section-heading > span { font-size: 12px; color: var(--muted); }
.stu-save-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.stu-save-bar > p { font-size: 12px; color: var(--muted); }
.stu-save-bar .row-actions { margin: 0; flex-wrap: wrap; }
.stu-save-bar .row-actions .btn { min-width: 0; }
.stu-page #stu-sec-grades .stu-sub { padding: 10px; }
.stu-page #stu-sec-grades .stu-sub select { padding: 0 8px; }
.stu-page #stu-sec-plan > .row-actions { flex-wrap: wrap; }
@media (max-width: 1000px) {
  body.stu-mode #main { padding-top: 20px; }
  .stu-page .stu-grades-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .stu-page .stu-sub, .stu-page #stu-sec-grades .stu-sub { padding: 6px 4px; gap: 6px; border-radius: 8px; text-align: center; }
  .stu-page .stu-sub select, .stu-page #stu-sec-grades .stu-sub select { padding: 0 2px; min-height: 44px; font-size: 16px; border-radius: 6px; }
  .stu-head h1 { font-size: 24px; }
  .stu-head .lead { max-width: 22em; line-height: 1.7; }
  .stu-list-heading, .stu-roster-toolbar { padding: 16px; }
  .stu-roster-toolbar { padding-top: 0; }
  .stu-search { max-width: none; flex-basis: 100%; }
  .stu-board .stu-table-wrap { padding: 0 12px 12px; }
  .stu-roster-table, .stu-roster-table tbody { display: block; }
  .stu-roster-table thead { display: none; }
  .stu-roster-table tbody { display: grid; gap: 12px; }
  .stu-roster-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .stu-roster-table td { display: block; border: 0; padding: 0; min-width: 0; }
  #main .stu-roster-table td.stu-roster-name { padding: 0; grid-column: 1; grid-row: 1; }
  .stu-roster-table .stu-roster-count { grid-column: 2; grid-row: 1; }
  .stu-roster-table .stu-roster-grades, .stu-roster-table .stu-roster-notes, .stu-roster-table .stu-roster-actions { grid-column: 1 / -1; margin-top: 14px; }
  .stu-grade-preview { justify-content: flex-start; gap: 6px 12px; }
  #main .stu-roster-table td.stu-roster-grades { text-align: left; }
  .stu-roster-table tbody tr.stu-on { border-color: var(--accent); }
  .stu-roster-table tbody tr.stu-on td, .stu-roster-table tbody tr:hover td { background: transparent; }
  .stu-add-body { padding: 0 16px 16px; }
  .stu-add > summary { padding: 16px; }
  .stu-add > summary span { display: block; margin: 6px 0 0; }
  .stu-add-meta { grid-template-columns: 1fr; }
  .stu-work { padding: 16px; }
  .stu-work-heading h2 { font-size: 22px; }
  .stu-work-tools { width: 100%; }
  .stu-work-tools .btn { flex: 1; }
  .stu-work-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 18px 0; }
  .stu-work-nav button { padding: 8px 4px; font-size: 13px; }
  .stu-save-bar .row-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px; }
  .stu-save-bar .row-actions .btn { width: 100%; }
  .stu-save-bar .row-actions .btn-primary { grid-row: 1; }
  .stu-page #stu-sec-plan > .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .stu-page #stu-sec-plan > .row-actions .btn-primary { grid-column: 1 / -1; }
}

/* Compact student workspace: keep fifteen choices visible on a laptop. */
body.stu-mode #main { padding-top: 12px; padding-bottom: 16px; }
.stu-page { gap: 12px; }
.stu-page [hidden] { display: none !important; }
.stu-head h1 { font-size: 24px; margin: 0; }
.stu-head .lead, .stu-head .stu-eyebrow { display: none; }
.stu-page .stu-work { padding: 12px 16px; }
.stu-work-heading { gap: 8px; }
.stu-work-heading > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.stu-work-heading .stu-eyebrow { display: none; }
.stu-work-heading h2 { font-size: 20px; margin: 0; }
.stu-work-heading p { margin: 0; }
.stu-work-nav { margin: 8px 0; padding-bottom: 8px; gap: 6px; }
.stu-work .stu-section-heading { margin-bottom: 6px; }
.stu-work .stu-section-heading h3 { display: none; }
.stu-work .stu-section-heading p { margin: 0; font-size: 12px; }
.stu-plan-table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#main .stu-plan-table { table-layout: fixed; width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; }
#main .stu-plan-table th, #main .stu-plan-table td { height: 28px; padding: 2px 10px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
#main .stu-plan-table th { position: static; background: var(--bg); font-size: 12px; }
#main .stu-plan-table th:nth-child(1) { width: 48px; }
#main .stu-plan-table th:nth-child(2) { width: 28%; }
#main .stu-plan-table th:nth-child(3) { width: 30%; }
#main .stu-plan-table th:nth-child(4) { width: 60px; }
#main .stu-plan-table th:nth-child(5) { width: 16%; }
#main .stu-plan-table tbody tr:last-child td { border-bottom: 0; }
#main .stu-plan-table td:nth-child(2), #main .stu-plan-table td:nth-child(3) { text-align: left; }
.stu-plan-major { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--brand-text, var(--accent)); font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.stu-plan-major { text-decoration: underline; text-underline-offset: 3px; }
.plan-admissions-card .major-line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.plan-admissions-card .major-line .lead { margin: 4px 0 0; }
.plan-admissions-close { flex: none; min-height: 44px; }
.plan-admissions-section { border-top: 1px solid var(--line); margin-top: 16px; }
.plan-admissions-section .kv { grid-template-columns: 6.5rem minmax(0, 1fr); }
.plan-admissions-section dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.plan-admissions-line { display: block; }
.plan-admissions-card .major-detail-actions { grid-template-columns: 1fr; }
.plan-admissions-card:focus { outline: none; }
.stu-page #stu-sec-plan > .row-actions { margin-top: 8px; gap: 8px; }
.stu-list-heading { padding: 12px 16px 8px; }
.stu-list-heading h2 { margin-bottom: 2px; }
.stu-roster-toolbar { gap: 8px; padding: 0 16px 10px; }
.stu-roster-table td { padding-top: 8px; padding-bottom: 8px; }
.stu-roster-notes p { -webkit-line-clamp: 2; }
.student-report-dialog { width: min(1000px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px #0004; }
.student-report-dialog::backdrop { background: #101b18a6; }
.student-report-dialog[open] { display: flex; flex-direction: column; }
.stu-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.stu-report-heading h2 { margin: 0; font-size: 18px; }
.stu-report-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.stu-report-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.stu-report-body > .stu-report { padding: 0; margin: 0; border: 0; background: transparent; }
.stu-report-body > .stu-report > h3 { display: none; }
.stu-report-footer { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); }
.stu-report-footer .btn { min-height: 44px; width: auto; }
body:has(.student-report-dialog[open]) { overflow: hidden; }
@media (min-width: 1001px) {
  .stu-page .btn, .stu-work-nav button, .stu-status-tabs button, .stu-search input { min-height: 34px; }
  .stu-work-nav { margin: 4px 0; padding-bottom: 4px; }
  .stu-work-nav button { padding: 4px 12px; }
  #main .stu-plan-table th, #main .stu-plan-table td { height: 26px; }
  .stu-roster-actions .btn { min-height: 30px; }
}
@media (max-width: 1000px) {
  .stu-work-tools { width: auto; }
  .stu-work-nav { display: flex; margin: 8px 0; }
  .stu-work-nav button { flex: 1; }
  #main .stu-plan-table th, #main .stu-plan-table td { padding: 2px 6px; }
  #main .stu-plan-table th:nth-child(1) { width: 32px; }
  #main .stu-plan-table th:nth-child(2) { width: 32%; }
  #main .stu-plan-table th:nth-child(3) { width: 34%; }
  #main .stu-plan-table th:nth-child(4), #main .stu-plan-table td:nth-child(4), #main .stu-plan-table th:nth-child(6), #main .stu-plan-table td:nth-child(6) { display: none; }
  #main .stu-plan-table th:nth-child(5) { width: auto; }
  .stu-plan-major { min-height: 44px; }
  .stu-page #stu-sec-plan > .row-actions { display: flex; }
  .stu-page #stu-sec-plan > .row-actions .btn { flex: 1 1 auto; padding-inline: 8px; font-size: 13px; }
  .stu-roster-table .stu-roster-grades, .stu-roster-table .stu-roster-notes, .stu-roster-table .stu-roster-actions { margin-top: 8px; }
  .student-report-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .stu-report-heading, .stu-report-body, .stu-report-footer { padding-inline: 12px; }
}

/* Student details and grades keep their own lines within each desktop column. */
@media (min-width: 1280px) {
  .stu-roster-table th:nth-child(1) { width: 174px; }
  .stu-roster-table th:nth-child(2) { width: 356px; }
  .stu-roster-table th:nth-child(3) { width: auto; }
  .stu-roster-table th:nth-child(4) { width: 60px; }
  .stu-roster-table td { padding: 8px; }
  #main .stu-roster-table td.stu-roster-name { padding-left: 16px; }
  .stu-roster-name .stu-name-button { min-height: 28px; font-size: 14px; }
  .stu-roster-name > span { margin-top: 2px; line-height: 1.45; }
  .stu-roster-grades > b { font-size: 13px; }
  .stu-roster-grades .stu-incomplete { margin-inline: 3px; font-size: 11px; }
  .stu-roster-table .stu-grade-preview { gap: 4px; margin-top: 6px; }
  .stu-roster-table .stu-grade-preview > span { font-size: 11px; }
  .stu-roster-table .stu-grade-preview b { margin-left: 1px; padding-inline: 2px; }
  .stu-roster-notes p { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
  .stu-roster-count button { min-height: 32px; padding: 0; font-size: 16px; white-space: nowrap; }
  .stu-roster-count button span { display: inline; margin-left: 3px; }
  .stu-page .stu-roster-actions .btn { min-height: 32px; }
}

/* Interview uses a dark header in both system color schemes. */
body.iv-mode .top .user-out { background:#24382d; color:#f1f8f4; border-color:#638371; }
body.iv-mode .top .user-out:hover { background:#314c3d; color:#fff; }
body.iv-mode .top .user-out:focus-visible { outline:2px solid #a5e4bd; outline-offset:3px; }
body.iv-mode .top .user-out:disabled { background:#26392e; color:#bacbbf; border-color:#52675a; opacity:1; }
body.iv-mode .top .user-org { color:#b7cbbf; }
body.iv-mode .top .user-name { color:#f1f8f4; }

.vocational-page { max-width: 1000px; margin: 20px auto; }
.vocational-page h2 { margin: 0 0 8px; }
.vocational-empty { margin-top: 24px; padding: 32px 20px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; background: var(--bg); }
.vocational-empty h3 { margin: 0 0 8px; font-size: 16px; }
.vocational-empty p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
#main .ai-results-table :is(th, td) { text-align: left; vertical-align: top; }

/* Compact student intake: labels stay visible and all ten grades fit two rows. */
.student-high-school { min-width: 0; margin-bottom: 12px; }
.stu-add-meta .student-high-school { margin-bottom: 0; }
.student-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.student-detail-grid .org-field { min-width: 0; margin: 0; gap: 5px; }
.student-detail-grid input, .student-detail-grid select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; }
.match-student-form .student-detail-grid { gap: 8px; margin: 10px 0; }
.match-student-dialog .match-student-form { scroll-padding-bottom: 80px; }
.match-student-form .row-actions { position: sticky; bottom: -1px; z-index: 1; padding-top: 10px; padding-bottom: 2px; background: var(--paper); }
@media (max-width: 540px) {
  .student-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-student-form .student-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .match-student-form .student-detail-grid .org-field { font-size: 12px; }
}
.student-high-school input { width: 100%; min-width: 0; box-sizing: border-box; }
.match-student-dialog .student-picker-head { padding: 16px 20px 12px; flex-shrink: 0; }
.match-student-dialog .org-field { min-width: 0; gap: 5px; }
.match-student-dialog .student-notes-field { margin: 10px 0; gap: 4px; }
.match-student-dialog .student-notes-field textarea { height: 60px; min-height: 60px; padding: 7px 10px; resize: none; }
.match-student-dialog .student-notes-field > span { font-size: 13px; }
.match-student-dialog .warn { margin: 8px 0; }
@media (max-width: 540px) {
  .match-student-dialog .student-picker-head { padding: 12px 12px 10px; }
  .match-student-dialog .student-picker-head h2 { font-size: 18px; }
  .match-student-dialog .match-student-form { padding: 0 12px 12px; }
  .match-student-form .stu-add-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .match-student-form .student-high-school { grid-column: 1 / -1; grid-row: 2; }
  .match-student-form .stu-grades-grid { gap: 5px; }
  .match-student-form .stu-sub { padding: 4px 2px; font-size: 12px; text-align: center; }
  .match-student-form .stu-sub select { padding: 0 2px; }
}

@media (max-width:540px) and (max-height:740px) {
  .match-student-dialog .student-notes-field { margin:6px 0; }
  .match-student-dialog .student-notes-field textarea { height:48px; min-height:48px; }
  .match-student-dialog .student-notes-field small { font-size:11px; line-height:1.4; }
  .match-student-form .stu-grades-grid { margin-bottom:6px; }
  .match-student-form .row-actions { margin-top:6px; }
}

/* The consultant can see progress and keep choices while the agent fills gaps. */
.ai-workflow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.ai-workflow li { border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; font-size: 12px; color: var(--muted); }
.ai-workflow li.done { border-color: #7eae98; color: var(--brand-text, #18674d); background: var(--accent-soft); }
.ai-next-controls { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.ai-next-controls .btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.ai-select-major { min-width: 54px; min-height: 34px; padding: 5px; font-size: 12px; }
.ai-select-major[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--brand-color, #18674d); }
.ai-results-table th:nth-child(8) { width: 8%; }

.ai-english-status { display: block; margin-bottom: 4px; font-size: 12px; }
.ai-report-facts { margin: 14px 0; }
.ai-report-facts summary { cursor: pointer; font-weight: 600; }
.ai-report-facts section { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.ai-test-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-test-content { margin-top: 4px; }
.ai-test-content summary { cursor: pointer; font-size: 12px; text-decoration: underline; }
.ai-test-content p { margin: 6px 0 0; }
@media (max-width: 780px) {
  .ai-results-table td[data-label="测试内容"] > * { grid-column: 2; min-width: 0; }
}

.lead-prompt-settings{margin-bottom:20px}.lead-prompt-settings h3{margin-bottom:8px}.lead-prompt-settings form{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-top:14px}.lead-prompt-settings label{min-width:140px}.lead-prompt-settings select{min-height:42px;border:1px solid var(--line);border-radius:8px;background:var(--paper);padding:8px;color:var(--ink)}.lead-prompt-settings [role=status]{flex-basis:100%}
.org-wechat-preview { width:150px; max-width:100%; height:auto; border:1px solid var(--line); border-radius:8px; }
.org-interviewer-settings { display: grid; gap: 16px; min-width: 0; margin-top: 16px; }
.org-interviewer-preview { width: 136px; height: 136px; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; background: var(--paper); }
.org-interviewer-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.org-interviewer-settings .iv-photo-credit { color: var(--muted); font-size: 12px; }
.org-interviewer-controls { min-width: 0; }
.org-interviewer-controls p { margin: 0 0 12px; font-size: 14px; }
.org-interviewer-controls .row-actions { flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.org-interviewer-controls .btn { min-height: 44px; white-space: normal; }
.org-interviewer-controls small { display: block; font-size: 12px; line-height: 1.7; color: var(--muted); }

@media print {
  @page student-report { size:A4; margin:15mm; }
  body.printing-student-report { page:student-report; }
  html:has(body.printing-student-report), body.printing-student-report { display:block!important; height:auto!important; min-height:0!important; overflow:visible!important; background:#fff!important; color:#111!important; }
  body.printing-student-report > :not(#student-report-dialog) { display:none!important; }
  body.printing-student-report #student-report-dialog[open] { display:block!important; position:static!important; inset:auto!important; width:100%!important; max-width:none!important; max-height:none!important; height:auto!important; overflow:visible!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; box-shadow:none!important; background:white!important; color:#111!important; }
  body.printing-student-report #student-report-dialog::backdrop { display:none; background:transparent; }
  body.printing-student-report .stu-report-heading { padding:0 0 12px; }
  body.printing-student-report :is(.stu-report-footer,.student-picker-close) { display:none!important; }
  body.printing-student-report .stu-report-body { max-height:none; height:auto; overflow:visible; padding:12px 0 0; }
  body.printing-student-report .stu-report { color:#111; font-size:11pt; line-height:1.65; }
  body.printing-student-report .stu-report :is(h4,h3) { break-after:avoid; }
  body.printing-student-report .stu-plan-list > li { break-inside:avoid; }
}

.student-transfer-field { display: grid; gap: 8px; margin: 16px 0 12px; font-size: 14px; font-weight: 600; }
.student-transfer-field input { width: 100%; min-width: 0; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 16px; }
#student-transfer-recipient { padding: 12px; background: #edf7f0; color: #20573c; border-radius: 10px; overflow-wrap: anywhere; }

.counselor-panel { margin-top: 20px; }
.counselor-quota { padding: 16px 20px; border-radius: 14px; background: #edf7f0; color: #20573c; font-size: 18px; font-weight: 700; }
.counselor-list { display: grid; gap: 12px; margin: 20px 0; }
.counselor-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.counselor-card h4 { margin: 0 0 8px; overflow-wrap: anywhere; }
.counselor-card p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.counselor-card .btn { flex-shrink: 0; }
.counselor-create { margin-top: 24px; }
.counselor-create summary { font-size: 18px; font-weight: 700; cursor: pointer; margin-bottom: 20px; }
.counselor-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; border: 0; min-width: 0; margin: 0; }
.counselor-fields input { min-width: 0; width: 100%; box-sizing: border-box; }
@media (max-width: 640px) { .counselor-fields { grid-template-columns: 1fr; } .counselor-card { align-items: flex-start; flex-wrap: wrap; } .org-subnav { flex-wrap: wrap; } }

.technical-support-trigger { display: none; position: fixed; z-index: 35; right: max(20px, env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); width: 72px; min-height: 76px; padding: 12px 6px; border: 1px solid #d6e9df; border-radius: 20px; background: #fff; color: #18674d; box-shadow: 0 6px 24px rgb(24 66 45 / 14%); cursor: pointer; }
body.auth-on .technical-support-trigger { display: grid; justify-items: center; gap: 7px; }
.technical-support-trigger svg { width: 28px; height: 28px; }
.technical-support-trigger span { font-size: 12px; font-weight: 650; line-height: 1.4; }
.technical-support-trigger:hover { background: #edf7f0; }
.technical-support-trigger:active { background: #dcefe3; }
.technical-support-trigger:focus-visible, .technical-support-close:focus-visible, .technical-support-phone:focus-visible { outline: 3px solid #18674d; outline-offset: 4px; }
.technical-support-dialog { width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; margin: auto; padding: 28px 24px 24px; overflow: auto; border: 1px solid #d6e9df; border-radius: 24px; background: #fff; color: #19342b; text-align: center; box-shadow: 0 24px 80px rgb(13 42 30 / 20%); }
.technical-support-dialog::backdrop { background: rgb(14 35 26 / 46%); }
body:has(#technical-support-dialog[open]) #auth { overflow: hidden; }
.technical-support-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #52685d; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; }
.technical-support-close:hover { background: #edf7f0; }
.technical-support-eyebrow { margin: 8px 0; color: #18674d; font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.technical-support-dialog h2 { margin: 0 0 8px; font-size: 26px; }
#technical-support-description { margin: 0 0 20px; font-size: 13px; line-height: 1.7; color: #52685d; }
.technical-support-phone { display: grid; gap: 5px; padding: 14px 10px; border-radius: 14px; background: #edf7f0; color: #18674d; text-decoration: none; }
.technical-support-phone span, .technical-support-phone small { font-size: 12px; }
.technical-support-phone strong { font-size: 25px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.technical-support-wechat { margin-top: 20px; }
.technical-support-wechat img { display: block; width: 208px; max-width: 100%; height: auto; margin: auto; }
.technical-support-wechat p { margin: 12px 0 5px; font-size: 15px; font-weight: 650; }
.technical-support-wechat small { display: block; font-size: 12px; color: #52685d; line-height: 1.7; }
@media (max-width: 640px) {
  .technical-support-trigger { right: max(12px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); width: 64px; min-height: 70px; border-radius: 18px; }
  body.auth-on .auth-access { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
}
@media print { .technical-support-trigger, .technical-support-dialog { display: none!important; } }

.auth-recovery-heading h3 { margin: 0 0 8px; font-size: 22px; }
.auth-recovery-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-recovery-contact { margin-top: 10px; padding: 10px 0; min-height: 44px; border: 0; background: none; color: var(--brand-text, #18674d); text-align: left; font-size: 13px; font-weight: 650; cursor: pointer; }
.admin-recovery-panel { margin-top: 20px; }
.admin-recovery-panel h3 { margin-top: 0; }
.admin-recovery-panel form { margin-top: 16px; }
.recovery-identity-check { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.7; }
.recovery-identity-check input { flex: none; width: 20px; height: 20px; margin: 0; }
.admin-recovery-result { margin-top: 16px; padding: 16px; border-radius: 12px; background: #edf7f0; color: #20573c; overflow-wrap: anywhere; }
.admin-recovery-result p { margin: 0 0 10px; font-weight: 600; }
.admin-recovery-result label { display: grid; gap: 6px; font-size: 13px; }
.admin-recovery-result input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: 8px; border: 1px solid #c4ddce; border-radius: 8px; font-size: 26px; font-weight: 650; text-align: center; letter-spacing: .1em; background: #fff; color: #20573c; }
.admin-recovery-result small { display: block; margin-top: 10px; font-size: 12px; line-height: 1.7; }

.auth-recovery-status { margin: 0; padding: 14px; background: #edf7f0; color: #20573c; border-radius: 10px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.registration-pending-heading { padding: 16px; border: 1px solid #cfe4d7; border-radius: 12px; background: #edf7f0; }
.registration-support {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.registration-support-details { display: grid; justify-items: start; color: var(--ink); font-size: 14px; }
.registration-support-phone { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-text, #18674d); font-weight: 700; font-variant-numeric: tabular-nums; }
.registration-support-details small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.registration-support-qr { width: 116px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.registration-support-qr img { display: block; width: 100%; height: auto; }
.registration-support a:focus-visible { outline: 2px solid var(--brand-text, #18674d); outline-offset: 3px; }
.admin-recovery-result .recovery-identity-check { display: flex; margin: 16px 0; }
.admin-recovery-result .row-actions { flex-wrap: wrap; gap: 8px; }

/* Source: vocational.css */
/* Scoped workspace styles keep the full admissions table on every screen. */
body.vocational-mode #main { width:100%; max-width:1800px; padding:16px; min-width:0; }
#main .vocational-page { margin:0 auto; max-width:none; padding:18px; min-width:0; background:#fff; color:#23344b; border-radius:12px; }
.voc-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.voc-head > div { min-width:0; }
#main .voc-head h2 { font-size:20px; font-weight:700; line-height:1.4; margin:0 0 4px; color:#23344b; }
.voc-head p, .voc-owner-note, .voc-footnote { font-size:12px; color:#59677a; margin:0; line-height:1.6; }
.voc-year { flex-shrink:0; font-size:12px; color:#526477; background:#f1f5f9; padding:4px 8px; border:1px solid #dbe3ec; border-radius:5px; white-space:nowrap; }
.voc-owner { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:10px 12px; margin-bottom:14px; background:#f6f8fb; border:1px solid #e1e7ef; border-radius:8px; }
.voc-owner label { display:flex; align-items:center; gap:10px; min-width:0; font-size:12px; }
.voc-owner label > span { white-space:nowrap; color:#59677a; }
.voc-owner select { width:220px; }
.voc-member-error:empty { display:none; }
.vocational-page select, .vocational-page input { min-height:36px; min-width:0; max-width:100%; border:1px solid #c5cfdb; border-radius:6px; padding:6px 9px; background:#fff; color:#23344b; font:inherit; font-size:13px; }
.vocational-page button { cursor:pointer; font:inherit; font-size:13px; border:1px solid #c5cfdb; border-radius:6px; padding:7px 11px; background:#fff; color:#344861; }
.vocational-page button:hover { background:#eef4fb; }
.vocational-page :is(button,a,select,input):focus-visible { outline:2px solid #1769a7; outline-offset:2px; }
.vocational-page button:disabled { cursor:default; opacity:.5; }
.voc-workspace { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:end; }
.voc-switch { grid-column:1/-1; display:flex; gap:0; width:fit-content; padding:3px; background:#edf2f7; border-radius:8px; }
.voc-switch button { border:1px solid transparent; background:transparent; padding:7px 18px; }
.voc-switch button[aria-pressed=true] { background:#fff; border-color:#cbd8e5; color:#155d93; font-weight:650; box-shadow:0 1px 3px #23344b0d; }
.voc-switch b { display:inline-block; margin-left:4px; padding:0 5px; border-radius:4px; font-size:11px; background:#e2eaf3; color:#344861; }
.voc-filters { grid-column:1/-1; display:flex; align-items:end; flex-wrap:wrap; gap:8px; }
.voc-filters label { display:flex; flex-direction:column; flex:1; min-width:110px; gap:4px; color:#59677a; font-size:12px; }
.voc-filters label.voc-search { flex:2; min-width:220px; }
.voc-filters select { width:100%; }
.voc-filter-tools { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.voc-filter-actions { display:flex; gap:8px; }
.voc-filter-more { display:none; }
.voc-toolbar { grid-column:2; display:flex; align-items:center; gap:8px; font-size:12px; }
.voc-toolbar label { display:flex; min-width:0; }
.voc-toolbar select { font-size:12px; }
.voc-status { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 16px; font-size:12px; padding:10px 0; color:#526477; }
.voc-status strong { font-weight:600; color:#223851; }
#main .voc-table th, #main .voc-table td { text-align:left; vertical-align:top; }
#main .voc-table .voc-plan { text-align:center; }
.voc-content, .voc-test, .voc-time { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
.voc-table-wrap{overflow:auto;max-height:calc(100dvh - 365px);min-height:220px;border:1px solid #b3c0d0;border-radius:5px}.voc-table{border-collapse:separate;border-spacing:0;width:100%;min-width:1000px;font-size:13px;text-align:left;table-layout:fixed}.voc-table th{position:sticky;top:0;background:#f3f6fa;color:#384c65;font-size:12px;z-index:1;padding:10px 9px;box-shadow:0 1px #b3c0d0;text-align:left}.voc-table td{padding:9px;vertical-align:top;border-bottom:1px solid #dbe2ea;border-right:1px solid #e0e6ee;line-height:1.55;background:white}.voc-table th:nth-child(1){width:16%}.voc-table th:nth-child(2){width:16%}.voc-table th:nth-child(3){width:6%}.voc-table th:nth-child(4){width:10%}.voc-table th:nth-child(5){width:20%}.voc-table th:nth-child(6){width:25%}.voc-table th:nth-child(7){width:7%}.voc-table tr.voc-school-start td{border-top:1.5px solid #8e9fb3}.vocational-page button.voc-link{border:0;background:transparent;padding:0;font-weight:600;text-align:left;color:#155d93;line-height:1.55}.voc-table small{display:block;font-size:11px;color:#5b6b7d;margin-top:4px}.voc-table .voc-category{color:#3b526e}.voc-table .voc-plan{color:#b32f32;font-weight:700;text-align:center}.vocational-page button.voc-content{padding:0;text-align:left;border:0;line-height:1.55;background:transparent;color:#3e4b5c;font-size:12px}.voc-table .voc-time{font-size:12px}.voc-table .voc-conflict{color:#9d5708}.voc-table .voc-english{color:#a1450f}.voc-add{white-space:nowrap}.voc-add.is-selected{color:#155e98;border-color:#4b87b0;background:#eff7fc}.voc-alert{font-size:12px;line-height:1.7;background:#fff6df;border:1px solid #e7cb92;padding:8px 12px;margin-bottom:8px;border-radius:5px;color:#795318}.voc-empty,.voc-loading{padding:55px 20px;text-align:center;color:#5b6b7d}.voc-footnote{line-height:1.7;margin-top:12px}.voc-dialog{padding:0;border:1px solid #c2ccd8;border-radius:10px;width:min(880px,94vw);max-width:94vw;max-height:88vh;color:#26384e;box-shadow:0 20px 75px #122b4c40;overflow:hidden}.voc-dialog[open]{display:flex;flex-direction:column}.voc-dialog::backdrop{background:#14283d99}.voc-dialog header{padding:16px 20px;display:flex;gap:14px;align-items:start;justify-content:space-between;border-bottom:1px solid #d5deea}.voc-dialog h2{font-size:19px;margin:0 0 6px}.voc-dialog header p{font-size:12px;margin:0;color:#54657b}.voc-dialog nav{display:flex;gap:8px;padding:10px 20px;border-bottom:1px solid #d5deea}.voc-dialog-body{padding:4px 20px 20px;overflow:auto;min-height:0;overscroll-behavior:contain}.voc-dialog-body h3{font-size:14px;margin:18px 0 8px}.voc-fulltext{white-space:pre-wrap;font-size:13px;line-height:1.85;overflow-wrap:anywhere}.voc-detail-meta{display:flex;gap:20px;flex-wrap:wrap;margin-top:12px;font-size:13px}.voc-detail-meta div{flex:1;min-width:130px}.voc-detail-meta b{display:block;font-size:12px;color:#637389;margin-bottom:5px}.voc-dialog footer{padding:12px 20px;display:flex;gap:14px;align-items:center;justify-content:space-between;border-top:1px solid #d5deea;background:#f9fbfd;font-size:12px}.voc-sources{display:flex;gap:10px;flex-wrap:wrap;font-size:13px}.voc-sources a{color:#155e98;padding:8px;border:1px solid #c9d6e5;border-radius:4px}.voc-source-disabled{color:#8e621d;width:100%}.voc-member-error{color:#a1450f!important}.vocational-page .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

@media (max-width:700px) {
  body.vocational-mode .top { padding:8px 12px 6px; }
  body.vocational-mode .top-row { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  body.vocational-mode .top-row .brand { min-width:0; flex-shrink:1; }
  body.vocational-mode .brand > div:last-child { min-width:0; }
  body.vocational-mode .top h1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
  body.vocational-mode .user-name { display:none; }
  body.vocational-mode .user-slot { min-width:0; gap:4px; }
  body.vocational-mode .user-out { min-height:36px; padding:0 6px; }
  body.vocational-mode .tabbar { margin:0 -4px; padding:0; }
  body.vocational-mode .tabbar button { min-height:44px; }
  body.vocational-mode #main { padding:8px; }
  #main .vocational-page { padding:12px; border-radius:10px; }
  #main .voc-head h2 { font-size:18px; }
  .voc-head { align-items:start; gap:8px; margin-bottom:10px; }
  .voc-head p { font-size:12px; }
  .voc-year { font-size:11px; padding:4px 6px; }
  .voc-owner { padding:6px 8px; gap:6px; margin-bottom:10px; }
  .voc-owner label { width:100%; gap:8px; }
  .voc-owner select { flex:1; width:0; }
  .voc-owner-note { display:none; }
  .voc-workspace { grid-template-columns:minmax(0,1fr) auto; gap:10px 8px; }
  .voc-switch { width:100%; }
  .voc-switch button { flex:1; padding:6px 8px; }
  .vocational-page :is(button,select,input) { min-height:44px; }
  .vocational-page :is(input,select) { font-size:16px; }
  .voc-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
  .voc-filters label { min-width:0; }
  .voc-filters label.voc-search { grid-column:1/-1; min-width:0; }
  .voc-filters:not(.is-expanded) .voc-secondary { display:none; }
  .voc-filter-tools { grid-column:1/-1; display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; }
  .voc-filter-actions button { padding:6px 8px; font-size:12px; }
  .voc-filter-more { display:block; }
  .voc-toolbar { justify-content:space-between; padding-top:0; gap:6px; }
  .voc-toolbar label { flex:1; }
  .voc-toolbar select { width:100%; font-size:12px; padding-left:6px; padding-right:4px; }
  .voc-toolbar > button { font-size:12px; }
  .voc-status { font-size:12px; gap:2px; padding:8px 0; }
  .voc-status > span { font-size:11px; }
  .voc-table-wrap { max-height:65dvh; border-radius:6px; }
  .voc-table .voc-content { font-size:12px; }
  .voc-dialog header, .voc-dialog nav, .voc-dialog footer { padding:12px; }
  .voc-dialog-body { padding:0 12px 15px; }
  .voc-dialog footer span { max-width:42%; }
  .voc-dialog { max-height:90dvh; }
}

/* Source: live-studio.css */
/* Live-only styles: portrait audience canvas and separate presenter controls. */
body.live-mode { background: #e8edf3; color: #243244; }
body.live-mode .top { background: #fff; color: #243244; border-color: #dce3ec; }
body.live-mode .top :is(.sub, .user-out) { color: #52647a; background: transparent; }
body.live-popup .top, body.live-popup #main { width: 100%; max-width: none; margin: 0; }
body.live-popup .top { display: none; }
body.live-mode #main { height: auto; min-height: 100dvh; padding: 0; width: 100%; max-width: none; }
.live-app.live-studio { display: block; padding: 0; min-height: 100dvh; color: #243244; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
.live-studio *, .live-studio *::before, .live-studio *::after { box-sizing: border-box; }
.live-studio button, .live-studio input, .live-studio textarea, .live-studio select { font: inherit; }
.live-studio button { min-height: 44px; padding: 9px 13px; border: 1px solid #d3dce9; border-radius: 8px; background: #fff; color: #354a65; font-size: 12px; font-weight: 550; cursor: pointer; }
.live-studio button:hover { background: #edf3fb; border-color: #9bb4d8; }
.live-studio button:disabled { opacity: .5; cursor: default; }
.live-studio :is(button,input,textarea,select,summary):focus-visible { outline: 2px solid #3477cd; outline-offset: 3px; }
.studio-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 24px; border-bottom: 1px solid #dce3ec; background: #fff; }
.studio-toolbar > div, .studio-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.studio-toolbar-mark { padding: 5px 7px; background: #285f9e; color: #fff; font-size: 10px; font-weight: 750; letter-spacing: .1em; border-radius: 4px; }
.studio-toolbar b { font-size: 16px; }
.studio-session-state { padding-left: 12px; border-left: 1px solid #dce3ec; font-size: 12px; color: #748096; }
.studio-toolbar-actions button:first-child { border-color: #315f9c; color: #315f9c; }
.studio-workspace { display: grid; grid-template-columns: minmax(420px,1fr) minmax(340px,410px); gap: 32px; align-items: start; max-width: 1440px; padding: 28px 28px 40px; margin: 0 auto; }
.studio-stage-wrap { width: 100%; max-width: 620px; justify-self: center; min-width: 0; }
.studio-stage-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #667a93; font-size: 11px; margin-bottom: 12px; letter-spacing: .04em; }
.studio-stage { --stage-bg: #f5eddd; --stage-paper: #fffdf8; --stage-ink: #363b42; --stage-muted: #7c786c; --stage-accent: #9c7737; --stage-soft: #ece1cb; --stage-border: #e1d3b8; min-height: 960px; width: 100%; height: auto; background: var(--stage-bg); color: var(--stage-ink); border: 1px solid var(--stage-border); padding: 26px 24px; border-radius: 3px; box-shadow: 0 8px 30px rgb(56 69 86 / 7%); }
.studio-stage[data-theme="blue"] { --stage-bg:#e9f1fa; --stage-paper:#fcfdff; --stage-ink:#223a54; --stage-muted:#607992; --stage-accent:#2d659f; --stage-soft:#dce9f6; --stage-border:#c7d9ec; }
.studio-stage[data-theme="green"] { --stage-bg:#e8f2ed; --stage-paper:#fbfefc; --stage-ink:#254235; --stage-muted:#627e6f; --stage-accent:#28765b; --stage-soft:#d5e8de; --stage-border:#bdd8ca; }
.studio-stage[data-theme="coral"] { --stage-bg:#faede7; --stage-paper:#fffaf8; --stage-ink:#513b34; --stage-muted:#8e756b; --stage-accent:#b35c3e; --stage-soft:#f2dcd1; --stage-border:#e6c6b7; }
.studio-stage[data-theme="night"] { --stage-bg:#17263d; --stage-paper:#20344f; --stage-ink:#ecf3fd; --stage-muted:#b2c3d9; --stage-accent:#b2ccf3; --stage-soft:#2b4260; --stage-border:#3b5576; }
.studio-stage-content { min-width: 0; }
.studio-brand { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--stage-border); padding-bottom: 16px; }
.studio-brand > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.studio-brand img { width: 28px; height: 28px; object-fit: contain; }
.studio-brand > div > span:last-child { font-size: 11px; font-weight: 650; letter-spacing: .08em; overflow-wrap: anywhere; }
.studio-brand-mark { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border: 1px solid var(--stage-accent); font-weight: 750; font-size: 15px; color: var(--stage-accent); border-radius: 50%; }
.studio-brand > b { border: 1px solid var(--stage-border); color: var(--stage-accent); font-size: 12px; padding: 4px 7px; border-radius: 3px; }
.studio-stage-title { margin: 20px 0; }
.studio-stage-title > p { font-size: 11px; line-height: 1.8; color: var(--stage-muted); margin: 0; overflow-wrap: anywhere; }
.studio-stage-title > p:first-child { letter-spacing: .2em; color: var(--stage-accent); }
.studio-stage-title > h1 { font-size: clamp(26px,3vw,36px); letter-spacing: .02em; line-height: 1.4; margin: 3px 0 7px; color: var(--stage-ink); }
.studio-student { padding: 16px; background: var(--stage-paper); border: 1px solid var(--stage-border); border-top: 2px solid var(--stage-accent); border-radius: 8px; margin: 0 0 16px; }
.studio-student > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.studio-student h2 { margin: 0; font-size: 18px; line-height: 1.5; color: var(--stage-ink); overflow-wrap: anywhere; }
.studio-student > div:first-child > span { font-size: 10px; color: var(--stage-muted); }
.studio-student > div:first-child > b { margin-left: auto; color: var(--stage-accent); font-size: 13px; }
.studio-grade-strip { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: 3px; margin: 14px 0 10px; }
.studio-grade-strip > span { display: grid; justify-items: center; gap: 6px; font-size: 10px; color: var(--stage-muted); }
.studio-grade-strip strong { font-size: 14px; font-weight: 650; color: var(--stage-ink); }
.studio-student > p { font-size: 10px; margin: 0; line-height: 1.7; color: var(--stage-muted); }
.live-studio .live-board.studio-results { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
.live-studio .studio-result { padding: 14px 16px; background: var(--stage-paper); border: 1px solid var(--stage-border); border-radius: 8px; min-width: 0; content-visibility: visible; contain-intrinsic-size: none; }
.studio-result-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.studio-rank { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--stage-muted); }
.studio-band { font-size: 10px; font-weight: 650; border-radius: 3px; padding: 3px 7px; color: var(--stage-ink); background: var(--stage-soft); }
.studio-band[data-studio-band="safe"] { color:#286344; background:#dcefe3; }
.studio-band[data-studio-band="steady"] { color:#285a8c; background:#deecf8; }
.studio-band[data-studio-band="rush"], .studio-band[data-studio-band="fight"] { color:#865b19; background:#f6e8c9; }
.studio-location { font-size: 10px; margin-left: auto; color: var(--stage-muted); overflow-wrap: anywhere; }
.live-studio .studio-result h3 { color: var(--stage-ink); font-size: 16px; margin: 0; line-height: 1.5; }
.live-studio .studio-link { border: 0; border-radius: 0; min-height: 0; padding: 0; color: inherit; background: none; font: inherit; text-align: left; line-height: inherit; text-decoration: none; }
.live-studio .studio-link:hover { color: var(--stage-accent); background: none; text-decoration: underline; text-underline-offset: 3px; }
.studio-major { font-size: 12px; line-height: 1.7; color: var(--stage-muted); margin: 3px 0 10px; }
.studio-result-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding-top: 9px; border-top: 1px solid var(--stage-border); }
.studio-result-metrics > div { min-width: 0; }
.studio-result-metrics span { font-size: 9px; display: block; margin-bottom: 3px; color: var(--stage-muted); }
.studio-result-metrics b { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--stage-ink); line-height: 1.4; overflow-wrap: anywhere; }
.studio-result-metrics .studio-highlight b { color: var(--stage-accent); }
.studio-result-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--stage-muted); margin: 8px 0 0; line-height: 1.6; }
.studio-card-details { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--stage-border); }
.studio-card-details > summary { min-height: 24px; font-size: 10px; cursor: pointer; color: var(--stage-accent); }
.studio-card-details dl { margin: 8px 0; }
.studio-card-details dl > div { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--stage-border); font-size: 10px; line-height: 1.8; }
.studio-card-details dt { color: var(--stage-muted); }
.studio-card-details dd { margin: 0; color: var(--stage-ink); white-space: pre-line; overflow-wrap: anywhere; }
.studio-detail-actions { display: flex; gap: 8px; }
.studio-detail-actions button { background: var(--stage-paper); color: var(--stage-ink); border-color: var(--stage-border); }
.studio-stage-footer { display: grid; gap: 6px; padding: 16px 0 0; color: var(--stage-accent); line-height: 1.7; }
.studio-stage-footer b { font-size: 12px; }
.studio-stage-footer > span { font-size: 11px; color: var(--stage-ink); overflow-wrap: anywhere; }
.studio-stage-footer > small { font-size: 9px; color: var(--stage-muted); }
.studio-stage-empty { padding: 52px 12px; border: 1px dashed var(--stage-border); text-align: center; border-radius: 8px; }
.studio-stage-empty > span { font-size: 11px; color: var(--stage-accent); }
.studio-stage-empty h3 { font-size: 19px; line-height: 1.7; margin: 12px 0; color: var(--stage-ink); }
.studio-stage-empty p { font-size: 12px; line-height: 1.8; color: var(--stage-muted); }
.studio-share-hint { font-size: 11px; color: #687b92; text-align: center; margin: 14px 0 0; line-height: 1.8; }
.studio-camera-space { display: grid; place-items: center; border: 1px dashed var(--stage-border); background: var(--stage-soft); color: var(--stage-muted); font-size: 11px; border-radius: 6px; }
.studio-camera-top { min-height: 230px; margin-bottom: 20px; }
.studio-camera-side { min-height: 320px; height: 100%; }
.studio-stage[data-camera="right"], .studio-stage[data-camera="left"] { display: grid; grid-template-columns: minmax(0,3fr) minmax(80px,1fr); gap: 18px; }
.studio-stage[data-camera="left"] { grid-template-columns: minmax(80px,1fr) minmax(0,3fr); }
.studio-stage[data-camera="left"] .studio-camera-side { grid-column: 1; grid-row: 1; }
.studio-stage[data-camera="left"] .studio-stage-content { grid-column: 2; }
.studio-stage[data-camera="left"] .studio-camera-top, .studio-stage[data-camera="right"] .studio-camera-top { display: none; }
.studio-stage[data-layout="compact"] .studio-result { padding: 10px 12px; }
.studio-stage[data-layout="compact"] .studio-result h3 { font-size: 14px; }
.studio-stage[data-layout="compact"] .studio-major { margin-bottom: 6px; font-size: 11px; }
.studio-stage[data-layout="compact"] .studio-result-top { margin-bottom: 4px; }
.studio-stage[data-layout="compact"] .studio-result-metrics b { font-size: 15px; }
.studio-controls { min-width: 0; display: grid; gap: 16px; }
.studio-panel { background: #fff; border: 1px solid #d9e1ec; border-radius: 12px; padding: 20px; min-width: 0; }
.studio-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.studio-panel h2 { font-size: 17px; font-weight: 700; color: #25394f; line-height: 1.4; margin: 4px 0 0; }
.studio-panel-kicker { font-size: 10px; letter-spacing: .08em; color: #7489a2; }
.studio-count { white-space: nowrap; font-size: 11px; color: #2d609f; background: #e8f0fb; padding: 5px 9px; border-radius: 5px; }
.studio-panel label { display: grid; gap: 7px; color: #596e88; font-size: 12px; min-width: 0; }
.studio-panel :is(input,textarea,select) { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #d4deeb; background: #f8fafc; color: #2c4059; padding: 10px; border-radius: 7px; font-size: 13px; line-height: 1.6; }
.studio-panel :is(input,textarea)::placeholder { color: #68788f; }
.studio-panel textarea { display: block; resize: vertical; max-width: 100%; }
.studio-panel #live-paste { margin: 8px 0; }
.studio-helper { color: #63738a; font-size: 11px; line-height: 1.8; margin: 8px 0; }
.studio-button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.live-studio button.studio-primary { background: #315f9c; color: #fff; border-color: #315f9c; }
.live-studio button.studio-primary:hover { background: #264f86; }
.studio-errors, .studio-notice { font-size: 12px; line-height: 1.8; padding: 10px; border-radius: 6px; margin: 12px 0 0; }
.studio-errors { background: #fff0eb; color: #ac4233; }
.studio-errors p { margin: 0; }
.studio-notice { background: #edf4fc; color: #3a6395; }
.studio-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
.studio-queue-heading > b { font-size: 12px; color: #536a86; }
.studio-queue-heading > b span { color: #8998ac; margin-left: 8px; }
.studio-queue-heading > button { font-size: 11px; border: 0; padding: 0 4px; }
.studio-queue-list { list-style: none; padding: 0; margin: 8px 0; }
.studio-queue-list > li { display: grid; grid-template-columns: 20px minmax(0,1fr) auto auto; align-items: center; gap: 8px; border-top: 1px solid #e8edf4; padding: 10px 0; }
.studio-queue-list > li > span { font-size: 11px; color: #8e9cb1; font-variant-numeric: tabular-nums; }
.studio-queue-list b { font-size: 12px; font-weight: 650; color: #3d5571; overflow-wrap: anywhere; }
.studio-queue-list small { display: block; font-size: 10px; color: #65758b; margin-top: 4px; }
.studio-queue-list .is-current b { color: #245c9d; }
.studio-queue-list button { font-size: 11px; min-width: 44px; padding: 6px 9px; }
.studio-queue-list button.studio-remove { font-size: 18px; border: 0; background: transparent; color: #65758b; }
.studio-empty-queue { font-size: 12px; line-height: 1.8; color: #65758b; padding: 14px 0; }
.studio-next { display: flex; justify-content: space-between; gap: 8px; align-items: center; width: 100%; margin-top: 12px; }
.studio-next span { font-size: 10px; font-weight: 400; }
.studio-manual > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; color: #2c4059; font-size: 14px; font-weight: 650; }
.studio-manual > summary b { font-size: 11px; color: #65758b; }
.studio-guest-label { margin: 12px 0; }
.live-studio .studio-manual .live-grade-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px 8px; }
.live-studio .live-grade-field { font-size: 11px; color: #5c718a; gap: 5px; }
.live-studio .live-grade-field select { color: #2c4059; background: #f8fafc; border: 1px solid #d4deeb; border-radius: 6px; min-height: 44px; font-size: 14px; padding: 8px 3px; color-scheme: light; }
.studio-themes { display: flex; gap: 6px; flex-wrap: wrap; border: 0; margin: 0 0 16px; padding: 0; }
.studio-themes legend { font-size: 12px; color: #596e88; margin-bottom: 8px; }
.studio-themes button { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; min-height: 44px; padding: 7px 9px; }
.studio-themes button[aria-pressed="true"] { background: #edf4fe; color: #2a609e; border-color: #7098c9; }
.studio-themes button > span { width: 8px; height: 8px; border-radius: 50%; background: #af8a4b; }
.studio-themes [data-theme="blue"] > span { background: #4a89ca; }
.studio-themes [data-theme="green"] > span { background: #36a484; }
.studio-themes [data-theme="coral"] > span { background: #d87a55; }
.studio-themes [data-theme="night"] > span { background: #263c60; }
.studio-setting-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 12px; }
.studio-script-kind { color: #7c8ca1; font-size: 11px; margin: 0 0 10px; }
.studio-script { font-size: 13px; line-height: 2; color: #3a4f69; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-ai { width: 100%; margin-top: 16px; }
.studio-plan .basket-batch button { width: 100%; min-height: 44px; background: #315f9c; color: #fff; border-color: #315f9c; }
.studio-plan :is(.batch-basket-status,.batch-basket-error) { color: #3d5e86; font-size: 12px; }
.studio-mobile-tabs { display: none; }
.live-studio > .live-ai-panel { margin: 0 auto 32px; max-width: 1384px; }
.studio-presentation .top { display: none; }
.live-studio.is-presentation .studio-workspace { display: block; }
.live-studio.is-presentation :is(.studio-controls,.studio-mobile-tabs,.live-ai-panel,.studio-share-hint,.studio-stage-label) { display: none; }
.live-studio.is-presentation .studio-stage-wrap { display: block; max-width: 620px; margin: auto; }
@media (max-width: 960px) {
  .studio-workspace { grid-template-columns: minmax(0,1fr) minmax(300px,360px); gap: 18px; padding: 20px 18px; }
  .studio-stage { padding: 20px 16px; }
}
@media (max-width: 760px) {
  .studio-toolbar { padding: 12px; gap: 12px; flex-wrap: wrap; }
  .studio-toolbar > div { gap: 8px; }
  .studio-toolbar b { font-size: 14px; }
  .studio-session-state { display: none; }
  .studio-toolbar-actions { margin-left: auto; }
  .studio-toolbar-actions button { font-size: 11px; padding: 7px 10px; }
  .studio-mobile-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 12px; background: #f6f8fb; border-bottom: 1px solid #dce3ec; }
  .studio-mobile-tabs button { background: transparent; border-color: transparent; color: #7b8da5; }
  .studio-mobile-tabs button[aria-pressed="true"] { background: #fff; border-color: #cbd9eb; color: #315f9c; }
  .studio-workspace { display: block; padding: 16px 12px 24px; }
  .live-studio[data-mobile-tab="control"] .studio-stage-wrap, .live-studio[data-mobile-tab="preview"] .studio-controls { display: none; }
  .live-studio.is-presentation .studio-stage-wrap { display: block; }
  .studio-panel { padding: 18px 16px; }
  .studio-panel :is(input,select,textarea) { font-size: 16px; }
  .studio-stage { padding: 20px 14px; min-height: 740px; }
  .studio-result-metrics b { font-size: 16px; }
  .studio-result-metrics span, .studio-student > p, .studio-result-foot,
  .studio-card-details > summary, .studio-grade-strip > span { font-size: 11px; }
  .studio-major, .studio-location, .studio-helper { font-size: 12px; }
  .studio-stage[data-camera="right"], .studio-stage[data-camera="left"] { grid-template-columns: minmax(0,3fr) minmax(54px,1fr); gap: 8px; padding: 16px 10px; }
  .studio-stage[data-camera="left"] { grid-template-columns: minmax(54px,1fr) minmax(0,3fr); }
  .studio-stage[data-camera="right"] .studio-result, .studio-stage[data-camera="left"] .studio-result { padding: 10px 8px; }
  .studio-stage[data-camera="right"] .studio-result-metrics b, .studio-stage[data-camera="left"] .studio-result-metrics b { font-size: 13px; }
  .studio-stage[data-camera="right"] .studio-location, .studio-stage[data-camera="left"] .studio-location { display: none; }
  .studio-camera-side > span { writing-mode: vertical-rl; letter-spacing: .2em; }
  .studio-camera-top { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .live-studio * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  body.live-mode .top, .studio-toolbar, .studio-controls, .studio-mobile-tabs, .studio-share-hint, .studio-stage-label, .live-ai-panel { display: none !important; }
  .live-studio .studio-workspace { display: block; padding: 0; }
  .live-studio .studio-stage-wrap { display: block !important; max-width: none; }
  .studio-stage { box-shadow: none; print-color-adjust: exact; }
}

/* Source: privacy.css */
.privacy-consent { display:flex; align-items:flex-start; gap:9px; margin:14px 0; font-size:12px; line-height:1.65; color:inherit; text-align:left; }
.privacy-consent input[type="checkbox"] { appearance:auto; flex:none; width:17px; height:17px; min-height:0; margin:3px 0 0; padding:0; accent-color:#18674d; }
.privacy-consent > div { min-width:0; }
.privacy-consent label { display:inline; font:inherit; cursor:pointer; color:inherit; }
.privacy-link { display:inline; width:auto; border:0; border-radius:0; background:transparent; padding:0 2px; color:#247758; font:inherit; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.privacy-consent small { display:block; font-size:11px; opacity:.8; }
.iv-room .privacy-link, #screen-iv .privacy-link { color:#9be0bf; }
.privacy-dialog { width:min(580px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid #c9d7ce; border-radius:16px; background:#fff; color:#182b24; box-shadow:0 20px 80px #0005; font:14px/1.75 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; }
.privacy-dialog[open] { display:flex; flex-direction:column; }
.privacy-dialog::backdrop { background:#0b1714a6; }
.privacy-dialog header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px 22px 12px; border-bottom:1px solid #dfe7e2; }
.privacy-dialog header p { margin:0; color:#537262; font-size:12px; }
.privacy-dialog h2 { margin:2px 0 0; font-size:20px; }
.privacy-dialog header button { flex:none; border:0; background:transparent; padding:0 6px; color:#314c3f; font-size:26px; cursor:pointer; }
.privacy-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px 22px 18px; }
.privacy-body h3 { font-size:15px; margin:18px 0 4px; }
.privacy-body p { margin:6px 0; }
.privacy-body .privacy-note { margin-top:16px; padding:10px 12px; border-radius:8px; background:#eef5f0; color:#456453; font-size:12px; }
.privacy-dialog footer { flex:none; padding:12px 22px; border-top:1px solid #dfe7e2; }
.privacy-dialog footer button { width:100%; border:0; border-radius:8px; padding:10px; background:#18674d; color:#fff; font:inherit; cursor:pointer; }
.privacy-consent input:focus-visible, .privacy-link:focus-visible, .privacy-dialog button:focus-visible { outline:2px solid #3f9a75; outline-offset:3px; }
/* Keep the student intake within a small phone viewport. */
.match-student-dialog .privacy-consent { margin:8px 0; gap:7px; line-height:1.5; }
@media (max-width:540px) {
  .match-student-dialog .privacy-consent { margin:6px 0; }
  .match-student-dialog .privacy-consent small { line-height:1.4; }
}
