@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light dark;

  /* FIGS approved primitives */
  --figs-navy: #003057;
  --figs-ink: #14213d;
  --figs-wordmark: #263a52;
  --figs-blue-mid: #16466a;
  --figs-blue-light: #d6e4f0;
  --figs-paper: #fafaf6;
  --figs-white: #ffffff;
  --figs-rule: #e5e7eb;
  --figs-coral: #f47b55;
  --figs-coral-soft: #ffe1df;
  --figs-focus: #246bfe;
  --figs-success: #146c43;
  --figs-success-soft: #d3fff8;
  --figs-error: #b3261e;
  --figs-error-soft: #ffe1df;

  /* Semantic light mode */
  --page: var(--figs-paper);
  --surface: var(--figs-white);
  --surface-alt: var(--figs-paper);
  --surface-brand: var(--figs-blue-light);
  --text: var(--figs-ink);
  --text-secondary: var(--figs-wordmark);
  --muted: #6e6e6e;
  --border: var(--figs-rule);
  --border-strong: var(--figs-navy);
  --action: var(--figs-navy);
  --action-text: var(--figs-white);
  --accent: var(--figs-coral);
  --focus: var(--figs-focus);

  --font-zh: "Noto Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-latin: Inter, "Helvetica Neue", Arial, sans-serif;
  --container: 1240px;
  --reading: 800px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
  --s24: 96px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-wrap: anywhere;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.7 var(--font-zh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

button,
input { touch-action: manipulation; }

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:visited { color: var(--text-secondary); }
a:hover { color: var(--figs-blue-mid); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
h4,
p { margin-top: 0; }

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.16;
}

h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 750; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 3.3rem); font-weight: 700; letter-spacing: -0.025em; }
h3 { font-size: 1.1rem; font-weight: 650; }

.shell {
  width: min(calc(100% - 80px), var(--container));
  margin-inline: auto;
}

.hidden { display: none !important; }

.eyebrow,
.toolbar-label {
  margin: 0;
  color: var(--figs-navy);
  font: 750 0.72rem/1.25 var(--font-latin);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before { content: "[ "; color: var(--accent); }
.eyebrow::after { content: " ]"; color: var(--accent); }

.meta,
.local-note,
.status,
.empty {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Brand header */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
}

/* The operational site uses one persistent left navigation; legacy top headers are intentionally removed. */
.site-header { display: none !important; }
.admin-side-nav,
.vertical-index { display: none !important; }

.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 292px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.app-sidebar-inner { min-height: 100%; display: flex; flex-direction: column; padding: 20px 16px; }
.sidebar-brand { display: block; width: 260px; max-width: 100%; line-height: 0; }
.sidebar-brand img { display: block; width: 260px; max-width: 100%; height: auto; }

.sidebar-primary { display: grid; gap: 2px; margin-top: 36px; }
.sidebar-primary a { min-height: 40px; display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: var(--s2); padding: 7px 8px; border-left: 3px solid transparent; color: var(--text-secondary); font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.sidebar-primary a span { color: var(--muted); font: 700 0.64rem/1 var(--font-latin); font-variant-numeric: tabular-nums; }
.sidebar-primary a:hover,
.sidebar-primary a[aria-current="page"] { border-left-color: var(--accent); background: var(--surface-alt); color: var(--figs-navy); }
.sidebar-primary a[aria-current="page"] span { color: var(--accent); }
.sidebar-student-subnav { display: grid; gap: 1px; margin: -1px 0 var(--s2) 30px; padding: var(--s2) 0 var(--s2) var(--s3); border-left: 1px solid var(--border); }
.sidebar-student-subnav a { min-height: 27px; display: flex; align-items: center; padding: 2px 4px; color: var(--muted); font-size: 0.68rem; font-weight: 600; line-height: 1.25; text-decoration: none; }
.sidebar-student-subnav a:hover { color: var(--figs-navy); text-decoration: underline; text-underline-offset: 0.2em; }

.sidebar-secondary { display: grid; gap: 2px; margin-top: auto; padding-top: var(--s6); border-top: 1px solid var(--border); }
.sidebar-secondary p { margin: 0 0 var(--s2); color: var(--muted); font: 700 0.64rem/1 var(--font-latin); letter-spacing: 0.12em; }
.sidebar-secondary a { min-height: 36px; display: flex; align-items: center; color: var(--muted); font-size: 0.8rem; text-decoration: none; }
.sidebar-secondary a:hover,
.sidebar-secondary a[aria-current="page"] { color: var(--figs-navy); text-decoration: underline; text-underline-offset: 0.22em; }

body { padding-left: 292px; }

.nav {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
}

.brand-lockup,
.brand-lockup picture {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.brand-lockup img {
  display: block;
  width: 320px;
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s8);
  font: 650 0.86rem/1.2 var(--font-zh);
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--figs-navy);
}

.vertical-index {
  position: fixed;
  z-index: 10;
  top: 152px;
  left: 18px;
  display: grid;
  gap: var(--s6);
}

.vertical-index a {
  color: var(--muted);
  font: 650 0.6rem/1.35 var(--font-latin);
  letter-spacing: 0.1em;
  text-decoration: none;
  writing-mode: vertical-rl;
}

.vertical-index a:hover { color: var(--figs-navy); }

/* Management navigation and operational pages */
.admin-side-nav {
  position: fixed;
  z-index: 10;
  top: 158px;
  left: 18px;
  display: grid;
  gap: var(--s3);
  width: 126px;
}

.admin-side-nav a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--s1);
  align-items: baseline;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.admin-side-nav span {
  color: var(--accent);
  font: 700 0.62rem/1.2 var(--font-latin);
}

.admin-side-nav a:hover,
.admin-side-nav a[aria-current="page"] { color: var(--figs-navy); }

.manager-page { max-width: 1120px; }

.manager-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s6);
  padding-bottom: var(--s4);
  border-bottom: 2px solid var(--figs-navy);
}

.manager-toolbar .meta { margin: var(--s1) 0 0; }

.room-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s6);
  padding-bottom: var(--s4);
  border-bottom: 2px solid var(--figs-navy);
}
.room-summary { margin: 0; color: var(--text-secondary); font-size: 0.84rem; }
.room-edit-form { margin-top: var(--s6); }
.room-board { display: grid; gap: var(--s10); margin-top: var(--s8); }
.room-section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.room-section-head h2 { margin: 0 0 var(--s3); font-size: 1.45rem; }
.room-section-head .eyebrow { margin: 0 0 var(--s3); }
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.room-card { min-height: 150px; padding: var(--s3); border: 1px solid var(--border); border-top: 3px solid var(--muted); background: var(--surface); }
.room-card.in-use { border-top-color: var(--accent); background: var(--surface-alt); }
.room-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.room-card-head h3 { margin: 0; color: var(--figs-navy); font: 700 1.05rem/1 var(--font-latin); }
.room-card-head span { color: var(--muted); font-size: 0.72rem; }
.room-empty { margin: var(--s6) 0 0; color: var(--muted); font-size: 0.8rem; }
.room-course-list { display: grid; gap: var(--s2); margin-top: var(--s3); }
.room-course { width: 100%; display: grid; gap: 2px; padding: var(--s2); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.room-course:hover { border-color: var(--figs-navy); background: var(--figs-blue-light); }
.room-course time { color: var(--figs-navy); font: 700 0.72rem/1.2 var(--font-latin); }
.room-course strong { font-size: 0.83rem; }
.room-course small { color: var(--text-secondary); font-size: 0.72rem; }

.manager-primary,
.manager-secondary,
.text-action {
  min-height: 44px;
  border: 1px solid var(--figs-navy);
  border-radius: 0;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

.manager-primary { background: var(--figs-navy); color: var(--figs-white); }
.manager-primary:hover { background: var(--figs-blue-mid); }
.manager-secondary { background: var(--surface); color: var(--figs-navy); }
.manager-secondary:hover { background: var(--figs-blue-light); }
.text-action { min-height: 36px; border-color: transparent; padding: 5px 0; background: transparent; color: var(--figs-navy); text-decoration: underline; text-underline-offset: 0.2em; }
.text-action:hover { color: var(--figs-blue-mid); }

.manager-form {
  margin: var(--s6) 0;
  padding: var(--s6);
  border: 1px solid var(--border);
  border-top: 6px solid var(--figs-navy);
  background: var(--surface-brand);
}

.manager-form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.manager-form-head h2 { margin: var(--s2) 0 0; font-size: 1.9rem; }
.plain-close { width: 44px; height: 44px; flex: 0 0 auto; border: 0; background: transparent; color: var(--figs-navy); cursor: pointer; font-size: 1.5rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.form-grid label {
  display: grid;
  gap: var(--s2);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--figs-navy);
  border-radius: 0;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--text);
  font: 400 0.9rem/1.5 var(--font-zh);
}

.form-grid textarea { min-height: 88px; resize: vertical; }
.form-full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); }

.manager-table-wrap { overflow-x: auto; }
.manager-table { min-width: 720px; border-top: 2px solid var(--figs-navy); }
.manager-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.7fr) minmax(120px, 1fr) minmax(100px, 0.8fr) minmax(90px, 0.65fr) minmax(110px, 0.8fr);
  align-items: center;
  gap: var(--s3);
  min-height: 60px;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.86rem;
}

.manager-row > strong { color: var(--text); font-size: 0.96rem; }
.manager-row > small { color: var(--muted); font-size: 0.74rem; }
.manager-head { min-height: 42px; background: var(--surface-alt); color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.manager-head > strong { color: inherit; font-size: inherit; }
.manager-row:not(.manager-head):hover { background: var(--figs-blue-light); }

.manager-class-table .manager-row { grid-template-columns: minmax(180px, 1.7fr) 120px 120px 100px 110px; }
.type-tag { display: inline-block; padding: 3px 7px; border: 1px solid var(--figs-navy); color: var(--figs-navy); font-size: 0.72rem; font-style: normal; font-weight: 700; }
.type-tag.group { border-color: var(--accent); }
.manager-empty { margin: 0; padding: var(--s6) var(--s3); color: var(--muted); }

.class-detail {
  margin-top: var(--s8);
  padding: var(--s6);
  border-top: 6px solid var(--figs-navy);
  background: var(--surface-alt);
}

.class-detail-grid,
.class-schedule-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.class-detail-grid { margin-bottom: var(--s6); }
.class-detail-grid section { padding-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.class-detail-grid h3,
.class-schedule-columns h3 { margin: 0 0 var(--s2); color: var(--figs-navy); font-size: 0.9rem; }
.class-detail-grid p { margin: 0; color: var(--text-secondary); font-size: 0.86rem; }
.student-name-list { line-height: 1.9; }
.class-course-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.class-course-list li { display: grid; gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.class-course-list time { color: var(--figs-navy); font: 650 0.72rem/1.4 var(--font-latin); font-variant-numeric: tabular-nums; }

.student-list { margin-top: var(--s6); border-top: 2px solid var(--figs-navy); }
.student-list-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(200px, 2fr) 100px minmax(160px, 1.5fr); gap: var(--s4); align-items: center; min-height: 62px; padding: var(--s3); border-bottom: 1px solid var(--border); background: var(--surface); }
.student-list-row:hover { background: var(--figs-blue-light); }
.student-list-head { min-height: 42px; background: var(--surface-alt); color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.student-list-name { color: var(--figs-navy); font-size: 1rem; font-weight: 700; text-decoration: none; }
.student-list-row p { margin: 0; color: var(--text-secondary); font-size: 0.84rem; }

.schedule-manager-tools { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin: 0 0 var(--s4); }
.schedule-manager-tools .search-wrap { width: min(100%, 380px); margin: 0; }
.schedule-manager-tools .search-wrap input { min-height: 44px; }
.schedule-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.schedule-form .form-full { grid-column: 1 / -1; }
.schedule-search-results { margin: var(--s6) 0; border-top: 2px solid var(--figs-navy); }
.schedule-search-row { display: grid; grid-template-columns: 120px 100px minmax(120px, 1.3fr) minmax(140px, 1.5fr) minmax(110px, 1fr); gap: var(--s3); min-height: 52px; align-items: center; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; }
.schedule-search-row strong { color: var(--figs-navy); }
.schedule-search-head { min-height: 40px; background: var(--surface-alt); color: var(--muted); font-size: 0.7rem; font-weight: 700; }

@media (prefers-color-scheme: dark) {
  .admin-side-nav a:hover,
  .admin-side-nav a[aria-current="page"],
  .plain-close,
  .manager-row > strong,
  .text-action,
  .student-list-name,
  .class-detail-grid h3,
  .class-schedule-columns h3,
  .class-course-list time { color: #d6e4f0; }
  .manager-primary { background: #fafaf6; color: #14213d; }
  .manager-primary:hover { background: #d6e4f0; }
  .manager-secondary { border-color: #d6e4f0; color: #fafaf6; background: transparent; }
  .manager-secondary:hover,
  .manager-row:not(.manager-head):hover,
  .student-list-row:hover { background: #16466a; }
  .manager-form { background: #16466a; }
  .form-grid input,
  .form-grid select,
  .form-grid textarea { border-color: #d6e4f0; }
  .type-tag { border-color: #d6e4f0; color: #fafaf6; }
  .type-tag.group { border-color: #f47b55; }
}

/* Brand-editorial homepage: no custom photography or theme overlays */
.home-main { padding: 0; }

.home-cover {
  min-height: 520px;
  display: flex;
  align-items: center;
  padding: var(--s24) 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.home-cover-inner {
  position: relative;
  padding: var(--s12) clamp(24px, 6vw, 80px);
  border-left: 8px solid var(--figs-navy);
}

.home-cover-inner::before,
.home-cover-inner::after {
  position: absolute;
  left: -8px;
  width: 44px;
  height: 44px;
  border-color: var(--accent);
  content: "";
  pointer-events: none;
}

.home-cover-inner::before {
  top: 0;
  border-top: 4px solid var(--accent);
}

.home-cover-inner::after {
  bottom: 0;
  border-bottom: 4px solid var(--accent);
}

.cover-kicker {
  margin-bottom: var(--s6);
  color: var(--figs-navy);
  font: 750 0.72rem/1.2 var(--font-latin);
  letter-spacing: 0.14em;
}

.home-cover h1 {
  max-width: 860px;
  margin-bottom: var(--s6);
  color: var(--figs-ink);
}

.home-cover p:not(.cover-kicker) {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 1.06rem;
}

.cover-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: var(--s8);
  border-bottom: 2px solid var(--accent);
  color: var(--figs-navy);
  font-weight: 700;
  text-decoration: none;
}

.archive-section { padding: var(--s16) 0; background: var(--surface); }
.archive-muted { background: var(--surface-alt); }

.editorial-heading {
  display: grid;
  grid-template-columns: 2fr 7fr 3fr;
  align-items: end;
  gap: var(--s6);
  padding-bottom: var(--s6);
  border-bottom: 2px solid var(--border-strong);
}

.editorial-heading h2 { grid-column: 2; margin-bottom: 0; }
.editorial-heading > p:last-child { grid-column: 3; margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }

.workbench-section { min-height: 100vh; display: flex; align-items: flex-start; padding-top: var(--s16); }
.workbench-section .shell { width: min(calc(100% - 80px), 1120px); }
.workbench-section .editorial-heading h1 { grid-column: 2; margin: 0; font-size: clamp(2.6rem, 5vw, 4.5rem); }

.archive-list { margin: 0; padding: 0; list-style: none; }

.archive-list li {
  display: grid;
  grid-template-columns: 1fr 9fr 2fr;
  gap: var(--s6);
  align-items: center;
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--border);
}

.archive-list li > span {
  color: var(--figs-navy);
  font: 700 0.72rem/1.2 var(--font-latin);
  font-variant-numeric: tabular-nums;
}

.archive-list a { display: grid; gap: var(--s1); color: var(--text); text-decoration: none; }
.archive-list strong { font-size: 1.45rem; font-weight: 650; }
.archive-list em { color: var(--muted); font-size: 0.9rem; font-style: normal; }
.archive-list small { justify-self: end; color: var(--figs-navy); font: 650 0.75rem/1.2 var(--font-latin); }
.archive-list li:hover { border-bottom-color: var(--figs-navy); }
.archive-list li:hover strong { color: var(--figs-navy); }

/* Page headers and common layout */
.directory-head,
.profile-head {
  padding: var(--s16) 0 var(--s12);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.directory-head .shell,
.profile-head .shell { position: relative; }

.directory-head .shell::after,
.profile-head .shell::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  border-top: 8px solid var(--figs-navy);
  border-right: 8px solid var(--figs-navy);
  content: "";
  pointer-events: none;
}

.directory-head h1,
.profile-head h1 { margin: var(--s4) 0 0; max-width: 900px; font-size: clamp(2.05rem, 3.5vw, 3.45rem); line-height: 1.08; }

.intro,
.profile-subtitle {
  max-width: var(--reading);
  margin: var(--s4) 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--figs-navy);
  font-weight: 700;
  text-decoration: none;
}

main { padding: var(--s12) 0 var(--s16); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s6);
  padding-bottom: var(--s4);
  border-bottom: 2px solid var(--border-strong);
}

.section-heading h2 { margin-bottom: 0; }

.footer {
  padding: var(--s6) 0 var(--s8);
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: 500 0.75rem/1.5 var(--font-latin);
}

/* Inputs, buttons and control states */
input[type="text"],
input[type="search"],
input[type="date"] {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
}

input:hover { border-color: var(--figs-blue-mid); }
input::placeholder { color: var(--muted); opacity: 1; }

.search-wrap { max-width: 600px; margin-top: var(--s8); }
.search-wrap input { width: 100%; padding: 10px 12px; }

.filter,
.bulk-actions button,
.task-create button,
.date-stepper button,
.course-action,
.known-group-row button {
  min-height: 44px;
  border: 1px solid var(--figs-navy);
  border-radius: 0;
  background: var(--surface);
  color: var(--figs-navy);
  cursor: pointer;
  font-weight: 650;
}

.filter:hover,
.bulk-actions button:hover,
.date-stepper button:hover,
.known-group-row button:hover {
  background: var(--figs-blue-light);
  color: var(--figs-ink);
}

.filter:active,
.bulk-actions button:active,
.date-stepper button:active { background: var(--figs-navy); color: var(--figs-white); }

.filter.active,
.bulk-actions button:last-child,
.task-create button {
  background: var(--action);
  color: var(--action-text);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--figs-navy);
}

/* Student directory */
.student-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--s6);
  border-top: 2px solid var(--figs-navy);
}

.student-card {
  min-height: 136px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s6);
  padding: var(--s6);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.student-card:nth-child(even) { border-right: 0; }
.student-card:hover { background: var(--surface-brand); color: var(--text); }
.student-card h2 { margin: 0; font-size: 1.5rem; }
.student-card p { margin: var(--s1) 0 0; color: var(--muted); font-size: 0.84rem; }

.student-card-meta { display: grid; justify-items: end; gap: var(--s2); text-align: right; }

.badge,
.camp-mark,
.tags li {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--figs-navy);
  background: transparent;
  color: var(--figs-navy);
  font-size: 0.72rem;
  font-weight: 700;
}

.camp-mark { border-color: var(--accent); color: var(--text-secondary); }
.empty { display: none; padding: var(--s12) 0; text-align: center; }

/* Student profile */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s12);
}

.profile-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6);
  align-items: start;
}

.profile-side .profile-block { margin-bottom: 0; }

.profile-block {
  margin-bottom: var(--s8);
  padding-bottom: var(--s8);
  border-bottom: 1px solid var(--border);
}

.profile-main h2,
.profile-side h2 { margin: 0 0 var(--s4); font-size: 1.75rem; }

.facts,
.camp-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

.fact,
.summary,
.info-row,
.detail {
  padding: var(--s4);
  border: 1px solid var(--border);
  background: var(--surface);
}

.fact dt,
.summary h3,
.info-row h3,
.detail summary {
  color: var(--figs-navy);
  font-size: 0.82rem;
  font-weight: 700;
}

.fact dd { margin: var(--s2) 0 0; font-weight: 600; }
.summary p,
.info-row p,
.detail p { margin: var(--s2) 0 0; color: var(--text-secondary); font-size: 0.9rem; }

.summary-list,
.info-list,
.handoff-list { display: grid; gap: var(--s3); }

.detail summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.course-lesson { margin: var(--s3) 0 var(--s1) !important; color: var(--figs-navy) !important; font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }

.source-list { margin: 0; padding: 0; border-top: 2px solid var(--figs-navy); list-style: none; }
.source-list li { border-bottom: 1px solid var(--border); }
.source-list a { min-height: 48px; display: flex; justify-content: space-between; gap: var(--s4); align-items: center; padding: var(--s3) 0; text-decoration: none; font-size: 0.85rem; font-weight: 650; }
.source-list span:last-child { color: var(--accent); }

.side-note,
.schedule-guide {
  padding: var(--s6);
  border-top: 6px solid var(--figs-navy);
  background: var(--surface-brand);
}

.side-note h2 { font-size: 1.2rem; }
.side-note p { margin: var(--s2) 0 0; color: var(--text-secondary); font-size: 0.86rem; }

.camp-profile { padding-top: var(--s6); border-top: 2px solid var(--figs-navy); }
.camp-profile > header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.camp-profile > header h2,
.camp-profile > header p { margin: 0; }
.camp-profile > header p { color: var(--muted); font-size: 0.82rem; }
.camp-program-grid .info-row.full { grid-column: 1 / -1; }

/* Daily actions */
.action-page { max-width: 1120px; }

.action-toolbar,
.schedule-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s6);
  padding-bottom: var(--s4);
  border-bottom: 2px solid var(--figs-navy);
}

.action-toolbar label { display: block; margin-bottom: var(--s1); color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.action-toolbar input { padding: 8px 10px; }
.bulk-actions { display: flex; gap: var(--s2); }
.bulk-actions button,
.filter,
.date-stepper button { padding: 8px 12px; font-size: 0.78rem; }

.task-create { margin: var(--s6) 0; padding-bottom: var(--s6); border-bottom: 1px solid var(--border); }
.task-create form { display: flex; align-items: center; gap: var(--s3); }
.task-create input[type="text"] { min-width: 0; flex: 1; padding: 9px 12px; }
.task-create label { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; font-size: 0.82rem; }
.task-create button { padding: 8px 16px; }

.task-list,
.feedback-table { border-top: 2px solid var(--figs-navy); }

.task-item {
  display: grid;
  grid-template-columns: 1fr 84px 44px;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s1);
  border-bottom: 1px solid var(--border);
}

.task-item label { min-height: 44px; display: flex; align-items: center; gap: var(--s3); cursor: pointer; }
.task-item span { font-size: 0.94rem; }
.task-item.done span { color: var(--muted); text-decoration: line-through; }
.task-item small { color: var(--muted); font-size: 0.72rem; }
.task-item button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.25rem; }

.task-empty { padding: var(--s12) 0; border-bottom: 1px solid var(--border); }
.task-empty h2 { font-size: 1.75rem; }
.task-empty p:last-child { color: var(--muted); }
.local-note { margin: var(--s6) 0 0; }

/* Preparation */
.prep-section { margin-bottom: var(--s12); }
.prep-section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s6); padding-bottom: var(--s3); border-bottom: 2px solid var(--figs-navy); }
.prep-section-head h2 { margin: var(--s2) 0 0; font-size: 1.8rem; }
.prep-section-head p { margin: 0; color: var(--muted); font-size: 0.78rem; }

.prep-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(260px, 2fr) 144px;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--border);
}

.prep-row h3,
.prep-row p { margin: 0; }
.prep-row p { color: var(--text-secondary); font-size: 0.82rem; }
.prep-row label { min-height: 44px; display: flex; align-items: center; justify-self: end; gap: var(--s2); white-space: nowrap; font-size: 0.82rem; }
.prep-row.done { background: var(--figs-success-soft); }
.prep-row.done h3 { text-decoration: line-through; }
.prep-empty { padding: var(--s6) 0; color: var(--muted); }

.known-groups { margin-top: var(--s4); }
.known-groups summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--figs-navy); font-size: 0.82rem; font-weight: 650; }
.known-group-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.known-group-row button { padding: 6px 10px; }

/* Feedback */
.assistant-groups { display: grid; gap: var(--s8); }
.assistant-group { border-top: 4px solid var(--figs-navy); }
.assistant-group > header { display: flex; align-items: end; justify-content: space-between; gap: var(--s6); padding: var(--s4) 0; }
.assistant-group > header h2 { margin: var(--s2) 0 0; font-size: 1.75rem; }
.assistant-group > header > p { margin: 0; color: var(--muted); text-align: right; font-size: 0.76rem; }
.assistant-group > header strong { color: var(--figs-navy); font-variant-numeric: tabular-nums; }

.feedback-row {
  display: grid;
  grid-template-columns: 1.1fr 2fr 132px 132px;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--border);
}

.feedback-head { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.feedback-row strong { font-size: 0.95rem; }
.feedback-row p { margin: 0; color: var(--text-secondary); font-size: 0.78rem; }
.feedback-row label { min-height: 44px; display: flex; align-items: center; gap: var(--s2); white-space: nowrap; font-size: 0.78rem; }

/* Schedule */
.schedule-toolbar { margin-bottom: var(--s4); }
.date-stepper { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: var(--s2); }
.date-stepper input { min-width: 160px; padding: 8px 10px; }
.filter-set { display: flex; flex-wrap: wrap; gap: var(--s2); }

.schedule-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: var(--s8);
  border-block: 2px solid var(--figs-navy);
}

.schedule-summary article { padding: var(--s3); border-right: 1px solid var(--border); background: var(--surface); }
.schedule-summary article:last-child { border-right: 0; }
.schedule-summary span { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.schedule-summary strong { display: block; margin-top: var(--s1); color: var(--figs-navy); font: 700 1.65rem/1 var(--font-latin); font-variant-numeric: tabular-nums; }

.schedule-title { margin-bottom: var(--s3); }
.schedule-title h2 { font-size: 1.9rem; }
.schedule-day { margin: var(--s1) 0 0; color: var(--muted); font-size: 0.8rem; }

.schedule-view-switch { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
.schedule-view-switch .filter { min-width: 108px; }
.schedule-list-wrap { overflow-x: auto; border-top: 2px solid var(--figs-navy); }
.schedule-list { display: grid; min-width: 880px; }
.schedule-list-head,
.schedule-list-row {
  width: 100%;
  display: grid;
  grid-template-columns: 110px minmax(150px, 1.4fr) minmax(100px, .85fr) minmax(100px, .85fr) minmax(120px, 1fr) minmax(140px, 1.15fr);
  align-items: center;
  column-gap: var(--s3);
}
.schedule-list-head {
  min-height: 44px;
  padding: 0 var(--s3);
  border-bottom: 1px solid var(--figs-navy);
  background: var(--surface-alt);
  color: var(--figs-navy);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: .06em;
}
.schedule-list-row {
  min-height: 76px;
  padding: var(--s3);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--figs-navy);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.schedule-list-row:hover { background: var(--figs-blue-light); }
.schedule-list-row.group { border-left-color: var(--accent); }
.schedule-list-row time { color: var(--figs-navy); font: 700 0.9rem/1.25 var(--font-latin); font-variant-numeric: tabular-nums; }
.schedule-list-name { display: grid; gap: 2px; min-width: 0; }
.schedule-list-name small { color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.schedule-list-row strong { font-size: 0.98rem; }
.schedule-list-cell { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.45; }
.assistant-cell { white-space: normal; }
.schedule-list-row.cancelled { border-left-color: var(--figs-error); background: var(--figs-error-soft); color: var(--figs-error); }
.schedule-list-row.cancelled strong { text-decoration: line-through; }

.matrix-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.schedule-matrix { min-width: max-content; }
.matrix-row { display: grid; border-bottom: 1px solid var(--border); }
.matrix-row:last-child { border-bottom: 0; }
.matrix-header { position: sticky; z-index: 3; top: 0; background: var(--figs-navy); color: var(--figs-white); }

.matrix-time,
.matrix-room,
.matrix-cell {
  min-height: 64px;
  padding: 6px;
  border-right: 1px solid var(--border);
}

.matrix-row > *:last-child { border-right: 0; }

.matrix-time {
  position: sticky;
  z-index: 2;
  left: 0;
  background: var(--surface-alt);
  color: var(--figs-navy);
  font: 700 0.76rem/1.25 var(--font-latin);
  font-variant-numeric: tabular-nums;
}

.matrix-header .matrix-time { z-index: 4; background: var(--figs-navy); color: var(--figs-white); }
.matrix-room { display: flex; align-items: center; color: inherit; font-size: 0.68rem; font-weight: 700; line-height: 1.25; }
.matrix-cell { display: grid; align-content: start; gap: var(--s1); background: var(--surface); }

.matrix-course {
  width: 100%;
  min-height: 52px;
  display: grid;
  gap: 2px;
  padding: 5px 6px;
  border: 0;
  border-left: 3px solid var(--figs-navy);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.matrix-course:hover { background: var(--figs-blue-light); }
.matrix-course.group { border-left-color: var(--accent); background: var(--figs-blue-light); }
.matrix-course.group:hover { background: var(--figs-coral-soft); }
.matrix-course span { color: var(--figs-navy); font-size: 0.6rem; font-weight: 750; }
.matrix-course strong { font-size: 0.76rem; line-height: 1.25; }
.matrix-course small { overflow: hidden; color: var(--text-secondary); font-size: 0.65rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.matrix-course.cancelled {
  border-left-color: var(--figs-error) !important;
  background: var(--figs-error-soft) !important;
  color: var(--figs-error);
  opacity: 0.82;
}

.matrix-course.cancelled strong { text-decoration: line-through; }
.matrix-course.cancelled span { color: var(--figs-error); }

.course-selected {
  position: relative;
  margin-top: var(--s4);
  padding: var(--s6);
  border: 1px solid var(--border);
  border-left: 6px solid var(--figs-navy);
  background: var(--surface-brand);
}

.course-selected h2 { margin: 0 0 var(--s4); padding-right: var(--s8); font-size: 1.8rem; }
.course-selected dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.course-selected dl div { padding-top: var(--s3); border-top: 1px solid var(--figs-wordmark); }
.course-selected dt { color: var(--figs-navy); font-size: 0.76rem; font-weight: 700; }
.course-selected dd { margin: var(--s1) 0 0; }
.selected-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--figs-navy); cursor: pointer; font-size: 1.5rem; }

.course-action { margin-top: var(--s4); padding: 8px 12px; }
.course-action.danger { border-color: var(--figs-error); color: var(--figs-error); }
.course-action.danger:hover { background: var(--figs-error-soft); }
.cancel-note { margin: var(--s4) 0 0; padding: var(--s3); border-left: 4px solid var(--figs-error); background: var(--figs-error-soft); color: var(--figs-error); font-size: 0.82rem; }

.schedule-empty { padding: var(--s12); border: 1px solid var(--border); background: var(--surface); }
.schedule-empty h3 { font-size: 1.6rem; }
.schedule-empty p:last-child { margin-bottom: 0; color: var(--muted); }

.schedule-guide { display: flex; justify-content: space-between; gap: var(--s8); margin-top: var(--s8); }
.schedule-guide > div { max-width: 760px; }
.schedule-guide h2 { margin: var(--s2) 0 0; font-size: 1.75rem; }
.schedule-guide p:last-child { margin: var(--s3) 0 0; color: var(--text-secondary); }
.template-link { align-self: flex-end; flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--figs-navy); color: var(--figs-navy); font-weight: 650; text-decoration: none; }
.template-link:hover { background: var(--figs-navy); color: var(--figs-white); }

/* Dark mode is an explicit FIGS mapping, not an inversion */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #14213d;
    --surface: #1f3a5f;
    --surface-alt: #051c2c;
    --surface-brand: #16466a;
    --text: #fafaf6;
    --text-secondary: #d6e4f0;
    --muted: #d6e4f0;
    --border: #263a52;
    --border-strong: #fafaf6;
    --action: #fafaf6;
    --action-text: #14213d;
    --focus: #31d7ff;
  }

  .site-header { background: #003057; border-color: #263a52; }
  .sidebar-primary a:hover,
  .sidebar-primary a[aria-current="page"] { color: #fafaf6; background: #16466a; }
  .sidebar-secondary a:hover,
  .sidebar-secondary a[aria-current="page"] { color: #fafaf6; }
  .nav-links a,
  .nav-links a:visited { color: #fafaf6; }
  .nav-links a:hover,
  .nav-links a[aria-current="page"] { color: #ffffff; }
  .eyebrow,
  .toolbar-label,
  .cover-kicker,
  .cover-link,
  .archive-list li > span,
  .archive-list small,
  .vertical-index a:hover,
  .back,
  .fact dt,
  .summary h3,
  .info-row h3,
  .detail summary,
  .source-list span:last-child,
  .assistant-group > header strong,
  .schedule-summary strong,
  .course-selected dt,
  .selected-close { color: #d6e4f0; }
  .home-cover h1 { color: #fafaf6; }
  .home-cover-inner { border-left-color: #ffffff; }
  .directory-head .shell::after,
  .profile-head .shell::after { border-color: #d6e4f0; }
  input[type="date"] { color-scheme: dark; }
  .filter,
  .bulk-actions button,
  .task-create button,
  .date-stepper button,
  .course-action,
  .known-group-row button,
  .badge,
  .tags li,
  .template-link { border-color: #d6e4f0; color: #fafaf6; }
  .filter:hover,
  .bulk-actions button:hover,
  .date-stepper button:hover,
  .known-group-row button:hover { background: #16466a; color: #ffffff; }
  .filter.active,
  .bulk-actions button:last-child,
  .task-create button { background: #fafaf6; color: #14213d; }
  .student-card:hover,
  .matrix-course:hover { background: #16466a; }
  .camp-mark { border-color: #f47b55; color: #fafaf6; }
  .prep-row.done { background: #004a50; }
  .matrix-course { border-left-color: #31d7ff; }
  .matrix-course.group { border-left-color: #f47b55; background: #16466a; }
  .matrix-course.group:hover { background: #263a52; }
  .matrix-course span { color: #d6e4f0; }
  .matrix-header,
  .matrix-header .matrix-time { background: #003057; }
  .course-selected dl div { border-color: #d6e4f0; }
  .matrix-course.cancelled { background: #4b0b30 !important; color: #ffe1df; }
  .matrix-course.cancelled span { color: #ffe1df; }
  .cancel-note { background: #4b0b30; color: #ffe1df; }
  .schedule-list-row:hover { background: #16466a; }
  .schedule-list-row time { color: #d6e4f0; }
  .schedule-list-row.cancelled { background: #4b0b30; color: #ffe1df; }
}

/* Responsive FIGS 4 / 8 / 12 column behavior */
@media (max-width: 1279px) {
  .vertical-index,
  .admin-side-nav { display: none; }
}

@media (max-width: 959px) {
  body { padding-left: 0; }
  .app-sidebar { position: relative; width: 100%; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .app-sidebar-inner { min-height: 0; padding: 20px 16px; }
  .sidebar-brand { width: 300px; }
  .sidebar-primary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s1); margin-top: var(--s4); }
  .sidebar-primary a { min-height: 44px; display: flex; justify-content: center; padding: 6px 3px; border-left: 0; border-bottom: 2px solid transparent; font-size: 0.76rem; text-align: center; }
  .sidebar-primary a span { display: none; }
  .sidebar-primary a:hover,
  .sidebar-primary a[aria-current="page"] { border-left: 0; border-bottom-color: var(--accent); }
  .sidebar-student-subnav { grid-column: 1 / -1; display: flex; gap: var(--s3); margin: 0; padding: var(--s2) 0; overflow-x: auto; border-left: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .sidebar-student-subnav a { width: auto; min-height: 30px; flex: 0 0 auto; padding: 3px 5px; font-size: 0.7rem; white-space: nowrap; }
  .sidebar-secondary { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: var(--s4); padding-top: var(--s4); }
  .sidebar-secondary p { width: 100%; }
  .sidebar-secondary a { min-height: 32px; font-size: 0.76rem; }
}

@media (max-width: 600px) {
  .sidebar-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-primary a { font-size: 0.74rem; }
}

@media (max-width: 1023px) {
  .shell { width: min(calc(100% - 48px), var(--container)); }
  .editorial-heading { grid-template-columns: 1fr 3fr; }
  .editorial-heading h2 { grid-column: 2; }
  .editorial-heading > p:last-child { grid-column: 2; }
  .profile-layout { grid-template-columns: 1fr; gap: 0; }
  .profile-side { grid-template-columns: 1fr; margin-top: var(--s6); }
  .schedule-guide { flex-direction: column; }
  .template-link { align-self: flex-start; }
}

@media (max-width: 767px) {
  .shell { width: min(calc(100% - 32px), var(--container)); }

  .nav {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: var(--s3);
    padding: var(--s4) 0;
  }

  .brand-lockup img { width: 300px; max-width: calc(100vw - 20px); }
  .nav-links { width: 100%; justify-content: space-between; gap: var(--s3); font-size: 0.82rem; }
  .nav-links a { min-height: 44px; }

  .home-cover { min-height: 0; padding: var(--s16) 0; }
  .home-cover-inner { padding: var(--s8) var(--s6); }
  .home-cover h1 { font-size: clamp(2.35rem, 11vw, 3.4rem); }
  .home-cover p:not(.cover-kicker) { font-size: 1rem; }

  .archive-section { padding: var(--s12) 0; }
  .editorial-heading { display: block; }
  .editorial-heading h2 { margin-top: var(--s3); }
  .editorial-heading > p:last-child { margin-top: var(--s2); }
  .archive-list li { grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); }
  .archive-list small { display: none; }
  .archive-list strong { font-size: 1.2rem; }
  .workbench-section { min-height: 0; padding-top: var(--s8); }
  .workbench-section .shell { width: min(calc(100% - 32px), 1120px); }
  .workbench-section .editorial-heading h1 { margin-top: var(--s3); }

  .directory-head,
  .profile-head { padding: var(--s12) 0 var(--s8); }
  .directory-head .shell::after,
  .profile-head .shell::after { width: 40px; height: 40px; border-width: 5px; }
  .directory-head h1,
  .profile-head h1 { font-size: clamp(2rem, 10vw, 3rem); }
  main { padding: var(--s8) 0 var(--s12); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: var(--s2); }

  .student-grid { grid-template-columns: 1fr; }
  .student-card,
  .student-card:nth-child(even) { min-height: 0; border-right: 0; }
  .student-card { align-items: stretch; flex-direction: column; }
  .student-card-meta { justify-items: start; text-align: left; }

  .manager-toolbar,
  .schedule-manager-tools,
  .room-toolbar { align-items: stretch; flex-direction: column; gap: var(--s3); }
  .manager-toolbar .manager-primary,
  .schedule-manager-tools .manager-primary { width: 100%; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .room-card { min-height: 126px; padding: var(--s2); }
  .manager-form { padding: var(--s4); }
  .form-grid,
  .schedule-form .form-grid,
  .class-detail-grid,
  .class-schedule-columns { grid-template-columns: 1fr; }
  .form-full { grid-column: auto; }
  .manager-table-wrap { width: calc(100% + 32px); margin-left: -16px; }
  .manager-table { min-width: 680px; }
  .student-list { width: calc(100% + 32px); margin-left: -16px; overflow-x: auto; }
  .student-list-row { min-width: 680px; }
  .schedule-manager-tools .search-wrap { width: 100%; }
  .schedule-search-results { width: calc(100% + 32px); margin-left: -16px; overflow-x: auto; }
  .schedule-search-row { min-width: 660px; }

  .facts,
  .camp-program-grid { grid-template-columns: 1fr; }
  .camp-program-grid .info-row.full { grid-column: auto; }
  .camp-profile > header { align-items: flex-start; flex-direction: column; }

  .action-toolbar,
  .schedule-toolbar { align-items: stretch; flex-direction: column; gap: var(--s3); }
  .action-toolbar > div:first-child,
  .action-toolbar input { width: 100%; }
  .bulk-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .bulk-actions button { width: 100%; }

  .task-create form { align-items: stretch; flex-direction: column; }
  .task-create label { min-height: 44px; }
  .task-item { grid-template-columns: 1fr 68px 44px; gap: var(--s2); }

  .prep-section-head { align-items: flex-start; flex-direction: column; gap: var(--s2); }
  .prep-row { grid-template-columns: 1fr; gap: var(--s2); }
  .prep-row label { justify-self: start; }
  .known-group-row { align-items: flex-start; }

  .assistant-group > header { align-items: flex-start; flex-direction: column; gap: var(--s2); }
  .assistant-group > header > p { text-align: left; }
  .feedback-head { display: none; }
  .feedback-row { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .feedback-row > div:first-child,
  .feedback-row > div:nth-child(2) { grid-column: 1 / -1; }
  .feedback-row label { border-top: 1px solid var(--border); }

  .date-stepper { grid-template-columns: auto minmax(0, 1fr) auto; }
  .date-stepper input { min-width: 0; width: 100%; }
  .filter-set { display: grid; grid-template-columns: repeat(3, 1fr); }
  .filter { padding-inline: 6px; }

  .schedule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-summary article { border-bottom: 1px solid var(--border); }
  .schedule-summary article:nth-child(even) { border-right: 0; }
  .schedule-summary article:last-child { grid-column: 1 / -1; border-bottom: 0; }

  .matrix-wrap { width: calc(100% + 32px); max-width: none; margin-left: -16px; border-inline: 0; }
  .matrix-time,
  .matrix-room,
  .matrix-cell { min-height: 58px; padding: 5px; }
  .matrix-course { min-height: 48px; padding: 4px 5px; }
  .matrix-course strong { font-size: 0.72rem; }
  .matrix-course small { font-size: 0.62rem; }
  .schedule-view-switch { display: grid; grid-template-columns: 1fr 1fr; }
  .schedule-view-switch .filter { width: 100%; min-width: 0; }
  .schedule-list-wrap { width: calc(100% + 32px); margin-left: -16px; }
  .schedule-list { min-width: 780px; }
  .schedule-list-head,
  .schedule-list-row { grid-template-columns: 90px minmax(130px, 1.35fr) minmax(80px, .8fr) minmax(80px, .8fr) minmax(100px, .95fr) minmax(120px, 1.1fr); gap: var(--s2); }
  .schedule-list-row { min-height: 68px; padding: var(--s2); }
  .schedule-list-row strong { font-size: 0.9rem; }

  .course-selected { padding: var(--s6) var(--s4); }
  .course-selected dl { grid-template-columns: 1fr; }
  .schedule-guide { padding: var(--s6) var(--s4); }
}

@media (max-width: 359px) {
  .shell { width: calc(100% - 28px); }
  .nav-links { font-size: 0.76rem; }
  .date-stepper button { padding-inline: 7px; }
  .task-item { grid-template-columns: 1fr 54px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root { color-scheme: light; }
  body { background: #ffffff; color: #000000; }
  .site-header,
  .vertical-index,
  .filter-set,
  .bulk-actions,
  .footer { display: none; }
  a { color: inherit; text-decoration: none; }
  .shell { width: 100%; }
  .matrix-wrap { overflow: visible; }
}

/* Student score records */
.score-section { display: grid; gap: var(--s6); }
.score-section-head,
.score-record-head,
.score-form-head { display: flex; align-items: start; justify-content: space-between; gap: var(--s4); }
.score-section-head h2,
.score-form-head h3 { margin: var(--s2) 0; }
.score-section-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 0.84rem; }
.score-record-list { display: grid; gap: var(--s4); }
.score-record { border: 1px solid var(--border); border-left: 4px solid var(--figs-navy); background: var(--surface); }
.score-record-head { padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--border); }
.score-record-head .eyebrow { margin-bottom: var(--s2); }
.score-record-head h3 { margin: 0; font-size: 1.05rem; }
.score-record-head h3 + p { margin: var(--s1) 0 0; color: var(--muted); font-size: 0.76rem; }
.score-record-actions { display: flex; align-items: center; gap: var(--s3); }
.score-record-actions .text-action { font-size: 0.78rem; }
.score-delete { color: var(--muted); }
.score-values { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.score-values > div { min-height: 68px; padding: var(--s3); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.score-values > div:nth-child(6n) { border-right: 0; }
.score-values dt { margin-bottom: 3px; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.score-values dd { margin: 0; color: var(--text); font: 700 1.02rem/1.25 var(--font-latin); font-variant-numeric: tabular-nums; }
.score-values .score-total { background: var(--surface-brand); }
.score-values .score-empty { grid-column: 1 / -1; display: flex; align-items: center; color: var(--muted); font-size: 0.8rem; }
.score-trend-line { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: var(--s3); align-items: center; min-height: 54px; padding: var(--s3) var(--s4); background: var(--surface-alt); }
.score-trend-line > strong { color: var(--figs-navy); font-size: 0.78rem; }
.score-trend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0; font-size: 0.82rem; font-weight: 700; }
.score-trend-up { color: #c92d2d; }
.score-trend-down { color: #277e55; }
.score-trend-neutral { color: var(--muted); font-weight: 500; }
.score-form { padding: var(--s6); border-top: 5px solid var(--figs-navy); background: var(--surface-brand); }
.score-form-head { margin-bottom: var(--s4); }
.score-input-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
.score-input-grid label { display: grid; gap: var(--s1); color: var(--text-secondary); font-size: 0.76rem; font-weight: 700; }
.score-input-grid input { min-width: 0; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 0; padding: var(--s2); background: var(--surface); color: var(--text); font: 400 0.86rem/1.2 var(--font-latin); }
.score-input-grid .score-wide { grid-column: span 2; }
.score-status { margin: 0; padding: var(--s4); border: 1px dashed var(--border); }

/* Compact desktop navigation */
@media (min-width: 960px) {
  .app-sidebar { width: 264px; }
  .app-sidebar-inner { padding: 18px 12px; }
  .sidebar-brand,
  .sidebar-brand img { width: 236px; }
  .sidebar-primary { margin-top: 28px; }
  .sidebar-primary a { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; padding-inline: 6px; font-size: 0.82rem; }
  .sidebar-secondary { padding-top: 18px; }
  body { padding-left: 264px; }
}

@media (max-width: 767px) {
  .score-section-head { align-items: stretch; flex-direction: column; }
  .score-section-head .manager-primary { width: 100%; }
  .score-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-values > div:nth-child(6n) { border-right: 1px solid var(--border); }
  .score-values > div:nth-child(3n) { border-right: 0; }
  .score-trend-line { grid-template-columns: 1fr; gap: var(--s1); }
  .score-input-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-input-grid .score-wide { grid-column: 1 / -1; }
}
