:root {
  color-scheme: light;
  --ink: #17242b;
  --muted: #52636b;
  --brand: #173f4f;
  --brand-deep: #0d2e3a;
  --accent: #e39a22;
  --accent-soft: #fff3d9;
  --line: #d7e0e3;
  --surface: #f4f7f8;
  --white: #fff;
  --danger-soft: #fff6e8;
  --max-width: 1180px;
  --content-width: 800px;
  --shadow: 0 14px 38px rgb(13 46 58 / 8%);
  --shadow-card: 0 8px 24px rgb(13 46 58 / 7%);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-size: 1rem;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--brand-deep);
  background: #ffe0a6;
}

a {
  color: #0d607c;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: #073e51;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid #f3b94f;
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.content-width {
  max-width: var(--content-width);
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 0;
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--brand-deep);
  transform: translateY(-120%);
}

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

.site-header {
  position: relative;
  z-index: 10;
  color: var(--white);
  background: var(--brand-deep);
  border-bottom: 4px solid var(--accent);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--white);
  text-decoration: none;
}

.brand:hover {
  color: var(--white);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--brand-deep);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.25;
}

.brand small {
  margin-top: 0.15rem;
  color: #bfd0d6;
  font-size: 0.72rem;
}

.desktop-nav {
  display: flex;
  gap: 1.15rem;
  align-items: center;
}

.desktop-nav a {
  color: #e7f0f2;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.desktop-nav a:hover,
.desktop-nav a.router-link-active {
  color: #ffd68b;
}

.mobile-nav {
  display: none;
}

.page-masthead {
  position: relative;
  overflow: hidden;
  padding: 2.4rem 0 3rem;
  background:
    linear-gradient(125deg, rgb(23 63 79 / 97%), rgb(13 46 58 / 94%)),
    repeating-linear-gradient(135deg, transparent 0 28px, rgb(255 255 255 / 5%) 28px 29px);
  color: var(--white);
}

.page-masthead::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 42px solid rgb(246 185 74 / 13%);
  border-radius: 50%;
}

.breadcrumbs {
  position: relative;
  z-index: 1;
  margin-bottom: 2.2rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #c8d7dc;
  font-size: 0.82rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: #78939d;
}

.breadcrumbs a {
  color: #e5eef0;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 0.65rem;
  color: #ffd68b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-masthead h1 {
  position: relative;
  z-index: 1;
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  line-height: 1.07;
  letter-spacing: -0.035em;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 68ch;
  margin: 1.2rem 0 0;
  color: #d8e4e7;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.page-content {
  min-width: 0;
  padding-block: 2.5rem 5rem;
}

.discovery {
  display: grid;
  gap: 3.5rem;
}

.discovery + .article-layout,
.discovery + .prose {
  margin-top: 3.5rem;
}

.discovery-section {
  min-width: 0;
}

.discovery-section--tinted {
  position: relative;
  z-index: 0;
  padding-block: 3rem;
}

.discovery-section--tinted::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: #edf4f5;
  border-block: 1px solid var(--line);
  box-shadow: 0 0 0 100vmax #edf4f5;
  clip-path: inset(0 -100vmax);
}

.section-intro {
  max-width: 710px;
  margin-bottom: 1.4rem;
}

.section-intro h2 {
  margin: 0.15rem 0 0.5rem;
  color: var(--brand-deep);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.section-intro p:last-child {
  margin: 0;
  color: var(--muted);
}

.section-kicker {
  margin: 0 0 0.25rem;
  color: #8a5a08;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

.card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-card,
.content-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 245px;
  padding: 1.35rem;
  flex-direction: column;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

.topic-card:hover,
.content-card:hover {
  color: var(--ink);
  border-color: #8da6af;
  box-shadow: 0 12px 30px rgb(13 46 58 / 12%);
  transform: translateY(-2px);
}

.topic-card__mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 1.3rem;
  place-items: center;
  color: var(--brand-deep);
  background: var(--accent-soft);
  border: 1px solid #edc778;
  border-radius: 8px;
  font-weight: 900;
}

.topic-card__type,
.content-card__type {
  margin-bottom: 0.45rem;
  color: #6b551d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-card strong,
.content-card strong {
  color: var(--brand-deep);
  font-size: 1.18rem;
  line-height: 1.3;
}

.topic-card strong + span,
.content-card strong + span {
  margin: 0.65rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.card-link {
  margin-top: auto;
  color: #0d607c;
  font-size: 0.88rem;
  font-weight: 800;
}

.content-card--tool {
  border-top: 4px solid var(--accent);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.task-grid a {
  display: flex;
  padding: 0.9rem 1rem;
  justify-content: space-between;
  gap: 1rem;
  color: var(--brand-deep);
  background: var(--white);
  border: 1px solid #c8d7dc;
  border-radius: 6px;
  font-weight: 720;
  text-decoration: none;
}

.editorial-note {
  padding: 1.25rem 1.4rem;
  background: #fff9ed;
  border: 1px solid #edcf94;
  border-left: 5px solid var(--accent);
  border-radius: 7px;
}

.editorial-note p {
  margin: 0.35rem 0 0;
  color: #4d5d63;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(160px, 215px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.article-body {
  min-width: 0;
}

.article-toc {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 2.5rem);
  padding: 1rem 1rem 1rem 1.1rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.article-toc__title {
  margin: 0 0 0.55rem;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-toc ol {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding-left: 1.15rem;
  color: #84959b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.article-toc a {
  display: block;
  min-height: 24px;
  padding-block: 0.18rem;
  color: #365560;
  text-decoration: none;
}

.article-toc a:hover {
  color: #0d607c;
  text-decoration: underline;
}

.status-notice {
  margin-bottom: 2.3rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid #5c7c88;
  border-radius: 6px;
}

.status-notice--tool {
  background: var(--danger-soft);
  border-left-color: var(--accent);
}

.calculator-plan {
  margin-bottom: 2.5rem;
  padding: 1.35rem;
  background: var(--danger-soft);
  border: 1px solid #efce91;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
}

.calculator-plan .eyebrow {
  color: #865b10;
}

.calculator-plan h2 {
  margin: 0.2rem 0 0.5rem;
  color: var(--brand-deep);
  font-size: 1.45rem;
}

.calculator-plan h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.calculator-plan p {
  margin: 0;
}

.calculator-plan__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.calculator-plan__grid ul {
  margin: 0;
  padding-left: 1.2rem;
}

.status-notice strong,
.status-notice p {
  display: block;
}

.status-notice p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.prose {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.prose h2,
.sources h2,
.related h2 {
  margin: 3rem 0 1rem;
  color: var(--brand-deep);
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.prose h2 {
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  color: var(--brand);
  font-size: 1.25rem;
  line-height: 1.3;
}

.prose p,
.prose li {
  max-width: 75ch;
}

/* Give technical articles a wider reading measure without changing legal or tool pages. */
.page-shell--article .prose p,
.page-shell--article .prose li {
  max-width: 88ch;
}

.prose p {
  margin: 0.85rem 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin-block: 0.5rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.85rem 1.2rem;
  color: #31474f;
  background: #edf4f5;
  border-left: 4px solid var(--brand);
}

.prose code {
  padding: 0.12em 0.32em;
  background: #edf1f2;
  border-radius: 3px;
  font-size: 0.9em;
}

.table-scroll-region {
  min-width: 0;
  margin: 1.5rem 0;
}

.table-scroll-hint {
  display: none;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.table-scroll-region.is-overflowing .table-scroll-hint {
  display: block;
}

.table-scroll-viewport {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.table-scroll-viewport:focus-visible,
.budget-table-wrap:focus-visible {
  outline: 3px solid #efb43c;
  outline-offset: 2px;
}

.prose table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.content-figure {
  width: min(100%, 840px);
  margin: 2rem auto;
}

.content-figure__viewport {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-radius: 8px;
}

.content-figure__viewport:focus-visible {
  outline: 3px solid #efb43c;
  outline-offset: 2px;
}

.content-figure__hint {
  display: none;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.content-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .content-figure__hint {
    display: block;
  }

  .content-figure__viewport {
    border: 1px solid var(--line);
  }

  .content-figure img {
    width: max(100%, var(--figure-mobile-width));
    max-width: none;
    border: 0;
    border-radius: 0;
  }
}

@media (min-width: 1000px) {
  .content-figure__hint {
    display: block;
  }

  /* Wider article columns show complete 640px diagrams without horizontal scrolling. */
  .page-shell--article .content-figure__hint {
    display: none;
  }

  .content-figure__viewport {
    border: 1px solid var(--line);
  }

  .content-figure img {
    width: max(100%, var(--figure-mobile-width));
    max-width: none;
    border: 0;
    border-radius: 0;
  }
}

.prose th,
.prose td {
  min-width: 150px;
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

.prose th {
  color: var(--brand-deep);
  background: #eaf0f2;
}

.sources,
.commercial-resources,
.related {
  margin-top: 3.2rem;
  padding-top: 0.2rem;
  border-top: 3px solid var(--brand);
}

.commercial-resources {
  padding: 1.2rem 1.25rem;
  background: #f4f7f7;
  border: 1px solid var(--line);
  border-top: 3px solid #6f858d;
  border-radius: 8px;
}

.commercial-resources h2 {
  margin-top: 0.15rem;
}

.commercial-disclosure {
  color: var(--muted);
  font-size: 0.92rem;
}

.commercial-resource > a {
  color: var(--brand-deep);
  font-weight: 700;
}

.commercial-resource p {
  margin-bottom: 0.45rem;
}

.commercial-resource small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.sources ol,
.related ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}

.sources li,
.related li {
  margin-block: 0.75rem;
}

.related li {
  margin: 0;
}

.related a {
  display: flex;
  height: 100%;
  padding: 0.85rem 0.95rem;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--brand-deep);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.sources small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
}

.calculator {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 50% 3rem;
  padding: 1.4rem;
  overflow: hidden;
  transform: translateX(-50%);
  background: #eef4f5;
  border: 1px solid #c8d7dc;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.calculator--wide {
  width: min(1240px, calc(100vw - 2rem));
}

.calculator__heading {
  margin-bottom: 1.25rem;
}

.calculator__heading .eyebrow {
  color: #865b10;
}

.calculator__heading h2 {
  margin: 0.2rem 0 0.4rem;
  color: var(--brand-deep);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
}

.calculator__heading p:last-child,
.section-heading p {
  margin: 0;
  color: var(--muted);
}

.calculator__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.calculator__panel {
  min-width: 0;
  padding: 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculator__panel h3,
.calculator__panel h4 {
  margin-top: 0;
  color: var(--brand-deep);
}

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

.calculator label,
.calculator legend {
  color: #263c45;
  font-size: 0.88rem;
  font-weight: 700;
}

.calculator label small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 450;
}

.calculator input:not([type="radio"]):not([type="checkbox"]),
.calculator select,
.calculator textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 0.3rem;
  padding: 0.58rem 0.65rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #9db1b9;
  border-radius: 5px;
  font: inherit;
  font-size: 0.92rem;
}

.calculator textarea {
  resize: vertical;
}

.calculator input:focus,
.calculator select:focus,
.calculator textarea:focus,
.button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid #f3b94f;
  outline-offset: 2px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  margin-top: 0.3rem;
}

.input-with-unit input {
  min-width: 0;
  margin-top: 0 !important;
  border-radius: 5px 0 0 5px !important;
}

.input-with-unit > span {
  display: grid;
  min-width: 54px;
  padding: 0.45rem;
  place-items: center;
  color: #3f555e;
  background: #edf2f3;
  border: 1px solid #9db1b9;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.choice-row legend {
  width: 100%;
  margin-bottom: 0.35rem;
}

.checkbox-label {
  display: flex !important;
  grid-column: 1 / -1;
  gap: 0.55rem;
  align-items: center;
  margin-block: 0.6rem;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.calculator__inputs {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.calculator__noscript {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.calculator__details {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

details.calculator__details summary {
  margin-bottom: 0.8rem;
  cursor: pointer;
  color: var(--brand-deep);
  font-weight: 750;
}

.calculator__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.button,
.text-button {
  min-height: 42px;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
  color: var(--white);
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 5px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
}

.button--secondary {
  color: var(--brand-deep);
  background: var(--white);
}

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

.text-button {
  min-height: 36px;
  padding: 0.4rem 0.55rem;
  color: #8b2f24;
  background: transparent;
  border-color: #cda8a2;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.result-grid > div {
  padding: 0.85rem;
  background: #f3f7f8;
  border-left: 4px solid var(--brand);
  border-radius: 4px;
}

.result-grid span,
.result-grid strong,
.result-grid small {
  display: block;
}

.result-grid span,
.result-grid small {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-grid strong {
  margin: 0.25rem 0;
  color: var(--brand-deep);
  font-size: 1.25rem;
  line-height: 1.2;
}

.form-error,
.warning-list,
.unresolved,
.peak-result--unknown,
.unknown-state {
  padding: 0.8rem 0.95rem;
  color: #743718;
  background: #fff4df;
  border-left: 4px solid var(--accent);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #a43b2c;
  box-shadow: 0 0 0 2px rgb(164 59 44 / 16%);
}

.warning-list,
.unresolved ul {
  padding-left: 2rem;
}

.result-scope {
  margin-top: 1.2rem;
  padding-top: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.copy-status {
  min-height: 1.5em;
  margin-bottom: 0;
  color: #27603c;
  font-size: 0.85rem;
  font-weight: 700;
}

.budget-section,
.budget-results {
  margin-bottom: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.budget-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.budget-table-wrap + *,
.known-contribution {
  overflow-wrap: anywhere;
}

.known-contribution {
  display: block;
  margin-top: 0.25rem;
}

.budget-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

.budget-table th,
.budget-table td {
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

.budget-table th {
  color: var(--brand-deep);
  background: #eaf0f2;
  font-size: 0.82rem;
}

.budget-table label + label {
  display: block;
  margin-top: 0.65rem;
}

.scenario-card {
  margin-top: 1rem;
  padding: 1rem;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.event-fields {
  margin-top: 0.8rem;
  padding: 0.9rem;
  background: var(--white);
  border-left: 4px solid var(--accent);
}

.event-fields .count-grid {
  margin-block: 0.8rem;
}

.full-field {
  grid-column: 1 / -1;
}

.scenario-results,
.peak-result,
.unresolved {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.scenario-results ul,
.peak-result ul,
.unresolved ul {
  margin-bottom: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-footer {
  padding: 3rem 0 1.4rem;
  color: #d7e3e6;
  background: var(--brand-deep);
  border-top: 5px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
}

.footer-grid p {
  max-width: 55ch;
  color: #aebfc5;
}

.footer-grid nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

.footer-grid a {
  color: #e7f0f2;
}

.footer-note {
  margin-top: 2rem;
  padding-top: 1.2rem;
  color: #9db0b7;
  border-top: 1px solid #315361;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .budget-table-hint {
    display: block;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    position: relative;
    display: block;
  }

  .mobile-nav summary {
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    color: var(--white);
    border: 1px solid #55737e;
    border-radius: 4px;
  }

  .mobile-nav nav {
    position: absolute;
    right: 0;
    top: calc(100% + 0.65rem);
    width: min(270px, calc(100vw - 2rem));
    padding: 0.6rem;
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
  }

  .mobile-nav nav a {
    display: block;
    padding: 0.65rem 0.75rem;
    color: var(--brand-deep);
    text-decoration: none;
  }

  .calculator__layout {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .article-toc {
    position: static;
    max-height: none;
  }

  .card-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 1.25rem), var(--max-width));
  }

  .header-inner {
    min-height: 72px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .page-masthead {
    padding: 1.5rem 0 2.2rem;
  }

  .breadcrumbs {
    margin-bottom: 1.45rem;
  }

  .page-content {
    padding-block: 1.6rem 3.5rem;
  }

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

  .calculator-plan__grid {
    grid-template-columns: 1fr;
  }

  .calculator {
    width: calc(100vw - 1rem);
    padding: 0.65rem;
  }

  .calculator__panel {
    padding: 0.85rem;
  }

  .form-grid,
  .count-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
  }

  .card-grid--three,
  .card-grid--two,
  .task-grid,
  .related ul {
    grid-template-columns: 1fr;
  }

  .topic-card,
  .content-card {
    min-height: 0;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .status-notice,
  .article-toc,
  .calculator__actions {
    display: none;
  }

  .table-scroll-hint {
    display: none !important;
  }

  .page-masthead {
    padding: 1rem 0;
    color: var(--ink);
    background: none;
  }

  .lede,
  .eyebrow,
  .breadcrumbs ol {
    color: var(--ink);
  }

  .calculator {
    width: 100%;
    margin: 0 0 2rem;
    padding: 0;
    transform: none;
    border: 0;
    box-shadow: none;
  }

  .calculator__layout,
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calculator__panel,
  .result-grid > div,
  .scenario-card,
  .peak-result,
  .unresolved {
    break-inside: avoid;
  }

  .budget-table-wrap {
    overflow: visible;
  }

  .budget-table {
    width: 100%;
    min-width: 0;
    font-size: 8pt;
  }

  .article-layout {
    display: block;
  }

  a {
    color: inherit;
  }
}
