/*
 * Oaks Classical portal — project-wide UI/UX standards pass
 *
 * This layer intentionally sits after the legacy component stylesheet. It
 * unifies every role and workspace without changing Vue bindings, visibility
 * gates, routes, or actions.
 */

:root {
  --ink: #1c2923;
  --muted: #5d6b64;
  --line: #d5ded8;
  --paper: #f3f6f3;
  --surface: #ffffff;
  --forest: #255340;
  --forest-strong: #173c2e;
  --forest-soft: #e9f1ed;
  --blue: #315f7b;
  --gold: #a5762d;
  --gold-soft: #fbf3e3;
  --red: #a33f3f;
  --red-soft: #fff1ef;
  --info-soft: #edf4f8;
  --shadow: 0 12px 36px rgba(28, 41, 35, 0.08);
  --shadow-raised: 0 24px 72px rgba(22, 42, 33, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --content-width: 1440px;
  --focus-ring: #c18a32;
  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --portal-nav-height: 68px;
  --portal-context-height: 62px;
  --portal-public-nav-height: 76px;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(circle at 100% 0, rgba(191, 207, 197, 0.22), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-width: 280px;
  overflow-x: clip;
}

::selection {
  background: #dcebe3;
  color: var(--forest-strong);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

.skip-link {
  background: var(--forest-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-raised);
  color: #fff;
  left: 18px;
  min-height: 44px;
  padding: 10px 16px;
  position: fixed;
  top: 0;
  transform: translateY(-130%);
  transition: transform 150ms ease;
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
}

html body button:focus-visible,
html body a:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body summary:focus-visible,
html body [tabindex]:focus-visible {
  box-shadow: 0 0 0 4px rgba(193, 138, 50, 0.25) !important;
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}

html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible {
  border-color: var(--forest) !important;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1,
.paperwork-hero h2,
.student-portal-hero h2,
.dashboard-hero h2,
.public-portal-section h1,
.public-portal-section h2 {
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(1.6rem, 2.1vw, 2.05rem);
  font-weight: 600;
  line-height: 1.12;
}

h2 {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

p {
  line-height: 1.62;
}

small {
  line-height: 1.45;
}

button,
a {
  border-radius: var(--radius-sm);
  font-weight: 600;
  min-height: 42px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

button {
  line-height: 1.2;
}

button:not(:disabled):active,
a:active {
  transform: translateY(1px);
}

button:disabled {
  filter: grayscale(0.25);
  opacity: 0.58;
}

.ghost {
  background: #fff;
  border-color: #c9d4ce;
  color: var(--forest-strong);
}

.ghost:hover {
  background: var(--forest-soft);
  border-color: #9fb8aa;
  color: var(--forest-strong);
}

.danger-link,
.danger-button {
  background: #fff;
  border: 1px solid #e3b9b4;
  color: var(--red);
}

.danger-link:hover,
.danger-button:hover {
  background: var(--red-soft);
  border-color: #cd8f88;
  color: #822f2f;
}

/* Login and invitation */

.public-site {
  background:
    linear-gradient(135deg, rgba(21, 55, 42, 0.98), rgba(39, 78, 61, 0.94)),
    var(--forest-strong);
  min-height: 100vh;
  min-height: 100svh;
}

.portal-public-nav {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(213, 222, 216, 0.85);
  min-height: var(--portal-public-nav-height);
  padding: 7px clamp(18px, 4vw, 64px);
  padding-left: max(clamp(18px, 4vw, 64px), env(safe-area-inset-left));
  padding-right: max(clamp(18px, 4vw, 64px), env(safe-area-inset-right));
}

.portal-public-nav .public-brand img {
  height: 56px;
  object-fit: contain;
  width: 176px;
}

.portal-public-nav nav a {
  background: var(--forest-soft);
  border: 1px solid #d5e2db;
  color: var(--forest-strong);
  padding-inline: 16px;
}

.portal-public-nav nav a:hover {
  background: #dceae3;
  border-color: #acc2b6;
}

.public-portal-section {
  align-items: center;
  background:
    radial-gradient(circle at 16% 18%, rgba(218, 192, 138, 0.16), transparent 22rem),
    radial-gradient(circle at 82% 75%, rgba(140, 174, 154, 0.18), transparent 26rem),
    linear-gradient(135deg, #173a2d, #214b3a 58%, #18382c);
  gap: clamp(30px, 6vw, 88px);
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  min-height: calc(100vh - var(--portal-public-nav-height));
  min-height: calc(100svh - var(--portal-public-nav-height));
  padding: clamp(30px, 6vmin, 76px) clamp(24px, 6vw, 88px);
  padding-left: max(clamp(24px, 6vw, 88px), env(safe-area-inset-left));
  padding-right: max(clamp(24px, 6vw, 88px), env(safe-area-inset-right));
}

.public-portal-section > div {
  max-width: 680px;
  min-width: 0;
}

.public-portal-section > div > p:not(.eyebrow) {
  color: #dbe8e1;
  font-size: 1.05rem;
}

.public-portal-section .eyebrow {
  color: #efd49d;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-portal-section :is(h1, h2) {
  color: #fff;
  font-size: clamp(2rem, min(3.8vw, 7vh), 3.5rem);
  font-weight: 400;
  line-height: 1.06;
  max-width: 13ch;
  overflow-wrap: anywhere;
}

.login-card.public-login-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(7, 25, 17, 0.32);
  gap: 18px;
  max-width: 460px;
  min-width: 0;
  padding: clamp(24px, 4vw, 36px);
  width: 100%;
}

.public-login-card > img {
  height: clamp(96px, 15vh, 128px);
  margin-bottom: 2px;
  max-width: 250px;
  object-fit: contain;
  width: 100%;
}

.public-login-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.public-login-card button[type="submit"] {
  min-height: 48px;
}

.form-error,
.form-success,
.notice-band {
  border-radius: var(--radius-sm);
  line-height: 1.45;
  padding: 11px 13px;
}

.form-error,
.notice-band.error {
  background: var(--red-soft);
  border-color: #e5b4ae;
  color: #852e2e;
}

.form-success,
.notice-band.success {
  background: #eaf6ee;
  border-color: #b9d8c4;
  color: #22593a;
}

/* Portal shell and navigation */

main {
  min-height: 100vh;
  min-height: 100svh;
}

main :is(h1, h2, h3, h4, p, strong, small) {
  overflow-wrap: anywhere;
}

.topnav {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(204, 216, 208, 0.92);
  box-shadow: 0 8px 26px rgba(25, 49, 37, 0.07);
  gap: 16px;
  min-height: var(--portal-nav-height);
  padding: 7px clamp(18px, 3vw, 44px);
  padding-left: max(clamp(18px, 3vw, 44px), env(safe-area-inset-left));
  padding-right: max(clamp(18px, 3vw, 44px), env(safe-area-inset-right));
  z-index: 100;
}

.topnav-brand {
  gap: 10px;
  min-height: 48px;
  min-width: 214px;
}

.topnav-brand > div,
.account-stack {
  min-width: 0;
}

.topnav-brand img {
  background: #fff;
  border-color: #dbe4de;
  border-radius: 10px;
  flex: 0 0 auto;
  height: 44px;
  object-fit: contain;
  padding: 2px;
  width: 44px;
}

.topnav-brand strong {
  color: var(--forest-strong);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.topnav-brand span {
  font-size: 0.73rem;
}

.topnav-brand strong,
.topnav-brand span,
.account-stack strong,
.account-stack span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav-links {
  gap: 3px;
}

.topnav-links button {
  border: 1px solid transparent;
  border-radius: 9px;
  color: #324039;
  min-height: 38px;
  padding-inline: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.topnav-links button:hover {
  background: #f1f5f2;
  color: var(--forest);
}

.topnav-links button.active {
  background: var(--forest-soft);
  border-color: #d4e4db;
  color: var(--forest-strong);
  box-shadow: inset 0 -2px 0 #3e745d;
}

.account-menu-trigger {
  border-color: #d5dfd9;
  max-width: min(22vw, 210px);
  min-height: 40px;
  padding: 5px 30px 5px 11px;
}

.account-menu-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-trigger::after {
  content: "";
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  height: 0;
  transition: transform 140ms ease;
  width: 0;
}

.account-menu.open .account-menu-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.account-menu-dropdown,
.admin-menu div {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  min-width: 190px;
  padding: 6px;
}

.account-menu-dropdown button,
.admin-menu div button {
  min-height: 38px;
}

.account-menu-role {
  border-bottom: 1px solid #e1e8e3;
  gap: 5px;
  margin-bottom: 3px;
  padding: 5px 5px 9px;
}

.account-menu-role span {
  color: #6b7771;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-menu-role select {
  min-height: 34px;
  width: 100%;
}

.account-menu-dropdown .account-menu-signout {
  color: #7b3131;
}

.account-menu-dropdown .account-menu-signout:hover {
  background: #fbefef;
  color: #692626;
}

.view-as-switcher {
  gap: 6px;
}

.view-as-switcher span {
  color: #6b7771;
  letter-spacing: 0.06em;
}

.view-as-switcher select {
  min-height: 36px;
}

.portal-mobile-menu-button {
  border-radius: 10px;
}

.topbar {
  background: rgba(249, 250, 248, 0.94);
  border-bottom-color: #dfe6e1;
  min-height: var(--portal-context-height);
  padding: 11px clamp(18px, 3vw, 44px);
  padding-left: max(clamp(18px, 3vw, 44px), env(safe-area-inset-left));
  padding-right: max(clamp(18px, 3vw, 44px), env(safe-area-inset-right));
}

.topbar h1 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.topbar .eyebrow {
  color: #7f673a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.workspace {
  margin-inline: auto;
  max-width: var(--content-width);
  padding: clamp(18px, 2.4vw, 28px) clamp(18px, 3vw, 44px) 56px;
  padding-left: max(clamp(18px, 3vw, 44px), env(safe-area-inset-left));
  padding-right: max(clamp(18px, 3vw, 44px), env(safe-area-inset-right));
  width: 100%;
}

/* Shared surfaces and information hierarchy */

.panel,
.member-admin-shell,
.member-detail,
.profile-box,
.family-overview-card,
.family-edit-panel,
.school-portal-card,
.summary-grid article,
.admin-stat-strip article,
.lower-grade-group-card,
.rules-section,
.trade-structure-grid article,
.trade-area-grid article,
.upper-info-grid article,
.upper-fees-grid section,
.upper-schedule-grid section,
.upper-financial-note {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 7px 22px rgba(28, 41, 35, 0.045);
}

.panel {
  margin-bottom: 18px;
}

.panel-head {
  background: linear-gradient(180deg, #fff, #fcfdfc);
  border-bottom-color: #e1e8e3;
  gap: 14px;
  min-height: 62px;
  padding: 15px 18px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 1.08rem;
  font-weight: 600;
}

.panel-head > span {
  font-size: 0.82rem;
  font-weight: 600;
}

.panel-actions {
  align-items: center;
}

.eyebrow {
  color: #84642c;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paperwork-hero,
.student-portal-hero,
.dashboard-hero {
  align-items: center;
  border: 1px solid rgba(118, 151, 134, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 20px;
  min-height: 0;
  overflow: hidden;
  padding: clamp(18px, 2.5vw, 28px);
}

.paperwork-hero > *,
.student-portal-hero > *,
.dashboard-hero > * {
  min-width: 0;
}

.paperwork-hero {
  background:
    radial-gradient(circle at 100% 0, rgba(165, 118, 45, 0.1), transparent 20rem),
    #fff;
}

.student-portal-hero,
.dashboard-hero {
  background:
    radial-gradient(circle at 90% 12%, rgba(215, 190, 135, 0.17), transparent 19rem),
    linear-gradient(135deg, #173b2d, #285540);
}

.hero h2,
.student-portal-hero h2,
.dashboard-hero h2,
.setup-progress-band h2 {
  color: #fff;
}

.paperwork-hero h2,
.student-portal-hero h2,
.dashboard-hero h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.paperwork-hero .paperwork-stats {
  max-width: min(42vw, 480px);
}

.dashboard-grid,
.parent-dashboard-grid,
.teacher-dashboard-grid,
.admin-dashboard-grid,
.school-portal-grid,
.program-page-grid,
.lower-dashboard-grid,
.upper-dashboard-grid,
.calendar-layout {
  gap: 18px;
}

.dashboard-grid > *,
.parent-dashboard-grid > *,
.teacher-dashboard-grid > *,
.admin-dashboard-grid > *,
.school-portal-grid > *,
.program-page-grid > *,
.lower-dashboard-grid > *,
.upper-dashboard-grid > *,
.calendar-layout > * {
  min-width: 0;
}

.dashboard-focus-panel {
  border-top: 3px solid #4c7a65;
}

.admin-dashboard-grid .admin-panel-section {
  padding-bottom: 14px;
}

.dashboard-side-panel {
  border-top: 3px solid #c2a366;
}

.admin-stat-strip,
.school-stat-strip,
.people-stat-strip,
.summary-grid {
  gap: 12px;
}

.admin-stat-strip article,
.school-stat-strip article,
.summary-grid article {
  border-left: 3px solid #739782;
  gap: 4px;
  min-height: 88px;
  padding: 16px;
}

.admin-stat-strip span,
.school-stat-strip span,
.summary-grid span {
  color: #66736d;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-stat-strip strong,
.school-stat-strip strong,
.summary-grid strong {
  color: var(--forest-strong);
  font-size: clamp(1.22rem, 1.8vw, 1.55rem);
  font-weight: 700;
}

.status-pill {
  align-items: center;
  border: 1px solid #cad7d0;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: 28px;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-pill.complete,
.status-pill.ready,
.status-pill.active {
  background: #e8f5ed;
  border-color: #b8d7c3;
  color: #24593a;
}

.status-pill.overdue,
.status-pill.hidden {
  background: var(--red-soft);
  border-color: #e5b7b0;
  color: #853333;
}

.status-pill.next,
.status-pill.invited,
.status-pill.in {
  background: var(--gold-soft);
  border-color: #e7cf9e;
  color: #765318;
}

.student-empty-state {
  align-content: center;
  background:
    radial-gradient(circle at 0 100%, rgba(181, 207, 192, 0.18), transparent 14rem),
    #f8faf8;
  border: 1px dashed #cbd8d0;
  border-radius: var(--radius-md);
  margin: 16px;
  min-height: 118px;
  padding: 22px;
}

.student-empty-state strong {
  color: var(--forest-strong);
  font-size: 1rem;
  font-weight: 600;
}

.student-empty-state p {
  margin: 0;
  max-width: 62ch;
}

.notice-band {
  background: var(--info-soft);
  border: 1px solid #cedfe8;
  color: #34566a;
  margin: 14px 16px;
}

/* Forms, filters, menus, and actions */

label {
  gap: 7px;
}

label > span,
.field-note {
  color: #596760;
}

label > span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fff;
  border-color: #cbd6d0;
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding-inline: 12px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebfb5;
}

input::placeholder,
textarea::placeholder {
  color: #65716b;
  opacity: 1;
}

textarea {
  min-height: 112px;
  padding-block: 10px;
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f4f2;
  color: #65716b;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--forest);
  min-height: 20px;
  padding: 0;
  width: 20px;
}

input[type="file"] {
  background: #f7f9f7;
  min-height: 44px;
  padding: 7px;
}

input[type="file"]::file-selector-button {
  background: var(--forest-soft);
  border: 1px solid #c3d4ca;
  border-radius: 7px;
  color: var(--forest-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin-right: 10px;
  padding: 6px 10px;
}

.inline-check,
.check-option,
.subscription-row,
.in-person-check,
.access-checkbox-grid label,
.teacher-class-picker label {
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.check-option:hover,
.subscription-row:hover,
.access-checkbox-grid label:hover,
.teacher-class-picker label:hover {
  background: var(--forest-soft);
  border-color: #b7cdbf;
}

.school-content-form,
.compact-class-form,
.assignment-edit-form,
.class-editor-form,
.collective-editor-form,
.calendar-event-form,
.admin-announcement-form,
.add-family-form {
  gap: 14px;
}

.form-actions {
  align-items: center;
  border-top: 1px solid #e4eae6;
  gap: 9px;
  margin-top: 4px;
  padding-top: 15px;
}

.form-actions button {
  min-width: 108px;
}

.section-tabs {
  background: #e6ede8;
  border-color: #ccd8d1;
  border-radius: 11px;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: thin;
}

.section-tabs button {
  border-radius: 8px;
  min-height: 40px;
  white-space: nowrap;
}

.section-tabs button.active {
  box-shadow: 0 3px 10px rgba(28, 41, 35, 0.12);
}

details > summary {
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.member-collapsible > summary,
.filter-menu summary,
.calendar-legend summary,
.calendar-upcoming-panel summary {
  transition: background-color 140ms ease, color 140ms ease;
}

.member-collapsible > summary:hover,
.filter-menu summary:hover,
.calendar-legend summary:hover,
.calendar-upcoming-panel summary:hover {
  background: #f1f5f2;
}

.filter-options {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  padding: 10px;
}

.parent-dashboard-actions {
  gap: 9px;
  margin-bottom: 18px;
}

.parent-dashboard-actions button {
  min-height: 44px;
}

.assignment-bulk-actions {
  background: #f3f6f4;
  border: 1px solid #d9e2dc;
  border-radius: var(--radius-md);
  gap: 10px;
  margin: 12px;
  padding: 10px;
}

/* Lists, rows, cards, and tables */

.dashboard-task-list,
.dashboard-class-list,
.announcement-list,
.assignment-mini-list,
.teacher-assignment-list,
.school-material-list,
.assignment-list,
.admin-task-list,
.dashboard-action-list,
.collective-archive-list,
.calendar-upcoming-list,
.progress-record-list {
  gap: 10px;
}

.class-color-row,
.dashboard-class-list > button,
.announcement-list article,
.admin-announcement-list article,
.admin-task-list article,
.dashboard-action-list article,
.assignment-mini-list button,
.teacher-class-actions > div,
.teacher-assignment-list article,
.school-material-list article,
.assignment-list article,
.collective-archive-list article,
.calendar-upcoming-list article,
.person-summary-row,
.access-editor-row {
  background: #fff;
  border: 1px solid #dce4df;
  border-radius: 10px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.class-color-row:hover,
.dashboard-class-list > button:hover,
.admin-task-list article:hover,
.dashboard-action-list article:hover,
.assignment-mini-list button:hover,
.teacher-class-actions > div:hover,
.teacher-assignment-list article:hover,
.school-material-list article:hover,
.assignment-list article:hover,
.collective-archive-list article:hover,
.calendar-upcoming-list article:hover {
  background: #fbfdfb;
  border-color: #b9cabf;
  box-shadow: 0 5px 18px rgba(29, 54, 41, 0.07);
}

.class-color-row {
  border-left: 4px solid var(--class-color, #6f937f);
}

.class-color-row strong,
.dashboard-task-list strong,
.dashboard-class-list > button,
.dashboard-action-list strong,
.announcement-list article > strong,
.admin-task-list strong,
.assignment-mini-list strong {
  font-weight: 600;
}

/* Keep the inherited prototype typography on a predictable 400/600/700 scale. */

.academy-info-details summary,
.trade-coming-label,
.public-camp-grid summary,
.view-as-switcher span,
.section-tabs button.active,
.filter-menu summary::after,
.filter-menu summary span,
.admin-panel-section h3,
.parent-assignment-summary span,
.dismiss-announcement-button,
.assignment-count-row span,
.paperwork-stats span,
.class-summary-row span,
.calendar-weekdays span,
.student-prep-progress,
.avatar-block,
.photo-delete-button,
.people-directory-filters label span,
.directory-photo,
.member-profile-stats span,
.family-summary-strip span,
.setup-step-list span,
.student-row.table-head > span,
.paperwork-admin-head > span {
  font-weight: 700;
}

.admin-stat-strip span,
.family-login-email > span {
  font-weight: 700;
}

.file-button-grid button,
.filter-menu summary strong,
.parent-assignment-file,
.teacher-post-preview span,
.trade-vision-card p,
.student-chip-list span,
.calendar-event span,
.student-class-list span,
.back-school-files small,
.back-school-files .file-upload-button,
.program-chip-list span,
.directory-head span,
.download-note {
  font-weight: 600;
}

.collective-editor-options > summary,
.notice-band.error {
  font-weight: 600;
}

.people-directory-table small,
.people-directory-table button > span:not(:first-child) {
  font-weight: 400;
}

.public-portal-section .eyebrow {
  font-weight: 700;
}

.announcement-list article {
  border-left: 3px solid #b99a5d;
}

.dismiss-announcement-button,
.photo-delete-button {
  border-radius: 999px;
  min-height: 36px;
  width: 36px;
}

.assignment-row-actions,
.panel-actions,
.teacher-class-header-actions,
.member-edit-buttons,
.export-actions {
  gap: 8px;
}

.table-wrap {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a9b9b0 #eff3f0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th {
  background: #f2f6f3;
  color: #4c5e55;
  font-size: 0.75rem;
  letter-spacing: 0.055em;
  position: sticky;
  text-align: left;
  text-transform: uppercase;
  top: 0;
  z-index: 2;
}

th,
td {
  border-bottom-color: #e1e8e3;
  padding: 12px 14px;
  vertical-align: top;
}

tbody tr {
  transition: background-color 120ms ease;
}

tbody tr:nth-child(even) {
  background: #fbfcfb;
}

tbody tr:hover {
  background: #f1f6f3;
}

.book-panel .table-wrap {
  min-height: min(520px, 60vh);
}

.book-panel table {
  min-width: 780px;
}

.people-directory-table {
  border: 1px solid #dce4df;
  border-radius: var(--radius-md);
  margin: 14px;
  overflow: auto;
}

.people-directory-table button {
  border-radius: 0;
  min-height: 60px;
  padding: 11px 14px;
}

.people-directory-table button:hover {
  background: #f1f6f3;
}

.directory-photo {
  background: #dfeae4;
  color: var(--forest-strong);
  font-weight: 700;
}

/* Calendar */

.calendar-layout {
  align-items: start;
}

.calendar-year-summary {
  align-items: center;
  display: flex;
  gap: 18px;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding: 16px 18px;
}

.calendar-event-status {
  grid-column: 1 / -1;
  margin: 0;
}

.calendar-year-summary h2,
.calendar-year-summary p {
  margin: 0;
}

.calendar-year-summary h2 {
  font-size: 1.18rem;
  margin-top: 2px;
}

.calendar-year-summary p,
.calendar-year-summary > small {
  color: var(--muted);
}

.calendar-year-summary > small {
  max-width: 380px;
  text-align: right;
}

.calendar-panel {
  border-radius: var(--radius-lg);
}

.calendar-toolbar {
  background: #fcfdfc;
  border-bottom: 1px solid #dfe7e2;
  min-height: 66px;
  padding: 12px 16px;
}

.calendar-toolbar h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.calendar-toolbar > div {
  min-width: 0;
  text-align: center;
}

.calendar-toolbar > div small {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 2px;
}

.calendar-weekdays {
  background: #f0f5f1;
  border-bottom: 1px solid #dce5df;
}

.calendar-weekdays span {
  color: #596a61;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 9px;
  text-transform: uppercase;
}

.calendar-grid article {
  background: #fff;
  min-height: 118px;
  padding: 8px;
}

.calendar-grid article.muted {
  background: #f7f8f7;
}

.role-member .calendar-grid article.has-break {
  background: #eef5f0;
}

.calendar-grid article.today {
  background: #f4faf6;
  box-shadow: inset 0 0 0 2px #6e9a80;
}

.calendar-grid article.calendar-day-clickable {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.calendar-grid article.calendar-day-clickable:hover,
.calendar-grid article.calendar-day-clickable:focus-visible {
  background: #f3f8f5;
  box-shadow: inset 0 0 0 2px #8aa999;
  outline: 0;
}

.calendar-grid article > strong {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.calendar-grid article.today > strong {
  background: var(--forest);
  color: #fff;
}

.calendar-event {
  border-radius: 6px;
  min-height: 0;
  padding: 6px 7px;
  text-align: left;
}

.calendar-side-panel {
  overflow: hidden;
  padding: 0;
  position: sticky;
  top: 96px;
}

.calendar-side-panel > details {
  border: 0;
  border-bottom: 1px solid #dfe7e2;
  border-radius: 0;
  margin: 0;
  overflow: hidden;
}

.calendar-side-panel > details:last-child {
  border-bottom: 0;
}

.calendar-side-panel > details > summary,
.calendar-side-panel > details[open] > summary {
  background: #fff;
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 56px;
  padding: 13px 16px;
}

.calendar-side-panel > details > summary:hover {
  background: #f3f7f4;
}

.calendar-side-panel > details[open] > summary {
  background: #f8faf9;
  border-bottom: 1px solid #e1e8e3;
}

.calendar-side-panel > details > summary strong {
  color: var(--forest-strong);
  font-size: 0.78rem;
  letter-spacing: 0.075em;
  line-height: 1.2;
}

.calendar-side-panel > details > summary::after {
  border-color: #60736a;
  height: 9px;
  margin-right: 2px;
  width: 9px;
}

.calendar-admin-tool-actions {
  display: grid;
  padding: 12px 14px 14px;
}

.calendar-admin-tool-actions > div {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-admin-tool-actions button {
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.calendar-side-panel .calendar-legend,
.calendar-side-panel .calendar-upcoming-panel {
  border-top: 0;
  margin-top: 0;
}

.calendar-side-panel .calendar-legend-list,
.calendar-side-panel .calendar-upcoming-list,
.calendar-side-panel .student-empty-state {
  margin: 0;
  padding: 12px 14px 14px;
}

.calendar-side-panel .calendar-legend-list,
.calendar-side-panel .calendar-upcoming-list {
  gap: 8px;
}

.calendar-side-panel .calendar-upcoming-list article {
  padding: 11px 12px;
}

@media (max-width: 520px) {
  .calendar-admin-tool-actions > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

.calendar-upcoming-list small {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  line-height: 1.35;
  margin-top: 5px;
}

.calendar-event-editor-backdrop {
  align-items: stretch;
  background: rgba(16, 28, 21, 0.3);
  display: flex;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: 140;
}

.calendar-event-editor {
  background: #fff;
  box-shadow: -14px 0 38px rgba(15, 31, 25, 0.16);
  max-width: 470px;
  overflow-y: auto;
  padding: 24px;
  width: min(470px, 100%);
}

.calendar-event-editor > header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 16px;
}

.calendar-event-editor h2,
.calendar-event-editor p {
  margin: 0;
}

.calendar-event-editor header p {
  color: var(--muted);
  margin-top: 4px;
}

.calendar-event-editor form {
  display: grid;
  gap: 15px;
  padding-top: 18px;
}

.calendar-day-action-editor {
  max-width: 520px;
  width: min(520px, 100%);
}

.calendar-day-action-options {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.calendar-day-action-options button {
  display: grid;
  gap: 5px;
  padding: 16px;
  text-align: left;
}

.calendar-day-action-options button span {
  font-size: 0.86rem;
  font-weight: 500;
  opacity: 0.78;
}

.calendar-event-editor form > label {
  display: grid;
  gap: 6px;
}

.calendar-event-editor input[type="text"],
.calendar-event-editor input[type="date"],
.calendar-event-editor textarea {
  width: 100%;
}

.calendar-audience-options {
  border: 0;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}

.calendar-audience-options legend {
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.calendar-audience-options > div {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-audience-options > div button {
  background: #fff;
  border: 1px solid #cad7d0;
  color: var(--forest-strong);
  font-size: 0.78rem;
  min-height: 38px;
  padding: 7px 8px;
}

.calendar-audience-options > div button.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.calendar-staff-only-toggle,
.calendar-date-range-toggle {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  gap: 7px;
  justify-self: start;
}

.calendar-staff-only-toggle {
  margin-left: auto;
}

.calendar-staff-only-toggle input,
.calendar-date-range-toggle input {
  margin: 0;
}

.calendar-event-editor footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  padding-top: 16px;
}

@media (max-width: 620px) {
  .calendar-year-summary,
  .calendar-admin-tool-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-year-summary > small {
    text-align: left;
  }

  .calendar-admin-tool-actions > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-event-editor {
    padding: 18px;
  }

  .calendar-audience-options > div {
    grid-template-columns: 1fr;
  }

  .calendar-event-editor footer {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-event-editor footer > span {
    display: none;
  }
}

/* Collective, school, resources, program and family surfaces */

.collective-guide-panel {
  border-top: 4px solid #7b9f8b;
}

.collective-guide-header {
  background:
    radial-gradient(circle at 100% 0, rgba(188, 145, 70, 0.1), transparent 15rem),
    #fff;
  padding: clamp(18px, 3vw, 26px);
}

.collective-guide-groups,
.collective-editor-group,
.collective-break-editor,
.lower-grade-group-list,
.rules-content,
.upper-school-info-panel,
.trade-program-panel {
  gap: 16px;
}

.collective-guide-group,
.collective-editor-group,
.collective-break-editor,
.lower-grade-group-card,
.lower-subject-card,
.rules-card,
.trade-vision-card {
  border-radius: var(--radius-md);
}

.collective-guide-entry {
  border-bottom-color: #e0e7e2;
  padding-block: 10px;
}

.collective-day-tracker {
  background: var(--forest-soft);
  border-color: #c5d8cd;
  border-radius: var(--radius-md);
}

.program-intro {
  background:
    radial-gradient(circle at 92% 12%, rgba(187, 147, 73, 0.12), transparent 18rem),
    #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.file-button-grid button {
  background: #f8faf8;
  border: 1px solid #d8e2dc;
  color: var(--forest-strong);
  justify-content: flex-start;
  min-height: 64px;
  padding: 12px 15px;
  text-align: left;
}

.file-button-grid button:hover {
  background: var(--forest-soft);
  border-color: #b5cbbf;
}

.file-preview iframe {
  border-radius: var(--radius-md);
}

.school-class-card,
.lower-subject-card {
  background: #fbfdfb;
  border-color: #d9e2dc;
  border-radius: var(--radius-md);
}

.school-class-card:hover,
.lower-subject-card:hover {
  border-color: #b7cbbf;
  box-shadow: 0 7px 22px rgba(29, 54, 41, 0.07);
}

.class-tabs {
  background: #edf2ef;
  border-radius: 10px;
  gap: 4px;
  padding: 4px;
}

.class-tabs button {
  border-radius: 7px;
}

.class-admin-hub {
  border-top: 5px solid var(--class-color, #D8E6E0);
}

.class-admin-hub .class-admin-layout.direct-class-page {
  grid-template-columns: minmax(0, 1fr);
}

.class-admin-hub .class-admin-detail {
  min-width: 0;
  width: 100%;
}

.class-admin-hub > .panel-head {
  background: color-mix(in srgb, var(--class-color, #D8E6E0) 58%, white);
  scroll-margin-top: calc(var(--portal-nav-height) + 16px);
}

.class-admin-hub .class-tabs button.active {
  background: var(--class-color, #D8E6E0);
  border-color: color-mix(in srgb, var(--class-color, #D8E6E0) 72%, #4e6459);
  color: #203d32;
}

.class-admin-hub .assignment-submit-actions .inline-check {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 44px;
}

.class-admin-hub .hub-class-edit-form {
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px 0 0;
}

.student-class-sidebar {
  background: #f3f6f4;
  border-right-color: #dce5df;
}

.family-summary-strip {
  background: #f0f5f2;
  border-color: #d7e2db;
  border-radius: var(--radius-md);
}

.family-overview-card,
.family-edit-panel,
.family-required-forms {
  border-radius: var(--radius-md);
}

.family-profile-header {
  background:
    radial-gradient(circle at 95% 0, rgba(184, 145, 74, 0.12), transparent 16rem),
    linear-gradient(135deg, #fff, #f7faf8);
  border-radius: var(--radius-lg);
}

.paperwork-stats span,
.member-profile-stats span,
.student-chip-list span {
  border-radius: 999px;
}

/* Member administration and drawers */

.member-admin-shell {
  overflow: hidden;
}

.member-admin-layout {
  align-items: start;
  gap: 18px;
  padding: 16px;
}

.member-directory {
  border: 1px solid #d8e2dc;
  border-radius: var(--radius-md);
  max-height: calc(100vh - 210px);
  overflow: auto;
  position: sticky;
  top: 96px;
}

.member-directory > button {
  border-bottom-color: #e1e8e3;
  min-height: 68px;
  padding: 11px 12px;
}

.member-directory > button:hover,
.member-directory > button.active {
  background: var(--forest-soft);
}

.profile-section-grid {
  gap: 16px;
}

.profile-box {
  padding: 16px;
}

.profile-box.member-collapsible {
  padding: 0;
}

.profile-box.member-collapsible > summary {
  padding: 14px 16px;
}

.profile-box.member-collapsible[open] > summary {
  background: #f3f7f4;
  border-bottom: 1px solid #dfe7e2;
}

.subscription-row,
.access-editor-row,
.paperwork-admin-row,
.guardian-entry-row,
.student-entry-row {
  border-color: #dce4df;
}

.member-detail-overlay {
  align-items: stretch;
  backdrop-filter: blur(3px);
  background: rgba(15, 31, 24, 0.54);
  justify-content: flex-end;
  padding: 0;
  z-index: 200;
}

.member-detail-drawer {
  animation: portal-drawer-in 180ms ease-out both;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px 0 0 18px;
  box-shadow: -22px 0 70px rgba(7, 26, 17, 0.24);
  height: 100dvh;
  max-height: none;
  max-width: min(1040px, 92vw);
  overflow: auto;
  width: 100%;
}

.member-detail-header {
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: #dbe4de;
  padding: 18px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.member-drawer-actions {
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.96);
  border-top-color: #dbe4de;
  bottom: 0;
  padding: 13px 18px;
  position: sticky;
  z-index: 10;
}

.member-close-confirm-overlay {
  backdrop-filter: blur(3px);
  background: rgba(15, 31, 24, 0.58);
}

.member-close-confirm-dialog {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
  padding: 24px;
}

.parent-assignment-overlay {
  backdrop-filter: blur(3px);
  background: rgba(15, 31, 24, 0.58);
  z-index: 220;
}

.parent-assignment-dialog {
  animation: portal-modal-in 170ms ease-out both;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}

.parent-assignment-dialog-header {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px 24px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.parent-assignment-summary {
  background: #f2f6f3;
}

@keyframes portal-drawer-in {
  from {
    opacity: 0.5;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes portal-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Wide desktop navigation */

@media (min-width: 1081px) {
  .topnav {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topnav-collapsible {
    align-items: center;
    display: flex;
    gap: 16px;
    grid-column: 2;
    justify-content: space-between;
    min-width: 0;
  }

  .topnav-links {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topnav-links::-webkit-scrollbar {
    display: none;
  }

  .topnav-account {
    flex: 0 0 auto;
  }
}

/* Tablet and compact desktop */

@media (max-width: 1080px) {
  .topnav {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .portal-mobile-menu-button {
    border-color: #cdd9d2;
    display: grid;
    height: 46px;
    min-height: 46px;
    width: 46px;
  }

  .topnav-collapsible {
    background: #fff;
    border: 1px solid #d9e2dc;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-top: 2px;
    max-height: calc(100vh - 78px);
    max-height: calc(100svh - 78px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px;
  }

  .topnav-collapsible.open {
    display: grid;
  }

  .topnav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topnav-links button {
    justify-content: flex-start;
    min-height: 46px;
  }

  .topnav-account {
    align-items: center;
    border-top-color: #dce4df;
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: space-between;
    padding-top: 12px;
  }

  .account-menu,
  .account-menu-trigger {
    max-width: 100%;
  }

  .account-stack {
    justify-items: start;
    text-align: left;
  }

  .account-menu-dropdown {
    left: auto;
    margin-top: 8px;
    position: static;
    right: 0;
  }

  .simple-dashboard-grid,
  .compact-dashboard-hero + .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simple-dashboard-grid > :first-child,
  .compact-dashboard-hero + .dashboard-grid > :first-child {
    grid-column: 1 / -1;
  }

  .trade-area-grid,
  .lower-subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .public-portal-section {
    gap: 28px;
    grid-template-columns: 1fr;
  }

  .public-portal-section > div {
    margin-inline: auto;
    text-align: center;
  }

  .public-portal-section :is(h1, h2) {
    margin-inline: auto;
    max-width: 16ch;
  }

  .public-login-card {
    margin-inline: auto;
  }

  .paperwork-hero,
  .student-portal-hero,
  .dashboard-hero {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  .paperwork-hero .paperwork-stats {
    justify-content: flex-start;
    max-width: none;
  }

  .dashboard-grid,
  .simple-dashboard-grid,
  .compact-dashboard-hero + .dashboard-grid,
  .parent-dashboard-grid,
  .teacher-dashboard-grid,
  .admin-dashboard-grid,
  .school-portal-grid,
  .program-page-grid,
  .lower-dashboard-grid,
  .upper-dashboard-grid,
  .calendar-layout,
  .student-dashboard-grid,
  .student-class-page,
  .class-admin-layout,
  .direct-class-page,
  .paperwork-layout,
  .family-overview-grid,
  .member-admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .simple-dashboard-grid > :first-child,
  .compact-dashboard-hero + .dashboard-grid > :first-child {
    grid-column: auto;
  }

  .calendar-side-panel,
  .member-directory {
    max-height: none;
    position: static;
  }

  .member-directory {
    width: 100%;
  }

  .admin-announcement-form,
  .announcement-target-grid,
  .class-target-grid,
  .announcement-class-row,
  .school-content-form,
  .class-editor-form,
  .class-editor-fields,
  .collective-editor-meta,
  .collective-year-fields,
  .reporting-period-row,
  .paperwork-admin-row,
  .guardian-entry-row,
  .student-entry-row,
  .family-student-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-content-form > textarea,
  .school-content-form > .form-actions,
  .class-editor-form > .form-actions,
  .collective-editor-form > .form-actions,
  .admin-announcement-form > .form-actions,
  .paperwork-admin-row > .paperwork-file-list {
    grid-column: 1 / -1;
  }

  .upper-info-grid,
  .school-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Short laptops and landscape tablets */

@media (min-width: 641px) and (max-height: 720px) {
  :root {
    --portal-nav-height: 60px;
    --portal-context-height: 54px;
    --portal-public-nav-height: 66px;
  }

  .portal-public-nav {
    padding-block: 5px;
  }

  .portal-public-nav .public-brand img {
    height: 48px;
    width: 154px;
  }

  .public-portal-section {
    gap: clamp(24px, 4vw, 52px);
    padding-block: 20px;
  }

  .public-portal-section :is(h1, h2) {
    font-size: clamp(1.9rem, min(3.4vw, 6.5vh), 3rem);
  }

  .login-card.public-login-card {
    gap: 12px;
    padding: 18px 24px;
  }

  .public-login-card > img {
    height: 84px;
  }

  .public-login-card h3 {
    font-size: 1.25rem;
  }

  .topnav {
    padding-block: 5px;
  }

  .topnav-brand {
    min-height: 44px;
  }

  .topnav-brand img {
    height: 40px;
    width: 40px;
  }

  .topbar {
    padding-block: 8px;
  }

  .workspace {
    padding-top: 16px;
  }

  .paperwork-hero,
  .student-portal-hero,
  .dashboard-hero {
    margin-bottom: 16px;
    padding: 16px 18px;
  }
}

@media (min-width: 760px) and (max-width: 900px) and (max-height: 620px) {
  .public-portal-section {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    padding-inline: 28px;
  }

  .public-portal-section > div {
    margin-inline: 0;
    text-align: left;
  }

  .public-portal-section :is(h1, h2) {
    margin-inline: 0;
    max-width: 13ch;
  }
}

/* Phone */

@media (max-width: 640px) {
  :root {
    --portal-nav-height: 60px;
    --portal-context-height: 56px;
    --portal-public-nav-height: 68px;
  }

  body {
    font-size: 15px;
  }

  .portal-public-nav {
    align-items: center;
    flex-direction: row;
    min-height: var(--portal-public-nav-height);
    padding: 6px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .portal-public-nav .public-brand img {
    height: 46px;
    width: 132px;
  }

  .portal-public-nav nav {
    margin-left: auto;
  }

  .portal-public-nav nav a {
    font-size: 0.8rem;
    min-height: 40px;
    padding-inline: 10px;
  }

  .public-portal-section {
    align-content: start;
    min-height: calc(100vh - var(--portal-public-nav-height));
    min-height: calc(100svh - var(--portal-public-nav-height));
    padding: 28px 12px 40px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .public-portal-section :is(h1, h2) {
    font-size: clamp(1.85rem, 9.5vw, 2.6rem);
  }

  .login-card.public-login-card {
    border-radius: var(--radius-lg);
    padding: 22px 18px;
  }

  .topnav {
    min-height: var(--portal-nav-height);
    padding: 6px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .topnav-brand {
    gap: 9px;
    min-height: 44px;
    min-width: 0;
  }

  .topnav-brand img {
    height: 40px;
    width: 40px;
  }

  .topnav-brand strong {
    font-size: 0.95rem;
  }

  .topnav-brand span {
    display: none;
  }

  .topnav-collapsible {
    border-left: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-right: 0;
    margin-inline: -12px;
    max-height: calc(100vh - 66px);
    max-height: calc(100svh - 66px);
    padding: 10px 12px;
  }

  .topnav-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .topnav-account {
    align-items: stretch;
    flex-direction: column;
  }

  .view-as-switcher {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-menu,
  .account-menu-trigger {
    width: 100%;
  }

  .account-menu-trigger {
    justify-content: flex-start;
  }

  .account-menu-dropdown {
    box-shadow: none;
    margin-top: 6px;
    position: static;
    width: 100%;
  }

  .topnav.parent-simple-nav {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topnav.parent-simple-nav .topnav-account {
    align-items: flex-end;
    display: grid;
  }

  .topnav.parent-simple-nav .account-menu-trigger {
    padding-left: 8px;
    width: auto;
  }

  .topnav.parent-simple-nav .account-stack span {
    display: none;
  }

  .topnav.parent-simple-nav .account-menu-dropdown {
    box-shadow: var(--shadow-raised);
    min-width: 180px;
    position: absolute;
    right: 0;
    width: auto;
  }

  .topbar {
    min-height: var(--portal-context-height);
    padding: 9px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .topbar h1 {
    font-size: clamp(1.25rem, 6vw, 1.55rem);
  }

  .workspace {
    padding: 14px 10px 36px;
    padding-bottom: max(36px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .panel,
  .member-admin-shell,
  .paperwork-hero,
  .student-portal-hero,
  .dashboard-hero,
  .family-profile-header,
  .program-intro {
    border-radius: var(--radius-md);
  }

  .panel {
    margin-bottom: 14px;
  }

  .panel-head {
    align-items: flex-start;
    min-height: 50px;
    padding: 12px;
  }

  .panel-head,
  .panel-actions,
  .paperwork-admin-head,
  .collective-guide-header,
  .teacher-class-header,
  .family-profile-header {
    flex-direction: column;
  }

  .panel-actions,
  .teacher-class-header-actions,
  .collective-guide-actions {
    justify-content: stretch;
    width: 100%;
  }

  .panel-actions button,
  .teacher-class-header-actions button,
  .collective-guide-actions button {
    flex: 1 1 auto;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .section-tabs {
    display: flex;
    margin-inline: -2px;
    width: calc(100% + 4px);
  }

  .section-tabs button {
    flex: 0 0 auto;
  }

  .parent-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat-strip,
  .school-stat-strip,
  .people-stat-strip,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat-strip article,
  .school-stat-strip article,
  .summary-grid article {
    min-height: 78px;
    padding: 13px;
  }

  .dashboard-grid,
  .parent-dashboard-grid,
  .teacher-dashboard-grid,
  .admin-dashboard-grid {
    gap: 12px;
  }

  .paperwork-hero,
  .student-portal-hero,
  .dashboard-hero {
    gap: 12px;
    margin-bottom: 14px;
    padding: 15px 14px;
  }

  .paperwork-hero h2,
  .student-portal-hero h2,
  .dashboard-hero h2 {
    font-size: clamp(1.3rem, 6.5vw, 1.65rem);
  }

  .admin-announcement-form,
  .announcement-target-grid,
  .class-target-grid,
  .announcement-class-row,
  .school-content-form,
  .class-editor-form,
  .class-editor-fields,
  .collective-editor-meta,
  .collective-year-fields,
  .reporting-period-row,
  .paperwork-admin-row,
  .guardian-entry-row,
  .student-entry-row,
  .family-student-row,
  .upper-info-grid,
  .upper-fees-grid,
  .upper-schedule-grid,
  .school-class-grid,
  .lower-subject-grid,
  .trade-structure-grid,
  .trade-area-grid,
  .file-button-grid,
  .access-checkbox-grid,
  .teacher-class-picker > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-announcement-form > *,
  .announcement-target-grid > *,
  .class-target-grid > *,
  .announcement-class-row > *,
  .school-content-form > *,
  .class-editor-form > *,
  .class-editor-fields > *,
  .collective-editor-meta > *,
  .collective-year-fields > *,
  .reporting-period-row > *,
  .paperwork-admin-row > *,
  .guardian-entry-row > *,
  .student-entry-row > *,
  .family-student-row > * {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .assignment-bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .assignment-row-actions button {
    width: 100%;
  }

  .people-directory-filters {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .people-directory-table {
    margin: 12px;
  }

  .people-directory-table button {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .people-directory-table button > span:nth-child(n + 3) {
    grid-column: 2;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-grid article {
    border-bottom: 1px solid #e0e7e2;
    border-right: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 52px;
    padding: 8px 12px;
  }

  .calendar-grid article.muted {
    display: none;
  }

  .calendar-grid article > strong {
    grid-column: 1;
  }

  .calendar-grid article > .calendar-event-list,
  .calendar-grid article > .calendar-more {
    grid-column: 2;
  }

  .calendar-grid article.today {
    box-shadow: inset 3px 0 0 #5c8b71;
  }

  .calendar-event {
    min-height: 38px;
  }

  .calendar-toolbar {
    gap: 8px;
    padding: 10px;
  }

  .calendar-toolbar button {
    font-size: 0.78rem;
    padding-inline: 9px;
  }

  .file-preview {
    padding: 10px;
  }

  .file-preview iframe {
    min-height: 65vh;
  }

  .book-panel .table-wrap {
    min-height: 460px;
  }

  .member-admin-layout {
    padding: 10px;
  }

  .member-detail-drawer {
    border-radius: 0;
    max-width: 100vw;
  }

  .member-detail-header {
    align-items: flex-start;
    padding: 14px;
  }

  .member-header-actions {
    align-items: stretch;
    width: 100%;
  }

  .member-edit-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .profile-section-grid {
    padding: 10px;
  }

  .profile-box {
    padding: 13px;
  }

  .parent-assignment-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .parent-assignment-dialog {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 94dvh;
  }

  .parent-assignment-dialog-header,
  .parent-assignment-detail-section,
  .parent-assignment-dialog-footer,
  .parent-assignment-summary {
    padding-left: 16px;
    padding-right: 16px;
  }

  .parent-assignment-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 400px) {
  .topnav-brand strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .parent-dashboard-actions,
  .admin-stat-strip,
  .school-stat-strip,
  .people-stat-strip,
  .summary-grid,
  .assignment-row-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-toolbar h2 {
    font-size: 1.08rem;
  }
}

/* Streamlined member directory and family editor */

.member-admin-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
}

.member-directory-workspace {
  background: #fbfcfb;
  border: 1px solid #d8e2dc;
  border-radius: var(--radius-md);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.member-directory-toolbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.member-directory-tabs,
.member-school-switch {
  background: #eef3f0;
  border: 1px solid #d7e1db;
  border-radius: 10px;
  display: inline-grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.member-directory-tabs button,
.member-school-switch button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  min-height: 38px;
  padding: 8px 14px;
}

.member-directory-tabs button.active,
.member-school-switch button.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 46, 31, 0.12);
  color: var(--forest);
}

.member-directory-tabs button span {
  background: #e4ece7;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.73rem;
  justify-content: center;
  margin-left: 5px;
  min-width: 22px;
  padding: 2px 6px;
}

.member-secure-note {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 750;
  gap: 7px;
}

.member-secure-note::before {
  color: var(--forest);
  content: "✓";
  font-weight: 900;
}

.member-family-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 210px) auto;
}

.member-family-filters label,
.member-people-filters label {
  display: grid;
  gap: 5px;
}

.member-family-filters label > span,
.member-people-filters label > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.member-family-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-family-card {
  align-items: center;
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 12px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 11px;
  text-align: left;
}

.member-family-card:hover {
  background: #f5f8f6;
  border-color: #adc6b6;
  box-shadow: 0 8px 22px rgba(20, 52, 35, 0.08);
}

.member-family-card .directory-photo {
  border-radius: 9px;
  height: 44px;
  overflow: hidden;
  width: 44px;
}

.member-family-card .directory-photo img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-family-card-copy,
.member-family-card-status {
  display: grid;
  gap: 3px;
}

.member-family-card-copy strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.member-family-card-copy small,
.member-family-card-status small {
  color: var(--muted);
  font-size: 0.74rem;
}

.member-family-card-status {
  justify-items: end;
}

.member-family-card-status .status-pill {
  margin: 0;
}

.member-people-filters {
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(130px, 0.65fr)) auto;
}

.member-people-table {
  max-height: min(58vh, 560px);
}

.member-detail-drawer {
  max-width: min(960px, 94vw);
}

.member-detail-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.member-header-actions {
  align-items: end;
}

.member-editor-notice {
  border-bottom: 1px solid #dce5df;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 9px 20px;
}

.member-editor-notice.success {
  background: #edf7f0;
  color: #245b39;
}

.member-editor-notice.error {
  background: #fff0ee;
  color: #8b342b;
}

.member-editor-tabs {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #dbe4de;
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  position: sticky;
  top: 125px;
  z-index: 9;
}

.member-editor-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  min-height: 44px;
  padding: 8px 14px 10px;
}

.member-editor-tabs button.active {
  border-bottom-color: var(--forest);
  color: var(--forest);
}

.member-editor-tabs button span {
  background: #edf2ef;
  border-radius: 999px;
  font-size: 0.72rem;
  margin-left: 4px;
  padding: 2px 6px;
}

.profile-section-grid.member-editor-content {
  display: block;
  padding: 20px;
}

.member-editor-content > * + * {
  margin-top: 16px;
}

.member-family-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-editor-content .profile-box {
  border-color: #dce5df;
  border-radius: 12px;
  box-shadow: none;
  padding: 18px;
}

.member-editor-content h3 {
  color: var(--ink);
  margin: 0;
}

.member-family-details-card > label {
  display: grid;
  gap: 5px;
}

.member-family-details-card > label > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.member-readonly-field {
  align-items: center;
  background: #f5f7f6;
  border: 1px solid #dce4df;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 44px;
  padding: 6px 8px 6px 12px;
}

.member-readonly-field button {
  min-height: 32px;
}

.member-setup-meter {
  background: #e8eeea;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.member-setup-meter span {
  background: var(--forest);
  display: block;
  height: 100%;
}

.member-setup-list {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-setup-list li {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 9px;
}

.member-setup-list li.complete {
  color: var(--ink);
}

.member-setup-list li > span {
  color: var(--forest);
  font-weight: 900;
}

.member-signin-card .member-generate-link {
  justify-self: start;
}

.member-more-actions {
  padding: 0 !important;
}

.member-more-actions .admin-action-card {
  border: 0;
  border-radius: 0;
  margin: 0 16px 16px;
}

.member-people-section {
  display: grid;
  gap: 12px;
}

.member-section-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.member-section-heading h3,
.member-section-heading p {
  margin: 0;
}

.member-section-heading p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 3px;
}

.member-person-list {
  display: grid;
  gap: 10px;
}

.member-person-card {
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 12px;
  overflow: hidden;
}

.member-person-card > header {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.member-person-avatar {
  align-items: center;
  background: #e7efea;
  border-radius: 10px;
  color: var(--forest);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  overflow: hidden;
  width: 48px;
}

.member-person-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-person-summary {
  display: grid;
  gap: 3px;
}

.member-person-summary > strong {
  color: var(--ink);
}

.member-person-summary > small {
  color: var(--muted);
}

.member-person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.member-person-chips i {
  background: #eef4f0;
  border-radius: 999px;
  color: var(--forest);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  padding: 3px 7px;
}

.member-person-editor {
  background: #fafcfb;
  border-top: 1px solid #e0e7e2;
  display: grid;
  gap: 16px;
  padding: 16px;
}

.member-person-editor .guardian-entry-row,
.member-person-editor .student-entry-row {
  background: transparent;
  border: 0;
  padding: 0;
}

.member-flat-check-grid {
  display: grid;
  gap: 0 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-flat-check-grid label {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e2e8e4;
  border-radius: 0;
  min-height: 40px;
  padding: 7px 2px;
}

.teacher-class-picker,
.member-class-bundle-list {
  display: grid;
  gap: 12px;
}

.member-class-bundle-list,
.teacher-class-picker > .member-class-bundle-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: start;
  max-width: 652px;
  width: 100%;
}

.member-class-bundle {
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 10px;
  overflow: hidden;
}

.member-class-bundle > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  min-height: 48px;
  padding: 10px 14px;
}

.member-class-bundle > summary::-webkit-details-marker {
  display: none;
}

.member-class-bundle > summary::after {
  color: var(--forest);
  content: "+";
  font-size: 1.15rem;
  font-weight: 800;
  margin-left: 2px;
}

.member-class-bundle[open] > summary::after {
  content: "−";
}

.member-class-bundle > summary > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  margin-left: auto;
}

.member-class-bundle > .member-class-choice-grid {
  border-top: 1px solid #e3e9e5;
  padding: 0 12px 6px;
}

.member-class-summary-chips i {
  background: #f4f7f5;
  border-radius: 5px;
  color: #455a50;
}

.member-class-editor {
  border: 1px solid #dce5df;
  border-radius: 10px;
  gap: 14px;
  padding: 16px;
}

.member-class-editor-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.member-class-editor-heading small {
  display: block;
  margin-top: 3px;
}

.member-school-switch {
  justify-self: start;
}

.member-class-picker {
  display: grid;
  gap: 10px;
}

.member-class-picker > p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.member-class-choice-grid {
  display: grid;
  gap: 0 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-class-choice {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dfe7e2;
  border-radius: 0;
  display: grid;
  gap: 10px;
  min-height: 44px;
  padding: 7px 2px;
}

.teacher-class-picker .member-class-choice,
.member-class-editor .member-class-choice {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #dfe7e2;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 7px 2px;
}

.teacher-class-picker .member-class-choice:hover,
.member-class-editor .member-class-choice:hover {
  background: #f7faf8;
  border-color: #d6e1da;
}

.lower-subject-choice-grid .member-class-choice {
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.72fr);
}

.member-class-choice > label,
.upper-class-choice {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(0, 1fr);
}

.member-class-choice label,
.upper-class-choice {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.member-class-choice input,
.member-flat-check-grid input,
.member-person-editor .teacher-class-picker input {
  accent-color: var(--forest);
  height: 18px;
  min-height: 0;
  width: 18px;
}

.member-class-choice select {
  font-size: 0.82rem;
  min-height: 36px;
  padding: 6px 30px 6px 8px;
}

.member-class-choice select:disabled {
  background: #f2f4f3;
  color: #99a39d;
  opacity: 0.72;
}

.upper-class-choice > span {
  display: grid;
  gap: 2px;
}

.upper-class-choice small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.member-delete-person {
  justify-self: start;
}

.member-program-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-form-list {
  display: grid;
  gap: 10px;
}

.member-drawer-actions {
  align-items: center;
  justify-content: space-between;
}

.member-save-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.member-save-state strong {
  color: #8a641c;
}

@media (max-width: 1180px) {
  .member-family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .member-people-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-family-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-editor-tabs {
    top: 116px;
  }
}

@media (max-width: 720px) {
  .member-directory-workspace,
  .profile-section-grid.member-editor-content {
    padding: 12px;
  }

  .member-directory-toolbar,
  .member-section-heading,
  .member-class-editor-heading,
  .member-drawer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .member-family-filters,
  .member-family-grid,
  .member-class-bundle-list,
  .member-class-choice-grid,
  .member-program-grid,
  .member-flat-check-grid,
  .member-person-editor .teacher-class-picker > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-secure-note {
    display: none;
  }

  .member-family-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .member-family-card-status {
    align-items: center;
    display: flex;
    grid-column: 2;
    justify-content: flex-start;
  }

  .member-detail-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .member-header-actions {
    align-items: center;
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .member-editor-tabs {
    overflow-x: auto;
    padding-left: 12px;
    padding-right: 12px;
    position: static;
  }

  .member-editor-tabs button {
    white-space: nowrap;
  }

  .member-person-card > header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .member-person-card > header > button {
    grid-column: 2;
    justify-self: start;
  }

  .member-person-editor .guardian-entry-row,
  .member-person-editor .student-entry-row,
  .lower-subject-choice-grid .member-class-choice {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-school-switch {
    justify-self: stretch;
  }

  .member-edit-buttons {
    width: 100%;
  }
}

/* Admin structure */

.classes-page-heading-actions {
  align-items: end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.class-directory-groups {
  display: grid;
  gap: 18px;
  padding: 14px;
}

.class-directory-group {
  border: 1px solid #dce5df;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.class-directory-group > header {
  align-items: center;
  background: #315b4c;
  border-bottom: 1px solid #264b3e;
  color: #fff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 14px;
}

.class-directory-group > header small {
  color: #dceae3;
}

.class-directory-group-header-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.class-directory-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
}

.class-directory-create-button {
  background: #f8ecd0;
  border-color: #ead8ad;
  color: #23483b;
  min-height: 36px;
  padding: 7px 12px;
}

.class-directory-create-button:hover,
.class-directory-create-button:focus-visible {
  background: #fff5dc;
  border-color: #f1dfb7;
  color: #173c2e;
}

.class-directory-create-form {
  background: #f4f8f5;
  border-bottom: 1px solid #dce5df;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(130px, 0.35fr);
  padding: 14px;
}

.class-directory-create-form label {
  display: grid;
  gap: 7px;
}

.class-directory-create-form .form-actions {
  grid-column: 1 / -1;
}

.class-directory-sections {
  display: grid;
}

.class-directory-section {
  border-bottom: 1px solid #e3eae5;
}

.class-directory-section:last-child {
  border-bottom: 0;
}

.class-directory-section > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
  min-height: 64px;
  padding: 11px 14px;
}

.class-directory-section > summary::-webkit-details-marker {
  display: none;
}

.class-directory-section > summary::after {
  color: var(--forest);
  content: "+";
  font-size: 1.3rem;
  font-weight: 700;
  order: 3;
}

.class-directory-section[open] > summary {
  background: #f8faf9;
  border-bottom: 1px solid #e3eae5;
}

.class-directory-section[open] > summary::after {
  content: "−";
}

.class-directory-section > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.class-directory-section > summary small,
.class-directory-summary-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.class-directory-summary-count {
  margin-left: auto;
  white-space: nowrap;
}

.class-directory-class-list {
  display: grid;
  gap: 0 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 14px 12px;
}

.class-directory-class-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e3eae5;
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 62px;
  padding: 9px 2px;
  text-align: left;
  width: 100%;
}

.class-directory-class-button:hover {
  background: var(--forest-soft);
  color: var(--forest-strong);
}

.class-directory-class-button:focus-visible {
  outline: 3px solid rgba(38, 94, 69, 0.24);
  outline-offset: 2px;
}

.class-directory-color-swatch {
  background: var(--class-color, var(--forest));
  border: 1px solid rgba(39, 62, 51, 0.16);
  border-radius: 3px;
  height: 24px;
  width: 6px;
}

.class-directory-class-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.class-directory-class-button small {
  color: var(--muted);
  font-weight: 500;
}

.schedules-page-intro {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px;
}

.schedules-page-intro h1,
.schedules-page-intro p {
  margin: 0;
}

.schedules-page-intro p {
  color: var(--muted);
  margin-top: 5px;
}

.schedule-school-tabs {
  background: #edf3ef;
  border-radius: 10px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.schedule-school-tabs button {
  background: transparent;
  border-color: transparent;
  color: var(--forest);
}

.schedule-school-tabs button.active {
  background: #fff;
  border-color: #ccd9d1;
  box-shadow: 0 3px 9px rgba(24, 65, 50, 0.08);
}

.lower-schedule-panel {
  overflow: hidden;
}

.lower-schedule-source {
  align-items: center;
  border-bottom: 1px solid #e1e8e3;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px;
}

.lower-schedule-source p {
  color: var(--muted);
  margin: 4px 0 0;
}

.lower-schedule-class-list {
  padding: 16px 18px;
}

.admin-calendar-year-panel {
  min-width: 0;
  overflow: hidden;
}

.admin-calendar-year-head {
  align-items: center;
  background: #fbfcfb;
  border-bottom: 1px solid #dfe7e2;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 15px 18px;
}

.admin-calendar-year-head h2,
.admin-calendar-year-head p {
  margin: 0;
}

.admin-calendar-year-head p,
.admin-calendar-year-head > span {
  color: var(--muted);
}

.admin-calendar-year-head p {
  margin-top: 4px;
}

.admin-calendar-year-grid {
  padding: 14px;
}

.admin-calendar-year-grid .school-setup-month-grid article.calendar-day-clickable {
  cursor: pointer;
}

.admin-calendar-year-grid .school-setup-month-grid article.calendar-day-clickable:hover,
.admin-calendar-year-grid .school-setup-month-grid article.calendar-day-clickable:focus-visible {
  box-shadow: inset 0 0 0 2px #8aa999;
  outline: 0;
}

.admin-calendar-year-grid .school-setup-month-grid article.today,
.admin-calendar-year-grid .school-setup-month-grid article.today:hover,
.admin-calendar-year-grid .school-setup-month-grid article.today:focus-visible {
  background: #fff7df;
  box-shadow: inset 0 0 0 2px #d5ab50;
}

.admin-calendar-year-grid .school-setup-month-grid article.today .school-setup-day-number {
  align-items: center;
  background: #f1d994;
  border-radius: 999px;
  color: #5c4213;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.admin-year-calendar-event {
  background: var(--class-color, #D8E6E0);
  border-left: 3px solid color-mix(in srgb, var(--class-color, #D8E6E0) 74%, #44594f);
  color: #203d32;
  width: 100%;
}

.admin-calendar-break-span {
  align-items: center;
  background: #cfe2d7;
  border: 0;
  border-radius: 4px;
  color: #234c36;
  display: flex;
  font-size: 0.65rem;
  font-weight: 850;
  height: 21px;
  justify-content: flex-start;
  line-height: 1;
  margin: 3px 0 4px;
  min-height: 21px;
  overflow: hidden;
  padding: 0 6px;
  position: relative;
  text-align: left;
  width: 100%;
  z-index: 1;
}

.admin-calendar-break-span.continues-before {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
  margin-left: -6px;
  width: calc(100% + 6px);
}

.admin-calendar-break-span.continues-after {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  width: calc(100% + 6px);
}

.admin-calendar-break-span.continues-before.continues-after {
  width: calc(100% + 12px);
}

.admin-calendar-break-span.break-start {
  overflow: visible;
  z-index: 2;
}

.admin-calendar-break-span span {
  pointer-events: none;
  white-space: nowrap;
}

.parent-calendar-break-span {
  cursor: default;
}

@media (max-width: 1000px) {
  .class-directory-class-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-calendar-year-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .class-directory-class-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .classes-page-heading-actions,
  .schedules-page-intro,
  .lower-schedule-source,
  .admin-calendar-year-head {
    align-items: stretch;
    flex-direction: column;
    justify-items: stretch;
  }

  .classes-page-heading-actions {
    width: 100%;
  }

  .classes-page-heading-actions > button,
  .schedule-school-tabs,
  .schedule-school-tabs button {
    width: 100%;
  }

  .class-directory-create-form,
  .class-admin-hub .hub-class-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .class-directory-group > header,
  .class-directory-group-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .class-directory-group-header-actions {
    gap: 8px;
  }

  .class-directory-create-button {
    width: 100%;
  }

  .class-directory-toolbar .class-directory-create-button {
    width: auto;
  }

  .class-directory-class-button {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .class-directory-summary-count {
    display: none;
  }
}

/* Shared parent-facing page style */

.parent-dashboard-home,
.collective-workspace,
.calendar-workspace {
  max-width: none;
}

.parent-view-header,
.role-view-header,
.collective-guide-header,
.calendar-toolbar {
  background: linear-gradient(135deg, #274c40 0%, #386654 100%);
  border-bottom: 3px solid var(--gold);
  color: #fff;
  padding: 0.85rem 1.15rem;
}

.parent-view-header,
.role-view-header,
.collective-guide-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.parent-dashboard-header {
  border: 1px solid #d4dfd8;
  border-bottom: 3px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
  min-height: 96px;
  overflow: hidden;
}

.family-class-review-notice {
  background: #fff9eb;
  border: 1px solid #e4cf91;
  border-left: 4px solid var(--gold);
  box-shadow: 0 8px 24px rgba(92, 70, 22, 0.08);
  padding: 1rem 1.15rem;
}

.family-class-review-notice h2 {
  color: var(--forest-strong);
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.family-class-review-notice p {
  color: #5d5645;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  max-width: 78ch;
}

.member-class-review-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.member-class-review-status {
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
  margin-top: 4px;
}

.member-class-review-status.is-pending {
  color: #8a641c;
}

.member-class-review-status.is-approved {
  color: var(--forest);
}

.member-person-chips .member-class-review-chip {
  background: #fff4d7;
  color: #7c5917;
}

.role-view-header {
  border: 1px solid #d4dfd8;
  border-bottom: 3px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
  margin-bottom: 1rem;
  min-height: 96px;
  overflow: hidden;
}

.parent-view-header .eyebrow,
.role-view-header .eyebrow,
.collective-guide-header .eyebrow,
.calendar-toolbar .eyebrow {
  color: #f3d795;
}

.parent-view-header h1,
.role-view-header h1,
.collective-guide-header h1,
.calendar-toolbar h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0.08rem 0 0.12rem;
}

.parent-view-header p,
.role-view-header p,
.collective-guide-header p,
.calendar-toolbar p {
  margin: 0;
}

.parent-view-header p:not(.eyebrow),
.role-view-header p:not(.eyebrow),
.collective-guide-header p:not(.eyebrow) {
  color: #e8f0eb;
  font-size: 0.82rem;
}

.collective-guide-panel,
.parent-dashboard-home > .panel,
.parent-dashboard-main-grid > .panel,
.calendar-panel,
.calendar-side-panel {
  border-color: #d4dfd8;
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
}

.collective-guide-panel {
  border-top: 1px solid #d4dfd8;
}

.collective-workspace,
.collective-editor-panel {
  scroll-margin-top: calc(var(--portal-nav-height) + 16px);
}

.collective-guide-header button,
.collective-guide-header .collective-print-select,
.calendar-toolbar .ghost {
  background: #f5e7bf;
  border-color: #f5e7bf;
  border-radius: var(--radius-sm);
  color: #172820;
  font-size: 0.86rem;
  min-height: 34px;
}

.collective-guide-header .collective-print-select {
  -webkit-appearance: auto;
  appearance: auto;
  background-image: none !important;
}

.collective-guide-header button:hover,
.collective-guide-header button:focus-visible,
.collective-guide-header .collective-print-select:hover,
.collective-guide-header .collective-print-select:focus,
.collective-guide-header .collective-print-select:focus-visible,
.calendar-toolbar .ghost:hover,
.calendar-toolbar .ghost:focus-visible {
  background: #fff3d3;
  border-color: #f5e7bf;
  color: #172820;
}

.calendar-panel {
  border: 1px solid #d4dfd8;
}

.calendar-toolbar {
  min-height: 76px;
}

.calendar-toolbar > div {
  color: #fff;
}

.calendar-toolbar h1 {
  text-align: center;
}

/* Teacher and administrator role layouts */

.role-teacher .teacher-class-header,
.role-manage .admin-view-header {
  background: linear-gradient(135deg, #274c40 0%, #386654 100%);
  border-bottom: 3px solid var(--gold);
  color: #fff;
}

.role-manage .admin-view-header {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 112px;
  padding: 18px 22px;
  width: 100%;
}

.role-manage .classes-page-intro {
  padding: 0;
}

.role-manage .classes-page-intro > .member-status {
  margin: 0;
  padding: 12px 18px;
}

.role-teacher .teacher-class-header {
  border-top: 1px solid #d4dfd8;
  padding: 0.85rem 1.15rem;
}

.role-teacher .teacher-class-header .eyebrow,
.role-manage .admin-view-header .eyebrow {
  color: #f3d795;
}

.role-teacher .teacher-class-header h1,
.role-manage .admin-view-header h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0.08rem 0 0.12rem;
}

.role-teacher .teacher-class-header h1 {
  align-items: center;
  display: inline-flex;
  gap: 9px;
}

.role-teacher .teacher-class-header > div > p:not(.eyebrow),
.role-manage .admin-view-header .admin-view-description {
  color: #e8f0eb;
}

.role-manage .admin-view-header .eyebrow,
.role-manage .admin-view-header .admin-view-description {
  margin: 0;
}

.role-manage .admin-view-header .admin-view-description {
  font-size: 0.92rem;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.role-teacher .teacher-class-header .class-summary-row span,
.role-manage .classes-page-counts span {
  color: #f6ecd0;
}

.role-teacher .teacher-class-header .class-summary-row span,
.role-manage .classes-page-counts span {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(245, 231, 191, 0.42);
}

.role-manage .classes-page-counts strong {
  color: #fff;
}

.role-teacher .teacher-class-header .ghost,
.role-manage .admin-view-header .ghost {
  background: #f5e7bf;
  border-color: #f5e7bf;
  color: #172820;
  min-height: 34px;
}

.role-teacher .teacher-class-header .ghost:hover,
.role-teacher .teacher-class-header .ghost:focus-visible,
.role-manage .admin-view-header .ghost:hover,
.role-manage .admin-view-header .ghost:focus-visible {
  background: #fff3d3;
  border-color: #f5e7bf;
  color: #172820;
}

.role-manage .schedule-school-tabs {
  background: rgba(255, 255, 255, 0.13);
}

.role-manage .schedule-school-tabs button {
  color: #f7edd3;
}

.role-manage .schedule-school-tabs button.active {
  background: #f5e7bf;
  border-color: #f5e7bf;
  color: #172820;
}

.role-teacher .teacher-dashboard-home > .panel,
.role-teacher .teacher-dashboard-grid > .panel,
.role-teacher .teacher-class-page,
.role-teacher .lower-dashboard-grid > .panel,
.role-teacher .lower-weekly-work-panel,
.role-teacher .upper-school-info-panel,
.role-manage .admin-dashboard-home > .panel,
.role-manage .admin-dashboard-grid > .panel,
.role-manage .classes-page-intro,
.role-manage .school-class-panel,
.role-manage .schedules-page-intro,
.role-manage .lower-schedule-panel,
.role-manage .upper-school-info-panel,
.role-manage .member-admin-shell,
.role-manage .calendar-year-summary,
.role-manage .admin-calendar-year-panel {
  border-color: #d4dfd8;
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
}

.role-manage .classes-page-intro,
.role-manage .schedules-page-intro,
.role-manage .member-admin-shell,
.role-manage .calendar-year-summary,
.role-teacher .teacher-class-page {
  overflow: hidden;
}

/* One stable admin page frame: the header and primary workspace move together. */

.role-manage .admin-page-shell {
  background: #fbfcfb;
  border: 1px solid #d4dfd8;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
  overflow: hidden;
  width: 100%;
}

.role-manage .calendar-workspace {
  max-width: var(--content-width);
}

.role-manage .admin-page-shell > .admin-view-header,
.role-manage .admin-page-shell > .classes-page-intro > .admin-view-header {
  border: 0;
  border-bottom: 3px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.role-manage .admin-page-body {
  background: #fbfcfb;
  padding: 16px;
}

.role-manage .admin-dashboard-body > .panel,
.role-manage .admin-dashboard-body .admin-dashboard-grid > .panel {
  box-shadow: none;
}

.role-manage .admin-dashboard-body > :last-child,
.role-manage .admin-dashboard-body .admin-dashboard-grid:last-child > :last-child {
  margin-bottom: 0;
}

.role-manage .admin-classes-shell .classes-page-intro {
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.role-manage .admin-classes-shell .school-class-panel,
.role-manage .admin-schedules-shell > .lower-schedule-panel,
.role-manage .admin-schedules-shell > .upper-school-info-panel,
.role-manage .admin-calendar-shell > .admin-calendar-year-panel,
.role-manage .admin-calendar-shell > .calendar-side-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.role-manage .admin-classes-shell .class-split-workspace {
  background: #f4f7f5;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  height: max(500px, calc(100svh - var(--portal-nav-height) - 196px));
  min-height: 0;
}

.role-manage .admin-classes-shell .class-split-directory {
  background: #fbfcfb;
  border-right: 1px solid #d4dfd8;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.role-manage .admin-classes-shell .class-split-directory .school-class-panel {
  min-height: 100%;
}

.role-manage .admin-classes-shell .class-split-directory .school-class-panel > .panel-head {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 6;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-toolbar {
  flex-shrink: 0;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-toolbar > span {
  white-space: nowrap;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-toolbar .class-directory-create-button {
  font-size: 0.78rem;
  min-height: 34px;
  padding: 6px 9px;
  width: auto;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-groups {
  gap: 12px;
  padding: 12px;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-class-list,
.role-manage .admin-classes-shell .class-split-directory .class-directory-create-form {
  grid-template-columns: minmax(0, 1fr);
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-create-form .form-actions {
  align-items: stretch;
  flex-direction: column-reverse;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-create-form .form-actions button {
  width: 100%;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-group > header {
  align-items: flex-start;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-group-header-actions {
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.role-manage .admin-classes-shell .class-split-directory .class-directory-create-button {
  font-size: 0.76rem;
  min-height: 34px;
  padding: 6px 9px;
}

.role-manage .admin-classes-shell .class-directory-class-button.active {
  background: color-mix(in srgb, var(--class-color, #d8e6e0) 32%, white);
  box-shadow: inset 4px 0 0 var(--class-color, var(--forest));
  color: var(--forest-strong);
}

.role-manage .admin-classes-shell .class-split-main {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.role-manage .admin-classes-shell .class-split-main > .class-admin-hub {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.role-manage .admin-classes-shell .class-split-main .class-admin-layout {
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.role-manage .admin-classes-shell .class-split-main .class-admin-detail {
  align-content: start;
  border: 0;
}

.role-manage .admin-classes-shell .class-split-main .class-tabs {
  box-shadow: 0 8px 16px rgba(28, 41, 35, 0.05);
  position: sticky;
  top: 0;
  z-index: 5;
}

.role-manage .admin-classes-shell .class-split-empty {
  align-items: center;
  display: grid;
  height: 100%;
  justify-items: center;
  margin: 0;
  min-height: 0;
  padding: 28px;
  text-align: center;
}

.role-manage .admin-classes-shell .class-split-empty h2,
.role-manage .admin-classes-shell .class-split-empty p {
  margin: 0;
}

.role-manage .admin-classes-shell .class-split-empty p {
  color: var(--muted);
  margin-top: 6px;
}

.role-manage .admin-schedules-shell > .schedules-page-intro,
.role-manage .admin-calendar-shell > .calendar-year-summary {
  border: 0;
  border-bottom: 3px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.role-manage .admin-calendar-shell {
  align-items: start;
  display: grid;
  gap: 0;
  grid-template-areas:
    "header header"
    "status status"
    "calendar utility";
  grid-template-columns: minmax(0, 1fr) 290px;
}

.role-manage .admin-calendar-shell > .calendar-year-summary {
  grid-area: header;
}

.role-manage .admin-calendar-shell > .calendar-event-status {
  grid-area: status;
  margin: 14px 16px 0;
}

.role-manage .admin-calendar-shell > .admin-calendar-year-panel {
  grid-area: calendar;
  min-width: 0;
}

.role-manage .admin-calendar-shell > .calendar-side-panel {
  align-self: start;
  background: #f8faf9;
  border-left: 1px solid #dfe7e2;
  border-top: 0;
  grid-area: utility;
  position: static;
}

.role-manage .admin-calendar-shell > .calendar-side-panel > details > summary,
.role-manage .admin-calendar-shell > .calendar-side-panel > details[open] > summary {
  min-height: 48px;
  padding: 11px 13px;
}

.role-manage .admin-calendar-shell .calendar-admin-tool-actions {
  padding: 10px 12px 12px;
}

.role-manage .admin-calendar-shell .calendar-admin-tool-actions > div {
  grid-template-columns: minmax(0, 1fr);
}

.role-manage .admin-calendar-shell .calendar-upcoming-list {
  max-height: 360px;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .role-manage .admin-calendar-shell {
    grid-template-areas:
      "header"
      "status"
      "utility"
      "calendar";
    grid-template-columns: minmax(0, 1fr);
  }

  .role-manage .admin-calendar-shell > .calendar-side-panel {
    border-bottom: 1px solid #dfe7e2;
    border-left: 0;
  }
}

/* One shared parent and teacher page frame, matched to the admin header. */

.role-member .parent-dashboard-home,
.role-member .parent-student-workspace,
.role-member .collective-workspace,
.role-member .calendar-workspace,
.role-member .parent-paperwork-workspace,
.role-member .parent-resources-workspace,
.role-member .role-program-workspace,
.role-teacher .teacher-dashboard-home,
.role-teacher .collective-workspace,
.role-teacher .calendar-workspace,
.role-teacher .role-program-workspace {
  max-width: var(--content-width);
}

.portal-page-shell {
  background: #fbfcfb;
  border: 1px solid #d4dfd8;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 34px rgba(36, 72, 60, 0.09);
  overflow: hidden;
  width: 100%;
}

.portal-page-header {
  background: linear-gradient(135deg, #274c40 0%, #386654 100%);
  border: 0;
  border-bottom: 3px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  color: #fff;
  gap: 18px;
  margin: 0;
  min-height: 112px;
  padding: 18px 22px;
  width: 100%;
}

.portal-page-header:not(.calendar-toolbar) {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.portal-page-header .eyebrow {
  color: #f3d795;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

.portal-page-header h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0.08rem 0 0.12rem;
}

.portal-page-header p,
.portal-page-header small {
  margin: 0;
}

.portal-page-header p:not(.eyebrow),
.portal-page-header small {
  color: #e8f0eb;
  font-size: 0.92rem;
  line-height: 1.35;
}

.portal-page-header :is(button, select) {
  background: #f5e7bf;
  border-color: #f5e7bf;
  border-radius: var(--radius-sm);
  color: #172820;
  font-size: 0.86rem;
  min-height: 34px;
}

.portal-page-header :is(button, select):hover,
.portal-page-header :is(button, select):focus,
.portal-page-header :is(button, select):focus-visible {
  background: #fff3d3;
  border-color: #f5e7bf;
  color: #172820;
}

.portal-page-body {
  background: #fbfcfb;
  display: grid;
  gap: 16px;
  padding: 16px;
}

.portal-page-body > *,
.portal-page-body > .panel,
.portal-page-body > div > .panel {
  margin-bottom: 0;
  margin-top: 0;
}

.parent-dashboard-body > .panel,
.parent-dashboard-body .parent-dashboard-main-grid > .panel,
.teacher-dashboard-body > .panel,
.teacher-dashboard-body .teacher-dashboard-grid > .panel,
.lower-school-page-body > .panel,
.lower-school-page-body .lower-dashboard-grid > .panel,
.parent-paperwork-body .paperwork-layout > .panel,
.parent-resources-body > .panel,
.role-program-body > .panel,
.role-program-body .program-page-grid > .panel {
  box-shadow: none;
}

.parent-dashboard-header,
.teacher-dashboard-header,
.lower-school-page-shell > .role-view-header,
.teacher-upper-school-shell > .role-view-header {
  border: 0;
  border-bottom: 3px solid var(--gold);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.parent-student-work-panel,
.collective-guide-panel,
.teacher-class-page,
.calendar-panel {
  border-top-width: 1px;
}

.teacher-class-summary-row {
  background: #f4f7f5;
  border-bottom: 1px solid #dfe7e2;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
}

.role-teacher .teacher-class-page > .teacher-class-summary-row span {
  background: #fff;
  border-color: #cddbd3;
  color: var(--forest-strong);
}

.teacher-upper-school-shell > .upper-school-info-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.family-self-service.portal-page-shell > .family-profile-header {
  border-bottom: 3px solid var(--gold);
  border-radius: 0;
  margin: 0;
}

.family-self-service.portal-page-shell > :not(.family-profile-header) {
  margin-left: 16px;
  margin-right: 16px;
}

.family-self-service.portal-page-shell > :last-child {
  margin-bottom: 16px;
}

.role-program-body .program-page-grid {
  margin: 0;
}

.role-program-body > .panel,
.role-program-body .program-page-grid > .panel {
  margin: 0;
}

.calendar-panel.portal-page-shell .calendar-toolbar {
  min-height: 112px;
}

/* Keep the family and teacher calendar dense enough to scan as one month. */
:is(.role-member, .role-teacher) .calendar-layout {
  gap: 14px;
}

:is(.role-member, .role-teacher) .calendar-weekdays span {
  font-size: 0.67rem;
  padding: 7px;
}

:is(.role-member, .role-teacher) .calendar-grid article {
  gap: 5px;
  min-height: 94px;
  padding: 6px;
}

:is(.role-member, .role-teacher) .calendar-grid article > strong {
  font-size: 0.76rem;
  height: 24px;
  width: 24px;
}

:is(.role-member, .role-teacher) .calendar-event-list {
  gap: 4px;
}

:is(.role-member, .role-teacher) .calendar-event {
  border-left-width: 4px;
  gap: 1px;
  padding: 4px 5px;
}

:is(.role-member, .role-teacher) .calendar-event span {
  font-size: 0.7rem;
}

:is(.role-member, .role-teacher) .calendar-event small,
:is(.role-member, .role-teacher) .calendar-more {
  font-size: 0.64rem;
}

:is(.role-member, .role-teacher) .calendar-side-panel > details > summary,
:is(.role-member, .role-teacher) .calendar-side-panel > details[open] > summary {
  min-height: 46px;
  padding: 10px 13px;
}

:is(.role-member, .role-teacher) .calendar-side-panel > details > summary strong {
  font-size: 0.7rem;
}

:is(.role-member, .role-teacher) .calendar-side-panel .calendar-legend-list,
:is(.role-member, .role-teacher) .calendar-side-panel .calendar-upcoming-list,
:is(.role-member, .role-teacher) .calendar-side-panel .student-empty-state {
  padding: 10px 12px 12px;
}

:is(.role-member, .role-teacher) .calendar-side-panel .calendar-upcoming-list {
  gap: 7px;
}

:is(.role-member, .role-teacher) .calendar-side-panel .calendar-upcoming-list article {
  padding: 9px 10px;
}

:is(.role-member, .role-teacher) .calendar-upcoming-list strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

:is(.role-member, .role-teacher) .calendar-upcoming-list span {
  font-size: 0.72rem;
  line-height: 1.35;
}

:is(.role-member, .role-teacher) .calendar-upcoming-list small {
  font-size: 0.68rem;
}

@media (min-width: 1001px) {
  .role-manage .admin-page-shell .admin-view-header {
    height: 112px;
  }

  .portal-page-header {
    height: 112px;
  }

}

@media (max-width: 820px) {
  .role-manage .admin-classes-shell .class-split-workspace {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .role-manage .admin-classes-shell .class-split-directory {
    border-bottom: 1px solid #d4dfd8;
    border-right: 0;
    max-height: 44svh;
  }

  .role-manage .admin-classes-shell .class-split-main {
    min-height: 560px;
    overflow: visible;
  }

  .role-manage .admin-classes-shell .class-split-main > .class-admin-hub {
    height: auto;
    min-height: 560px;
    overflow: visible;
  }

  .role-manage .admin-classes-shell .class-split-main .class-admin-layout {
    overflow: visible;
  }

  .role-manage .admin-classes-shell .class-split-main .class-tabs {
    position: static;
  }
}

@media (max-width: 720px) {
  .parent-view-header,
  .role-view-header {
    align-items: flex-start;
    min-height: 84px;
  }

  .collective-guide-header {
    align-items: stretch;
  }

  .collective-guide-actions,
  .collective-guide-actions > *,
  .collective-guide-actions select {
    width: 100%;
  }

  .calendar-toolbar {
    padding: 0.7rem;
  }

  .role-manage .admin-view-header,
  .role-teacher .teacher-class-header {
    align-items: stretch;
  }

  .portal-page-header {
    align-items: stretch;
    min-height: 0;
    padding: 16px;
  }

  .portal-page-header:not(.calendar-toolbar) {
    flex-direction: column;
  }

  .calendar-panel.portal-page-shell .calendar-toolbar {
    min-height: 0;
  }

  .portal-page-header :is(button, select),
  .portal-page-header .parent-student-work-actions,
  .portal-page-header .teacher-class-header-actions {
    width: 100%;
  }

  .role-manage .admin-view-header {
    min-height: 0;
    padding: 16px;
  }

  .role-manage .schedule-school-tabs,
  .role-manage .schedule-school-tabs button,
  .role-manage .member-admin-shell > .panel-head .panel-actions,
  .role-manage .member-admin-shell > .panel-head .ghost,
  .role-teacher .teacher-class-header-actions,
  .role-teacher .teacher-class-header-actions .ghost {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .role-member .calendar-grid .parent-calendar-break-span,
  .role-member .calendar-grid .parent-calendar-break-span.continues-before,
  .role-member .calendar-grid .parent-calendar-break-span.continues-after,
  .role-member .calendar-grid .parent-calendar-break-span.continues-before.continues-after {
    border-radius: 4px;
    grid-column: 2;
    margin: 0;
    width: 100%;
  }

  :is(.role-member, .role-teacher) .calendar-grid article {
    gap: 8px;
    min-height: 52px;
    padding: 8px 12px;
  }

  :is(.role-member, .role-teacher) .calendar-grid article > strong {
    font-size: 0.86rem;
    height: 28px;
    width: 28px;
  }

  :is(.role-member, .role-teacher) .calendar-event {
    min-height: 38px;
    padding: 6px 7px;
  }

  :is(.role-member, .role-teacher) .calendar-event span {
    font-size: 0.78rem;
  }

  :is(.role-member, .role-teacher) .calendar-event small,
  :is(.role-member, .role-teacher) .calendar-more {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .skip-link,
  .topnav,
  .topbar,
  .panel-actions,
  .parent-dashboard-actions,
  .portal-mobile-menu-button,
  .form-actions,
  .assignment-row-actions,
  .member-drawer-actions {
    display: none !important;
  }

  .workspace {
    max-width: none;
    padding: 0;
  }

  .panel,
  .summary-grid article,
  .admin-stat-strip article {
    box-shadow: none;
    break-inside: avoid;
  }
}
