:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #edf3f4;
  --surface-3: #dce8e8;
  --primary: #155c63;
  --primary-rgb: 21 92 99;
  --primary-strong: #082f36;
  --primary-dark: #08272d;
  --secondary: #5e4b7b;
  --secondary-rgb: 94 75 123;
  --accent: #9a6a2f;
  --accent-rgb: 154 106 47;
  --accent-on-dark: #d0a45a;
  --accent-soft: rgb(var(--accent-rgb) / 0.16);
  --text: #101820;
  --text-soft: #344851;
  --text-muted: #66787f;
  --text-on-dark: #f8fbfb;
  --text-on-dark-muted: #c8d7da;
  --muted: var(--text-soft);
  --success: #1d7357;
  --success-rgb: 29 115 87;
  --warning: #8a6518;
  --warning-rgb: 138 101 24;
  --error: #9b3a44;
  --error-rgb: 155 58 68;
  --border: #cedbde;
  --line: var(--border);
  --line-strong: rgb(var(--primary-rgb) / 0.36);
  --nav-bg: #08272d;
  --nav-surface: #0d353d;
  --nav-line: rgb(248 251 251 / 0.14);
  --radius: 6px;
  --shadow: none;
  --shadow-soft: none;
  --nav-width: clamp(312px, 21vw, 360px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #081315;
    --surface: #101d20;
    --surface-2: #15272b;
    --surface-3: #1e3439;
    --primary: #72c0c4;
    --primary-rgb: 114 192 196;
    --primary-strong: #d8f1f2;
    --primary-dark: #061114;
    --secondary: #b6a2cf;
    --secondary-rgb: 182 162 207;
    --accent: #d0a45a;
    --accent-rgb: 208 164 90;
    --accent-on-dark: #d0a45a;
    --accent-soft: rgb(var(--accent-rgb) / 0.18);
    --text: #edf6f7;
    --text-soft: #bfd0d3;
    --text-muted: #8ea4a9;
    --text-on-dark: #f8fbfb;
    --text-on-dark-muted: #c8d7da;
    --success: #74c69d;
    --success-rgb: 116 198 157;
    --warning: #e0b65a;
    --warning-rgb: 224 182 90;
    --error: #e48d96;
    --error-rgb: 228 141 150;
    --border: #2a444a;
    --line: var(--border);
    --line-strong: rgb(var(--primary-rgb) / 0.34);
    --nav-bg: #061114;
    --nav-surface: #0b2429;
    --nav-line: rgb(248 251 251 / 0.16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081315;
  --surface: #101d20;
  --surface-2: #15272b;
  --surface-3: #1e3439;
  --primary: #72c0c4;
  --primary-rgb: 114 192 196;
  --primary-strong: #d8f1f2;
  --primary-dark: #061114;
  --secondary: #b6a2cf;
  --secondary-rgb: 182 162 207;
  --accent: #d0a45a;
  --accent-rgb: 208 164 90;
  --accent-on-dark: #d0a45a;
  --accent-soft: rgb(var(--accent-rgb) / 0.18);
  --text: #edf6f7;
  --text-soft: #bfd0d3;
  --text-muted: #8ea4a9;
  --text-on-dark: #f8fbfb;
  --text-on-dark-muted: #c8d7da;
  --success: #74c69d;
  --success-rgb: 116 198 157;
  --warning: #e0b65a;
  --warning-rgb: 224 182 90;
  --error: #e48d96;
  --error-rgb: 228 141 150;
  --border: #2a444a;
  --line: var(--border);
  --line-strong: rgb(var(--primary-rgb) / 0.34);
  --nav-bg: #061114;
  --nav-surface: #0b2429;
  --nav-line: rgb(248 251 251 / 0.16);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-padding-top: 18px;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: 0;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

button {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  color: var(--primary-strong);
}

p {
  color: var(--text);
}

small,
.muted {
  color: var(--text-soft);
}

code {
  padding: 0.08rem 0.22rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--primary-dark);
  color: var(--text-on-dark);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 22px;
}

.site-kicker,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 4px 0 5px;
  color: var(--text-on-dark);
  font-size: clamp(1.42rem, 1.85vw, 1.82rem);
  line-height: 1.08;
  font-weight: 800;
}

.site-header .site-kicker,
.site-header a {
  color: var(--accent-on-dark);
}

.site-header a:hover {
  color: var(--text-on-dark);
}

.intro {
  max-width: 82ch;
  margin: 0;
  color: var(--text-on-dark-muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.site-credit {
  margin: 5px 0 0;
  color: var(--text-on-dark-muted);
  font-size: 0.78rem;
}

.nav-toggle,
.nav-close,
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
}

.nav-toggle {
  display: none;
  padding: 0 12px;
}

.nav-close {
  display: none;
  width: 32px;
}

.nav-toggle:hover,
.nav-close:hover,
.modal-close:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.nav-backdrop {
  display: none;
}

.site-layout {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 22px 54px;
}

main {
  min-width: 0;
}

main > section[hidden] {
  display: none !important;
}

.side-nav {
  position: sticky;
  top: 14px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--nav-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.nav-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--nav-line);
  color: var(--text-on-dark-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-home,
.nav-group summary,
.nav-group-links .nav-link {
  border-radius: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--text-on-dark);
  font-size: 0.82rem;
  line-height: 1.22;
  text-decoration: none;
}

.nav-home {
  color: var(--text-on-dark);
  background: rgb(var(--primary-rgb) / 0.22);
}

.nav-group {
  border: 1px solid var(--nav-line);
  border-radius: 8px;
  background: var(--nav-surface);
}

.nav-group summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 30px 9px 10px;
  color: var(--text-on-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "+";
  position: absolute;
  right: 10px;
  color: var(--text-on-dark-muted);
  font-size: 0.95rem;
}

.nav-group[open] summary::after {
  content: "-";
  color: var(--accent-on-dark);
}

.nav-group-links {
  display: grid;
  gap: 3px;
  padding: 2px 7px 9px;
}

.nav-link:hover,
.nav-link.is-active,
.nav-link.active {
  color: var(--text-on-dark);
  background: rgb(var(--primary-rgb) / 0.28);
}

.nav-link.is-active,
.nav-link.active {
  border-left: 2px solid var(--primary);
  padding-left: 8px;
  box-shadow: inset 0 0 0 1px rgb(var(--primary-rgb) / 0.22);
}

.nav-group.has-active {
  border-color: rgb(var(--primary-rgb) / 0.48);
}

.nav-group.has-active summary {
  color: var(--accent-on-dark);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-dark);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.hero {
  color: var(--text-on-dark);
}

.home-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 18px;
  min-height: min(390px, calc(100vh - 120px));
  overflow: hidden;
  align-items: stretch;
  padding: 18px;
  isolation: isolate;
}

.home-section.hero {
  background: var(--surface);
}

.home-copy,
.home-experiment-list {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.home-copy h2 {
  margin: 8px 0 10px;
  color: var(--primary-strong);
  font-size: clamp(1.72rem, 3vw, 2.64rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.home-copy p {
  max-width: 72ch;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.54;
}

.author-credit strong {
  color: var(--primary-strong);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.home-experiment-list {
  display: grid;
  gap: 12px;
  align-content: center;
}

.home-list-group {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.home-list-group h3 {
  margin: 0 0 2px;
  color: var(--text-soft);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-experiment-link {
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-2);
}

.home-experiment-link:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.home-experiment-link span {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-experiment-link strong {
  color: inherit;
  font-size: 0.82rem;
  font-weight: 760;
}

.section-card,
section.card {
  scroll-margin-top: 18px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.experiment-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.section-label {
  min-height: 20px;
  margin-bottom: 6px;
}

h2 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 1.06rem;
  line-height: 1.22;
  font-weight: 780;
}

.experiment-summary {
  max-width: 82ch;
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric-card {
  min-height: 48px;
  padding: 8px 9px;
  background: var(--surface-2);
}

.metric-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: var(--text);
  font-size: 0.79rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.experiment-body {
  display: grid;
  gap: 12px;
}

.experiment-description {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 2px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.description-block {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.description-block:last-child {
  border-bottom: 0;
}

.description-block h3 {
  margin: 0;
  color: var(--primary);
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 820;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.description-copy {
  min-width: 0;
}

.description-block p,
.description-block ul {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.48;
}

.description-block p + p,
.description-block p + .equation-box,
.description-block .equation-box + p {
  margin-top: 9px;
}

.description-block ul {
  padding-left: 18px;
}

.description-block li + li {
  margin-top: 5px;
}

.equation-box {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  background: var(--surface-2);
}

.equation-box .math-line {
  display: block;
  overflow-x: auto;
  color: var(--text);
}

.equation-box mjx-container {
  margin: 0 !important;
  text-align: left !important;
}

.equation-box mjx-container svg {
  color: var(--text);
}

.settings-stack:empty {
  display: none;
}

.details-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.details-panel summary {
  min-height: 38px;
  cursor: pointer;
  padding: 9px 12px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
  user-select: none;
}

.details-panel summary:hover {
  background: var(--accent-soft);
}

.case-heading {
  margin: 0 12px 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.data-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.table-block h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 780;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.74rem;
  table-layout: fixed;
}

th,
td {
  padding: 6px 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  overflow-wrap: anywhere;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  color: var(--primary-strong);
  background: rgb(var(--primary-rgb) / 0.10);
  font-weight: 800;
}

tbody tr:nth-child(odd) {
  background: var(--surface-2);
}

#cfl-deltat-audit tbody tr[class*="cfl-row"] {
  background:
    linear-gradient(90deg, rgb(var(--cfl-row-rgb, 8 95 99) / 0.16), transparent 48%),
    var(--surface);
  box-shadow: inset 4px 0 0 rgb(var(--cfl-row-rgb, 8 95 99) / 0.82);
}

#cfl-deltat-audit tbody tr[class*="cfl-row"]:nth-child(odd) {
  background:
    linear-gradient(90deg, rgb(var(--cfl-row-rgb, 8 95 99) / 0.18), transparent 48%),
    var(--surface-2);
}

#cfl-deltat-audit .cfl-row-tc1 { --cfl-row-rgb: 8 95 99; }
#cfl-deltat-audit .cfl-row-tc1-cubed { --cfl-row-rgb: 129 80 20; }
#cfl-deltat-audit .cfl-row-tc2 { --cfl-row-rgb: 43 103 173; }
#cfl-deltat-audit .cfl-row-tc3 { --cfl-row-rgb: 81 92 42; }
#cfl-deltat-audit .cfl-row-tc4 { --cfl-row-rgb: 155 56 74; }
#cfl-deltat-audit .cfl-row-tc5 { --cfl-row-rgb: 105 84 156; }
#cfl-deltat-audit .cfl-row-tc6 { --cfl-row-rgb: 34 118 78; }
#cfl-deltat-audit .cfl-row-tc7 { --cfl-row-rgb: 128 67 115; }

td {
  color: var(--text);
}

.table-symbol,
.table-unit {
  display: block;
}

.table-unit {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
}

.diagnostics-stack {
  display: grid;
  gap: 14px;
}

.main-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reference-video-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.reference-video-stack .reference-video-card {
  grid-column: 1 / -1;
  width: 100%;
}

.media-card,
.media-section,
.alpha-panel,
.subfigure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.media-card {
  padding: 10px;
}

.media-card h4 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 760;
}

.reference-video-card {
  padding: 12px;
  background: var(--surface);
}

.reference-video-card h4 {
  font-size: 0.9rem;
}

.reference-video-card video {
  max-height: min(72vh, 760px);
  object-fit: contain;
}

.media-section {
  padding: 12px;
}

.media-section h3 {
  margin: 0 0 6px;
  color: var(--primary-strong);
  font-size: 0.88rem;
  line-height: 1.25;
  font-weight: 780;
}

.results-section {
  background: var(--surface);
}

.diagnosis-data-list {
  margin-top: 12px;
}

.diagnosis-data-list summary {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 760;
  cursor: pointer;
}

.inline-code-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.inline-code-panel summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--primary-strong);
  font-weight: 760;
}

.inline-code-panel pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 11px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.45;
}

.asset-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
}

.asset-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.asset-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-link small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.66rem;
  letter-spacing: 0;
}

.asset-link:hover {
  border-color: var(--accent);
  color: var(--primary-strong);
}

.section-note,
.field-units {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.section-note {
  margin: 0 0 8px;
}

.field-units {
  margin: 0 0 10px;
}

.unit {
  color: var(--text-muted);
  font-size: 0.82em;
  white-space: nowrap;
}

.alpha-panel {
  overflow: hidden;
  margin-top: 10px;
  background: var(--surface);
}

.alpha-panel summary {
  min-height: 38px;
  cursor: pointer;
  padding: 9px 11px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.alpha-panel summary:hover {
  color: var(--primary);
  background: var(--accent-soft);
}

.field-tabs {
  padding: 0 10px 10px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.field-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--surface);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.field-tab.is-active,
.field-tab:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.field-tab.is-active {
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.22);
}

.snapshot-grid,
.comparison-grid,
.subfigure-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 12px;
}

.animation-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.animation-split-grid .split-figure-wide {
  grid-column: 1 / -1;
}

.animation-split-section {
  background: var(--surface);
}

.subfigure {
  min-width: 0;
  margin: 0;
  padding: 8px;
  background: var(--surface);
}

.subfigure:hover {
  border-color: var(--accent);
}

.comparison-figure {
  background: var(--surface);
}

.plot-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}

.subfigure figcaption {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: left;
}

video,
img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.plot-open img,
.media-card img,
.media-card video {
  border: 1px solid var(--line);
  background: #ffffff;
}

.empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.84rem;
  font-style: italic;
}

.plot-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(8 19 21 / 0.86);
  backdrop-filter: blur(10px);
}

.plot-modal[hidden] {
  display: none;
}

.plot-modal figure {
  width: min(1280px, 96vw);
  max-height: 94vh;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plot-modal img {
  max-height: 82vh;
  object-fit: contain;
  background: #ffffff;
}

.plot-modal figcaption {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.84rem;
  text-align: center;
}

.modal-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 51;
  width: 36px;
  height: 36px;
  padding: 0;
}

@media (max-width: 1240px) {
  .experiment-top {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 980px) {
  .site-header-inner {
    padding: 16px;
  }

  .nav-toggle,
  .nav-close {
    display: inline-flex;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: none;
    border: 0;
    background: rgb(8 19 21 / 0.58);
  }

  body.nav-open .nav-backdrop {
    display: block;
  }

  .site-layout {
    display: block;
    padding: 16px 14px 44px;
  }

  .side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: none;
    width: min(360px, 92vw);
    max-height: none;
    border-width: 0 1px 0 0;
    border-radius: 0;
  }

  body.nav-open .side-nav {
    display: flex;
  }

  .home-section,
  .main-panels {
    grid-template-columns: 1fr;
  }

  .animation-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 13.5px;
  }

  .site-header-inner {
    align-items: flex-start;
  }

  .site-header h1 {
    font-size: 1.45rem;
  }

  .intro {
    font-size: 0.86rem;
  }

  .home-section {
    min-height: auto;
    padding: 16px;
  }

  .home-copy h2 {
    font-size: 1.75rem;
    line-height: 1.08;
  }

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

  .section-card {
    padding: 13px;
  }

  .experiment-description,
  .metric-grid,
  .tables {
    grid-template-columns: 1fr;
  }

  .description-block {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .field-tab {
    flex: 1 1 128px;
  }

  table {
    min-width: 620px;
  }
}

/* Minimal scientific preview theme. */
body {
  background: var(--bg);
}

.site-header {
  background: var(--primary-dark);
}

.site-header-inner {
  padding-block: 13px;
}

.site-kicker,
.section-label {
  color: var(--primary);
}

.site-header h1 {
  font-size: clamp(1.24rem, 1.45vw, 1.58rem);
  letter-spacing: 0.02em;
}

.intro,
.site-credit,
.home-copy p {
  color: var(--text-soft);
}

.site-header .intro,
.site-header .site-credit {
  color: var(--text-on-dark-muted);
}

.nav-toggle,
.nav-close,
.modal-close,
.btn-secondary,
.field-tab {
  background: var(--surface-2);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-dark);
}

.site-layout {
  gap: 20px;
  padding-top: 16px;
}

.side-nav {
  top: 12px;
  gap: 9px;
  padding: 12px;
  background: var(--nav-bg);
  box-shadow: none;
  scrollbar-gutter: stable;
}

.nav-home {
  background: rgb(var(--primary-rgb) / 0.22);
}

.nav-group {
  background: var(--nav-surface);
}

.nav-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  column-gap: 10px;
  row-gap: 2px;
}

.nav-link:hover,
.nav-link.is-active,
.nav-link.active {
  background: rgb(var(--primary-rgb) / 0.28);
}

.nav-link.is-active,
.nav-link.active {
  border-left-color: var(--primary);
}

.nav-status {
  flex: 0 0 auto;
  max-width: 11.5rem;
  padding: 2px 6px;
  border: 1px solid rgb(var(--warning-rgb) / 0.50);
  border-radius: 999px;
  color: var(--warning);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
  text-align: center;
}

.home-section {
  min-height: auto;
}

.home-section.hero,
.home-list-group,
.home-experiment-link,
.section-card,
section.card,
.media-section,
.media-card,
.alpha-panel,
.subfigure,
.data-panel,
.details-panel {
  background: var(--surface);
}

.home-section,
.section-card,
section.card {
  border-color: var(--line);
  box-shadow: none;
}

.home-experiment-list {
  align-content: start;
}

.home-experiment-link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 7px 8px;
}

.home-experiment-link span:first-child,
.home-experiment-link strong {
  grid-column: 1;
}

.home-experiment-link .nav-status {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.section-card,
section.card {
  margin-bottom: 14px;
  padding: 14px;
}

.experiment-top {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 12px;
}

.experiment-top h2 {
  margin-top: 5px;
  font-size: 1rem;
}

.experiment-summary {
  max-width: 86ch;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.43;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0 8px;
  padding: 2px 7px;
  border: 1px solid rgb(var(--warning-rgb) / 0.50);
  border-radius: 999px;
  color: var(--warning);
  background: rgb(var(--warning-rgb) / 0.12);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
  vertical-align: middle;
}

.is-pending .experiment-top {
  border-bottom-color: rgb(var(--warning-rgb) / 0.42);
}

.metric-grid {
  border-radius: 5px;
}

.metric-card {
  min-height: 42px;
  padding: 7px 8px;
  background: var(--surface-2);
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.58rem;
}

.metric-card strong {
  font-size: 0.74rem;
}

.experiment-body,
.diagnostics-stack {
  gap: 10px;
}

.experiment-description {
  border-color: var(--line);
}

.description-block {
  gap: 14px;
  padding: 8px 0;
}

.description-block h3 {
  color: var(--primary);
  font-size: 0.7rem;
}

.description-block p,
.description-block ul {
  font-size: 0.78rem;
}

.compact-details {
  margin: 8px 0;
  border-color: var(--line);
  background: var(--surface);
}

.compact-details summary {
  position: relative;
  min-height: 34px;
  padding: 8px 34px 8px 12px;
  color: var(--primary);
  font-size: 0.76rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.compact-details summary::after,
.details-panel summary::after,
.alpha-panel summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  color: var(--text-muted);
}

.compact-details[open] summary::after,
.details-panel[open] summary::after,
.alpha-panel[open] summary::after {
  content: "-";
  color: var(--primary);
}

.compact-details .description-copy {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.equation-box {
  overflow-x: auto;
  border-color: var(--line);
  border-left-color: var(--primary);
  background: var(--surface-2);
}

.equation-box .math-line,
mjx-container[jax="SVG"] {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

mjx-container[jax="SVG"] svg {
  max-width: none;
}

.details-panel summary {
  position: relative;
  padding-right: 34px;
}

.alpha-panel summary {
  position: relative;
  padding-right: 34px;
}

.media-section {
  padding: 11px;
}

.media-section h3,
.media-card h4 {
  color: var(--primary-strong);
}

.results-section,
.comparison-figure {
  background: var(--surface);
}

.empty {
  border-color: var(--line-strong);
  color: var(--text-muted);
  background: var(--surface-2);
}

.plot-open img,
.media-card img,
.media-card video,
.plot-modal img {
  background: #ffffff;
}

@media (max-width: 1240px) {
  .experiment-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .site-header-inner {
    align-items: center;
  }

  .side-nav {
    display: flex;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 180ms ease, visibility 180ms ease;
  }

  body.nav-open .side-nav {
    transform: translateX(0);
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-nav {
    transition: none;
  }
}

@media (max-width: 760px) {
  .site-header-inner {
    gap: 12px;
  }

  .nav-toggle {
    min-width: 56px;
    padding-inline: 10px;
  }

  .section-card,
  section.card {
    padding: 12px;
  }

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

  .status-chip {
    margin: 6px 0 0;
  }

  .home-experiment-link {
    grid-template-columns: 1fr;
  }

  .home-experiment-link .nav-status {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

/* Current verification polish. */
.site-header h1 {
  font-size: clamp(1.36rem, 1.7vw, 1.82rem);
}

.intro,
.experiment-summary,
.description-block p,
.description-block ul,
.section-note,
.field-units,
.empty {
  font-size: 0.92rem;
}

.experiment-top h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.18rem;
}

.description-block h3,
.media-section h3,
.details-panel summary,
.alpha-panel summary,
.compact-details summary {
  font-size: 0.88rem;
}

.field-tab,
.metric-card strong,
.subfigure figcaption {
  font-size: 0.82rem;
}

.status-chip,
.nav-status {
  border-color: rgb(var(--warning-rgb) / 0.50);
  color: var(--warning);
  background: rgb(var(--warning-rgb) / 0.12);
}

.status-chip.status-verified,
.nav-status.status-verified {
  border-color: rgb(var(--success-rgb) / 0.50);
  color: var(--success);
  background: rgb(var(--success-rgb) / 0.12);
}

.status-chip.status-issues,
.nav-status.status-issues {
  border-color: rgb(var(--error-rgb) / 0.54);
  color: var(--error);
  background: rgb(var(--error-rgb) / 0.12);
}

.status-chip.status-scaffold,
.status-chip.status-needs-data,
.nav-status.status-scaffold,
.nav-status.status-needs-data {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: var(--surface-2);
}

.side-nav .nav-status {
  border-color: rgb(var(--warning-rgb) / 0.48);
  color: var(--text-on-dark);
  background: rgb(var(--warning-rgb) / 0.20);
}

.side-nav .nav-status.status-verified {
  border-color: rgb(var(--success-rgb) / 0.48);
  color: var(--text-on-dark);
  background: rgb(var(--success-rgb) / 0.22);
}

.side-nav .nav-status.status-issues {
  border-color: rgb(var(--error-rgb) / 0.58);
  color: var(--text-on-dark);
  background: rgb(var(--error-rgb) / 0.28);
}

.side-nav .nav-status.status-scaffold,
.side-nav .nav-status.status-needs-data {
  border-color: rgb(248 251 251 / 0.28);
  color: var(--text-on-dark-muted);
  background: rgb(248 251 251 / 0.08);
}

.status-issues .experiment-top {
  border-bottom-color: rgb(var(--error-rgb) / 0.36);
}

.status-pending .experiment-top,
.status-scaffold .experiment-top,
.status-needs-data .experiment-top {
  border-bottom-color: rgb(var(--warning-rgb) / 0.42);
}

.audit-plot-grid {
  padding: 12px;
}

.error-details {
  padding: 0;
}

.error-details summary {
  position: relative;
  min-height: 42px;
  padding: 11px 38px 11px 12px;
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 820;
  cursor: pointer;
  user-select: none;
}

.error-details summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  color: var(--accent);
}

.error-details[open] summary::after {
  content: "-";
}

.error-details .results-grid {
  padding: 0 12px 12px;
}

.home-experiment-link .nav-status {
  justify-self: end;
  white-space: nowrap;
}

.nav-link .nav-status {
  justify-self: end;
  white-space: normal;
}
