/* Lightsmith Materials. Colour tokens follow the Lightsmith Community theme; every text/background
   pair meets WCAG AA. The theme is set on <html data-theme> before first paint (see base.html). */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eceef2;
  --fg: #11151c;
  --muted: #4a5261;
  --line: #d5d9e0;
  --accent: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #e8e7fb;
  --danger: #b42318;
  --warning-bg: #fffaeb;
  --warning: #93370d;
  --focus: #2563eb;
  --plot-1: #4338ca;
  --plot-2: #c2410c;
  --plot-3: #047857;
  --plot-4: #a21caf;
  --plot-5: #0369a1;
  --plot-6: #a16207;
  --grid: #e7e9ee;
  --code-bg: #0f1320;
  --code-fg: #e6e8f0;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 1px 3px rgb(16 24 40 / 6%);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1d2230;
  --fg: #e8eaf0;
  --muted: #a3abba;
  --line: #2e3545;
  --accent: #a5b4fc;
  --accent-fg: #11151c;
  --accent-soft: #23264a;
  --danger: #f97066;
  --warning-bg: #2b2111;
  --warning: #fdb022;
  --focus: #93c5fd;
  --plot-1: #a5b4fc;
  --plot-2: #fb923c;
  --plot-3: #34d399;
  --plot-4: #f0abfc;
  --plot-5: #7dd3fc;
  --plot-6: #fde047;
  --grid: #222838;
  --code-bg: #0f1320;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font-sans); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .9em; }
sub, sup { line-height: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-fg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.page { padding-top: 20px; padding-bottom: 56px; }
.narrow { max-width: 820px; }
.section { margin-top: 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 650; color: var(--accent); margin-bottom: .4em; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 70ch; }
main:focus { outline: none; }

/* buttons, chips, badges */
.btn { display: inline-flex; align-items: center; gap: .4em; padding: .5em .9em; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font: inherit; font-size: .9rem; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn .muted { font-weight: 400; font-size: .8rem; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 .8em; }
.chip { display: inline-block; padding: .15em .65em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; text-decoration: none; font-weight: 550; }
a.chip:hover { text-decoration: underline; }
.chip-quiet { background: var(--surface-2); color: var(--muted); }
.chip-on { background: var(--accent); color: var(--accent-fg); }
.chip-lg { font-size: .95rem; padding: .35em .9em; }
.badge { display: inline-block; padding: 0 .5em; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 600; line-height: 1.6; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fg); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-weight: 450; color: var(--muted); }
.header-search { position: relative; flex: 1; max-width: 420px; margin-left: 8px; }
.header-search input { width: 100%; padding: .5em .9em; padding-right: 2em; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-size: .9rem; }
.header-search .hint { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: .4em .65em; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.main-nav a:hover { background: var(--surface); color: var(--fg); }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: inline; }
.header-cta { margin-left: auto; }
@media (max-width: 1060px) { .main-nav { display: none; } }
@media (max-width: 720px) { .header-cta, .brand-sub, .header-search .hint { display: none; } .header-search { margin-left: 0; } }

/* typeahead */
.ta-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; list-style: none; margin: 0; padding: 4px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); max-height: 70vh; overflow: auto; text-align: left; }
.ta-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.ta-list li[aria-selected="true"], .ta-list li:hover { background: var(--accent-soft); }
.ta-list .ta-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* hero */
.hero { border-bottom: 1px solid var(--line); background: radial-gradient(1200px 400px at 10% -10%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1.15fr 1fr; align-items: center; padding-top: 72px; padding-bottom: 72px; } }
.hero-title { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; }
.big-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 20px 0 12px; padding: 6px 6px 6px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); max-width: 640px; }
.big-search:focus-within { border-color: var(--accent); }
.big-search svg { color: var(--muted); flex: none; }
.big-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 1.05rem; padding: .45em 0; }
.big-search input:focus { outline: none; }
.big-search select { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 8px; padding: .45em; font: inherit; font-size: .85rem; max-width: 40%; }
.quick-links { color: var(--muted); font-size: .9rem; }
.quick-links a { white-space: nowrap; }
.hero-code { padding: 0; overflow: hidden; background: var(--code-bg); border-color: #1e2436; }
.code-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #1e2436; }
.code-head .muted { margin-left: auto; color: #8a93a8; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #2d3448; }
.hero-code .code { margin: 0; border-radius: 0; }
.hero-code-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid #1e2436; }
.hero-code-foot .btn { background: transparent; color: var(--code-fg); border-color: #2d3448; }

/* code */
.code { background: var(--code-bg); color: var(--code-fg); border-radius: 10px; padding: 16px; overflow-x: auto; line-height: 1.55; font-size: .85rem; margin: 0; tab-size: 4; }
.code code { font-size: inherit; white-space: pre; }
.tok-k { color: #c4b5fd; } .tok-s { color: #a7f3d0; } .tok-c { color: #8a93a8; font-style: italic; } .tok-n { color: #fdba74; } .tok-f { color: #93c5fd; }
.code-wrap { position: relative; }
.copy-btn { position: absolute; top: 8px; right: 8px; border: 1px solid #2d3448; background: #1a2033; color: var(--code-fg); border-radius: 6px; font: inherit; font-size: .75rem; padding: 3px 8px; cursor: pointer; }
.copy-btn:hover { background: #262e48; }
.install { display: inline-block; font-family: var(--font-mono); font-size: .85rem; padding: .35em .7em; border-radius: 8px; background: var(--surface-2); color: var(--fg); cursor: copy; white-space: nowrap; }
.hero-code .install { background: #1a2033; color: var(--code-fg); }
.install::before { content: "$ "; color: var(--muted); }

/* home grids */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.cat-grid, .shelf-grid, .mat-grid { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0; }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cat-card h3 { margin-bottom: .2em; }
.cat-card h3 a { color: var(--fg); text-decoration: none; }
.cat-card h3 a:hover { color: var(--accent); }
.cat-card .chips { margin: .6em 0 0; }
.shelf-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 16px; }
.shelf-card, .mat-card { display: flex; flex-direction: column; gap: 2px; height: 100%; text-decoration: none; color: var(--fg); padding: 16px; }
.shelf-card:hover, .mat-card:hover { border-color: var(--accent); }
.shelf-title, .mat-name { font-weight: 650; }
.shelf-meta { margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--accent); font-weight: 600; }
.mat-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 20px; }
.sec-label { color: var(--muted); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 10px; }
.cta-band { display: grid; gap: 20px; padding: 28px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1.6fr 1fr; align-items: center; } }
.cta-band p { margin: 0; color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 32px; padding-bottom: 48px; }
.stats-row > div { display: flex; flex-direction: column; }
.stat { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }

/* breadcrumbs, lists */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 16px; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.filter { width: 100%; max-width: 420px; padding: .55em .9em; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; margin: 4px 0 20px; }
.divider { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.book-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
.book-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--fg); }
.book-list a:hover { background: var(--surface); }
.book-list .book-name { overflow: hidden; text-overflow: ellipsis; }
.ds-list { list-style: none; padding: 0; margin: 0; }
.ds-list li { display: flex; align-items: center; gap: 8px; border-radius: 8px; }
.ds-list a { flex: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--fg); min-width: 0; }
.ds-list a:hover { background: var(--surface); }
.ds-list li.current a { background: var(--accent-soft); }
.ds-list li.current .ds-name { font-weight: 650; color: var(--accent); }
.ds-meta { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .8rem; }
.ds-list .cmp { width: 16px; height: 16px; margin-left: 6px; accent-color: var(--accent); flex: none; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.result-list p { flex-basis: 100%; margin: 0; color: var(--muted); }
.count { font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.tabs-inline { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs-inline .tab { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-inline .tab.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }
.empty { padding: 16px 0; }

/* material and dataset pages */
.mat-header h1, .ds-header h1 { margin-bottom: .25em; }
.h1-pre { font-weight: 500; color: var(--muted); }
.ds-sub { font-size: 1.15rem; margin-bottom: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.facts dd { margin: 0; font-size: .9rem; font-weight: 550; }
.axes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); }
.mat-layout { display: grid; gap: 20px; margin: 20px 0; }
@media (min-width: 1000px) { .mat-layout { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.pages-col h2 { margin-bottom: 0; }
.ds-layout { display: grid; gap: 20px; margin-top: 20px; }
.ds-layout > * { min-width: 0; }
@media (min-width: 1100px) { .ds-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .ds-side { position: sticky; top: 76px; } }
.side-card { padding: 16px; }
.side-card + .side-card { margin-top: 16px; }
.h-side { font-size: 1rem; margin-bottom: 8px; }
.h-side a { color: var(--fg); text-decoration: none; }
.side-scroll { max-height: 46vh; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.side-scroll .divider { margin-top: 12px; }
.clamp { max-height: 12em; overflow: hidden; position: relative; }
.clamp.open { max-height: none; }
.clamp:not(.open)::after { content: ""; position: absolute; inset: auto 0 0; height: 3em; background: linear-gradient(transparent, var(--bg)); }
.prose p, .prose li { max-width: 75ch; }
.prose blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
.ext-links { padding-left: 1.2em; }
.api-line { margin-top: 32px; }
.about-mat { max-width: 860px; }

/* plot */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: .35em .8em; font: inherit; font-size: .875rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.plot-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .875rem; color: var(--muted); }
.plot-opts select, .tool-form select, .input-unit select { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 6px; padding: .25em .4em; font: inherit; font-size: .875rem; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--accent); }
.chart { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 260px; max-height: 480px; }
.chart-sm { aspect-ratio: 16 / 7; min-height: 220px; margin-top: 12px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; font-family: var(--font-sans); }
.chart .axis text { fill: var(--muted); font-size: 12px; }
.chart .axis-label { fill: var(--muted); font-size: 12.5px; font-weight: 550; }
.chart .gridline { stroke: var(--grid); }
.chart .frame { stroke: var(--line); fill: none; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .marker { stroke: var(--muted); stroke-dasharray: 4 3; }
.chart .hover-line { stroke: var(--muted); stroke-width: 1; }
.chart .legend text { fill: var(--fg); font-size: 12.5px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: .8rem;
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%); white-space: nowrap; z-index: 2; font-variant-numeric: tabular-nums; }
.chart-tip b { font-weight: 650; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }

/* calculator */
.calc-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.calc-form label { font-weight: 600; }
.input-unit { display: inline-flex; align-items: stretch; }
.input-unit input, .tool-form input[type="number"] { width: 9em; padding: .4em .6em; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; font-variant-numeric: tabular-nums; }
.input-unit input { border-radius: 6px 0 0 6px; }
.input-unit select { border-radius: 0 6px 6px 0; border-left: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 24px; }
.calc-grid dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.calc-grid dt { color: var(--muted); font-size: .875rem; }
.calc-grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .9rem; }
.calc-grid dd[data-out="n"], .calc-grid dd[data-out="k"] { font-size: 1.05rem; font-weight: 650; color: var(--fg); }
var { font-style: italic; }
.tool-form { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; font-size: .9rem; }
.tool-form > label { display: flex; flex-direction: column; gap: 4px; font-weight: 550; }
.tool-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-form legend { font-weight: 550; padding: 0; margin-bottom: 4px; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: .9rem; }
.kv-inline dt { color: var(--muted); }
.kv-inline dd { margin: 0 8px 0 -14px; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* library card */
.library-card { background: linear-gradient(180deg, var(--accent-soft), var(--bg) 140px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.library-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.library-head h2 { margin: 0; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tab-list button { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 8px; padding: .3em .8em; font: inherit; font-size: .85rem; cursor: pointer; }
.tab-list button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
[role="tabpanel"] .muted { margin: 8px 0 0; }
.library-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }

/* formula, data, refs */
.formula-box { overflow-x: auto; padding: 16px; background: var(--surface); border-radius: 10px; font-size: 1.15rem; }
math.formula { font-size: 1.1em; }
.coef { border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.coef td, .coef th { padding: 3px 14px 3px 0; text-align: left; }
details summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin-top: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; font-size: .925rem; }
.kv dt { color: var(--muted); text-transform: capitalize; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-tight { gap: 2px 10px; font-size: .85rem; }
.kv-tight dt { text-transform: none; }
.plain { list-style: none; padding: 0; margin: 0 0 8px; }
.notice { background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); color: var(--fg); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-top: 12px; }
.notice ul { margin: 4px 0 0; padding-left: 1.2em; }
.refs { overflow-wrap: anywhere; }
.doi-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.cite { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.cite p { margin: 0 0 4px; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.table-scroll { max-height: 26rem; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { border-collapse: collapse; width: 100%; font-family: var(--font-mono); font-size: .85rem; font-variant-numeric: tabular-nums; }
.data-table th { position: sticky; top: 0; background: var(--surface); text-align: right; padding: 6px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-sans); }
.data-table td { text-align: right; padding: 3px 14px; border-bottom: 1px solid var(--grid); }
.data-table tr:hover td { background: var(--surface); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0 48px; margin-top: 24px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand { font-weight: 700; }
.footer-h { font-weight: 650; font-size: .9rem; margin-bottom: .4em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; line-height: 2; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .site-header, .site-footer, .library-card, .ds-side, [data-transmission], [data-fresnel] { display: none; } .table-scroll { max-height: none; } }
