@import url("schedule.css");

:root {
  color-scheme: dark;
  --background: #0c0d10;
  --surface: #15171a;
  --grid-head: #222628;
  --ink: #e9edef;
  --muted: #989fa7;
  --line: #242528;
  --primary: #37cde7;
  --selected: #192830;
  --selected-text: #a7ecf7;
  --today: #11191e;
  --today-head: #293b44;
  --live: #55d9ae;
  --live-surface: #102621;
  --changed: #24180e;
  --changed-line: #875108;
  --flag: #9b5900;
  --cancelled: #2b171a;
  --cancelled-line: #934550;
  --radius: 14px;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #fcfcfc;
  --surface: #fff;
  --grid-head: #f0f4f6;
  --ink: #172028;
  --muted: #58656e;
  --line: #dce2e6;
  --primary: #006b9a;
  --selected: #e7f5fc;
  --selected-text: #075477;
  --today: #eef8fc;
  --today-head: #d8edf5;
  --live: #076b4c;
  --live-surface: #e9f9f0;
  --changed: #fff5e5;
  --changed-line: #b77514;
  --flag: #935300;
  --cancelled: #fae9ee;
  --cancelled-line: #a24e5a;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.055em; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; }
h3 { font-size: .94rem; line-height: 1.4; }
small, .muted { color: var(--muted); }
.frame { width: min(1360px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--background); border-bottom: 1px solid var(--line); }
.top, .top nav, .brand { display: flex; align-items: center; gap: 14px; }
.top { min-height: 64px; max-width: 1024px; justify-content: space-between; }
.top nav > a { font-size: .875rem; font-weight: 650; }
.brand { color: var(--ink); line-height: 1.15; }
.brand strong { font-size: 1.12rem; font-weight: 650; }
.brand small { display: block; font-size: .7rem; margin-top: 4px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 28px; height: 28px; flex: none; object-fit: contain; }
.icon { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }
.intro { margin: 44px 0 26px; }
.intro p { margin-top: 10px; color: var(--muted); }
.button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 9px 13px; min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: var(--primary); color: var(--background); font-size: .83rem; font-weight: 650; white-space: nowrap; }
.button:hover { filter: brightness(1.12); text-decoration: none; }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.secondary:hover { background: var(--selected); }
.icon-only { min-width: 36px; min-height: 36px; padding: 6px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.sheet > h2 + p { margin-top: 12px; }
.section-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.section-top small { display: block; margin-top: 4px; }
.week, .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week { font-size: .88rem; color: var(--ink); white-space: nowrap; }
.tag, .room { display: inline-flex; align-items: center; border-radius: 7px; padding: 3px 7px; font-size: .72rem; font-weight: 650; background: var(--grid-head); color: var(--ink); }
.tag.changed { background: var(--changed); color: var(--ink); }
.tag.cancel { background: var(--cancelled); color: var(--ink); }
.lesson-note { margin-top: 7px; font-size: .78rem; overflow-wrap: anywhere; }
.live-detail { display: none; }
.live .live-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; font-size: .72rem; font-weight: 650; color: var(--live); }
.pulse { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--live); }
.live .pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 80%, 100% { box-shadow: 0 0 0 6px #13966f00; } 0% { box-shadow: 0 0 0 0 #13966f70; } }
@media (prefers-reduced-motion: reduce) { .live .pulse { animation: none; } }
progress { display: block; height: 7px; width: 100%; accent-color: var(--primary); }
.live progress { width: min(83px, 42%); accent-color: var(--live); }
.list { margin: 7px 0 9px; }
.list a { display: flex; align-items: center; gap: 10px; padding: 11px 0; font-size: .8rem; color: var(--ink); }
.list a + a { border-top: 1px solid var(--line); }
.list small, .history small, table small { display: block; margin-top: 4px; }
.list .trailing { margin-left: auto; color: var(--muted); }
.result-icon { padding: 7px; border-radius: 7px; background: var(--selected); color: var(--primary); }
.footer { margin-top: 36px; padding: 15px 0 25px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; }
.ops-layout { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(230px, 1fr); gap: 18px; align-items: start; }
.metrics { display: flex; gap: 8px; margin: 17px 0; }
.metrics div { padding: 12px; background: var(--background); border-radius: 9px; flex: 1; }
.metrics dt { color: var(--muted); font-size: .72rem; }
.metrics dd { margin: 5px 0 0; font-size: 1.4rem; font-weight: 750; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .82rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
th { font-size: .73rem; color: var(--muted); background: var(--background); }
td .tag { margin-top: 4px; }
.load, .suggestion { margin-top: 12px; }
.load div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px; font-size: .82rem; }
.load progress { margin: 6px 0; }
.load a, .suggestion a { display: block; margin-top: 4px; font-size: .78rem; }
.suggestions { margin-top: 18px; }
.suggestion { font-size: .86rem; }
.suggestion small { display: block; margin-block: 5px; }
.form-sheet { max-width: 600px; margin: 38px auto; padding: 24px; }
.form-sheet h1 { font-size: 1.9rem; margin-bottom: 12px; }
.form-sheet h2 { margin-top: 24px; }
.back { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 16px; font-size: .85rem; }
.fields { margin-top: 20px; display: grid; gap: 14px; }
.fields label { display: block; font-weight: 650; margin-bottom: 5px; font-size: .85rem; }
.fields input:not([type=checkbox]), .fields select, .fields textarea { display: block; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--background); color: var(--ink); }
.fields .button { justify-self: start; }
.errorlist { margin: 0 0 7px; padding-left: 18px; color: var(--ink); font-size: .82rem; }
.history { padding-left: 18px; font-size: .83rem; }
.history li { margin: 8px 0; }
.notice { padding: 12px 15px; margin-top: 14px; background: var(--live-surface); color: var(--live); border-radius: 8px; }
@media (max-width: 710px) {
  .frame { width: calc(100% - 28px); }
  .top { min-height: 60px; gap: 7px; }
  .top nav { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .brand-mark { height: 28px; width: 28px; }
  .intro { margin: 26px 0 17px; }
  .ops-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sheet { padding: 14px; }
}

.directory-layout { display:grid; grid-template-columns: minmax(180px, 240px) minmax(0,1fr); gap:24px; align-items:start; }
.directory-nav { display:grid; gap:3px; }
.directory-nav a { padding:9px 12px; border-radius:7px; }
.directory-nav [aria-current] { background:var(--today); color:var(--live); font-weight:600; }
.directory-row { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.directory-row small { display:block; color:var(--muted); }
@media(max-width:700px){ .directory-layout { grid-template-columns:minmax(0,1fr); gap:12px; } .directory-nav { display:flex; overflow-x:auto; } .directory-nav a { white-space:nowrap; } }

.frame:has(.desk) { width:calc(100% - 40px); max-width:1800px; }
.desk { display:grid; grid-template-columns:195px minmax(0,1fr); gap:28px; }
.desk-nav { border-right:1px solid var(--line); padding-right:14px; }
.desk-nav a,.desk-week,.desk-days { display:flex; align-items:center; gap:10px; }
.desk-nav a { padding:10px; border-radius:7px; color:var(--muted); font-size:.85rem; }
.desk-nav a:hover,.desk-nav [aria-current],.desk-days [aria-current] { background:var(--selected); color:var(--selected-text); }
.desk-nav hr { border:0; border-top:1px solid var(--line); margin:16px 8px; }
.desk-main h1 { margin:0; font-size:1.65rem; }
.desk-week { margin:18px 0; font-size:.9rem; }
.desk-week a,.desk-days a { padding:6px 9px; border-radius:6px; }
.desk-days { flex-wrap:wrap; margin-bottom:12px; gap:4px; }
.desk-days a { color:var(--muted); font-size:.85rem; }
.matrix-scroll { overflow:auto; max-height:68vh; border:1px solid var(--line); border-radius:10px; }
.matrix { min-width:1020px; width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.matrix th,.matrix td { border-right:1px solid var(--line); padding:5px; }
.matrix th { background:var(--surface); text-align:left; padding:12px 8px; }
.matrix tr>th:first-child { position:sticky; left:0; width:86px; z-index:1; }
.matrix thead th { position:sticky; top:0; z-index:2; } .matrix thead th:first-child { z-index:3; }
.booking { display:grid; gap:4px; border-radius:5px; padding:8px; background:var(--surface); font-size:.78rem; }
.booking + .booking { margin-top:4px; } .booking small { color:var(--muted); }
.booking.changed { background: var(--changed); border: 1px solid var(--changed-line); }
.booking.cancelled { background: var(--cancelled); border: 1px solid var(--cancelled-line); }
.booking:hover,.booking:focus-visible { background:var(--selected); }
.desk-reports { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(290px,100%),1fr)); gap:16px; align-items:start; }
@media(max-width:800px){.desk { display:block; }.desk-nav { display:flex; overflow:auto; border:0; margin-bottom:16px; }.desk-nav a { white-space:nowrap; }.desk-nav hr {display:none;}.desk .section-top {flex-wrap:wrap;gap:8px;} }

@media (max-width: 800px) {
  .desk-nav { max-width: 100%; }
  .desk-main { min-width: 0; }
  .desk-week { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .directory-row { flex-wrap: wrap; gap: 6px 12px; }
  .directory-row > div { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
  .desk-week strong { white-space: nowrap; }
}

body:has(.desk) .top { width: calc(100% - 40px); max-width: 1800px; }
.desk { padding-top: clamp(16px, 2vw, 30px); }
.desk .booking { color: var(--ink); line-height: 1.4; }
.desk .booking b { font-size: .82rem; font-weight: 550; }
.desk .booking small { font-size: .72rem; }
.desk .booking:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--primary); }
.matrix tbody th a { color: var(--ink); font-size: .8rem; font-weight: 600; }
.matrix-continuation { color: var(--muted); }
.desk-reports .suggestions { margin-top: 0; }

/* Shared interaction and form states */
::selection { background: var(--selected-text); color: var(--background); }
input, textarea { caret-color: var(--primary); }
.button, .group-tile, .booking, .desk-nav a, .desk-days a {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; filter: none; }
.fields input:not([type=checkbox]), .fields select, .fields textarea {
  min-height: 42px;
  transition: border-color .16s ease, background-color .16s ease;
}
.fields input:not([type=checkbox]):hover, .fields select:hover, .fields textarea:hover { border-color: var(--muted); }
.fields input:not([type=checkbox]):focus-visible, .fields select:focus-visible, .fields textarea:focus-visible {
  border-color: var(--primary);
  outline-offset: 1px;
}
.form-sheet h1, .desk-main h1 { letter-spacing: -.035em; }
.form-sheet > p { line-height: 1.5; }
.errorlist { color: var(--ink); line-height: 1.45; }

/* The timetable remains the visual focus in the workspace. */
.matrix th { font-variant-numeric: tabular-nums; }
.booking { color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.booking:hover, .booking:focus-visible { color: var(--primary); text-decoration: none; }
.booking small { font-variant-numeric: tabular-nums; line-height: 1.4; }
.desk-days a { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; }
.desk-week a { display: inline-flex; align-items: center; min-height: 36px; }

@media (max-width: 710px) {
  .fields input:not([type=checkbox]), .fields select, .fields textarea { font-size: 1rem; }
  .desk-days a, .desk-week a { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .group-tile, .booking, .desk-nav a, .desk-days a,
  .fields input:not([type=checkbox]), .fields select, .fields textarea { transition: none; }
}

.booking[draggable="true"] { cursor: grab; }
.booking.lesson-dragging { opacity: .45; }
.matrix td.lesson-drop-target { background: var(--selected); outline: 2px solid var(--primary); outline-offset: -2px; }

body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > footer { flex-shrink: 0; gap: 12px; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) {
  html.theme-transition, html.theme-transition body, html.theme-transition header,
  html.theme-transition main, html.theme-transition footer, html.theme-transition a,
  html.theme-transition button, html.theme-transition section, html.theme-transition td,
  html.theme-transition th, html.theme-transition .event {
    transition: background-color .22s ease, color .22s ease, border-color .22s ease;
  }
}
.desk-nav-label { padding: 18px 10px 7px; color: var(--muted); font-size: .7rem; }
.desk-nav a { min-height: 40px; }
.desk-nav .icon { flex: 0 0 20px; }
@media (max-width: 800px) { .desk-nav-label { display: none; } }

.matrix td.drop-first-half, .week-cell.drop-first-half { background: linear-gradient(to bottom, var(--selected) 50%, transparent 50%) !important; }
.matrix td.drop-second-half, .week-cell.drop-second-half { background: linear-gradient(to bottom, transparent 50%, var(--selected) 50%) !important; }

.matrix-bell { display: block; white-space: nowrap; color: var(--muted); }

.pending-booking { border: 1px dashed var(--primary); margin-top: 4px; }
.request-actions { display: grid; grid-column: 1; gap: 4px; margin-top: 4px; font-size: .75rem; }
.request-add { display: inline-block; margin-top: 4px; font-size: .75rem; }

.matrix-event { display: grid; gap: 2px; padding: 6px 8px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; font-size: .75rem; overflow-wrap: anywhere; }
.matrix-event small { color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-context-menu { position: fixed; z-index: 50; min-width: 13rem; max-width: calc(100vw - 16px); padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.lesson-context-menu a { display: block; padding: 8px 10px; border-radius: 5px; color: var(--ink); font-size: .85rem; }
.lesson-context-menu a:is(:hover, :focus-visible) { background: var(--selected); text-decoration: none; }
.inbox { max-width: 960px; margin-inline: auto; }
.inbox-tabs { display: flex; gap: 18px; margin: 16px 0; border-bottom: 1px solid var(--line); }
.inbox-tabs a { padding: 10px 2px; color: var(--muted); border-bottom: 2px solid transparent; }
.inbox-tabs a[aria-current] { color: var(--ink); border-color: var(--primary); }
.inbox-tabs span, .inbox-status { padding: 2px 7px; border-radius: 999px; background: var(--selected); font-size: .75rem; white-space: nowrap; }
.inbox-list { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.inbox-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 16px; }
.inbox-item + .inbox-item { border-top: 1px solid var(--line); }
.inbox-kind { color: var(--primary); }
.inbox-item h2 { font-size: 1rem; margin: 0; }
.inbox-item p { margin: 6px 0 0; overflow-wrap: anywhere; }
.inbox-meta { color: var(--muted); font-size: .82rem; }
.inbox-empty { padding: 24px; margin: 0; color: var(--muted); }
.inbox-review { margin-top: 10px; }
.inbox-review summary { cursor: pointer; color: var(--primary); width: fit-content; }
.inbox-review .fields { margin-top: 10px; }
.inbox-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 540px) {
  .inbox-item { grid-template-columns: auto minmax(0,1fr); padding: 12px; gap: 8px; }
  .inbox-status { grid-column: 2; justify-self: start; }
}

.header-inbox { position: relative; }
.header-count { position: absolute; inset: -7px -6px auto auto; padding: 0 4px; min-width: 16px; border-radius: 9px; background: var(--primary); color: var(--background); font-size: .65rem; text-align: center; }
.password-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.password-tool output { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .top { gap: 8px; flex-wrap: wrap; padding-block: 10px; }
  .top nav { justify-content: flex-start; }
  .top nav .button { min-height: 36px; }
  .header-clock { display: none; }
  .frame:has(.desk) { width: calc(100% - 28px); }
}


.matrix-period { display: block; margin-top: 5px; font-size: .68rem; line-height: 1.25; overflow-wrap: anywhere; }
.academic-period { display: flex; align-items: center; gap: 8px; margin-block: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.semester-source { margin-block: 12px; font-size: .85rem; }
.form-sheet { padding: clamp(14px, 3vw, 24px); margin-block: clamp(16px, 4vw, 38px); }

.booking-room { align-self: flex-end; margin-top: auto; padding-inline: 4px; border: 1px solid var(--line); border-radius: 4px; text-align: right; }
.matrix td { vertical-align: top; }
.matrix-cell-content { display: flex; flex-direction: column; gap: 4px; }
.matrix-cell-content > .booking { display: flex; flex-direction: column; gap: 3px; padding: 6px; margin-top: 0; }
.directory-row { gap: 8px 12px; flex-wrap: wrap; }
.directory-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }


.credential-list .search { margin: 12px 0; max-width: 36rem; }
.credential-list .directory-row { padding-inline: 14px; }
.credential-pagination { margin-top: 12px; }
.issued-credentials { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 14px; }
.issued-credentials dt { color: var(--muted); }
.issued-credentials dd { margin: 0; overflow-wrap: anywhere; font-family: monospace; }

.lesson-badge { display: inline-block; align-self: start; width: fit-content; padding: 1px 5px; border: 1px solid currentColor; border-radius: 4px; font-size: .67rem; font-weight: 650; line-height: 1.4; }
.lesson-badge--blue { color: #22569e; background: #edf5ff; }
.lesson-badge--yellow { color: #765200; background: #fff5ce; }
.lesson-badge--red { color: #9d2540; background: #fff0f3; }
.lesson-badge--green { color: #206247; background: #ecfaf1; }
[data-theme="dark"] .lesson-badge--blue { color: #a1c8ff; background: #182d4c; }
[data-theme="dark"] .lesson-badge--yellow { color: #ffdc7b; background: #3b3018; }
[data-theme="dark"] .lesson-badge--red { color: #ffadb9; background: #402430; }
[data-theme="dark"] .lesson-badge--green { color: #9fe0b8; background: #1b3528; }


.desk-main h1, .credential-list h1, .inbox h1 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
.desk-main .booking b { font-weight: 600; }
.desk-main .booking small:empty { display: none; }
.lesson-context-menu > small { display: block; padding: 5px 10px 2px; }
.icon { width: 1em; overflow: hidden; flex-shrink: 0; vertical-align: middle; }

.ops-workspace, .message-workspace { width: min(100%, 1150px); margin-inline: auto; display: grid; gap: 16px; }
.ops-workspace h1, .message-workspace h1 { font-size: clamp(1.45rem, 3vw, 2.15rem); }
.ops-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.ops-metrics > div { padding: 12px 16px; display: flex; flex-direction: column-reverse; gap: 4px; }
.ops-metrics > div + div { border-inline-start: 1px solid var(--line); }
.ops-metrics dt { color: var(--muted); font-size: .78rem; }
.ops-metrics dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 2rem; line-height: 1.1; }
.usage-days { margin-top: 12px; display: grid; gap: 6px; }
.usage-day { display: grid; grid-template-columns: 34px minmax(0,1fr) 66px; align-items: center; gap: 8px; font-size: .78rem; }
.usage-day.is-today { color: var(--primary); }
.usage-day strong { text-align: right; font-variant-numeric: tabular-nums; }
.usage-bars { position: relative; min-width: 0; height: 7px; }
.usage-bars meter { position: absolute; width: 100%; height: 7px; display: block; appearance: none; }
.usage-bars meter::-webkit-meter-bar { border: 0; border-radius: 2px; background: transparent; }
.usage-bars meter::-webkit-meter-optimum-value { background: var(--line); border-radius: 2px; }
.usage-bars meter + meter::-webkit-meter-optimum-value { background: var(--primary); }
.operations-columns, .message-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ops-teachers { max-height: 520px; overflow: auto; }
.ops-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-block: 12px; }
.ops-filter label { display: grid; gap: 2px; font-size: .76rem; }
.ops-filter input, .ops-filter select { max-width: 100%; min-height: 36px; padding-inline: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--background); }
#absence h3 { margin-top: 16px; }
.ops-empty { margin-top: 10px; }
.substitution-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; padding: 14px; }
.substitution-row + .substitution-row { border-top: 1px solid var(--line); }
.ops-impact { display: grid; gap: 2px; margin-top: 8px; font-size: .78rem; }
.ops-impact span { color: var(--muted); }
.message-layout { grid-template-columns: minmax(180px, .65fr) minmax(0, 1.75fr); }
.message-list { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.message-list a, .message-list p { display: grid; padding: 12px; }
.message-list a[aria-current] { background: var(--selected); }
.message-list a + a { border-top: 1px solid var(--line); }
.staff-message { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; overflow-wrap: anywhere; }
.staff-message > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; font-size: .83rem; margin-bottom: 4px; }
.staff-message time { color: var(--muted); }
@media (max-width: 720px) {
  .operations-columns, .message-layout, .substitution-row { grid-template-columns: minmax(0, 1fr); }
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-metrics > div:nth-child(odd) { border-inline-start: 0; }
  .ops-metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ops-metrics > div { padding: 10px; }
}


:root[data-theme="light"] {
  --ops-banner: #edf7fc;
  --ops-border: #d4e9f3;
}
:root[data-theme="dark"] {
  --ops-banner: #12222b;
  --ops-border: #2e414d;
}
.site-header .top { max-width: 1150px; }
.top nav > a:not(.button) { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.top nav > a:not(.button):hover { text-decoration: none; background: var(--selected); }
.button:not(.icon-only) { border-radius: 999px; }
.ops-hero { display: grid; gap: 18px; padding: 22px; border: 1px solid var(--ops-border); border-radius: var(--radius); background: var(--ops-banner); }
.ops-hero h1 { color: var(--primary); letter-spacing: -.035em; font-size: clamp(1.55rem, 3.4vw, 2.6rem); }
.ops-hero .ops-metrics { background: var(--surface); border-color: var(--ops-border); }
.ops-hero .ops-metrics > div + div { border-color: var(--ops-border); }
.ops-hero .ops-metrics dd { color: var(--primary); font-size: 2.2rem; }
.ops-teachers .directory-row { min-height: 46px; }
.usage-chart .section-top { align-items: baseline; }
@media (prefers-reduced-motion: no-preference) {
  .usage-bars meter + meter { transform-origin: left; animation: reveal-usage 240ms ease-out both; }
  @keyframes reveal-usage { from { transform: scaleX(.65); opacity: .45; } to { transform: scaleX(1); opacity: 1; } }
}
@media (max-width: 720px) {
  .ops-hero { padding: 14px; gap: 12px; }
  .ops-hero .ops-metrics dd { font-size: 1.8rem; }
}
.ops-workspace, .message-workspace { padding-block-start: 16px; }
.fields .option-filter { margin-bottom: 5px; }
@media (max-width: 620px) {
  .top nav { column-gap: 4px; }
}

/* Quick access and room usage */
.ops-directory { margin: 20px 0 28px; }
.ops-directory .section-top { margin-bottom: 16px; }
.directory-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:8px; }
.directory-tiles a { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:62px; padding:13px 15px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--ink); font-size:.87rem; font-weight:600; }
.directory-tiles a:hover { background:var(--selected); text-decoration:none; }
.directory-tiles .icon { color:var(--muted); font-size:18px; }
.room-report { display:grid; gap:16px; }
.room-summary { display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:12px; }
.room-summary > div { padding:22px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.room-summary > div > span { display:block; color:var(--muted); font-size:.83rem; font-weight:600; }
.room-summary strong { display:block; margin-top:10px; font-size:2.8rem; line-height:1; letter-spacing:-.04em; }
.room-summary strong small { font-size:1rem; color:var(--muted); letter-spacing:0; }
.room-summary p { margin:10px 0 0; font-size:.78rem; color:var(--muted); }
.room-summary-primary strong { color:var(--primary); }
.room-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; margin-top:20px; }
.room-item { padding:14px; border:1px solid var(--line); border-radius:9px; }
.room-item-heading { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.room-item-heading span { color:var(--primary); font-weight:700; }
.room-item > small { display:block; margin-top:8px; color:var(--muted); }
.room-track { height:7px; overflow:hidden; background:var(--selected); border-radius:8px; margin-top:13px; }
.room-track span { display:block; height:100%; background:var(--primary); border-radius:inherit; }
.room-count { color:var(--muted); font-weight:700; }
@media(max-width:650px) { .room-summary { grid-template-columns:1fr 1fr; } .room-summary-primary { grid-column:1/-1; } .room-summary strong { font-size:2.2rem; } .directory-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.room-explainer { padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; }
.room-explainer p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
