/* Oxford's reading surfaces use solid ink unless the client supports frosted glass. */
@media screen {
  :root {
    color-scheme: dark;
    --bg: #140a0c; --paper: #271c21; --ink: #f7f2e7; --muted: #d2c3bc;
    --line: #ffffff28; --wine: #e9cb8e; --wine-dark: #ffdf9b;
    --gold: #e9cb8e; --gold-dark: #e9cb8e; --soft: #3e2e32;
    --amber: #f4d494; --amber-bg: #4a3422;
    --reading: #271c21; --glass: #302127; --edge: #ffffff38;
    --glass-shadow: inset 0 1px 0 #ffffff0e, 0 14px 40px -30px #000b;
    font-size: 16px;
  }
  body, body.signed-in {
    background: radial-gradient(ellipse at 12% -10%,#632a38,transparent 55%),
      radial-gradient(ellipse at 100% 20%,#49322d,transparent 54%),var(--bg);
    background-attachment: fixed;
  }
  .sidebar, .workspace-bar, .panel, .metrics > *, .auth-form, .auth-brand,
  .school-hero { border: 1px solid var(--edge); box-shadow: var(--glass-shadow) }
  .sidebar { background: var(--glass); border-width: 0 1px 0 0 }
  .brand-sub,.sidebar-user span,nav a { color: var(--muted) }
  nav a { padding-block: 8px }
  nav a.active { background: #efd39916; box-shadow: inset 3px 0 var(--gold) }
  .workspace-bar {
    border-radius: 16px; padding: 8px 14px; margin: 18px 0 24px;
    min-height: 50px; background: var(--glass);
  }
  .workspace-role { font-size: 13px; color: var(--ink); font-weight: 650 }
  .workspace-role::before { content: ''; display: inline-block; width: 8px; height: 8px;
    margin-right: 9px; background: var(--gold); border-radius: 50% }
  .workspace-year { margin-left: auto }
  .demo-label { background: #443526 }
  .page-head { padding-block: 5px 3px }
  .page-head h1,.school-hero h1,.auth-brand h1 { font-weight: 500 }
  .panel,.auth-form { background: var(--reading); border-color: var(--line); border-radius: 16px }
  .auth-form { border-radius: 0 22px 22px 0 }
  .school-hero,.auth-brand {
    position: relative; isolation: isolate; overflow: hidden;
    background: radial-gradient(ellipse at 95% 0,#955d4966,transparent 65%),
      linear-gradient(145deg,#5c2735cc,#28151eee);
  }
  .auth-brand { border-radius: 22px 0 0 22px }
  .auth-brand::after,.school-hero::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    right: -4.5rem; bottom: -4rem; width: 16rem; height: 19rem;
    border: 1px solid #ecd09957; border-radius: 9rem 9rem 0 0;
    box-shadow: 0 0 0 10px #eaca9509, 0 0 0 11px #eaca9526,
      0 0 0 26px #eaca9506, 0 0 0 27px #eaca9526, 0 0 0 44px #eaca9506, 0 0 0 45px #eaca951a;
  }
  .school-hero::after { right: 12%; opacity: .5 }
  .auth-brand .monogram { border-radius: 16px; background: #ffffff0d }
  .metrics > *, .metrics > :first-child { background: var(--glass); border-radius: 16px; border-color: var(--edge) }
  .metrics > :first-child { background: linear-gradient(145deg,#6c423f,#372429) }
  .metrics strong { color: var(--ink); font-weight: 570; font-size: clamp(32px,3vw,46px) }
  .metrics a:hover { border-color: var(--gold); background: #443036 }
  button,.button { color: #24171a; min-height: 44px; border-radius: 10px }
  button:hover,.button:hover { color: #160d0f }
  .secondary,.quiet,.signout { color: var(--wine) }
  .secondary { background: #ffffff09; border-color: #ffffff46 }
  .secondary:hover,.quiet:hover,.signout:hover { color: var(--wine-dark) }
  :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px }
  .skip-link { background: var(--paper) }
  input:not([type=hidden]):not([type=checkbox]), select,textarea {
    color-scheme: light; color: #251a1b; background: #faf4e8;
    border-color: #c9bbaa; min-height: 44px; accent-color: #693445;
  }
  .workspace-year select { width: auto }
  input::file-selector-button { padding: 5px 10px; border: 1px solid #b7a597; border-radius: 5px; margin-right: 8px }
  .scroll { border-radius: 9px; scrollbar-color: #9d8079 #241a1e }
  th { background: #433138; color: var(--ink); font-size: 13px }
  td { border-color: var(--line) }
  tbody tr:nth-child(even) { background: #ffffff04 }
  tbody tr:hover,tr:target td { background: #413035 }
  td small,.hint,.badge { font-size: 13px }
  .scroll:has(.requirements-table) { max-height: 70vh; overflow: auto }
  .requirements-table thead th { position: sticky; top: 0; z-index: 2 }
  .requirements-table :is(td,th):nth-child(2) { position: sticky; left: 0; background: #32252a; max-width: 32ch }
  .requirements-table thead th:nth-child(2) { z-index: 3; background: #433138 }
  .badge { background: #3c3037; color: #f3e7e6 }
  .badge.good { color: #b2efcd; background: #243c32 }
  .badge.warn { color: var(--amber); background: var(--amber-bg) }
  .badge.good::before { content: '✓'; margin-right: .3em }
  .attention { border-top: 2px solid var(--gold) }
  .flash { background: #233a30; color: #d5f4dc; border-color: #4d745d }
  .flash.error { background: #48272e; color: #ffe0da; border-color: #a35c67 }
  .phase-list {
    display: flex; overflow-x: auto; padding: 2px 2px 10px; gap: 12px;
    scroll-snap-type: x proximity; scrollbar-color: #a88979 #271c20; scroll-behavior: smooth;
  }
  .phase-list li { flex: 0 0 min(245px,90%); display: grid; align-content: space-between;
    justify-content: stretch; gap: 16px; padding: 16px; border-radius: 12px;
    background: #ffffff04; scroll-snap-align: start }
  .phase-list li.priority { background: #4a332c; border-color: #ccab76 }
  .phase-list .badge { justify-self: start }
  .stage-controls:not([hidden]) { display: flex; gap: 7px; justify-content: flex-end }
  .stage-controls button { min-width: 44px; font-size: 20px; line-height: 1 }
  .stage-controls button:disabled { opacity: .4; cursor: default }
  a,button { transition: color .16s ease, background-color .16s ease, border-color .16s ease }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    @media not (prefers-reduced-transparency: reduce) {
      :root { --glass: #ffffff0d; --reading: #261a1ee8 }
      .sidebar, .workspace-bar, .metrics > *, .auth-form,.panel {
        -webkit-backdrop-filter: blur(18px) saturate(145%);
        backdrop-filter: blur(18px) saturate(145%);
      }
    }
  }
  @media (max-width: 700px) {
    .sidebar { border-width: 0 0 1px }
    .workspace-bar { margin-top: 12px; gap: 8px }
    .workspace-year { margin-left: 0; flex-wrap: wrap }
    .auth-brand { border-radius: 16px 16px 0 0 }
    .auth-form { border-radius: 0 0 16px 16px }
    .requirements-table :is(td,th):nth-child(2) { max-width: 40vw; min-width: 6rem; overflow-wrap: anywhere }
  }
  @media (prefers-reduced-motion: reduce) {
    a,button { transition: none }
    .phase-list { scroll-behavior: auto }
  }
}
@media print {
  :root { font-size: 12pt; color-scheme: light; --ink: #000; --muted: #333; --line: #aaa; --paper: white }
  body.signed-in,body.signed-out,main,.workspace-bar,.panel,.school-hero,.metrics > * {
    display: block; background: white; box-shadow: none; color: black; width: auto; max-width: none }
  main { padding: 0 }
  .sidebar,.skip-link,.stage-controls,button,.button,.table-controls,.demo-label { display: none !important }
  .workspace-bar { min-height: auto; padding: 4pt 0; margin: 0 0 10pt }
  .workspace-bar::before { content: 'Oxford School Operations'; font-weight: bold }
  .workspace-role { display: block }
  .workspace-year select { appearance: none; border: 0; padding: 0; min-height: auto }
  .two,.overview-grid { display: block }
  .scroll { overflow: visible }
  .panel { border-color: #aaa; padding: 8pt; margin-bottom: 10pt }
  .metrics { grid-template-columns: repeat(2,1fr) }
  .metrics > * { min-height: auto; padding: 6pt }
  .phase-list { display: block }
  .phase-list li { margin-bottom: 3pt; break-inside: avoid }
  th,td { color: black; padding: 4pt; overflow-wrap: anywhere }
  tr { break-inside: avoid }
  thead { display: table-header-group }
}

@media screen {
  html { background-color: #140a0c; }
  .turbo-progress-bar {
    position: fixed; display: block; top: 0; left: 0; height: 3px;
    z-index: 10000; pointer-events: none; background: var(--gold);
  }
}

/* School register: burgundy cover, brass index and an uncluttered writing surface. */
.req-workspace { --register-gold:#e5cd94; --register-ink:#28252c; --register-quiet:#5f5862; }
.req-workspace [hidden] { display:none !important; }
.req-cover { display:flex; align-items:center; justify-content:space-between; gap:20px;
  padding:clamp(21px,3vw,40px); color:#fff8ed; border-radius:18px 18px 0 0;
  background:linear-gradient(108deg,#582638,#3c2130 77%,#35212b); border:1px solid #90627366; border-bottom:0; }
.req-back { color:#eadccf; text-decoration:none; font-size:13px; }
.req-heading h1 { font:500 clamp(32px,3.6vw,54px)/1.08 var(--serif); letter-spacing:-.045em; margin:15px 0 13px; }
.req-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; color:#efdedb; font-size:13px; }
.req-meta > span:not(:first-child):not(.badge) { border-left:1px solid #b895975e; padding-left:14px; }
.req-meta .badge { background:#f5e2b9; color:#503626; padding:3px 10px; }
.req-seal { flex:none; width:84px; aspect-ratio:1; border-radius:50%; border:1px solid #c6a57488;
  outline:1px solid #c6a57444; outline-offset:-6px; display:grid; place-content:center; justify-items:center;
  gap:8px; color:#e8ce96; transform:rotate(-6deg); }
.req-seal strong { font:500 15px var(--serif); letter-spacing:.1em; }
.req-nav { display:flex; flex-wrap:wrap; gap:3px 18px; padding:0 clamp(16px,3vw,40px);
  margin:0 0 21px; background:#31212a; border:1px solid #80596877; border-radius:0 0 12px 12px; }
.req-nav a { display:inline-flex; gap:7px; align-items:center; min-height:49px; color:#e7d9d6;
  font-size:14px; font-weight:550; text-decoration:none; border-radius:0; padding:0 3px; border-bottom:3px solid transparent; }
.req-nav a:hover,.req-nav a[aria-current] { color:#ffebbc; background:none; }
.req-nav a[aria-current] { border-bottom-color:#e7c78d; }
.req-nav a span { font:600 11px/1.6 system-ui,sans-serif; padding:0 6px; background:#ffffff14; border-radius:5px; }
.req-workspace section[id],.req-reset { scroll-margin-top:clamp(90px,30vh,290px); }
.req-workspace .panel { color-scheme:light; --ink:var(--register-ink); --muted:var(--register-quiet);
  --wine:#682d44; --wine-dark:#4c1e33; --gold:#80522d; --line:#dcd6d5; --paper:#fbfaf7;
  --amber:#663704; --amber-bg:#f7e5cc; background:var(--paper); color:var(--ink);
  box-shadow:0 11px 26px #10081024; border:1px solid #e3ddda; border-radius:14px; padding:clamp(18px,2.5vw,32px);
  -webkit-backdrop-filter:none; backdrop-filter:none; }
.req-workspace .panel h2 { color:#402433; font-size:clamp(24px,2.35vw,33px); font-weight:550; }
.req-workspace .panel h3 { color:#44323a; font-size:16px; }
.req-workspace .panel :is(p,.source,small,.hint,.muted) { color:var(--register-quiet); }
.req-workspace .panel :is(a,summary) { color:#72374e; }
.req-workspace .panel :is(input:not([type=hidden]):not([type=checkbox]),textarea,select) {
  border:1px solid #c8c0c1; background:white; border-radius:7px; color:#2d2630; }
.req-workspace .panel label { font-size:13px; font-weight:600; }
.req-workspace .panel :is(button,.button) { background:#682d44; color:#fff9f2; border:1px solid #682d44; box-shadow:none; }
.req-workspace .panel :is(button,.button):hover { background:#512137; }
.req-workspace .panel :is(.secondary,.quiet,.table-sort) { background:transparent; color:#652d45; border-color:#c7b9bf; }
.req-workspace .panel :is(.secondary,.quiet,.table-sort):hover { background:#efe8ea; color:#4d2034; }
.req-workspace .panel th,.req-workspace .panel .requirements-table thead th:nth-child(2) { background:#ede8e8; color:#493741; }
.req-workspace .panel td,.req-workspace .panel .requirements-table td:nth-child(2) { background:#fff; color:var(--ink); }
.req-workspace .panel .badge { background:#ede8e8; color:#472c39; }
.req-workspace .panel .badge.warn { background:#f8e7ce; color:#6e3900; }
.req-workspace .panel .badge.good { background:#dbece4; color:#214e3a; }
.req-card-head,.req-save { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; }
.req-card-head h2,.req-save p { margin:0; }
.req-card-head a { font-size:14px; font-weight:650; text-underline-offset:4px; }
.req-categories { display:flex; flex-wrap:wrap; gap:6px; margin:20px 0; padding-bottom:19px; border-bottom:1px solid var(--line); }
.req-categories a { display:inline-flex; min-height:35px; align-items:center; padding:5px 12px; border-radius:6px; background:#efebea;
  font-size:13px; font-weight:550; text-decoration:none; }
.req-categories a[aria-current],.req-categories a:hover { color:#fffaf0; background:#653048; }
.req-fields,.req-quantities { display:grid; align-items:end; gap:14px; grid-template-columns:minmax(0,2fr) minmax(78px,.7fr) minmax(0,1fr); }
.req-quantities { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.7fr); }
.req-workspace #add-requirement .form-stack { gap:17px; }
.req-workspace .form-stack > details { background:transparent; border:0; padding:0; }
.req-workspace .form-stack > details summary { font-size:13px; width:fit-content; }
.req-save { padding-top:17px; border-top:1px solid var(--line); }
.req-save .hint { max-width:52ch; font-size:13px; }
.req-save button { flex:none; margin-left:auto; }
.req-document { padding:16px 0; border-top:1px solid var(--line); }
.req-document .inline { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.req-document .actions { align-items:flex-end; }
.req-reset summary { font-weight:600; }
.req-reset[open] summary { margin-bottom:12px; }
.req-workspace :focus-visible { outline:3px solid #a57032; outline-offset:2px; }
@media(max-width:760px) {
  .req-seal { width:58px; gap:4px; } .req-seal strong { font-size:11px; }
  .req-nav { gap:0 10px; padding:0 13px; }
  .req-nav a { font-size:13px; }
  .req-fields,.req-quantities { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .req-fields label:first-child,.req-quantities label:last-child { grid-column:1/-1; }
}
@media(max-width:480px) {
  .req-cover { padding:18px 15px; } .req-seal { display:none; }
  .req-nav { display:grid; grid-template-columns:1fr 1fr; gap:0 8px; }
  .req-nav a { min-height:39px; } .req-meta { gap:6px 9px; font-size:12px; }
  .req-meta > span:not(:first-child):not(.badge) { padding-left:8px; }
  .req-categories { gap:5px; } .req-save button { width:100%; }
}

/* Compact work controls, with larger touch targets on handheld screens. */
@media screen {
  main :is(button:not(.table-sort), .button),
  main .actions > a:not(.button), main .record-link, main .record-menu > summary {
    box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center;
    gap:.35rem; min-height:34px; width:fit-content; max-width:100%;
    padding:.4rem .7rem; border-radius:7px; font-size:.84rem; line-height:1.25;
    font-weight:620; text-decoration:none; text-align:center;
  }
  main .actions > a:not(.button), main .record-link, main .record-menu > summary {
    border:1px solid var(--line); background:transparent; color:var(--wine);
  }
  main :is(.record-link,.actions > a:not(.button),.record-menu > summary):hover {
    border-color:currentColor; text-decoration:none;
  }
  main .actions { align-items:center; gap:6px 8px; }
  main .actions > form { margin:0; max-width:100%; }
  main :is(.form-grid,.form-stack) > button { justify-self:start; }
  main :is(.form-grid,.mini,.actions) label { min-width:0; max-width:100%; }
  main .directory-actions { display:flex; align-items:flex-start; flex-wrap:wrap; gap:6px; }
  main .record-menu { margin:0; }
  main .record-menu > summary { cursor:pointer; }
  main .record-menu > summary::after { content:'▾'; font-size:.8em; }
  main .record-menu[open] > summary { margin-bottom:6px; }
  main .directory-table td:last-child { width:40%; }
  main .directory-table input { max-width:32ch; }
  main .directory-tabs { display:flex; width:fit-content; max-width:100%; gap:2px;
    margin-bottom:14px; background:var(--paper); padding:3px; border:1px solid var(--line); border-radius:9px; }
  main .directory-tabs a { display:flex; align-items:center; padding:6px 12px; min-height:32px;
    font-size:.84rem; text-decoration:none; border-radius:6px; line-height:1.2; }
  main .directory-tabs a[aria-current=page] { background:var(--gold); color:#291d22; }
  main .directory-tabs a:hover { background:var(--soft); color:var(--ink); }
  main .directory-tools { display:flex; flex-wrap:wrap; align-items:end; gap:12px 28px; margin-bottom:16px; }
  main .directory-tools .mini { align-items:end; margin:0; }
  main .office-toolbar a, main .record-link, main .record-menu > summary, main .directory-tabs a {
    white-space:nowrap;
  }
}
@media screen and (max-width:700px), screen and (pointer:coarse) {
  main :is(button:not(.table-sort),.button,.actions > a:not(.button),.record-link,.record-menu > summary),
  main .directory-tabs a { min-height:44px; }
  main .directory-table { min-width:28rem; }
  main .directory-tabs a { padding-inline:9px; }
}
.workspace-back[hidden] { display:none }
.workspace-bar .workspace-back { flex:none; white-space:nowrap }

.workspace-school { margin-left:auto; }
.workspace-school label { display:flex; align-items:center; gap:7px; }
.workspace-school select { width:auto; max-width:16rem; }
.workspace-school + .workspace-year { margin:0; }

.req-workspace :is(.requirements-table,.strength-table) :is(td,th):first-child { text-align:center; }
.req-workspace .panel :is(.requirements-table,.strength-table) th .table-sort {
  min-height:30px; padding:2px 4px; border:0; background:transparent; color:inherit; text-decoration:none;
}
.req-workspace .panel :is(.requirements-table,.strength-table) th .table-sort:hover { background:#38233012; text-decoration:none; }

.delivery-documents .actions { align-items:flex-end; }
.panel:has(.record-menu) td { vertical-align:top; }
td .record-menu + .record-menu { margin-top:6px; }

.document-options { margin:0; align-self:end; max-width:100%; }
main details.document-options > summary { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.5rem .8rem; border:1px solid currentColor; border-radius:.6rem; font-weight:600; cursor:pointer; list-style:none; }
.document-options > summary::-webkit-details-marker { display:none; }
.document-options > summary::after { content:"⌄"; }
.document-options[open] > summary::after { transform:rotate(180deg); }
.document-options .document-choices { display:grid; gap:.5rem; padding:.7rem .15rem .25rem; }
.document-choices > div { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; }
.document-choices > div > span { min-width:5rem; font-size:.85rem; }
.document-formats { display:flex; flex-wrap:wrap; gap:.3rem; }
main .document-formats button { margin:0; min-height:32px; padding:.28rem .6rem; }
@media (pointer:coarse) { main .document-formats button { min-height:44px; } }
