/* Option F department comparison. Canonical department pages are unaffected. */
.portal-f-maths .maths-chapter-nav a:not([data-chapter]){display:block;grid-template-columns:1fr}
.portal-f-maths .chapter{scroll-margin-top:190px}
@media(max-width:1100px){.portal-f-maths .chapter{scroll-margin-top:24px}}
.maths-comparison-hub .maths-study-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin: 30px 0 24px;
}
.maths-comparison-hub .maths-study-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 30px 30px;
  border: 1px solid var(--f-line);
  border-top: 4px solid var(--f-navy);
  border-radius: 6px;
  background: #fff;
}
.maths-comparison-hub .maths-study-card:nth-child(2) { border-top-color: #b49a59; }
.maths-comparison-hub .maths-study-card .eyebrow { margin: 0 0 15px; color: var(--f-sand-deep); }
.maths-comparison-hub .maths-study-card h2 { font-size: 2rem; margin: 0 0 16px; }
.maths-comparison-hub .maths-study-card > p:not(.eyebrow) { color: var(--f-muted); font-size: 1rem; line-height: 1.7; max-width: 44ch; margin: 0 0 26px; }
.maths-comparison-hub .maths-study-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--f-line); }
.maths-comparison-hub .maths-study-links a { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 46px; padding: 11px 15px; border: 1px solid var(--f-navy); border-radius: 4px; font-size: .86rem; font-weight: 600; line-height: 1.4; text-decoration: none; color: #fff; background: var(--f-navy); }
.maths-comparison-hub .maths-study-links a + a { background: #fff; color: var(--f-link); border-color: #b7c2cb; }
.maths-comparison-hub .maths-study-links a:hover { background: #17496f; border-color: #17496f; color: #fff; }
.maths-comparison-hub .maths-preview-intro { color: var(--f-muted); font-size: .88rem; line-height: 1.7; max-width: 90ch; padding: 17px 20px; margin: 24px 0; border-left: 3px solid #b49a59; background: var(--f-sand); }
@media (max-width: 760px) {
  .maths-comparison-hub .maths-study-cards { grid-template-columns: 1fr; gap: 20px; }
  .maths-comparison-hub .maths-study-card { padding: 25px 24px; }
  .maths-comparison-hub .maths-study-card h2 { font-size: 1.8rem; }
}
body.portal-f-maths {
  --border: var(--f-line);
  --slate: var(--f-muted);
  --teal: var(--f-link);
  --amber-bg: #fcf5e7;
  background: var(--f-paper);
  min-width: 0;
}
.portal-f-maths .portal-f-page { padding-bottom: 36px; }
.portal-f-maths .maths-comparison {
  width: calc(100% - 64px);
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--f-muted);
  font-size: .8rem;
  line-height: 1.5;
}
.portal-f-maths .maths-comparison > :first-child { margin: 0; }
.portal-f-maths .maths-comparison strong { color: var(--f-navy); font-weight: 650; }
.portal-f-maths .maths-compare-options { display: flex; gap: 5px; flex-wrap: wrap; }
.portal-f-maths .maths-compare-options a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--f-line);
  border-radius: 5px;
  background: #fff;
  color: var(--f-link);
  font-weight: 600;
  text-decoration: none;
}
.portal-f-maths .maths-compare-options a:hover { border-color: #a38a52; }
.portal-f-maths .maths-compare-options a[aria-current] {
  background: var(--f-navy);
  border-color: var(--f-navy);
  color: #fff;
}
.portal-f-maths .department-shell,
.workspace-js .portal-f-maths .department-shell {
  width: calc(100% - 64px);
  max-width: 1320px;
  min-height: 0;
  margin: 0 auto;
  padding: 6px 0 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}
.portal-f-maths .department-workspace,
.portal-f-maths .workspace-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.portal-f-maths .site-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.portal-f-maths .workspace-footer {
  margin: 36px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--f-line);
  background: transparent;
  color: var(--f-muted);
  font-size: .75rem;
  line-height: 1.7;
}
.portal-f-maths .workspace-footer a { color: var(--f-link); }
.portal-f-maths .site-breadcrumb { margin: 0 0 22px; font-size: .76rem; }
.portal-f-maths .site-breadcrumb li { min-width: 0; }

/* A light, compact department rail keeps the global navy launcher dominant. */
.portal-f-maths .department-sidebar,
.workspace-js .portal-f-maths .department-sidebar {
  position: sticky;
  inset: 24px auto auto;
  width: auto;
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 48px);
  margin: 0;
  padding: 60px 14px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid var(--f-line);
  border-top: 3px solid var(--f-navy);
  border-radius: 6px;
  background: #fff;
  color: var(--f-ink);
  box-shadow: none;
  scrollbar-color: #c8bfa9 #fff;
  z-index: 20;
}
.portal-f-maths .maths-department-heading { padding: 0 8px 18px; }
.portal-f-maths .maths-department-heading .eyebrow,
.portal-f-maths .maths-department-heading > p:first-child {
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--f-sand-deep);
  margin: 0 0 7px;
}
.portal-f-maths .maths-department-heading h2 { margin: 0 0 7px; font-size: 1.6rem; }
.portal-f-maths .maths-department-heading > p:last-child {
  color: var(--f-muted);
  font-size: .76rem;
  line-height: 1.5;
  margin: 0;
}
.portal-f-maths .maths-side-nav { display: grid; gap: 8px; min-width: 0; }
.portal-f-maths nav.maths-nav-home { display: grid; gap: 3px; }
.portal-f-maths .maths-nav-home > a,
.portal-f-maths .maths-side-nav > a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  font-size: .86rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--f-navy);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
}
.portal-f-maths .maths-nav-label {
  margin: 10px 10px 0;
  color: var(--f-muted);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.portal-f-maths .maths-side-nav .maths-contents,
.portal-f-maths .maths-support-nav {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--f-line);
  border-radius: 0;
  background: transparent;
}
.portal-f-maths .maths-side-nav .maths-contents > summary,
.portal-f-maths .maths-support-nav > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 10px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--f-navy);
  font: 650 .78rem/1.5 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  list-style: none;
  cursor: pointer;
}
.portal-f-maths .maths-side-nav summary::-webkit-details-marker { display: none; }
.portal-f-maths .maths-side-nav summary::after { content: '+'; font: 400 1.05rem/1 Georgia, serif; }
.portal-f-maths .maths-side-nav details[open] > summary::after { content: '−'; }
.portal-f-maths .maths-chapter-nav { list-style: none; counter-reset: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.portal-f-maths .maths-chapter-nav li { margin: 0; padding: 0; }
.portal-f-maths .maths-chapter-nav li::before { content: none; }
.portal-f-maths .maths-chapter-nav a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-height: 44px;
  margin: 0;
  padding: 10px 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--f-link);
  font: 400 .82rem/1.5 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  text-decoration: none;
}
.portal-f-maths .maths-nav-number { color: #8d7544; font-size: .72rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.portal-f-maths .maths-chapter-nav a:hover,
.portal-f-maths .maths-chapter-nav a[aria-current],
.portal-f-maths .maths-nav-home > a:hover,
.portal-f-maths .maths-nav-home > a[aria-current] {
  background: var(--f-sand);
  color: var(--f-navy);
  border-left-color: #a98b49;
  text-decoration: none;
}
.portal-f-maths .maths-support-nav nav { display: grid; gap: 2px; margin: 0; padding: 0; }
.portal-f-maths .maths-support-nav nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px;
  color: var(--f-link);
  border-radius: 4px;
  font-size: .8rem;
  line-height: 1.5;
  text-decoration: none;
}
.portal-f-maths .maths-support-nav nav a:hover { background: #f5f2ea; }
.portal-f-maths .department-sidebar .department-toggle {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--f-line);
  border-radius: 4px;
  background: #f8f6f0;
  color: var(--f-navy);
  font: 28px/1 Arial, sans-serif;
  box-shadow: none;
  cursor: pointer;
}
.workspace-js .portal-f-maths .department-sidebar .department-toggle { display: grid; place-items: center; }
.portal-f-maths .department-sidebar .department-toggle:hover { background: var(--f-sand); }
html:not(.workspace-js) .portal-f-maths .department-sidebar { padding-top: 22px; }
.portal-f-maths .department-shell.menu-hidden,
.workspace-js .portal-f-maths .department-shell.menu-hidden { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.portal-f-maths .menu-hidden .department-sidebar,
.workspace-js .portal-f-maths .menu-hidden .department-sidebar {
  display: flex;
  width: 56px;
  min-height: 60px;
  max-height: 60px;
  padding: 0;
  overflow: hidden;
}
.portal-f-maths .menu-hidden .department-sidebar .department-toggle { right: 10px; }
.portal-f-maths .menu-hidden .department-sidebar > :not([data-department-toggle]) { display: none!important; }

/* The same seven chapters, with a document index replacing the side rail. */
.portal-f-maths.maths-layout-wide .department-shell,
.workspace-js .portal-f-maths.maths-layout-wide .department-shell { display: block; }
.portal-f-maths .maths-inline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 0 0 16px;
  margin: 0 0 25px;
  border-bottom: 1px solid var(--f-line);
}
.portal-f-maths .maths-inline-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--f-link); text-decoration: none; }
.portal-f-maths .maths-inline-nav a[aria-current] { color: var(--f-navy); box-shadow: inset 0 -2px var(--f-navy); font-weight: 650; }
.portal-f-maths .maths-inline-nav a:hover { text-decoration: underline; }
.portal-f-maths.maths-layout-wide .site-main > .maths-contents {
  background: var(--f-sand);
  border: 1px solid var(--f-sand-line);
  border-left: 3px solid #b49a59;
  border-radius: 5px;
  padding: 14px 20px;
  margin: 24px 0 32px;
}
.portal-f-maths.maths-layout-wide .site-main > .maths-contents > summary { min-height: 30px; color: var(--f-navy); font-size: .9rem; font-weight: 650; cursor: pointer; }
.portal-f-maths.maths-layout-wide .maths-contents .maths-chapter-nav { padding-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 18px; }

/* Homepage: a paper handbook feature beside the sand planning column. */
.portal-f-maths .home-heading { padding: 4px 0 26px; border-bottom: 2px solid var(--f-navy); margin: 0 0 26px; }
.portal-f-maths .home-heading h1 { font-size: clamp(2.5rem, 3.5vw, 3.4rem); }
.portal-f-maths .home-heading > div > p:last-child { font-size: 1rem; color: var(--f-muted); }
.portal-f-maths .home-eyebrow { color: var(--f-sand-deep); }
.portal-f-maths .home-highlights { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.portal-f-maths .home-feature { min-height: 410px; padding: 28px 30px; border: 1px solid var(--f-line); border-top: 3px solid var(--f-navy); border-radius: 7px; background: #fff; color: var(--f-ink); box-shadow: none; }
.portal-f-maths .home-feature h2 { max-width: 18ch; color: var(--f-navy); font-size: clamp(1.9rem, 2.7vw, 2.65rem); }
.portal-f-maths .home-feature h2 em { color: #775d2d; }
.portal-f-maths .feature-kicker { color: var(--f-sand-deep); font-size: .65rem; }
.portal-f-maths .feature-kicker svg { color: var(--f-navy); }
.portal-f-maths .feature-draft { color: #6c542b; background: var(--f-sand); border-color: var(--f-sand-line); font-size: .72rem; }
.portal-f-maths .feature-content > p:not(.feature-kicker) { color: #4f5d69; font-size: .94rem; max-width: 40ch; }
.portal-f-maths .home-button.handbook-launch { background: var(--f-navy); border-color: var(--f-navy); color: #fff; font-size: .88rem; margin-top: 24px; box-shadow: none; }
.portal-f-maths .home-button.handbook-launch:hover { background: #17496f; transform: none; }
.portal-f-maths .feature-bottom { color: var(--f-muted); font-size: .72rem; }
.portal-f-maths .home-math-art { opacity: .06; filter: brightness(.1); width: 60%; right: -10%; }
.portal-f-maths .home-priorities { gap: 16px; }
.portal-f-maths .priority-card,
.portal-f-maths .priority-card.priority-dates { padding: 22px 24px; border: 1px solid var(--f-sand-line); border-radius: 7px; background: var(--f-sand); color: var(--f-navy); box-shadow: none; }
.portal-f-maths .priority-card h2,
.portal-f-maths .priority-dates h2 { color: var(--f-navy); font-size: 1.6rem; }
.portal-f-maths .priority-card p,
.portal-f-maths .priority-dates p { color: #65583e; font-size: .86rem; }
.portal-f-maths .priority-label { color: var(--f-sand-deep); font-size: .66rem; }
.portal-f-maths .priority-icon,
.portal-f-maths .priority-dates .priority-icon { color: var(--f-navy); background: #e8ddc5; }
.portal-f-maths .priority-action { color: var(--f-link); font-size: .78rem; }
.portal-f-maths .priority-card:hover { transform: none; border-color: #b29a63; background: #eee3cd; }
.portal-f-maths .home-workspace { margin-top: 38px; }
.portal-f-maths .home-section-heading { padding-bottom: 16px; margin: 0; border-bottom: 2px solid var(--f-navy); }
.portal-f-maths .home-section-heading h2 { font-size: 1.9rem; }
.portal-f-maths .home-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.portal-f-maths .home-tile { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 5px 18px; min-height: 0; padding: 25px 0; border: 0; border-bottom: 1px solid var(--f-line); border-radius: 0; background: transparent; box-shadow: none; transform: none; }
.portal-f-maths .tile-top { grid-row: 1 / span 3; margin: 0; display: block; }
.portal-f-maths .tile-icon { width: 42px; height: 42px; border-radius: 6px; color: var(--f-navy); background: #e9e3d5; }
.portal-f-maths .tile-arrow { display: none; }
.portal-f-maths .home-tile h3 { margin: 0; font-size: 1.04rem; font-weight: 650; }
.portal-f-maths .home-tile p { margin: 0; max-width: 45ch; font-size: .87rem; color: var(--f-muted); }
.portal-f-maths .tile-footer { margin: 2px 0 0; border: 0; padding: 0; font-size: .72rem; color: var(--f-sand-deep); }
.portal-f-maths .home-tile:hover { background: #fff9; transform: none; box-shadow: none; border-color: #b49a59; }
.portal-f-maths .home-source-callout { background: var(--f-sand); border-color: var(--f-sand-line); border-radius: 6px; padding: 22px 25px; }
.portal-f-maths .home-source-callout h2 { color: var(--f-navy); }
.portal-f-maths .home-source-callout p { color: #65583e; font-size: .85rem; }
.portal-f-maths .home-source-callout > a { color: var(--f-link); font-size: .82rem; }

/* Handbook: seven full-width chapter panels; keep course and status accents. */
.portal-f-maths .handbook-heading { background: transparent; border: 0; border-bottom: 2px solid var(--f-navy); border-radius: 0; padding: 0 0 22px; }
.portal-f-maths .handbook-heading h1 { color: var(--f-navy); font-size: clamp(2.15rem, 3vw, 2.6rem); max-width: 30ch; margin: 8px 0 15px; line-height: 1.08; }
.portal-f-maths .handbook-heading .eyebrow { color: var(--f-sand-deep); }
.portal-f-maths .handbook-intro { color: #4d5c69; max-width: 88ch; font-size: 1rem; line-height: 1.65; margin: 0; }
.portal-f-maths .review-direction,
.portal-f-maths .review-status { color: var(--f-muted); }
.portal-f-maths .review-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 15px 0 10px; font-size: .76rem; line-height: 1.5; }
.portal-f-maths .review-direction { margin: 0; max-width: 100ch; font-size: .84rem; line-height: 1.6; }
.portal-f-maths .draft-label { background: var(--f-sand); color: #6c542b; }
.portal-f-maths .review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.portal-f-maths .review-actions button { background: #fff; border: 1px solid #b9c4cc; border-radius: 4px; color: var(--f-navy); min-height: 42px; padding: 9px 13px; font: 500 .8rem/1.4 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; cursor: pointer; }
.portal-f-maths .review-actions button:hover { background: var(--f-sand); }
.portal-f-maths .model-links { margin: 28px 0 36px; }
.portal-f-maths .model-links h2 { font-family: var(--f-serif); font-size: 1.4rem; }
.portal-f-maths .handbook-main .model-link-grid a { background: #fff; border-color: var(--f-line); border-top: 3px solid var(--f-navy); border-radius: 5px; padding: 18px 21px; }
.portal-f-maths .handbook-main .model-link-grid a:nth-child(n) { background: #fff; border-top-color: #b49a59; }
.portal-f-maths .handbook-main .model-link-grid a:hover { background: #f8f1e3; border-color: #b49a59; }
.portal-f-maths .chapter { margin: 0 0 28px; padding: 0 27px 25px; border-color: var(--f-line); border-radius: 6px; background: #fff; scroll-margin-top: 24px; }
.portal-f-maths .chapter-title { margin: 0 -27px 24px; padding: 22px 26px; gap: 17px; border-radius: 5px 5px 0 0; background: var(--section-tint); }
.portal-f-maths .chapter h2 { font-size: clamp(1.65rem, 2.3vw, 2rem); color: var(--section-color); }
.portal-f-maths .chapter-number { min-width: 40px; font-size: 2.45rem; }
.portal-f-maths .chapter-title .eyebrow { font-size: .61rem; letter-spacing: .09em; }
.portal-f-maths .chapter .manuscript { font-size: 1rem; line-height: 1.75; }
.portal-f-maths .chapter .manuscript > p,
.portal-f-maths .chapter .manuscript > ul { max-width: 82ch; }
.portal-f-maths .course-grid { min-width: 0; }
.portal-f-maths .course-card { min-width: 0; box-shadow: none; }
.portal-f-maths .handbook-main .course-card { box-shadow: none; border-color: var(--f-line); }
.portal-f-maths .handbook-main .course-card h3 { font-family: var(--f-serif); font-weight: 400!important; letter-spacing: -.015em; }
.portal-f-maths .handbook-main .course-card dl > div { min-width: 0; }
.portal-f-maths .course-card dd { min-width: 0; overflow-wrap: anywhere; }
.portal-f-maths .handbook-main .practice-grid article { box-shadow: none; }
.portal-f-maths .handbook-main .practice-grid h3 { font-family: var(--f-serif); font-weight: 400!important; font-size: 1.3rem!important; }
.portal-f-maths .assessment-flow { gap: 12px; }
.portal-f-maths .assessment-flow li { min-width: 0; }
.portal-f-maths .handbook-main .assessment-flow li:not(:last-child)::after { right: -18px; }
.portal-f-maths .map-wrap,
.portal-f-maths .reader-table { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.portal-f-maths .filters { min-width: 0; background: var(--f-sand); border-color: var(--f-sand-line); padding: 17px 20px; }
.portal-f-maths .filters > * { min-width: 0; max-width: 100%; }
.portal-f-maths .filters select { max-width: 100%; }
.portal-f-maths .school-dates li { min-width: 0; }
.portal-f-maths .source-register a,
.portal-f-maths .chapter a,
.portal-f-maths .chapter dd { overflow-wrap: anywhere; }
.portal-f-maths .setup-inline { background: var(--f-sand); border-left-color: #b49a59; }
.portal-f-maths .hb-toolbar { position: sticky; top: 16px; z-index: 10; border-color: var(--f-sand-line); background: var(--f-sand); border-radius: 5px; padding: 20px 24px; margin: 20px 0 26px; }
.portal-f-maths .hb-controls { flex-wrap: wrap; gap: 12px; }
.portal-f-maths .hb-controls label { min-width: 0; max-width: 100%; white-space: nowrap; gap: 10px; }
.portal-f-maths .hb-controls input { max-width: 320px; }
.portal-f-maths .setup-items { gap: 16px; }
.portal-f-maths .setup-items > * { min-width: 0; }
.portal-f-maths .hb-response { background: #fcf7ec; border-color: #d9c69e; border-radius: 5px; }
.portal-f-maths .hb-choices button { min-height: 42px; }
.portal-f-maths .hb-response textarea { width: 100%; max-width: 100%; }
.portal-f-maths .maths-preview-intro { color: var(--f-muted); font-size: .78rem; line-height: 1.6; }

@media (max-width: 1250px) {
  .portal-f-maths .department-shell { gap: 24px; }
  .portal-f-maths .home-highlights { grid-template-columns: 1fr; }
  .portal-f-maths .home-priorities { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .portal-f-maths .home-feature { min-height: 330px; }
  .portal-f-maths .home-feature h2 { max-width: 23ch; }
  .portal-f-maths .handbook-main .practice-grid { grid-template-columns: 1fr; }
  .portal-f-maths .handbook-main .assessment-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-f-maths .handbook-main .assessment-flow li:nth-child(3)::after { display: none; }
}
@media (max-width: 1100px) {
  .portal-f-maths .hb-toolbar { position: static; }
  .portal-f-maths .department-shell,
  .workspace-js .portal-f-maths .department-shell,
  .portal-f-maths .department-shell.menu-hidden,
  .workspace-js .portal-f-maths .department-shell.menu-hidden { display: block; padding: 0; }
  .portal-f-maths .department-sidebar,
  .workspace-js .portal-f-maths .department-sidebar,
  .portal-f-maths .menu-hidden .department-sidebar,
  .workspace-js .portal-f-maths .menu-hidden .department-sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 64px;
    max-height: none;
    height: auto;
    padding: 68px 18px 20px;
    margin: 0 0 24px;
    overflow: visible;
    box-shadow: none;
  }
  .portal-f-maths .menu-hidden .department-sidebar,
  .workspace-js .portal-f-maths .menu-hidden .department-sidebar { max-height: 64px; min-height: 64px; padding: 0; overflow: hidden; }
  .portal-f-maths .department-sidebar .department-toggle,
  .portal-f-maths .menu-hidden .department-sidebar .department-toggle {
    position: absolute;
    top: 11px;
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    height: 40px;
    min-height: 40px;
    padding: 8px 13px;
    align-items: center;
    justify-content: space-between;
    grid-template-columns: 1fr auto;
    gap: 10px;
    font-size: 1.25rem;
  }
  .portal-f-maths .department-sidebar .department-toggle::before { content: 'Department menu'; justify-self: start; font: 600 .86rem/1.4 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; }
  html[lang|='zh'] .portal-f-maths .department-sidebar .department-toggle::before { content: '部门菜单'; }
  .portal-f-maths .maths-department-heading { padding-left: 10px; }
  .portal-f-maths .maths-side-nav .maths-contents .maths-chapter-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
  .portal-f-maths .maths-support-nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-f-maths .home-highlights { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .portal-f-maths .home-priorities { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .portal-f-maths .home-feature { min-height: 380px; }
  .portal-f-maths .handbook-main .practice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .portal-f-maths .home-highlights { grid-template-columns: 1fr; }
  .portal-f-maths .home-priorities { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .portal-f-maths .home-feature { min-height: 320px; }
  .portal-f-maths .home-feature h2 { max-width: 22ch; }
  .portal-f-maths .handbook-main .practice-grid { grid-template-columns: 1fr; }
  .portal-f-maths .course-grid { grid-template-columns: 1fr; }
  .portal-f-maths.maths-layout-wide .maths-contents .maths-chapter-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-f-maths .handbook-main .assessment-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-f-maths .handbook-main .assessment-flow li:nth-child(n)::after { display: none; }
}
@media (max-width: 600px) {
  .portal-f-maths .maths-comparison,
  .portal-f-maths .department-shell,
  .workspace-js .portal-f-maths .department-shell { width: calc(100% - 36px); }
  .portal-f-maths .maths-comparison { align-items: start; padding: 16px 0 20px; font-size: .76rem; gap: 12px; }
  .portal-f-maths .maths-compare-options { width: 100%; }
  .portal-f-maths .maths-compare-options a { justify-content: center; padding: 10px 12px; min-height: 44px; }
  .portal-f-maths .maths-inline-nav { gap: 8px 20px; margin-bottom: 22px; }
  .portal-f-maths .maths-inline-nav a { font-size: .82rem; }
  .portal-f-maths .maths-side-nav .maths-contents .maths-chapter-nav,
  .portal-f-maths .maths-support-nav nav,
  .portal-f-maths.maths-layout-wide .maths-contents .maths-chapter-nav { grid-template-columns: 1fr; }
  .portal-f-maths .home-heading { padding-bottom: 22px; margin-bottom: 22px; }
  .portal-f-maths .home-heading h1 { font-size: 2.6rem; }
  .portal-f-maths .home-feature { min-height: 0; padding: 25px 23px; }
  .portal-f-maths .home-feature h2 { font-size: 2.1rem; max-width: 18ch; }
  .portal-f-maths .feature-kicker { font-size: .59rem; margin-bottom: 20px; }
  .portal-f-maths .home-priorities { grid-template-columns: 1fr; gap: 15px; }
  .portal-f-maths .priority-card,
  .portal-f-maths .priority-card.priority-dates { padding: 22px 23px; }
  .portal-f-maths .home-card-grid { grid-template-columns: 1fr; }
  .portal-f-maths .home-tile { padding: 22px 0; gap: 4px 15px; }
  .portal-f-maths .home-source-callout { padding: 21px; }
  .portal-f-maths .home-source-callout > a { margin-left: 0; }
  .portal-f-maths .handbook-heading h1 { font-size: 2.35rem; }
  .portal-f-maths .handbook-intro { font-size: 1rem; }
  .portal-f-maths .chapter { padding: 0 20px 21px; margin-bottom: 24px; }
  .portal-f-maths .chapter-title { margin: 0 -20px 20px; padding: 19px 18px; gap: 12px; }
  .portal-f-maths .chapter-number { font-size: 2rem; min-width: 34px; }
  .portal-f-maths .chapter h2 { font-size: 1.6rem; }
  .portal-f-maths .chapter-title .eyebrow { font-size: .56rem; }
  .portal-f-maths .chapter .manuscript { font-size: .96rem; }
  .portal-f-maths .model-link-grid { grid-template-columns: 1fr; }
  .portal-f-maths .setup-items { grid-template-columns: 1fr; }
  .portal-f-maths .handbook-main .assessment-flow { grid-template-columns: 1fr; }
  .portal-f-maths .school-dates li { grid-template-columns: 1fr; gap: 5px; }
  .portal-f-maths .hb-toolbar { padding: 18px; }
  .portal-f-maths .hb-controls { align-items: stretch; }
  .portal-f-maths .hb-controls label { flex-basis: 100%; }
  .portal-f-maths .hb-controls input { width: 100%; }
  .portal-f-maths.maths-layout-wide .site-main > .maths-contents { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-f-maths .home-tile,
  .portal-f-maths .priority-card,
  .portal-f-maths .home-button.handbook-launch { transition: none; }
}
@media print {
  .portal-f-maths .maths-comparison,
  .portal-f-maths .department-sidebar,
  .portal-f-maths .maths-inline-nav,
  .portal-f-maths .maths-contents,
  .portal-f-maths .hb-toolbar,
  .portal-f-maths .hb-response,
  .portal-f-maths .hb-agenda { display: none!important; }
  .portal-f-maths .department-shell,
  .workspace-js .portal-f-maths .department-shell,
  .portal-f-maths .department-shell.menu-hidden { width: 100%; max-width: none; display: block; margin: 0; padding: 0; }
  .portal-f-maths .site-main { width: 100%; padding: 0; }
  .portal-f-maths .handbook-heading { border: 0; padding: 0; }
  .portal-f-maths .chapter { border: 0; padding-inline: 0; }
  .portal-f-maths .chapter-title { margin-inline: 0; }
  .portal-f-maths .home-feature,
  .portal-f-maths .priority-card { background: #fff; border: 1px solid #aaa; break-inside: avoid; }
  .portal-f-maths .home-button.handbook-launch { background: #fff; color: #000; }
  .portal-f-maths .map-wrap,
  .portal-f-maths .reader-table { overflow: visible; }
}
