/* Hallmark v2 · custom · editorial utility · school ranking */
:root {
  color-scheme: light;
  --paper: #f6f6f3;
  --surface: #fff;
  --ink: #1b1d1e;
  --muted: #525b5c;
  --line: #dedfdb;
  --rule: #ebece8;
  --field-edge: #858d8c;
  --tile: #efefeb;
  --row: #f9f9f7;
  --teal: #00616a;
  --teal-hover: #004a52;
  --teal-sheet: #e9f1ef;
  --teal-bar: #347e84;
  --wine: #962541;
  --wine-sheet: #faeef1;
  --glass: rgb(246 246 243 / .86);
  --overlay: rgb(23 29 28 / .37);
  --shadow: 0 22px 68px rgb(25 35 33 / .16);
  --focus: #007580;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --radius: 18px;
  --ease-out: cubic-bezier(.19,.75,.25,1);
  --gutter: clamp(16px, 5.5vw, 80px);
  --size: 1240px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3, p, dl, figure { margin: 0; }
h1, h2, h3 { overflow-wrap: break-word; min-width: 0; }
h1, h2 { line-height: 1.02; letter-spacing: -.052em; }
h2 { font-size: clamp(25px, 3vw, 38px); font-weight: 680; }
h3 { font-size: 18px; line-height: 1.25; letter-spacing: -.022em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { background: none; border: 0; }
button:disabled, .btn:disabled { background: var(--tile); color: var(--muted); cursor: wait; }
button, a, select { touch-action: manipulation; }
input, textarea, select { min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
:where(h1,h2,h3)[tabindex] { scroll-margin-top: 82px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: fixed; top: 8px; left: 8px; transform: translateY(-150%); z-index: 20; padding: 10px 14px; background: var(--surface); border-radius: 9px; }
.skip:focus { transform: none; }
.glyph { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.shell { width: min(calc(100% - 2 * var(--gutter)), var(--size)); margin-inline: auto; }
.mast { position: sticky; top: 0; z-index: 4; background: var(--paper); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .mast { background: var(--glass); -webkit-backdrop-filter: saturate(145%) blur(20px); backdrop-filter: saturate(145%) blur(20px); }
}
.mast-inner, .footer-inner { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 680; letter-spacing: -.047em; }
.brand img { display: block; width: 25px; height: 25px; object-fit: contain; }
.primary-nav, .footer-inner > div { display: flex; align-items: center; gap: clamp(13px, 3.1vw, 40px); }
.primary-nav a { min-height: 40px; display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; white-space: nowrap; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--teal); }
.primary-nav a[aria-current] { font-weight: 650; }
.rating-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
  gap: 24px 36px;
  align-items: end;
  padding: clamp(43px, 6.4vw, 94px) 0 clamp(29px, 4.5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.rating-intro h1 { font-size: clamp(46px, 7.1vw, 105px); font-weight: 690; letter-spacing: -.079em; }
.rating-intro h1 > span { color: var(--teal); }
.rating-intro p { margin-top: 14px; font-size: clamp(15px, 1.45vw, 21px); color: var(--muted); letter-spacing: -.025em; }
.school-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-self: end; justify-self: end; width: 100%; max-width: 340px; }
.school-stats > div { min-width: 0; display: flex; flex-direction: column-reverse; border-left: 1px solid var(--line); padding-left: clamp(10px, 1.4vw, 21px); }
.school-stats dd { margin: 0; font-size: clamp(25px, 3.3vw, 42px); color: var(--ink); font-weight: 610; letter-spacing: -.075em; line-height: 1.04; font-variant-numeric: tabular-nums; }
.school-stats dt { margin-top: 6px; font-size: 13px; color: var(--muted); }
.rating-body { padding-top: clamp(22px, 3vw, 40px); }
.data-heading, .table-heading, .matrix-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.data-heading, .table-heading { margin-bottom: 16px; }
.matrix-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.year-wrap, .glass-control, .curator-jumps button, .edit-record, .sign-out {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px; background: var(--surface); font-size: 13px; font-weight: 560;
}
.year-wrap { color: var(--muted); }
.year-wrap:has(select:not([hidden])) { border-color: var(--field-edge); }
.year-wrap select, .select-wrap select { border: 0; background: none; }
.year-wrap svg, .glass-control svg, .edit-record svg { width: 15px; height: 15px; }
.glass-control, .curator-jumps button, .edit-record, .sign-out { color: var(--teal); }
.glass-control:hover, .curator-jumps button:hover, .edit-record:hover, .sign-out:hover { background: var(--teal-sheet); }
.panel, .matrix-surface, .staff-aside, .formula-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.matrix-host, .matrix-surface { min-width: 0; }
.matrix-surface { overflow: clip; }
.matrix-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.score-matrix, .ranking-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.score-matrix th, .score-matrix td, .ranking-table th, .ranking-table td {
  text-align: right; padding: 9px clamp(4px, 1.17vw, 19px); font-size: 14px; line-height: 1.28; white-space: nowrap;
}
.score-matrix th:first-child, .score-matrix td:first-child, .ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { text-align: left; }
.score-matrix thead th, .ranking-table thead th { background: var(--tile); color: var(--muted); font-size: 12px; font-weight: 630; white-space: normal; }
.score-matrix tbody :is(th, td), .ranking-table tbody td { border-bottom: 1px solid var(--rule); }
.score-matrix tbody tr:hover > :is(th,td), .ranking-table tbody tr:hover > td { background: var(--row); }
.score-matrix tbody th { font-weight: 660; }
.score-matrix .sum-col { background: var(--teal-sheet) !important; color: var(--teal); font-weight: 690; }
.score-matrix tfoot :is(th,td) { background: var(--tile); font-weight: 650; }
.score-matrix .debit, .negative-text { color: var(--wine); }
.score-matrix .unscored { color: var(--muted); }
.score-matrix tbody :is(th,td):has(button) { padding-block: 2px; }
.score-matrix button { min-width: 24px; min-height: 32px; border-radius: 5px; padding: 1px 3px; text-align: inherit; font: inherit; }
.score-matrix button:hover, .row-class:hover { text-decoration: underline; text-underline-offset: 3px; }
.score-matrix caption:not(.sr) { color: var(--muted); text-align: left; padding: 8px 15px; font-size: 13px; }
.static-avg { display: block; color: var(--muted); }
.narrow-label, .matrix-key { display: none; }
.matrix-key { border-top: 1px solid var(--rule); padding: 5px 12px; font-size: 13px; }
.matrix-key summary { cursor: pointer; padding-block: 6px; color: var(--teal); }
.matrix-key dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 12px; padding-bottom: 6px; }
.matrix-key dl div { display: flex; gap: 6px; }
.matrix-key dt { font-weight: 660; }
.matrix-key dd { margin: 0; color: var(--muted); }
.matrix-key abbr, .score-matrix abbr { text-decoration: none; }
.matrix-toolbar { padding: 10px 14px; }
.matrix-context, .muted, .small-note, .table-heading p, .message { color: var(--muted); }
.small-note, .matrix-context, .table-heading p { font-size: 14px; }
.chart-section-head, .standings { margin-top: clamp(34px, 6vw, 76px); }
.overview-grid { display: grid; grid-template-columns: minmax(0,2.5fr) minmax(0,1fr); align-items: stretch; gap: 16px; }
.overview-grid.no-leader { grid-template-columns: minmax(0,1fr); }
.chart-panel { padding: clamp(12px, 2vw, 24px); min-width: 0; }
.chart-tools, .chart-foot, .legend, .legend > span, .refresh-state { display: flex; align-items: center; gap: 8px; }
.chart-tools, .chart-foot { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.chart-foot { font-size: 12px; color: var(--muted); }
.chart-foot svg { width: 15px; height: 15px; }
.legend { flex-wrap: wrap; }
.key { width: 9px; height: 9px; border-radius: 2px; background: var(--teal-bar); }
.leader-key { background: var(--wine); }
.chart-empty { margin-block: 20px; padding: 12px 0; color: var(--muted); }
.segments { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--tile); }
.segments button { min-height: 34px; padding: 4px 12px; border-radius: 9px; font-size: 14px; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--teal); font-weight: 660; }
.select-wrap, .search { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--field-edge); border-radius: 999px; padding: 5px 11px; color: var(--muted); min-height: 38px; font-size: 14px; }
.select-wrap select { max-width: 100%; color: var(--ink); padding: 3px; }
.select-wrap select + span { display: none; }
.search input { border: 0; background: none; width: min(29vw, 180px); color: var(--ink); }
.plot { margin: 36px 0 32px; }
.plot-field { height: clamp(136px, 17vw, 210px); position: relative; margin-left: var(--axis-w, 30px); }
.tick-line { position: absolute; inset-inline: 0; border-top: 1px solid var(--rule); }
.tick-line.zero { border-color: var(--line); }
.tick-label { position: absolute; right: calc(100% + 6px); transform: translateY(-55%); color: var(--muted); font-size: 11px; }
.plot-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 4px; }
.bar-button { position: relative; display: block; min-width: 0; padding: 0; font-size: clamp(10px, 1.05vw, 13px); }
.inkbar { position: absolute; inset-inline: 18%; min-height: 1px; background: var(--teal-bar); border-radius: 4px 4px 0 0; }
.bar-button.is-leader .inkbar, .bar-button.negative .inkbar { background: var(--wine); }
.bar-button:hover .inkbar { filter: brightness(.88); }
.bar-button.negative .inkbar { border-radius: 0 0 4px 4px; }
.bar-label, .bar-value { position: absolute; inset-inline: 0; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.bar-label { top: calc(100% + 7px); font-weight: 630; }
.bar-value { transform: translateY(-4px); }
.bar-button.negative .bar-value { transform: translateY(4px); }
.side { padding: clamp(14px,2vw,22px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--teal-sheet); min-width: 0; }
.leader-card h2 { font-size: 14px; letter-spacing: -.01em; color: var(--teal); }
.leader-card h2 svg { display: none; }
.leader-name, .leader-empty { margin-top: 8px; font-size: clamp(30px,4vw,56px); font-weight: 690; line-height: 1; letter-spacing: -.065em; }
.leader-name small { margin-left: 6px; font-size: 16px; letter-spacing: -.03em; }
.leader-value { margin: 7px 0 10px; font-size: 14px; }
.leader-action, .runner, .row-class, .link-button, .text-link { font-weight: 610; color: var(--teal); padding: 0; }
.leader-action, .text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; overflow-wrap: anywhere; }
.leader-action:hover, .link-button:hover, .text-link:hover, .footer a:hover { text-decoration: underline; }
.next-leaders { margin-top: 14px; }
.runner { display: grid; width: 100%; grid-template-columns: 20px minmax(0,1fr) auto auto; align-items: center; text-align: left; gap: 6px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.table-panel { overflow-x: auto; }
.ranking-table td:first-child, .ranking-table th:first-child { text-align: center; }
.ranking-table td:last-child { padding-block: 3px; }
.ranking-table tr:last-child > td { border-bottom: 0; }
.row-class { min-height: 32px; }
.position { color: var(--muted); }
.position.first, .selected-num { color: var(--teal); font-weight: 680; }
.icon-button { display: inline-grid; align-items: center; justify-items: center; min-width: 36px; min-height: 36px; color: var(--teal); border-radius: 100%; background: var(--teal-sheet); }
.row-arrow { min-width: 28px; min-height: 28px; background: none; }
.empty, .message { padding: 20px 0; }
.empty { padding-inline: 16px; }
.page-intro { padding: clamp(36px, 6vw, 80px) 0 clamp(24px, 3vw, 48px); }
.page-intro h1, .static-title { font-size: clamp(41px, 6.5vw, 81px); font-weight: 690; }
.page-intro p:not(:empty) { margin-top: 12px; max-width: 62ch; color: var(--muted); }
.rules-layout, .school-grid, .staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: clamp(14px, 2.8vw, 34px); }
.rules-layout { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
.rules-list, .formula-panel, .staff-aside, .form-panel, .log-panel { padding: clamp(16px, 3vw, 30px); }
.rules-list > p, .rules-aside p, .school-copy > p, .staff-aside > p { margin-top: 10px; color: var(--muted); }
.criterion-item { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.8fr); gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.criterion-item span, .formula-example span { color: var(--muted); font-size: 14px; }
#criteria-list { margin-top: 14px; }
.formula-icon { display: none; }
.formula-example { margin-top: 12px; }
.formula-example strong { display: block; color: var(--teal); font-size: 28px; letter-spacing: -.05em; }
.plain-info { padding-top: 19px; }
.plain-info h3:not(:first-child) { margin-top: 19px; }
.school-image img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.school-image figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.school-copy hr { border: 0; border-top: 1px solid var(--line); margin-block: 19px; }
.address { display: flex; align-items: flex-start; gap: 7px; }
.staff-login { max-width: 850px; }
.staff-aside { background: var(--tile); }
.staff-aside .text-link { margin-top: 8px; }
.staff-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
.session-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; margin-bottom: 14px; }
.session-strip > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; min-width: 0; }
.session-id, .pill { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.curator-jumps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
#curator-matrix { margin-bottom: 24px; }
.log-panel { margin-top: 22px; }
.log-head > p { margin-top: 8px; }
.log-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-block: 16px; }
.journal-list, .entry-history ol, .breakdown { margin: 0; padding: 0; list-style: none; }
.journal-list li { display: grid; grid-template-columns: minmax(30px,.24fr) minmax(0,2fr) auto auto; align-items: center; gap: 10px; border-top: 1px solid var(--rule); padding: 12px 0; }
.journal-list li > div { min-width: 0; overflow-wrap: anywhere; }
.journal-list :is(small,time,.change-state) { display: block; color: var(--muted); font-size: 13px; }
.journal-value { font-weight: 675; white-space: nowrap; }
.journal-list .removed .journal-value { text-decoration: line-through; }
.journal-list .removed .change-state { color: var(--wine); }
#log-more { margin-top: 14px; }
.field, .form-fields { display: grid; gap: 7px; min-width: 0; font-size: 14px; font-weight: 590; }
.field > :is(input,select,textarea) { min-height: 43px; padding: 8px 10px; border: 1px solid var(--field-edge); border-radius: 9px; background: var(--surface); width: 100%; font-weight: 400; font-size: 16px; }
.field > textarea { resize: vertical; }
.field > :is(input,select,textarea):hover { border-color: var(--muted); }
.form-fields { gap: 14px; margin-top: 16px; }
.field-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.inline-year { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.inline-year select { min-height: 38px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; min-height: 43px; padding: 7px 16px; font-size: 15px; font-weight: 630; border-radius: 999px; }
.btn.primary { color: var(--surface); background: var(--teal); }
.btn.primary:hover { background: var(--teal-hover); }
.btn.secondary { background: var(--teal-sheet); color: var(--teal); }
.btn.danger { color: var(--surface); background: var(--wine); }
.actions, .editor-actions { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.notice, .error-box, .change-summary { padding: 12px; border-radius: 8px; background: var(--wine-sheet); color: var(--wine); }
.notice { margin-top: 12px; font-size: 14px; }
.notice.ok, .change-summary { background: var(--teal-sheet); color: var(--teal); }
.error-box { margin-top: 16px; }
dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: none; max-height: calc(100dvh - 16px); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--overlay); }
#class-dialog, .entry-dialog { width: min(560px,calc(100% - 22px)); padding: clamp(15px,3vw,25px); }
.matrix-dialog { width: min(var(--size),calc(100% - 20px)); padding: 0; }
.matrix-dialog .matrix-surface { border: 0; }
.drawer-top, .drawer-heading, .editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-top { color: var(--muted); font-size: 14px; }
.drawer-heading { margin: 12px 0; }
.drawer-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 16px; }
.drawer-stats div { padding: 10px; border-radius: 8px; background: var(--teal-sheet); }
.drawer-stats strong, .drawer-stats span { display: block; }
.drawer-stats strong { font-size: 23px; color: var(--teal); }
.drawer-stats span, .entry-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.breakdown { margin: 8px 0; }
.breakdown li { padding: 6px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.editor-head h2 { font-size: clamp(23px,3vw,34px); }
.entry-meta { margin-top: 7px; }
.entry-history { margin-top: 14px; border-top: 1px solid var(--rule); }
.entry-history summary { cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 620; }
.entry-history summary span { margin-left: auto; }
.entry-history li { padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; overflow-wrap: anywhere; }
.entry-history li div { display: flex; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
.entry-history time, .entry-history p { color: var(--muted); }
.text-danger { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; color: var(--wine); }
.footer { margin-top: clamp(44px,7vw,90px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer .glyph { width: 13px; height: 13px; }
.noscript-view { margin-top: 32px; }
.noscript-view .static-heading { margin: 12px 0; }
.snapshot-note { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
@media (max-width: 850px) {
  .rating-intro { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .school-stats { justify-self: start; }
  .school-stats > div:first-child { border-left: 0; padding-left: 0; }
}
@media (max-width: 700px) {
  .narrow-label, .matrix-key { display: revert; }
  .wide-label { display: none; }
  .score-matrix :is(th,td) { font-size: 12px; padding-inline: 3px; }
  .score-matrix :is(th,td):first-child { padding-left: 8px; }
  .score-matrix :is(th,td):last-child { padding-right: 8px; }
  .score-matrix button { min-width: 21px; padding-inline: 0; }
  .mast-inner { min-height: 52px; gap: 9px; }
  .brand { font-size: 16px; gap: 6px; }
  .brand img { width: 21px; height: 21px; }
  .primary-nav { gap: clamp(8px,3vw,18px); }
  .primary-nav a { font-size: 13px; }
  .school-stats dt { font-size: 12px; }
  .overview-grid, .rules-layout, .school-grid, .staff-grid { grid-template-columns: minmax(0,1fr); }
  .ranking-table :is(th,td) { white-space: normal; padding-inline: 5px; font-size: 12px; }
  .ranking-table .arrow-col, .ranking-table td:last-child { display: none; }
  .chart-tools .select-wrap { min-width: 0; font-size: 13px; }
  .runner { padding-block: 8px; }
  .journal-list li { gap: 6px; }
  .journal-list .edit-record { min-width: 36px; justify-content: center; padding-inline: 5px; }
  .journal-list .edit-record span { display: none; }
}
@media (max-width: 360px) {
  .score-matrix :is(th,td) { padding-inline: 2px; }
  .score-matrix :is(th,td):first-child { padding-left: 5px; }
  .score-matrix :is(th,td):last-child { padding-right: 5px; }
  .glass-control, .year-wrap { padding-inline: 9px; }
  .log-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .inline-year { align-items: flex-start; flex-direction: column; }
}
@media (pointer: coarse) {
  .matrix-dialog button, .score-matrix tbody button { min-height: 40px; }
  .score-matrix tbody button { width: 100%; }
  .icon-button, .edit-record { min-width: 40px; min-height: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rating-intro h1, .page-intro h1 { animation: title-arrival .55s var(--ease-out) both; }
  .rating-intro h1 > span { display: inline-block; animation: accent-arrival .6s var(--ease-out) .12s both; }
  .rating-intro-copy > p, .page-intro p { animation: settle .36s var(--ease-out) .08s both; }
  .school-stats dd { animation: settle .48s var(--ease-out) both; }
  .school-stats > div:nth-child(2) dd { animation-delay: .065s; }
  .school-stats > div:nth-child(3) dd { animation-delay: .13s; }
  .staff-login > section, .staff-login > aside { animation: settle .35s var(--ease-out) both; }
  .staff-login > aside { animation-delay: .05s; }
  .school-image { animation: settle .44s var(--ease-out) both; }
  .primary-nav a { position: relative; }
  .primary-nav a::after {
    content: ""; position: absolute; inset: auto 0 0; height: 2px; background: currentColor;
    transform: scaleX(0); transform-origin: right; transition: transform .23s var(--ease-out);
  }
  .primary-nav a:hover::after, .primary-nav a[aria-current]::after { transform: none; transform-origin: left; }
  :is(.btn,.icon-button,.glass-control,.edit-record,.segments button,.sign-out,.curator-jumps button) {
    transition: background-color .18s ease, color .18s ease, transform .18s var(--ease-out);
  }
  :is(.btn,.icon-button,.glass-control,.edit-record,.segments button,.sign-out,.curator-jumps button):active:not(:disabled) { transform: scale(.965); }
  :is(.field input,.field select,.field textarea,.search,.select-wrap) { transition: border-color .18s ease, background-color .18s ease; }
  :is(.field input,.field select,.field textarea,.search,.select-wrap):focus-within { border-color: var(--teal); }
  .score-matrix tbody :is(th,td), .ranking-table tbody td { transition: background-color .15s ease; }
  dialog[open] { animation: sheet-arrival .28s var(--ease-out); }
  dialog[open]::backdrop { animation: veil .22s ease-out; }
  .score-matrix td.cell-changed { animation: cell-shift .85s ease-out; }
  .inkbar { animation: show-bar .4s var(--ease-out); transform-origin: bottom; }
  .bar-button.negative .inkbar { transform-origin: top; }
  .bar-value { animation: show-value .32s ease-out; }
  .notice.ok:not([hidden]) { animation: confirm .55s var(--ease-out); }
  .entry-history[open] ol, .matrix-key[open] dl { animation: settle .24s var(--ease-out); }
  @keyframes title-arrival { from { transform: translateY(13px); } }
  @keyframes accent-arrival { from { transform: scale(.5); } 70% { transform: scale(1.15); } }
  @keyframes settle { from { transform: translateY(6px); } }
  @keyframes sheet-arrival { from { transform: translateY(13px) scale(.987); } }
  @keyframes veil { from { opacity: 0; } }
  @keyframes cell-shift { from { background-color: var(--teal-sheet); } }
  @keyframes show-bar { from { transform: scaleY(.03); } }
  @keyframes show-value { from { translate: 0 5px; } }
  @keyframes confirm { from { transform: translateY(-4px); } }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .runner:hover svg, .text-link:hover svg { transform: translateX(3px); }
  .runner svg, .text-link svg { transition: transform .22s var(--ease-out); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .mast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .mast { position: static; }
  .matrix-head-actions, .chart-tools, .footer, .noscript-view .matrix-key { display: none; }
  .shell { width: 100%; }
  .rating-intro { padding-top: 12px; }
  .rating-intro h1 { font-size: 42px; }
}

/* The staff workspace uses tinted glass on its floating controls. Forms and data
   sit on solid surfaces, including under the sticky controls on small screens. */
:is(#staff-page, .entry-dialog) {
  --staff-text: #1b2b2b;
  --staff-muted: #4f6768;
  --staff-border: #cfdad8;
  --staff-control-edge: #819593;
  --staff-paper: #f4f9f8;
  --staff-tint: #e5f1ee;
  --staff-soft: #f9fcfb;
  --staff-highlight: rgb(255 255 255 / .82);
  --staff-glass: rgb(241 249 247 / .85);
  --staff-float-shadow: 0 9px 27px rgb(21 67 65 / .12), inset 0 1px 0 var(--staff-highlight);
  --staff-sheet-shadow: 0 20px 60px rgb(23 59 57 / .2);
  --staff-radius: 22px;
  --staff-spring: cubic-bezier(.18,.72,.24,1.05);
  color: var(--staff-text);
}
#staff-page { max-width: 1110px; margin-inline: auto; }
#staff-body { min-width: 0; }
#staff-page .page-intro { padding-block: clamp(28px,5vw,65px) clamp(18px,3vw,34px); }
#staff-page .page-intro h1 {
  max-width: 18ch;
  font-size: clamp(34px,6.5vw,70px);
  font-weight: 690;
  letter-spacing: -.039em;
  line-height: 1.04;
  text-wrap: balance;
}
#staff-page .page-intro p { color: var(--staff-muted); line-height: 1.42; }
#staff-page :is(.form-panel,.log-panel,.matrix-surface,.staff-aside) {
  border-radius: var(--staff-radius);
  border-color: var(--staff-border);
}
#staff-page .staff-grid { grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: clamp(12px,2.6vw,28px); }
#staff-page .staff-login { max-width: 940px; }
#staff-page .staff-aside { background: var(--staff-tint); }
#staff-page .staff-aside :is(p,.small-note) { color: var(--staff-muted); }
#staff-page .staff-aside h2 { font-size: clamp(22px,3.1vw,32px); }
#staff-page .staff-login-address { color: var(--teal); margin-top: 8px; overflow-wrap: anywhere; }
#staff-page .session-strip {
  background: var(--staff-tint);
  border-color: var(--staff-border);
  border-radius: 16px;
  margin-bottom: 15px;
  padding: 10px clamp(12px,2vw,22px);
}
#staff-page .session-id { color: var(--staff-muted); }
#staff-page :is(.sign-out,.glass-control,.edit-record),
.entry-dialog .editor-close {
  background: var(--staff-soft);
  border-color: var(--staff-border);
  color: var(--teal);
  min-height: 42px;
}
#staff-page .curator-jumps {
  position: sticky;
  top: 65px;
  z-index: 3;
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  margin-bottom: clamp(18px,3.5vw,38px);
  padding: 4px;
  border: 1px solid var(--staff-border);
  border-radius: 999px;
  background: var(--staff-paper);
  box-shadow: var(--staff-float-shadow);
}
@supports (backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px)) {
  #staff-page .curator-jumps {
    background: var(--staff-glass);
    -webkit-backdrop-filter: blur(16px) saturate(154%);
    backdrop-filter: blur(16px) saturate(154%);
  }
}
#staff-page .curator-jumps button {
  justify-content: center;
  text-align: center;
  color: var(--staff-text);
  border: 0;
  background: transparent;
  min-height: 42px;
  padding: 6px clamp(8px,1.8vw,17px);
}
#staff-page .curator-jumps button:is([aria-current="location"],[aria-pressed="true"]),
#staff-page .curator-jumps button:hover { color: var(--teal); background: var(--surface); box-shadow: inset 0 1px 1px var(--staff-highlight); }
#staff-page :is(#curator-matrix-heading,#points-title,#log-heading) { scroll-margin-top: 134px; }
#staff-page #curator-matrix { margin-bottom: clamp(24px,4.5vw,50px); }
#staff-page .matrix-toolbar { padding: 10px 15px; }
#staff-page .matrix-toolbar p { color: var(--staff-muted); }
#staff-page .score-matrix thead th { background: var(--staff-paper); color: var(--staff-text); }
#staff-page .score-matrix tfoot :is(th,td) { background: var(--staff-paper); }
#staff-page .score-matrix [data-cell]:is(:hover,:focus-visible) { color: var(--teal-hover); background: var(--staff-tint); }
#staff-page .matrix-dialog .matrix-surface { border-radius: 0; }
#staff-page :is(.log-panel,.form-panel) > h2 { text-wrap: balance; }
#staff-page .log-panel { margin-top: clamp(24px,4.5vw,50px); }
#staff-page .log-filters { gap: 9px; }
#staff-page .log-filters .field select { text-overflow: ellipsis; padding-inline: 8px; }
#staff-page .log-filter-reset { justify-self: end; color: var(--teal); min-height: 40px; }
#staff-page .journal-list li { grid-template-columns: minmax(38px,.19fr) minmax(0,3fr) auto auto; column-gap: 13px; }
#staff-page .journal-list li > b { color: var(--teal); letter-spacing: -.022em; }
#staff-page .journal-list li > div > strong { font-weight: 640; }
#staff-page .journal-value { font-size: 21px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
#staff-page .change-state {
  display: inline-flex;
  padding: 2px 7px;
  margin-top: 4px;
  border-radius: 999px;
  color: var(--teal);
  background-color: var(--staff-tint);
  font-size: 12px;
}
#staff-page .removed .change-state { color: var(--wine); background: var(--wine-sheet); }
#staff-page #log-status:not(:empty) { margin-block: 12px; color: var(--staff-muted); }

:is(#staff-page,.entry-dialog) .field { color: var(--staff-muted); }
:is(#staff-page,.entry-dialog) .field :is(input,select,textarea) {
  min-height: 46px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--staff-control-edge);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--staff-soft);
  color: var(--staff-text);
  font-size: 16px;
  font-weight: 480;
  caret-color: var(--teal);
}
#staff-page .inline-year > span { white-space: nowrap; }
#staff-page .inline-year > select { width: auto; min-width: 106px; }
:is(#staff-page,.entry-dialog) .field :is(input,textarea)::placeholder { color: var(--staff-muted); opacity: 1; }
:is(#staff-page,.entry-dialog) .field :is(input,select,textarea):focus-visible { background: var(--surface); outline-offset: 2px; }
:is(#staff-page,.entry-dialog) .field :is(input,textarea)::selection { background: var(--staff-tint); color: var(--staff-text); }
:is(#staff-page,.entry-dialog) .btn { min-height: 46px; gap: 9px; }
:is(#staff-page,.entry-dialog) .btn.primary:enabled {
  background: linear-gradient(172deg,#087986,var(--teal) 68%);
  color: var(--surface);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .26), 0 3px 8px rgb(15 83 83 / .16);
}
:is(#staff-page,.entry-dialog) .btn.primary:hover:enabled { background: var(--teal-hover); }
:is(#staff-page,.entry-dialog) .btn.primary:disabled { color: var(--staff-muted); background: var(--staff-tint); box-shadow: none; }
#staff-page .staff-form-note { color: var(--staff-muted); font-weight: 400; }
:is(#staff-page,.entry-dialog) .point-input { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 5px; }
:is(#staff-page,.entry-dialog) .point-sign {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--staff-control-edge);
  background: var(--staff-tint);
  color: var(--teal);
  font-size: 20px;
}
:is(#staff-page,.entry-dialog) .point-sign[aria-pressed="true"] { background: var(--wine-sheet); color: var(--wine); }
.entry-dialog {
  --sheet-pad: clamp(19px,3vw,29px);
  padding: 0;
  border-color: var(--staff-border);
  border-radius: 26px;
  width: min(570px,calc(100% - 24px));
  overscroll-behavior: contain;
  box-shadow: var(--staff-sheet-shadow);
}
.entry-dialog .editor-inner { padding: 0 var(--sheet-pad) var(--sheet-pad); }
.entry-dialog .editor-head {
  position: sticky;
  z-index: 1;
  top: 0;
  margin-inline: calc(-1 * var(--sheet-pad));
  padding: 12px var(--sheet-pad) 9px;
  background-color: var(--staff-paper);
  border-bottom: 1px solid var(--staff-border);
}
@supports (backdrop-filter: blur(15px)) or (-webkit-backdrop-filter: blur(15px)) {
  .entry-dialog .editor-head {
    background: var(--staff-glass);
    -webkit-backdrop-filter: blur(15px) saturate(135%);
    backdrop-filter: blur(15px) saturate(135%);
  }
}
.entry-dialog .editor-close { flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--staff-border); }
.entry-dialog .editor-head h2 { line-height: 1.12; letter-spacing: -.035em; }
.entry-dialog .entry-meta { color: var(--staff-muted); margin-top: 12px; }
.entry-dialog .entry-history summary { min-height: 44px; color: var(--teal); }
.entry-dialog .entry-history summary .glyph { flex: none; }
.entry-dialog .entry-history li { padding-block: 10px; }
.entry-dialog .editor-actions { align-items: stretch; }
.entry-dialog .editor-actions .text-danger { justify-content: start; }
:is(#staff-page,.entry-dialog) :is(.notice,.change-summary) { font-weight: 500; }

@media (max-width:700px) {
  #staff-page .staff-grid {
    grid-template-columns: minmax(0,1fr);
  }
  #staff-page .curator-jumps {
    top: 61px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  #staff-page .curator-jumps button { line-height: 1.15; min-width: 0; padding-inline: 5px; white-space: normal; }
  #staff-page .staff-actions .primary { width: 100%; justify-content: center; }
  #staff-page .matrix-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding-inline: 11px; }
  #staff-page .matrix-context { font-size: 13px; line-height: 1.35; }
  #staff-page .matrix-toolbar .glass-control { white-space: nowrap; }
  #staff-page .log-filters { grid-template-columns: repeat(2,minmax(0,1fr)); margin-block: 14px; }
  #staff-page .log-filters .field:nth-child(2) { grid-row: 1; grid-column: 1 / -1; }
  #staff-page .score-matrix [data-cell] { min-height: 40px; width: 100%; }
  #staff-page .journal-list li { column-gap: 8px; }
  #staff-page .journal-value { font-size: 18px; }
  #staff-page .edit-record { min-height: 44px; min-width: 44px; }
  .entry-dialog {
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-height: calc(100dvh - 18px);
    border-radius: 25px 25px 0 0;
  }
  .entry-dialog .editor-inner { padding-bottom: calc(var(--sheet-pad) + env(safe-area-inset-bottom)); }
  .entry-dialog .editor-actions .btn.primary { width: 100%; }
}
@media (max-width:360px) {
  #staff-page .curator-jumps button { font-size: 12px; }
  #staff-page .log-panel { padding-inline: 12px; }
  #staff-page .journal-list li { grid-template-columns: minmax(22px,.15fr) minmax(0,2fr) auto auto; }
  #staff-page .journal-value { font-size: 16px; }
}
@media (prefers-reduced-motion:no-preference) {
  #staff-page .curator-jumps { animation: staff-float-in .43s var(--staff-spring) both; }
  #staff-page .staff-login > .staff-login-panel { animation: staff-flow-in .38s var(--ease-out) both; }
  #staff-page .staff-login-panel #login-hint { animation: staff-flow-in .32s var(--ease-out) .06s both; }
  #staff-page .score-matrix [data-cell] { transition: background-color .15s ease, color .15s ease; }
  :is(#staff-page,.entry-dialog) .point-sign { transition: transform .2s var(--staff-spring), background .2s ease, color .2s ease; }
  :is(#staff-page,.entry-dialog) .point-sign:active { transform: scale(.92); }
  .entry-dialog[open], #staff-page .matrix-dialog[open] { animation: staff-sheet-in .37s var(--staff-spring) both; }
  .entry-dialog[open] .change-summary { animation: staff-flow-in .3s var(--ease-out); }
  @keyframes staff-float-in { from { transform: translateY(-8px) scale(.975); } }
  @keyframes staff-flow-in { from { transform: translateY(7px); } }
  @keyframes staff-sheet-in { from { transform: translateY(20px) scale(.99); } }
}
@media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {
  #staff-page .curator-jumps, .entry-dialog .editor-head {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Reflections move with the controls, while information stays on a solid surface. */
:root {
  --glass-glint: rgb(235 255 251 / .16);
  --glass-rim: rgb(255 255 255 / .78);
}
#staff-page .curator-jumps { box-shadow: inset 0 1px 0 var(--glass-rim), var(--staff-float-shadow); }
#staff-page :is(.staff-login-panel,.form-panel) { isolation: isolate; }
#staff-page .btn.primary, .entry-dialog .btn.primary {
  isolation: isolate; position: relative; overflow: clip;
}
#staff-page .btn.primary::after, .entry-dialog .btn.primary::after {
  content: ""; position: absolute; inset: 1px; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 34%, var(--glass-glint) 49%, transparent 66%);
  border-radius: inherit; opacity: 0; transform: translateX(-85%);
}
@media (prefers-reduced-motion: no-preference) {
  #staff-page .btn.primary:is(:focus-visible,:active)::after, .entry-dialog .btn.primary:is(:focus-visible,:active)::after {
    animation: glass-reflection .58s var(--ease-out);
  }
  #board-content:not([hidden]) > #public-matrix { animation: score-sheet-arrival .33s var(--ease-out) both; }
  #leader-content .leader-name { animation: settle .32s var(--ease-out); }
  @keyframes glass-reflection {
    25% { opacity: .8; }
    to { opacity: 0; transform: translateX(85%); }
  }
  @keyframes score-sheet-arrival { from { transform: translateY(5px); } }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  #staff-page .btn.primary:hover::after, .entry-dialog .btn.primary:hover::after { animation: glass-reflection .58s var(--ease-out); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #staff-page .curator-jumps { box-shadow: none; }
  #staff-page .btn.primary::after, .entry-dialog .btn.primary::after { display: none; }
}

