/* -------------------------
   Design Tokens
   ------------------------- */

:root {
  --bg: #f8f7f6;
  --surface: #ffffff;
  --surface-muted: #f3f2ef;
  --text: #1f2933;
  --muted: #5f6b6b;
  --border: #ddd8d0;

  --accent: #00635D;
  --accent-soft: #e9f1ef;
  --accent-strong: #004c47;

  --hero-wash: #e0e0d0;
  --hero-sage: #a0b0a0;
  --hero-line: #607070;

  --danger: #b94a48;
  --success: #2f7d57;
  --warning: #b7791f;

  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);

  --header-height: 72px;
  --content-width: 1400px;
  --shell-padding-inline: clamp(20px, 3vw, 40px);
  --production-page-surface-padding-inline: clamp(20px, 4vw, 50px);
}

/* -------------------------
   Reset / Base Styles
   ------------------------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* -------------------------
   Fixed Header
   ------------------------- */

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 24px;
  height: 100%;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--content-width);
  padding-inline: var(--shell-padding-inline);
  position: relative;
  width: 100%;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 750;
  text-decoration: none;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

/* -------------------------
   Navigation / Dropdown
   ------------------------- */

.hamburger-menu {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 5px;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.hamburger-menu:hover,
.hamburger-menu:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.bar {
  background: var(--accent);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 23px;
}

.nav-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: none;
  min-width: 280px;
  padding: 8px;
  position: absolute;
  right: var(--shell-padding-inline);
  top: calc(var(--header-height) - 8px);
  z-index: 1001;
}

.nav-dropdown.visible {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: block;
  font-weight: 650;
  padding: 10px 12px;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--accent);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  position: relative;
}

.nav-group.active .nav-group-label {
  color: var(--accent);
}

.nav-child-links {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 14px;
  padding-left: 10px;
}

.nav-child-link {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-child-link:hover {
  background: var(--surface-muted);
  color: var(--accent);
}

.nav-child-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-child-link-disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
  padding: 8px 10px;
}

/* -------------------------
   Page Shell
   ------------------------- */

.app-shell {
  flex: 1 0 auto;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: calc(var(--header-height) + 32px) var(--shell-padding-inline) 48px;
  width: 100%;
}

.app-shell--development {
  --layout-mode: development;
}

.app-shell--production {
  --layout-mode: production;
}

.app-shell--production:not(.home-app-shell) {
  padding: calc(var(--header-height) + 24px) var(--shell-padding-inline) 40px;
}

.app-shell--production .page-main {
  gap: 20px;
}

.app-shell--production .card-grid {
  gap: 14px;
}

.app-shell--production .section-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-height: auto;
  padding: 12px 4px;
}

.app-shell--production .section-card h2,
.app-shell--production .section-card h3 {
  margin-bottom: 8px;
}

.app-shell--production .math-section {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 14px 4px;
}

.app-shell--production .interacting-hero-card,
.app-shell--production .discrete-hero-card,
.app-shell--production .discrete-model-page > .model-hero-card,
.app-shell--production .continuous-hero-card,
.app-shell--production .interacting-model-page > .model-hero-card,
.app-shell--production .continuous-model-page > .model-hero-card {
  border-color: var(--accent);
  border-width: 2px;
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  max-width: 820px;
}

.page-title {
  margin: 0 0 10px;
  font-size: 2.2rem;
  line-height: 1.1;
}

.page-description {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.home-app-shell {
  margin: 0;
  max-width: none;
  padding: var(--header-height) 0 0;
  width: 100%;
}

.home-app-shell--chromeless {
  padding: 0;
}

.home-app-shell .page-main {
  gap: 0;
}

/* -------------------------
   Cards / Content Blocks
   ------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-height: 180px;
  padding: 18px;
}

.section-card h2,
.section-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.section-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
}

.module-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.notice {
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 14px 16px;
}

.plot-placeholder {
  align-items: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 260px;
  padding: 24px;
  text-align: center;
}

/* -------------------------
   Model Pages
   ------------------------- */

.model-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.app-shell--production .model-page {
  gap: 18px;
}

.app-shell--production .continuous-model-page,
.app-shell--production .interacting-model-page,
.app-shell--production .discrete-model-page {
  background: var(--surface);
  border: 1px solid rgba(221, 216, 208, 0.72);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  margin-block: -24px -40px;
  padding: 28px var(--production-page-surface-padding-inline) 34px;
}

.app-shell--production .continuous-model-page > .model-interpretation-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 14px 0;
}

.app-shell--production .discrete-model-page > .model-interpretation-card:not(.chaos-atlas-card),
.app-shell--production .interacting-model-page > .model-interpretation-card,
.app-shell--production .discrete-model-page > .model-controls-interpretation-row > .model-interpretation-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 14px 0;
}

.model-page-title {
  font-size: 2.2rem;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 -4px;
}

.model-controls-card,
.model-interpretation-card,
.model-economic-card,
.model-plot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.model-controls-card,
.model-interpretation-card {
  padding: 22px 24px;
}

.app-shell--production .model-controls-card,
.app-shell--production .model-interpretation-card,
.app-shell--production .model-economic-card {
  padding: 18px 20px;
}

.model-hero-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  padding: 30px;
}

.model-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.model-hero-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.model-hero-headline {
  color: var(--text);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1.12;
  margin: 0;
  max-width: 760px;
}

.model-hero-body {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 820px;
}

.model-hero-body p {
  margin: 0;
}

.model-hero-equation-panel {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 210px;
  padding: 20px;
}

.model-hero-equation-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-hero-equation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 20px;
}

.model-hero-equation p {
  margin: 0;
}

.model-hero-parameters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.model-hero-parameters-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.model-controls-card h2,
.model-interpretation-card h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.app-shell--production .model-controls-card h2,
.app-shell--production .model-interpretation-card h2,
.app-shell--production .model-economic-card h2 {
  margin-bottom: 12px;
}

.model-interpretation-card h3 {
  color: var(--text);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin: 18px 0 8px;
  text-transform: uppercase;
}

.model-parameter-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.model-hero-parameters .model-parameter-list {
  font-size: 0.95rem;
}

.model-parameter-list .math-markdown p,
.model-control-label .math-markdown p {
  margin: 0;
}

.model-controls-card {
  background: var(--surface);
}

.model-controls-interpretation-row {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-shell--production .model-controls-interpretation-row,
.app-shell--production .model-controls-row,
.app-shell--production .model-visual-grid {
  gap: 16px;
}

.lotka-volterra-control-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-controls-row {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.model-controls-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-shell--production .model-controls-grid {
  gap: 12px;
}

.model-controls-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.model-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.app-shell--production .model-control {
  margin-top: 12px;
}

.model-control-label-row {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.model-control-label {
  color: var(--text);
  font-weight: 700;
}

.model-control-value {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.model-control-static-value {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 9px;
  width: fit-content;
}

.model-control-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 16px 0 0;
}

.model-toggle-control {
  margin-top: 64px;
}

.model-toggle-control--compact {
  margin-top: 24px;
}

#harvesting-phase-direction-toggle {
  margin-top: 40px;
}

.model-current-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #000000;
  margin-top: 16px;
  padding: 12px 14px;
}

.app-shell--production .model-current-note {
  margin-top: 12px;
}

.model-current-note .math-markdown {
  color: #000000;
}

.saturation-hopf-copy-panel {
  color: var(--muted);
  line-height: 1.5;
}

.saturation-hopf-copy-panel p {
  margin: 0;
}

.saturation-hopf-map-panel {
  height: 470px;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.saturation-hopf-map {
  height: 470px;
  max-height: 470px;
  min-height: 470px;
  width: 100%;
}

.saturation-hopf-selector-strip {
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr) minmax(320px, 0.84fr);
}

.saturation-hopf-control-panel {
  min-width: 0;
}

.saturation-hopf-control-panel h3 {
  color: var(--text);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.saturation-hopf-slider-stack {
  display: grid;
  gap: 12px;
}

.saturation-hopf-slider-stack .model-control:first-child {
  margin-top: 0;
}

.saturation-hopf-reset-button {
  align-self: flex-start;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: 18px;
  padding: 9px 12px;
}

.saturation-hopf-reset-button:hover {
  border-color: var(--accent);
}

.saturation-hopf-threshold-note {
  border-top: 2px solid rgba(183, 121, 31, 0.32);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 10px;
  padding-top: 10px;
}

.saturation-hopf-threshold-note p {
  margin: 0;
}

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

.saturation-hopf-readout-item {
  display: grid;
  gap: 3px;
}

.saturation-hopf-readout-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saturation-hopf-readout-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.saturation-hopf-readout-item--badge {
  align-content: start;
}

.saturation-hopf-selector-badge {
  justify-self: start;
}

.saturation-phase-top-row {
  align-items: start;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
}

.saturation-phase-selection-summary {
  min-width: 0;
  margin-top: 0;
}

.saturation-phase-summary-heading {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 780;
  letter-spacing: 0.03em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.saturation-phase-summary-groups {
  display: grid;
  gap: 0;
}

.saturation-phase-summary-group {
  border-top: 1px solid rgba(25, 87, 81, 0.16);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  padding: 12px 0;
}

.saturation-phase-summary-group:last-child {
  border-bottom: 1px solid rgba(25, 87, 81, 0.16);
}

.saturation-phase-summary-group-title {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.saturation-phase-summary-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.saturation-phase-summary-metric {
  align-items: baseline;
  display: inline-flex;
  gap: 5px;
  min-width: fit-content;
}

.saturation-phase-summary-metric--badge {
  align-items: center;
}

.saturation-phase-summary-label p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  margin: 0;
}

.saturation-phase-summary-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.saturation-phase-equation-summary {
  min-width: 0;
}

.saturation-phase-equation-summary .general-2d-nullcline-grid {
  gap: 12px;
}

.saturation-phase-unavailable {
  margin-top: 0;
}

.saturation-phase-unavailable p {
  color: var(--muted);
  margin: 6px 0 0;
}

.saturation-time-series-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.saturation-time-series-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.saturation-time-series-control-card {
  min-width: 0;
}

.saturation-time-series-status-strip {
  align-items: center;
  border-bottom: 1px solid rgba(25, 87, 81, 0.16);
  border-top: 1px solid rgba(25, 87, 81, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 9px 0;
}

.saturation-time-series-interpretation {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.saturation-time-regime-badge {
  flex: 0 0 auto;
}

.saturation-time-status-message {
  color: var(--text);
  line-height: 1.4;
}

.saturation-hopf-return-button {
  align-items: center;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 720;
  margin-left: auto;
  padding: 8px 11px;
}

.saturation-hopf-return-button:hover {
  border-color: var(--accent);
}

.saturation-time-series-card {
  min-height: 0;
  padding: 0;
}

.saturation-time-series-graph {
  width: 100%;
}

.competition-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.competition-explorer-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.competition-explorer-note {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.competition-explorer-note p {
  margin: 0;
}

.competition-analytic-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(220px, 0.42fr) minmax(360px, 1fr) minmax(280px, 0.72fr);
}

.competition-control-card,
.competition-nullcline-card {
  min-width: 0;
}

.competition-control-card .model-control {
  margin: 0;
}

.competition-control-card .model-control-label {
  margin-bottom: 7px;
}

.competition-control-card .model-dropdown {
  max-width: 360px;
}

.competition-dynamic-summary {
  min-width: 0;
}

.competition-status-strip {
  align-items: center;
  border-bottom: 1px solid rgba(25, 87, 81, 0.16);
  border-top: 1px solid rgba(25, 87, 81, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 9px 12px;
  padding: 9px 0;
}

.competition-regime-badge {
  border-color: rgba(25, 87, 81, 0.42);
  flex: 0 0 auto;
  text-transform: uppercase;
}

.competition-status-message {
  color: var(--text);
  line-height: 1.4;
  min-width: min(100%, 260px);
}

.competition-summary-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding-top: 10px;
}

.competition-summary-metric {
  align-items: baseline;
  display: inline-flex;
  gap: 6px;
  min-width: fit-content;
}

.competition-summary-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.competition-summary-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.competition-summary-value .math-markdown p {
  margin: 0;
}

.competition-interior-point-value {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
}

.competition-interior-classification-badge {
  font-size: 0.74rem;
  padding: 5px 8px;
}

.competition-nullcline-card .general-2d-nullcline-grid {
  gap: 10px;
}

.competition-widget-section {
  margin-top: 2px;
}

.competition-widget-section .phase-portrait-widget {
  gap: 8px;
}

.competition-widget-section .phase-portrait-toolbar {
  border-top: 1px solid rgba(25, 87, 81, 0.12);
  gap: 8px 10px;
  padding-top: 10px;
}

.competition-widget-section .phase-portrait-canvas-wrap {
  margin-top: 0;
}

.model-playback-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 30px;
}

.model-playback-controls button {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  min-height: 36px;
  padding: 7px 12px;
}

.model-playback-controls button:hover,
.model-playback-controls button:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}

.model-next-module-row {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 4fr) minmax(180px, 1fr);
}

.app-shell--production .model-next-module-row {
  gap: 18px;
}

.model-next-module-copy .math-markdown p {
  margin: 0;
}

.model-next-module-action {
  display: flex;
  justify-content: flex-end;
}

.model-next-module-button {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  text-align: center;
  text-decoration: none;
  width: 100%;
}

.model-next-module-button:hover {
  background: var(--accent-soft);
  border-color: rgba(0, 99, 93, 0.22);
  color: var(--accent-strong);
}

.model-interpretation-card--full {
  width: 100%;
}

.model-further-reading {
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  padding-left: 12px;
}

.model-further-reading-text p {
  margin: 0;
}

.model-further-reading a {
  border-radius: 4px;
  color: var(--accent);
  font-weight: 650;
  padding: 1px 2px;
  transition: background-color 140ms ease, color 140ms ease;
}

.model-further-reading a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.model-visual-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.discrete-interactive-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.interacting-interactive-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.general-2d-explorer-section .interactive-section-band {
  display: none;
}

.limit-cycle-explorer-section .interactive-section-band {
  display: none;
}

.limit-cycle-time-series-section .interactive-section-band {
  display: none;
}

.lotka-volterra-explorer-section .interactive-section-band {
  display: none;
}

.saturation-hopf-selector-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.saturation-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.general-2d-explorer-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-cycle-explorer-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-cycle-time-series-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lotka-volterra-explorer-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saturation-hopf-selector-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saturation-explorer-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.general-2d-explorer-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.limit-cycle-explorer-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.limit-cycle-time-series-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.lotka-volterra-explorer-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.saturation-hopf-selector-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.saturation-explorer-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.general-2d-prose-divider {
  display: none;
}

.limit-cycle-interactive-break {
  background: rgba(221, 216, 208, 0.86);
  display: block;
  height: 1px;
  margin: 24px auto 30px;
  width: min(64%, 780px);
}

.general-2d-classification-card {
  overflow-x: auto;
}

.general-2d-stability-table-wrap {
  margin: 18px 0 28px;
  overflow-x: auto;
}

.general-2d-stability-table-wrap:last-child {
  margin-bottom: 0;
}

.general-2d-stability-table-title {
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: none;
}

.general-2d-stability-table {
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 920px;
  width: 100%;
}

.general-2d-stability-table--four-column th:first-child,
.general-2d-stability-table--four-column td:first-child {
  width: 22%;
}

.general-2d-stability-table--four-column th:nth-child(2),
.general-2d-stability-table--four-column td:nth-child(2) {
  width: 39%;
}

.general-2d-stability-table--four-column th:nth-child(3),
.general-2d-stability-table--four-column td:nth-child(3) {
  width: 14%;
}

.general-2d-stability-table--four-column th:last-child,
.general-2d-stability-table--four-column td:last-child {
  width: 25%;
}

.general-2d-stability-table th,
.general-2d-stability-table td {
  border-bottom: 1px solid rgba(0, 99, 93, 0.14);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

.general-2d-stability-table th {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 780;
  letter-spacing: 0;
}

.general-2d-stability-table .math-markdown p {
  margin: 0;
}

.general-2d-stability-table .math-markdown {
  min-width: 0;
}

.general-2d-stability-classification-cell {
  text-align: left;
}

.general-2d-stability-chip {
  background-color: transparent !important;
  border: 2px solid;
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 760;
  justify-content: center;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.general-2d-linearisation-derivation {
  margin-top: 20px;
}

.general-2d-linearisation-derivation > summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 760;
}

.general-2d-linearisation-derivation[open] > summary + * {
  margin-top: 20px;
}

.limit-cycle-theorem-details {
  margin-top: 20px;
}

.limit-cycle-nested-proof {
  border-left: 2px solid rgba(125, 82, 196, 0.22);
  margin-left: 16px;
  padding-left: 16px;
}

@media (max-width: 900px) {
  .general-2d-stability-table {
    font-size: 0.92rem;
    min-width: 860px;
  }

  .general-2d-stability-table th,
  .general-2d-stability-table td {
    padding: 10px 12px;
  }

  .general-2d-stability-chip {
    font-size: 0.78rem;
    padding: 6px 9px;
  }
}

.general-2d-top-row {
  align-items: stretch;
  gap: 40px;
}

.general-2d-selector-card,
.general-2d-detail-card {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.general-2d-selected-equation {
  margin-top: 18px;
}

.general-2d-selected-equation .math-markdown p,
.general-2d-nullcline-equation p,
.general-2d-jacobian-block .math-markdown p {
  margin: 0;
}

.general-2d-system-metadata {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.general-2d-system-description,
.general-2d-system-citation {
  margin: 0;
}

.general-2d-system-citation {
  font-size: 0.9rem;
  font-style: italic;
}

.general-2d-nullcline-grid {
  display: grid;
  gap: 10px;
}

.general-2d-nullcline-row {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(112px, 0.34fr) minmax(0, 1fr);
}

.general-2d-jacobian-row {
  margin-top: 18px;
}

.general-2d-nullcline-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.general-2d-nullcline-equation-cell {
  min-width: 0;
}

.general-2d-nullcline-equation-cell .math-markdown {
  text-align: left;
}

.general-2d-nullcline-equation-cell mjx-container[display="true"] {
  margin-left: 0;
  margin-right: 0;
  text-align: left !important;
}

.general-2d-detail-card .math-markdown {
  text-align: left;
}

.general-2d-detail-card mjx-container[display="true"] {
  margin-left: 0;
  margin-right: 0;
  text-align: left !important;
}

.general-2d-jacobian-block {
  margin-top: 18px;
}

.limit-cycle-parameter-note {
  color: var(--muted);
  margin-bottom: 16px;
}

.limit-cycle-parameter-note p {
  margin: 0;
}

.limit-cycle-time-series-copy {
  color: var(--muted);
  margin: 0 0 8px;
}

.limit-cycle-time-series-copy p {
  margin: 0;
}

.general-2d-fixed-point-card {
  overflow-x: auto;
}

.general-2d-fixed-point-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.general-2d-fixed-point-table th,
.general-2d-fixed-point-table td {
  border-bottom: 1px solid rgba(0, 99, 93, 0.14);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.general-2d-fixed-point-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.general-2d-table-math p {
  margin: 0;
}

.general-2d-classification-badge {
  background-color: transparent !important;
  border: 2px solid;
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.model-plot-card.general-2d-widget-section {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.model-plot-card.general-2d-widget-section .model-plot-title {
  margin-bottom: 18px;
}

.phase-portrait-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phase-portrait-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.phase-portrait-toolbar-group {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.phase-portrait-toolbar label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

.phase-portrait-toolbar select,
.phase-portrait-toolbar button {
  border: 1px solid rgba(0, 99, 93, 0.22);
  border-radius: 6px;
  font: inherit;
  min-height: 34px;
  padding: 6px 10px;
}

.phase-portrait-toggle-button,
.phase-portrait-clear-button {
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.phase-portrait-status {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.phase-portrait-canvas-wrap {
  background: #fff;
  border: 0;
  border-radius: 0;
  min-height: clamp(640px, 68vh, 820px);
  overflow: hidden;
}

.phase-portrait-canvas-wrap canvas {
  display: block;
  height: clamp(640px, 68vh, 820px);
  width: 100%;
}

.phase-portrait-diagnostics {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  gap: 4px 12px;
  grid-template-columns: repeat(5, auto minmax(0, 1fr));
  margin: 0;
}

.phase-portrait-diagnostics dt {
  font-weight: 720;
}

.phase-portrait-diagnostics dd {
  margin: 0;
  min-width: 0;
}

.periodicity-interactive-section .interactive-section-band {
  display: none;
}

.periodicity-interactive-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.periodicity-prose-divider {
  display: none;
}

.logistic-map-prose-divider {
  display: none;
}

.insect-outbreak-prose-divider {
  display: none;
}

.logistic-map-interactive-section .interactive-section-band {
  display: none;
}

.logistic-map-interactive-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.continuous-interactive-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.insect-outbreak-interactive-section .interactive-section-band {
  display: none;
}

.insect-outbreak-interactive-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.insect-outbreak-interactive-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.harvesting-interactive-section .interactive-section-band {
  display: none;
}

.harvesting-interactive-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.harvesting-interactive-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.logistic-growth-interactive-section .interactive-section-band {
  display: none;
}

.logistic-growth-interactive-section .interactive-section-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.logistic-growth-interactive-section .interactive-section-dev-title {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.continuous-interactive-section--embedded {
  gap: 18px;
  margin-top: 18px;
}

.continuous-interactive-section--embedded > .insect-local-controls-card,
.continuous-interactive-section--embedded > .insect-local-visual-grid,
.continuous-interactive-section--embedded > .insect-bifurcation-controls-row,
.continuous-interactive-section--embedded .insect-bifurcation-plot-card {
  margin-top: 0;
}

.app-shell--production .discrete-interactive-section,
.app-shell--production .interacting-interactive-section,
.app-shell--production .continuous-interactive-section {
  background: var(--surface);
  border: 1px solid rgba(0, 99, 93, 0.2);
  border-radius: var(--radius-md);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .periodicity-interactive-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .general-2d-explorer-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .limit-cycle-explorer-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .limit-cycle-time-series-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .lotka-volterra-explorer-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .saturation-hopf-selector-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .saturation-explorer-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .competition-explorer-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .logistic-map-interactive-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .insect-outbreak-interactive-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .harvesting-interactive-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .logistic-growth-interactive-section {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.app-shell--production .periodicity-interactive-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .general-2d-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .limit-cycle-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .limit-cycle-time-series-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .lotka-volterra-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .saturation-hopf-selector-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .saturation-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .competition-explorer-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .logistic-map-interactive-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .insect-outbreak-interactive-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .harvesting-interactive-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .logistic-growth-interactive-section .interactive-section-band {
  background: var(--bg);
  color: var(--text);
  display: block;
  font-size: 1.18rem;
  font-weight: 760;
  line-height: 1.25;
  padding: 14px 20px;
}

.app-shell--production .periodicity-interactive-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .general-2d-explorer-section .interactive-section-body {
  background: var(--surface);
  gap: 12px;
  padding: 20px;
}

.app-shell--production .limit-cycle-explorer-section .interactive-section-body {
  background: var(--surface);
  gap: 12px;
  padding: 20px;
}

.app-shell--production .limit-cycle-time-series-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .lotka-volterra-explorer-section .interactive-section-body {
  background: var(--surface);
  gap: 12px;
  padding: 20px;
}

.app-shell--production .saturation-hopf-selector-section .interactive-section-body {
  background: var(--surface);
  gap: 14px;
  padding: 20px;
}

.app-shell--production .saturation-explorer-section .interactive-section-body {
  background: var(--surface);
  gap: 14px;
  padding: 20px;
}

.app-shell--production .competition-explorer-section .interactive-section-body {
  background: var(--surface);
  gap: 12px;
  padding: 18px 20px 20px;
}

.app-shell--production .general-2d-selector-card,
.app-shell--production .general-2d-detail-card {
  padding: 0;
}

.app-shell--production .limit-cycle-mu-card,
.app-shell--production .limit-cycle-nullcline-card {
  padding: 0;
}

.app-shell--production .limit-cycle-time-series-control-card {
  padding: 0;
}

.app-shell--production .limit-cycle-fixed-point-card {
  padding: 0;
}

.app-shell--production .lotka-volterra-control-card,
.app-shell--production .lotka-volterra-nullcline-card,
.app-shell--production .lotka-volterra-fixed-point-card {
  padding: 0;
}

.app-shell--production .competition-control-card,
.app-shell--production .competition-nullcline-card {
  padding: 0;
}

.app-shell--production .general-2d-top-row {
  gap: 40px;
}

.app-shell--production .limit-cycle-top-row {
  gap: 40px;
}

.app-shell--production .limit-cycle-time-series-controls {
  gap: 40px;
}

.app-shell--production .lotka-volterra-phase-control-row,
.app-shell--production .lotka-volterra-control-row {
  gap: 40px;
}

.app-shell--production .lotka-volterra-control-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lotka-volterra-parameter-note {
  color: var(--muted);
  line-height: 1.45;
  margin: 26px 0 0;
}

.lotka-volterra-parameter-note p {
  margin: 0;
}

.app-shell--production .interacting-model-page > .general-2d-prose-divider {
  background: rgba(221, 216, 208, 0.72);
  display: block;
  height: 1px;
  margin: 12px auto 14px;
  width: min(58%, 720px);
}

.app-shell--production
  .interacting-model-page
  > .general-2d-prose-divider
  + .model-interpretation-card {
  margin-top: 8px;
}

.app-shell--production .general-limit-cycles-page > .limit-cycle-interactive-break {
  margin: 28px auto 34px;
}

.app-shell--production .discrete-model-page > .periodicity-prose-divider {
  background: rgba(221, 216, 208, 0.72);
  display: block;
  height: 1px;
  margin: 8px auto 10px;
  width: min(58%, 720px);
}

.app-shell--production
  .discrete-model-page
  > .periodicity-prose-divider
  + .model-interpretation-card {
  margin-top: 6px;
}

.app-shell--production .discrete-model-page > .logistic-map-prose-divider {
  background: rgba(221, 216, 208, 0.72);
  display: block;
  height: 1px;
  margin: 8px auto 10px;
  width: min(58%, 720px);
}

.app-shell--production
  .discrete-model-page
  > .logistic-map-prose-divider
  + .model-interpretation-card,
.app-shell--production
  .discrete-model-page
  > .logistic-map-prose-divider
  + .model-controls-interpretation-row {
  margin-top: 6px;
}

.app-shell--production .continuous-model-page > .insect-outbreak-prose-divider {
  background: rgba(221, 216, 208, 0.72);
  display: block;
  height: 1px;
  margin: 8px auto 10px;
  width: min(58%, 720px);
}

.app-shell--production
  .continuous-model-page
  > .insect-outbreak-prose-divider
  + .model-interpretation-card {
  margin-top: 6px;
}

.app-shell--production .logistic-map-interactive-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .insect-outbreak-interactive-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .harvesting-interactive-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .logistic-growth-interactive-section .interactive-section-body {
  background: var(--surface);
  gap: 16px;
  padding: 20px;
}

.app-shell--production .insect-outbreak-interactive-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .harvesting-interactive-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .logistic-growth-interactive-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .general-2d-explorer-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .limit-cycle-explorer-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .limit-cycle-time-series-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .lotka-volterra-explorer-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .saturation-hopf-selector-section .interactive-section-dev-title,
.app-shell--production .saturation-explorer-section .interactive-section-dev-title,
.app-shell--production .competition-explorer-section .interactive-section-dev-title {
  display: none;
}

.app-shell--production .insect-outbreak-interactive-section .insect-local-controls-card,
.app-shell--production .insect-outbreak-interactive-section .insect-local-visual-grid,
.app-shell--production .insect-outbreak-interactive-section .insect-bifurcation-controls-row,
.app-shell--production .insect-outbreak-interactive-section .insect-bifurcation-plot-card {
  margin-top: 0;
}

.app-shell--production .periodicity-interactive-section
  .interactive-section-body
  > .model-controls-card
  > h2,
.app-shell--production .periodicity-interactive-section
  .interactive-section-body
  > .chaos-atlas-card
  > h2,
.app-shell--production .periodicity-interactive-section
  .interactive-section-body
  > .model-controls-interpretation-row
  > .model-controls-card
  > h2 {
  display: none;
}

.app-shell--production .discrete-interactive-section .model-controls-card,
.app-shell--production .discrete-interactive-section .model-interpretation-card,
.app-shell--production .discrete-interactive-section .model-plot-card,
.app-shell--production .interacting-interactive-section .model-controls-card,
.app-shell--production .interacting-interactive-section .model-interpretation-card,
.app-shell--production .interacting-interactive-section .model-plot-card,
.app-shell--production .continuous-interactive-section .model-controls-card,
.app-shell--production .continuous-interactive-section .model-interpretation-card,
.app-shell--production .continuous-interactive-section .model-economic-card,
.app-shell--production .continuous-interactive-section .model-plot-card {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.app-shell--production .discrete-interactive-section .model-current-note,
.app-shell--production .discrete-interactive-section .higher-cycle-summary-panel {
  background: rgba(248, 247, 246, 0.72);
  border-color: transparent;
  box-shadow: none;
}

.app-shell--production
  .periodicity-interactive-section
  .higher-cycle-summary-panel {
  align-self: start;
  padding-top: 0;
}

.app-shell--production
  .periodicity-interactive-section
  .higher-cycle-summary-panel
  h3 {
  margin-top: 0;
}

.app-shell--production
  .discrete-model-page
  .periodicity-period-two-proof {
  margin-top: 20px;
}

.app-shell--production
  .discrete-model-page
  .periodicity-period-two-proof
  > summary {
  color: var(--accent);
}

.app-shell--production
  .discrete-model-page
  .periodicity-period-two-proof[open]
  > summary
  + * {
  margin-top: 20px;
}

.app-shell--production
  .discrete-model-page
  .logistic-map-invariant-proof {
  margin-top: 20px;
}

.app-shell--production
  .discrete-model-page
  .logistic-map-invariant-proof
  > summary {
  color: var(--accent);
}

.app-shell--production
  .discrete-model-page
  .logistic-map-invariant-proof[open]
  > summary
  + * {
  margin-top: 20px;
}

.app-shell--production .discrete-model-page > .chaos-atlas-card {
  background: var(--surface);
  border-color: rgba(0, 99, 93, 0.2);
  box-shadow: none;
  padding: 20px;
}

.app-shell--production .discrete-model-page .chaos-atlas-selector-panel {
  background: rgba(248, 247, 246, 0.72);
  border-color: transparent;
}

.app-shell--production .discrete-model-page .chaos-atlas-image-frame {
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.app-shell--production .continuous-interactive-section .model-current-note {
  background: rgba(248, 247, 246, 0.72);
}

.period-two-example-grid {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
}

.app-shell--production .period-two-example-grid {
  gap: 22px;
}

.period-two-example-grid .model-control {
  margin-top: 0;
}

.higher-cycle-explorer-grid {
  align-items: start;
  display: grid;
  gap: 68px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-shell--production .higher-cycle-explorer-grid {
  gap: 40px;
}

.higher-cycle-copy-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.higher-cycle-copy-panel .model-control {
  margin-top: 0;
}

.higher-cycle-summary-panel {
  background: var(--bg);
  color: #000000;
  margin-top: 0;
}

.higher-cycle-summary-panel h3,
.higher-cycle-summary-panel .math-markdown {
  color: #000000;
}

.higher-cycle-length-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.higher-cycle-length-control label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.orbit-example-details {
  margin-top: 20px;
}

.chaos-atlas-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-shell--production .chaos-atlas-card,
.app-shell--production .chaos-atlas-display {
  gap: 14px;
}

.chaos-atlas-dropdown {
  color: var(--text);
}

.chaos-atlas-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chaos-atlas-image-frame {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 10px;
}

.chaos-atlas-image {
  display: block;
  height: auto;
  width: 100%;
}

.chaos-atlas-copy-grid {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
}

.app-shell--production .chaos-atlas-copy-grid {
  gap: 22px;
}

.chaos-atlas-title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 760;
  line-height: 1.35;
  margin: 0 0 8px;
}

.chaos-atlas-title p {
  margin: 0;
}

.chaos-atlas-selector-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.app-shell--production .chaos-atlas-selector-panel {
  padding: 12px;
}

.model-plot-card {
  min-height: 460px;
  padding: 18px;
}

.model-plot-card--full {
  grid-column: 1 / -1;
}

.model-plot-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  margin-bottom: 14px;
}

.model-plot-title p {
  margin: 0;
}

.model-plot-graph {
  min-height: 420px;
  width: 100%;
}

.model-plot-placeholder {
  align-items: center;
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  min-height: 380px;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.model-economic-card {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.85fr);
  padding: 22px 24px;
}

.model-economic-card h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 12px;
}

.model-economic-copy {
  min-width: 0;
}

.model-yield-placeholder .model-plot-card {
  height: 100%;
  min-height: 420px;
}

.insect-local-controls-card {
  margin-top: 18px;
}

.insect-current-note {
  background: var(--bg);
  color: #000000;
}

.insect-current-note .math-markdown {
  color: #000000;
}

.insect-local-visual-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.insect-bifurcation-controls-row {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  margin-top: 18px;
}

.insect-bifurcation-controls-stack {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.insect-bifurcation-plot-card {
  margin-top: 18px;
}

/* -------------------------
   Home Page
   ------------------------- */

.home-hero {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.46) 48%, rgba(255, 255, 255, 0.22) 100%),
    url("/assets/images/population-dynamics-hero.png");
  background-color: var(--surface-muted);
  background-position: center;
  background-size: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(28px, 3vw, 44px) var(--shell-padding-inline) 28px;
  position: relative;
}

.home-hero-inner {
  align-items: start;
  display: grid;
  flex: 1 0 auto;
  gap: clamp(44px, 7vw, 96px);
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.86fr);
  margin: 0 auto;
  max-width: var(--content-width);
  padding: clamp(68px, 10vh, 128px) 0 clamp(52px, 7vh, 74px);
  width: 100%;
}

.home-hero-copy {
  max-width: 760px;
}

.home-hero-title {
  color: var(--text);
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.98;
  margin: 0 0 22px;
}

.home-hero-description {
  color: var(--text);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 720px;
}

.home-hero-note {
  border-left: 2px solid rgba(95, 107, 107, 0.18);
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  max-width: 640px;
  padding-left: 18px;
}

.home-explore-rail {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.12);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 34px);
  padding: clamp(22px, 3vw, 34px);
}

.home-explore-heading {
  color: var(--text);
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.home-explore-link {
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  display: flex;
  gap: 16px;
  padding: 6px 0;
  text-decoration: none;
}

.home-explore-link:hover {
  background: transparent;
  border-color: transparent;
}

.home-explore-number {
  color: rgba(31, 41, 51, 0.34);
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.25;
  transition: color 150ms ease;
  width: 34px;
}

.home-explore-link:hover .home-explore-number {
  color: var(--accent);
}

.home-explore-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-explore-title {
  color: var(--text);
  font-size: 1.14rem;
  font-weight: 760;
  line-height: 1.25;
}

.home-explore-description {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
}

.home-further-reading {
  background: transparent;
  flex: 0 0 auto;
  margin: 0 auto;
  opacity: 1;
  padding: 0 0 clamp(50px, 6vh, 64px);
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.86);
  width: 100%;
}

.home-further-reading-inner {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: 0;
}

.home-further-reading-heading {
  color: rgba(31, 41, 51, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.home-reading-list {
  display: grid;
  gap: 13px;
  list-style: none;
  margin: 0;
  max-width: 920px;
  padding: 0;
}

.home-reading-item {
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 0;
}

.home-reading-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.home-reading-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.home-reading-title:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-reading-role {
  color: rgba(31, 41, 51, 0.66);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

.home-attribution {
  align-items: center;
  bottom: 30px;
  display: flex;
  gap: 10px;
  left: var(--shell-padding-inline);
  position: absolute;
}

.home-attribution-text {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.home-attribution-link {
  align-items: center;
  display: inline-flex;
  opacity: 0.64;
  text-decoration: none;
}

.home-attribution-link:hover {
  opacity: 1;
}

.home-attribution-icon {
  display: block;
  height: 20px;
  width: 20px;
}

.not-found-hero-inner {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: clamp(56px, 10vh, 112px) 0;
}

.not-found-panel {
  align-items: flex-start;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 860px;
  padding: 0;
  text-align: left;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.86);
}

.not-found-message {
  color: var(--text);
  font-size: clamp(1.6rem, 3.2vw, 3.05rem);
  line-height: 1.12;
  margin: 0;
}

.not-found-home-link {
  color: rgba(0, 99, 93, 0.78);
  font-size: 1.08rem;
  font-weight: 760;
  text-decoration: none;
  text-underline-offset: 4px;
}

.not-found-home-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.app-footer-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  height: var(--header-height);
  min-height: var(--header-height);
  width: 100%;
}

.app-footer-inner {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 0 auto;
  max-width: var(--content-width);
  min-height: 100%;
  padding-inline: var(--shell-padding-inline);
  width: 100%;
}

.footer-attribution {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.footer-github-link {
  align-items: center;
  display: inline-flex;
  opacity: 0.72;
  text-decoration: none;
}

.footer-github-link:hover {
  opacity: 1;
}

.footer-github-icon {
  display: block;
  height: 22px;
  width: 22px;
}

/* -------------------------
   Continuous Page
   ------------------------- */

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  padding: 26px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-headline {
  color: var(--text);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  line-height: 1.12;
  margin: 0;
  max-width: 680px;
}

.hero-body {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 700px;
}

.hero-body p {
  margin: 0;
}

.hero-callouts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.hero-pill {
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 650;
  padding: 6px 10px;
}

.hero-equations {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.hero-equation-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.equation-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero-equation {
  color: var(--text);
  line-height: 1.3;
}

.hero-equation p {
  margin: 0;
}

.continuous-note {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 12px 14px;
}

.continuous-landing-page,
.interacting-landing-page,
.discrete-landing-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-shell--production .continuous-landing-page,
.app-shell--production .interacting-landing-page,
.app-shell--production .discrete-landing-page {
  background: var(--surface);
  border: 1px solid rgba(221, 216, 208, 0.72);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  gap: 20px;
  margin-block: -24px -40px;
  padding: 28px var(--production-page-surface-padding-inline) 34px;
}

.app-shell--production .continuous-landing-page .continuous-note,
.app-shell--production .continuous-landing-page .math-section,
.app-shell--production .interacting-landing-page .continuous-note,
.app-shell--production .interacting-landing-page .math-section,
.app-shell--production .discrete-landing-page .continuous-note,
.app-shell--production .discrete-landing-page .math-section {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-inline: 0;
}

.app-shell--production .continuous-landing-page .explore-rail,
.app-shell--production .interacting-landing-page .explore-rail,
.app-shell--production .discrete-landing-page .explore-rail {
  border-color: rgba(0, 99, 93, 0.22);
  border-width: 1px;
  box-shadow: none;
}

.app-shell--production .continuous-landing-page .module-card,
.app-shell--production .interacting-landing-page .module-card,
.app-shell--production .discrete-landing-page .module-card {
  background: rgba(248, 247, 246, 0.72);
  border-color: rgba(221, 216, 208, 0.88);
}

.continuous-note .math-markdown {
  color: var(--muted);
  line-height: 1.5;
}

.continuous-note p {
  margin: 0;
}

.continuous-layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 3fr) minmax(480px, 2fr);
}

.continuous-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.explore-rail {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.explore-rail-header h2 {
  color: var(--text);
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 780;
  line-height: 1.16;
}

.explore-rail-header p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.module-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.module-card-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.module-card-link .module-card {
  border-color: var(--border);
}

.module-card-link:hover .module-card {
  background: var(--accent-soft);
  border-color: rgba(0, 99, 93, 0.22);
}

.module-card-title {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0 0 6px;
}

.module-card-meta {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0;
}

.math-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}

.math-section h2,
.planned-modules h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.math-markdown {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.math-markdown p:first-child {
  margin-top: 0;
}

.math-markdown p:last-child,
.math-markdown ul:last-child {
  margin-bottom: 0;
}

.math-markdown li {
  margin: 4px 0;
}

.planned-modules {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* -------------------------
   Responsive Rules
   ------------------------- */

@media (max-width: 1280px) {
  .interacting-hero-card,
  .interacting-model-page > .model-hero-card {
    grid-template-columns: 1fr;
  }
}

/* Large desktop keeps the generous composition; this band trims only the
   desktop/laptop pressure points. Mobile remains intentionally basic. */
@media (min-width: 1024px) and (max-width: 1440px) {
  .home-hero {
    padding: clamp(20px, 2.4vw, 34px) var(--shell-padding-inline) 24px;
  }

  .home-hero-inner {
    gap: clamp(28px, 4.2vw, 58px);
    grid-template-columns: minmax(0, 0.98fr) minmax(360px, 0.8fr);
    padding: clamp(34px, 5vh, 48px) 0 clamp(24px, 4vh, 36px);
  }

  .home-hero-copy {
    max-width: min(690px, 100%);
  }

  .home-hero-title {
    font-size: clamp(2.85rem, 4.15vw, 3.75rem);
    margin-bottom: 16px;
  }

  .home-hero-description {
    font-size: clamp(1rem, 1.35vw, 1.12rem);
    line-height: 1.45;
    margin-bottom: 14px;
    max-width: min(660px, 100%);
  }

  .home-hero-note {
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: min(600px, 100%);
    padding-left: 14px;
  }

  .home-explore-rail {
    gap: clamp(12px, 1.8vh, 18px);
    padding: clamp(20px, 2.1vw, 28px);
    width: 100%;
  }

  .home-explore-heading {
    font-size: 0.98rem;
    margin-bottom: 0;
  }

  .home-explore-link {
    gap: 12px;
    padding: 2px 0;
  }

  .home-explore-number {
    font-size: 0.94rem;
    width: 30px;
  }

  .home-explore-title {
    font-size: 1.02rem;
  }

  .home-explore-description {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .home-further-reading {
    padding-bottom: 62px;
  }

  .home-further-reading-heading {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .home-reading-list {
    gap: 7px;
    max-width: min(820px, 100%);
  }

  .home-reading-item {
    gap: 2px;
  }

  .home-reading-title {
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .home-reading-role {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .home-attribution {
    bottom: 24px;
  }
}

@media (max-width: 1100px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
  }

  .home-explore-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-explore-heading {
    grid-column: 1 / -1;
  }

  .home-hero {
    height: auto;
    min-height: 100vh;
  }

  .home-hero-inner {
    height: auto;
    min-height: auto;
    padding-bottom: clamp(34px, 5vh, 56px);
  }

  .home-further-reading {
    padding-bottom: 76px;
    position: static;
  }

  .home-reading-list {
    grid-template-columns: 1fr;
  }

  .continuous-layout {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .model-controls-interpretation-row,
  .model-controls-grid,
  .saturation-hopf-selector-strip,
  .saturation-phase-top-row,
  .competition-analytic-layout,
  .period-two-example-grid,
  .higher-cycle-explorer-grid,
  .model-hero-card {
    grid-template-columns: 1fr;
  }

  .saturation-hopf-slider-grid,
  .saturation-hopf-readout {
    grid-template-columns: 1fr;
  }

  .saturation-phase-summary-group {
    grid-template-columns: 1fr;
  }

  .competition-summary-metrics {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell--production .lotka-volterra-control-row {
    grid-template-columns: 1fr;
  }

  .model-controls-interpretation-row > .model-interpretation-card {
    order: -1;
  }

  .general-2d-top-row > .model-interpretation-card {
    order: 0;
  }

  .model-controls-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .continuous-main {
    width: 100%;
  }

  .explore-rail {
    order: -1;
    position: static;
    width: 100%;
  }

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

}

@media (max-width: 760px) {
  .header-inner {
    gap: 16px;
    padding-inline: 20px;
  }

  .app-shell {
    padding: calc(var(--header-height) + 24px) 20px 36px;
  }

  .home-app-shell {
    padding: var(--header-height) 0 0;
  }

  .home-app-shell--chromeless {
    padding: 0;
  }

  .brand-subtitle {
    display: none;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .nav-dropdown {
    left: 20px;
    min-width: 0;
    right: 20px;
  }

  .home-hero {
    height: auto;
    min-height: auto;
    padding: 24px 20px 28px;
  }

  .home-hero-inner {
    gap: 24px;
    height: auto;
    min-height: auto;
    padding: 58px 0 32px;
  }

  .home-explore-rail {
    display: flex;
  }

  .home-further-reading {
    padding: 0 0 76px;
    position: static;
  }

  .home-further-reading-inner {
    padding: 0;
  }

  .home-attribution {
    bottom: 28px;
    left: 20px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .hero-equations {
    padding: 14px;
  }

  .continuous-layout {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .model-visual-grid {
    grid-template-columns: 1fr;
  }

  .chaos-atlas-copy-grid {
    grid-template-columns: 1fr;
  }

  .insect-local-visual-grid {
    grid-template-columns: 1fr;
  }

  .insect-bifurcation-controls-row {
    grid-template-columns: 1fr;
  }

  .model-controls-grid--four {
    grid-template-columns: 1fr;
  }

  .model-economic-card {
    grid-template-columns: 1fr;
  }

  .model-plot-card {
    min-height: 360px;
  }

  .phase-portrait-canvas-wrap {
    min-height: 520px;
  }

  .phase-portrait-canvas-wrap canvas {
    height: 520px;
  }

  .model-plot-placeholder {
    min-height: 280px;
  }

  .continuous-main {
    width: 100%;
  }

  .explore-rail {
    order: -1;
    position: static;
    width: 100%;
  }

  .module-card-stack {
    display: grid;
    grid-template-columns: 1fr;
  }

  .model-next-module-row {
    grid-template-columns: 1fr;
  }

  .model-next-module-action {
    justify-content: flex-start;
  }

  .model-next-module-button {
    width: auto;
  }

  .math-section {
    padding: 18px;
  }
}
