/* Sensor modalities site: shell stylesheet (w3-frontend, 2026-11-26).
   Section 1: theme tokens. Dark = RuView dark professional (STORYBOARD tokens). Light = the one-pager's original :root.
   Section 2: the one-pager's own <style> block, kept so every existing class works (hard-coded colours now variables).
   Section 3: site shell (top bar, sidebar, page header, cards, figures, physics badges, prev/next).
   Section 4: responsive + print. No web fonts, no external requests. */

:root, [data-theme="dark"] {
  color-scheme: dark;
  --fg: #e6edf3;
  --fg-2: #c9d1d9;
  --fg-3: #8b949e;
  --fg-4: #484f58;
  --bg: #0d1117;
  --card: #161b22;
  --elevated: #1c2333;
  --stroke: #30363d;
  --stroke-strong: #3d4651;
  --hover: #242d3d;
  --accent: #a78bfa;          /* link/text violet: 7.0:1 on #0d1117 */
  --accent-strong: #7c3aed;   /* fills, white text 5.7:1 */
  --accent-hover: #6d28d9;
  --accent-soft: rgba(124, 58, 237, .18);
  --glow: rgba(124, 58, 237, .15);
  --success: #3fb950;
  --success-bg: rgba(63, 185, 80, .14);
  --warn: #d29922;
  --warn-bg: rgba(210, 153, 34, .14);
  --info: #58a6ff;
  --info-bg: rgba(88, 166, 255, .10);
  --error: #f85149;
  --error-bg: rgba(248, 81, 73, .12);
  --th-bg: #1c2333;
  --th-row-bg: #161b22;
  --zebra: #11161d;
  --row-hover: #1f2937;
  --seg-active-bg: #7c3aed;
  --seg-active-fg: #ffffff;
  --seg-active-stroke: #7c3aed;
  --topbar-bg: rgba(13, 17, 23, .92);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --mono: "JetBrains Mono", "Fira Code", Consolas, "SF Mono", Menlo, Monaco, ui-monospace, monospace;
  --topbar-h: 52px;
  --sidebar-w: 264px;
  --pad: 28px;
  --r1: 4px; --r2: 6px; --r3: 8px; --r4: 12px;
  /* figure palette (STORYBOARD): dark values */
  --fig-ink: #e6edf3; --fig-muted: #8b949e; --fig-line: #30363d; --fig-accent: #7c3aed;
  --fig-or: #f0883e; --fig-em: #58a6ff; --fig-ac: #3fb950; --fig-th: #d29922; --fig-bad: #f85149; --fig-bg: #161b22;
}
[data-theme="light"] {
  color-scheme: light;
  --fg: #141414;
  --fg-2: #3f3f46;
  --fg-3: #71717a;
  --fg-4: #a1a1aa;
  --bg: #fcfcfc;
  --card: #ffffff;
  --elevated: #ffffff;
  --stroke: #e4e4e7;
  --stroke-strong: #d4d4d8;
  --hover: #f4f4f5;
  --accent: #1d4ed8;
  --accent-strong: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --glow: rgba(29, 78, 216, .10);
  --success: #047857;
  --success-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --th-bg: #f4f4f5;
  --th-row-bg: #fafafa;
  --zebra: #fafafa;
  --row-hover: #f0f7ff;
  --seg-active-bg: #141414;
  --seg-active-fg: #ffffff;
  --seg-active-stroke: #141414;
  --topbar-bg: rgba(252, 252, 252, .92);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --fig-ink: #141414; --fig-muted: #71717a; --fig-line: #d4d4d8; --fig-accent: #7c3aed;
  --fig-or: #c2410c; --fig-em: #1d4ed8; --fig-ac: #047857; --fig-th: #b45309; --fig-bad: #b91c1c; --fig-bg: #ffffff;
}

/* ===== Section 2: the one-pager's original stylesheet (colours variableized) ===== */
/* original :root tokens now live under [data-theme="light"] below */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: none; padding: 24px var(--pad) 64px; }
.doc-header { margin-bottom: 16px; }
.doc-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.summary { margin: 0 0 6px; color: var(--fg-2); max-width: 90rem; }
.exported { margin: 0; color: var(--fg-3); font-size: 12px; }
.area-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  margin: 0 0 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
}
.area-nav a, .btn, .seg {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.area-nav a:hover, .btn:hover, .seg:hover { background: var(--hover); }
.seg.active, .area-nav a[aria-current="true"] {
  background: var(--fg);
  color: var(--seg-active-fg);
  border-color: var(--fg);
}
.sec, #families, #family-map, #abstract { scroll-margin-top: 72px; }
.sec { margin: 1.75rem 0 2rem; }
.sec > h2, .sec details > summary h2 {
  margin: 0 0 0.6rem;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.sec details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec details > summary::-webkit-details-marker { display: none; }
.sec details > summary::before {
  content: "▸";
  color: var(--fg-3);
  width: 1em;
}
.sec details[open] > summary::before { content: "▾"; }
.sec details > summary h2 { display: inline; }
.caption { color: var(--fg-2); margin: 0 0 12px; max-width: 90rem; }
.text { margin: 0.7rem 0; max-width: 90rem; }
.bullets, .numbers, .key-rows { margin: 0.6rem 0 0.8rem; padding-left: 1.3rem; max-width: 90rem; }
.bullets li, .numbers li, .key-rows li { margin: 0.3rem 0; }
.key-rows .detail { color: var(--fg-2); }
.callout {
  margin: 0.8rem 0 1rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--info-bg);
  max-width: 90rem;
}
.callout .lead { margin-right: 0.25rem; }
.metrics, .columns-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.metric, .col-point {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
}
.metric-value, .col-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-label, .col-label { color: var(--fg-2); font-size: 13px; }
.metric-detail { color: var(--fg-3); font-size: 12px; }
.grid {
  display: grid;
  gap: 10px 16px;
  margin: 10px 0 14px;
}
.ctrl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctrl-label { font-size: 12px; color: var(--fg-2); }
.ctrl select, .ctrl input[type="search"], .ctrl input[type="text"] {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  width: 100%;
}
.ctrl.toggle { flex-direction: row; align-items: center; gap: 8px; height: 32px; margin-top: 18px; }
.ctrl.toggle input { width: 14px; height: 14px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  height: 22px;
  border-radius: 999px;
  background: var(--hover);
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
}
.badge.tone-accent { background: var(--accent-soft); color: var(--accent); }
.badge.tone-success { background: var(--success-bg); color: var(--success); }
.badge.tone-neutral { background: var(--hover); color: var(--fg-2); }
.badge.tone-warning { background: var(--warn-bg); color: var(--warn); }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 13px;
}
table.data th, table.data td {
  border: 1px solid var(--stroke);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
table.data thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  background: var(--th-bg);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--stroke-strong);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
table.data tbody tr:nth-child(even) { background: var(--zebra); }
table.data tbody tr:hover { background: var(--row-hover); }
table.data.heatmap th, table.data.heatmap td { text-align: center; }
table.data.heatmap th[scope="row"] { text-align: left; background: var(--th-row-bg); position: sticky; left: 0; z-index: 2; }
.req-grid-heading { margin: 1.1rem 0 0.2rem; font-size: 16px; }
.toc { background: var(--card); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; max-width: 48rem; }
.toc h3 { margin: 0 0 8px; font-size: 13px; color: var(--fg-2); font-weight: 600; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: 3px 0; }
.toc li.depth-1 { padding-left: 16px; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.link-cards { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; }
.link-cards a { color: var(--accent); }
.link-cards .site { color: var(--fg-3); font-size: 12px; }
.chart-wrap { width: 100%; margin: 8px 0 16px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.sources { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--stroke); }
.sources h2 { font-size: 18px; }
.sources ol { padding-left: 1.3rem; }
.sources li { margin: 0.25rem 0; overflow-wrap: anywhere; }
.area-block { margin-top: 2rem; padding-top: 0.5rem; }
#count-note { color: var(--fg-2); }
.floating-skip { display: none; }

/* ===== Section 3: site shell ===== */
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
body { font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); }
a:hover { color: var(--accent); text-decoration: underline; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r1); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 8px 12px; background: var(--accent-strong); color: #fff; }
.skip-link:focus { left: 8px; top: 8px; }

/* dark-theme re-skin of original controls */
.seg.active, .area-nav a[aria-current="true"] { background: var(--seg-active-bg); border-color: var(--seg-active-stroke); color: var(--seg-active-fg); }
.btn, .seg { transition: background .12s, border-color .12s; }
.btn:hover, .seg:hover { border-color: var(--accent-strong); }
.seg.active:hover { background: var(--accent-hover); }
[data-theme="light"] .seg.active:hover { background: #27272a; }
.callout { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, var(--stroke)); }
.callout.tone-info { border-left: 3px solid var(--info); }
.callout.tone-warning, .callout.tone-warn { background: var(--warn-bg); border-left: 3px solid var(--warn); }
.callout.tone-success { background: var(--success-bg); border-left: 3px solid var(--success); }
.callout.tone-accent { background: var(--accent-soft); border-left: 3px solid var(--accent-strong); }
.badge { color: var(--fg-2); }
.badge.tone-danger, .badge.tone-error { background: var(--error-bg); color: var(--error); }
.badge.tone-info { background: var(--info-bg); color: var(--info); }
.ctrl select, .ctrl input[type="search"], .ctrl input[type="text"] { background: var(--elevated); }
.ctrl select:focus, .ctrl input:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--glow); outline: none; }
.ctrl.toggle input { accent-color: var(--accent-strong); }
.metric, .col-point, .toc { background: var(--card); }
.metric-value { color: var(--fg); }
.sec > h2, .sec details > summary h2 { color: var(--fg); }
.sec h3 { font-size: 16px; margin: 1.1rem 0 .4rem; }
.sec details > summary::before { font-size: 16px; line-height: 1; color: var(--fg-3); }
.sec details > summary:hover::before { color: var(--accent); }

/* tables: horizontal + vertical scroll box so the sticky header works inside it */
.table-wrap {
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow: auto;
  border: 1px solid var(--stroke);
  border-radius: var(--r3);
  background: var(--card);
  overscroll-behavior-x: contain;
}
.table-wrap table.data { border-style: hidden; }
.table-wrap table.data thead th { top: 0; }
table.data thead th { white-space: normal; }
table.data td { color: var(--fg-2); }
table.data td:first-child { color: var(--fg); }
table.data th[data-sort] { cursor: pointer; user-select: none; padding-right: 20px; position: sticky; }
table.data th[data-sort]::after { content: "↕"; position: absolute; right: 6px; color: var(--fg-3); font-size: 11px; }
table.data th[data-sort][aria-sort="ascending"]::after { content: "▲"; color: var(--accent); }
table.data th[data-sort][aria-sort="descending"]::after { content: "▼"; color: var(--accent); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.clamp-cells .req-grid-set td { max-width: 28ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count-note, [data-count] { color: var(--fg-2); font-size: 13px; }
.grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 8px; }
.grid-toolbar .ctrl.toggle { margin-top: 0; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px 0 20px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 650; font-size: 15px; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--fg); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: var(--r2); background: linear-gradient(135deg, #7c3aed, #58a6ff); box-shadow: 0 0 0 3px var(--glow); flex: none; }
.topnav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--r2); color: var(--fg-3); text-decoration: none; font-size: 13px; white-space: nowrap; }
.topnav a:hover { color: var(--fg); background: var(--hover); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent-strong); }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 10px; border-radius: var(--r2); border: 1px solid var(--stroke-strong); background: var(--card); color: var(--fg-2); font: inherit; font-size: 13px; cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
.menu-btn { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 12px 40px 16px;
  border-right: 1px solid var(--stroke);
  background: var(--bg);
  scrollbar-width: thin;
}
.side-toc-toggle { display: none; }
.side-title { margin: 0 0 8px 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.side-toc ul { list-style: none; margin: 0; padding: 0; }
.side-toc li { margin: 1px 0; }
.side-toc a { display: block; padding: 4px 8px; border-radius: var(--r2); color: var(--fg-3); text-decoration: none; font-size: 13px; line-height: 1.35; border-left: 2px solid transparent; }
.side-toc a:hover { color: var(--fg); background: var(--hover); text-decoration: none; }
.side-toc li.lvl-3 a { padding-left: 20px; font-size: 12.5px; }
.side-toc a.active { color: var(--fg); background: var(--accent-soft); border-left-color: var(--accent-strong); }
.page { min-width: 0; padding: 20px var(--pad) 48px; }

/* page header + breadcrumb */
.page-header { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke); }
.page-header h1, .doc-header h1 { margin: 6px 0 8px; font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; color: var(--fg); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--fg-3); }
.breadcrumb li + li::before { content: "/"; margin-right: 4px; color: var(--fg-4); }
.breadcrumb a { color: var(--fg-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--fg-2); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* card grid (index / hardware) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 20px; padding: 0; list-style: none; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); color: var(--fg); text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
a.card:hover { border-color: var(--accent-strong); background: var(--elevated); text-decoration: none; color: var(--fg); transform: translateY(-1px); box-shadow: 0 0 0 3px var(--glow); }
.card-title { font-weight: 600; font-size: 15px; color: var(--fg); }
.card-desc { color: var(--fg-2); font-size: 13px; }
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; color: var(--fg-3); font-size: 12px; }

/* figures */
.fig { margin: 12px 0 20px; padding: 12px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--fig-bg); break-inside: avoid; max-width: 72rem; }
.fig svg, .fig img { display: block; width: 100%; height: auto; max-height: 70vh; }
.fig figcaption, .fig .fig-caption { margin-top: 8px; color: var(--fg-3); font-size: 12.5px; line-height: 1.45; }
.fig figcaption b, .fig figcaption strong { color: var(--fg-2); }

/* physics-group badges: distinct hue + 3-letter code, text >= 4.5:1 in both themes */
.phys-EMW { --ph: #58a6ff; } .phys-EMQ { --ph: #39c5cf; } .phys-OPT { --ph: #e3b341; } .phys-ION { --ph: #ff7b9c; }
.phys-AIR { --ph: #56d364; } .phys-WAT { --ph: #a5b4fc; } .phys-SOL { --ph: #d6a77a; } .phys-THR { --ph: #ff9b52; }
.phys-CHM { --ph: #b5d334; } .phys-ELE { --ph: #f778ba; } .phys-DIG { --ph: #a0aab4; } .phys-MIX { --ph: #c4a5ff; }
[data-theme="light"] .phys-EMW { --ph: #1d4ed8; } [data-theme="light"] .phys-EMQ { --ph: #155e75; }
[data-theme="light"] .phys-OPT { --ph: #92400e; } [data-theme="light"] .phys-ION { --ph: #9f1239; }
[data-theme="light"] .phys-AIR { --ph: #166534; } [data-theme="light"] .phys-WAT { --ph: #4338ca; }
[data-theme="light"] .phys-SOL { --ph: #7c4a1e; } [data-theme="light"] .phys-THR { --ph: #9a3412; }
[data-theme="light"] .phys-CHM { --ph: #3f6212; } [data-theme="light"] .phys-ELE { --ph: #a21caf; }
[data-theme="light"] .phys-DIG { --ph: #475569; } [data-theme="light"] .phys-MIX { --ph: #6d28d9; }
.badge[class*="phys-"], .phys-badge {
  color: var(--ph); background: color-mix(in srgb, var(--ph) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ph) 45%, transparent);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; height: 20px; line-height: 18px;
}
.phys-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ph); margin-right: 6px; vertical-align: middle; }
.phys-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 8px 0 12px; font-size: 12px; color: var(--fg-2); }
.phys-legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* prev / next + footer */
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--stroke); }
.prevnext a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--stroke); border-radius: var(--r3); background: var(--card); text-decoration: none; }
.prevnext a:hover { border-color: var(--accent-strong); text-decoration: none; background: var(--elevated); }
.prevnext .next { text-align: right; grid-column: 2; }
.pn-label { font-size: 12px; color: var(--fg-3); }
.pn-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.site-footer { padding: 18px var(--pad) 28px; border-top: 1px solid var(--stroke); color: var(--fg-3); font-size: 12px; }
.site-footer a { color: var(--fg-3); }

/* ===== Section 4: responsive ===== */
@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--stroke); padding: 10px var(--pad); }
  .side-toc-toggle { display: inline-flex; }
  .side-title { display: none; }
  .sidebar .side-toc { display: none; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
  .sidebar.open .side-toc { display: block; }
  .side-toc-toggle .chev { transition: transform .15s; }
  .sidebar.open .side-toc-toggle .chev { transform: rotate(90deg); }
}
@media (max-width: 899px) {
  .menu-btn { display: inline-flex; }
  .topnav { display: none; }
  body.nav-open .topnav {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--topbar-h); left: 0; right: 0;
    padding: 8px 12px 12px; background: var(--card); border-bottom: 1px solid var(--stroke); box-shadow: var(--shadow);
    max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  }
  body.nav-open .topnav a { height: 40px; font-size: 14px; }
}
@media (max-width: 799px) {
  :root { --pad: 14px; }
  .page-header h1, .doc-header h1 { font-size: 22px; }
  .grid.plain { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .card-grid { grid-template-columns: 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { grid-column: 1; }
  .metric-value { font-size: 20px; }
  .theme-toggle .lbl { display: none; }
  .grid.plain { gap: 8px 10px; }
  .grid.plain .ctrl.toggle, .grid.plain .ctrl:has(input[type="search"]) { grid-column: 1 / -1; margin-top: 0; }
  table.data:not(.heatmap) th, table.data:not(.heatmap) td { min-width: 7.5rem; }
  table.data:not(.heatmap) td:first-child { min-width: 9.5rem; }
  .table-wrap { max-height: 78vh; }
}
@media (max-width: 359px) {
  .grid.plain { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* original print rules, then site print rules */
@media print {
  @page { size: landscape; margin: 10mm; }
  :root { --pad: 0px; }
  body { background: #fff; font-size: 11px; }
  .area-nav, .segmented, .btn, .ctrl, .grid.plain, .ctrl.toggle { display: none !important; }
  .page { padding: 0; }
  .doc-header { margin-bottom: 8px; }
  table.data { width: 100% !important; font-size: 10px; }
  table.data th, table.data td { padding: 4px 5px; }
  table.data thead th { position: static; box-shadow: none; background: #f0f0f0; }
  table.data tbody tr { break-inside: avoid; page-break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .area-block, .sec, .req-grid-set { break-inside: avoid; }
  details[open] > summary::before, details > summary::before { content: none; }
  a { color: inherit; text-decoration: none; }
  .chart-wrap { break-inside: avoid; }
}


/* site print: always light, no chrome, everything open, animation frozen */
@media print {
  :root, [data-theme="dark"], [data-theme="light"] {
    color-scheme: light;
    --fg: #141414; --fg-2: #3f3f46; --fg-3: #52525b; --fg-4: #71717a;
    --bg: #ffffff; --card: #ffffff; --elevated: #ffffff; --stroke: #d4d4d8; --stroke-strong: #a1a1aa; --hover: #f4f4f5;
    --accent: #1d4ed8; --accent-strong: #1d4ed8; --accent-soft: #eff6ff; --glow: transparent;
    --success: #047857; --success-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --info: #1d4ed8; --info-bg: #eff6ff;
    --error: #b91c1c; --error-bg: #fef2f2;
    --th-bg: #f0f0f0; --th-row-bg: #fafafa; --zebra: #fafafa; --row-hover: transparent;
    --seg-active-bg: #141414; --seg-active-fg: #fff; --seg-active-stroke: #141414;
    --fig-ink: #141414; --fig-muted: #71717a; --fig-line: #d4d4d8; --fig-accent: #7c3aed;
    --fig-or: #c2410c; --fig-em: #1d4ed8; --fig-ac: #047857; --fig-th: #b45309; --fig-bad: #b91c1c; --fig-bg: #ffffff;
    --pad: 0px;
  }
  .phys-EMW { --ph: #1d4ed8; } .phys-EMQ { --ph: #155e75; } .phys-OPT { --ph: #92400e; } .phys-ION { --ph: #9f1239; }
  .phys-AIR { --ph: #166534; } .phys-WAT { --ph: #4338ca; } .phys-SOL { --ph: #7c4a1e; } .phys-THR { --ph: #9a3412; }
  .phys-CHM { --ph: #3f6212; } .phys-ELE { --ph: #a21caf; } .phys-DIG { --ph: #475569; } .phys-MIX { --ph: #6d28d9; }
  body { background: #fff; color: #141414; }
  .topbar, .sidebar, .skip-link, .prevnext, .menu-btn, .theme-toggle, .grid-toolbar { display: none !important; }
  .layout { display: block; }
  .page { padding: 0; }
  .table-wrap { max-height: none; overflow: visible; border: 0; }
  .table-wrap table.data { border: 1px solid #d4d4d8; }
  /* the one-pager kept whole sections together; on the site that pushes big grids to a new page */
  .sec, .area-block, .req-grid-set { break-inside: auto; page-break-inside: auto; }
  table.data thead { display: table-header-group; }
  table.data tbody tr:nth-child(even) { background: #fafafa; }
  .clamp-cells .req-grid-set td { max-width: none; white-space: normal; overflow: visible; }
  .fig, .card, .metric, .callout, figure, svg { break-inside: avoid; page-break-inside: avoid; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  a.card:hover { transform: none; box-shadow: none; }
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .site-footer { border-top: 1px solid #d4d4d8; padding: 8px 0 0; }
}

/* ===== Section 5: round 3 additions (symposium subnav, footer credits, forms, contact) ===== */
.subnav { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; margin: 0 0 18px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r2, 8px); background: var(--card); }
.subnav-title { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin-right: 6px; }
.subnav a { font-size: 13px; padding: 3px 9px; border-radius: 999px; text-decoration: none; color: var(--fg); border: 1px solid transparent; }
.subnav a:hover { border-color: var(--stroke); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent-strong); }
.site-footer .footer-grid { display: grid; gap: 6px; max-width: 1100px; margin: 0 auto; }
.site-footer p { margin: 0; font-size: 13px; line-height: 1.5; }
.site-footer .foot-credits { font-size: 14px; }
.site-footer .foot-meta { opacity: .85; }
.site-footer a { color: var(--accent); }
.symp-link code { font-size: 12px; }
.fig .fig-body svg { max-width: 100%; height: auto; }
/* forms */
#submit-form { max-width: 760px; border: 1px solid var(--stroke); border-radius: 10px; padding: 18px 20px; background: var(--card); }
#submit-form .form-field { display: grid; gap: 4px; margin: 0 0 14px; }
#submit-form label, #submit-form legend { font-weight: 600; font-size: 14px; }
#submit-form .hint { font-size: 12.5px; color: var(--fg-3); }
#submit-form input[type="text"], #submit-form input[type="email"], #submit-form input[type="url"], #submit-form select, #submit-form textarea { width: 100%; box-sizing: border-box; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--stroke); border-radius: 6px; padding: 8px 10px; }
#submit-form textarea { min-height: 120px; resize: vertical; }
#submit-form input:focus, #submit-form select:focus, #submit-form textarea:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--glow, rgba(124,58,237,.3)); outline: none; }
#submit-form fieldset.form-field { border: 1px solid var(--stroke); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
#submit-form .form-choice { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-weight: 400; }
#submit-form .form-choice input { margin-top: 4px; accent-color: var(--accent-strong); }
#submit-form button[type="submit"] { background: var(--accent-strong); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
#submit-form button[disabled] { opacity: .6; cursor: progress; }
.form-card .err, .form-card [role="alert"] { color: var(--error); font-size: 13px; }
.form-card .ok { color: var(--success); }
.hp-wrap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.counter { font-size: 12px; color: var(--fg-3); text-align: right; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 10px 0; }
.social-links a { display: inline-block; padding: 6px 12px; border: 1px solid var(--stroke); border-radius: 999px; text-decoration: none; }
.social-links a:hover { border-color: var(--accent-strong); }
@media print { .subnav, .form-card { display: none; } .site-footer { font-size: 11px; } }

/* code blocks never widen the page */
pre { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
pre code { white-space: pre; }

/* form: choice rows, errors, fieldset legend */
#submit-form .form-choice { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
#submit-form .form-choice label { font-weight: 400; }
#submit-form legend { padding: 0 6px; }
#submit-form .field-error { color: var(--error); font-size: 13px; margin: 2px 0 0; }
#submit-form .field-error[hidden] { display: none; }
#submit-form button[type="submit"]:hover { filter: brightness(1.1); }
#submit-form label { display: block; margin-bottom: 4px; }
#submit-form .form-choice label { display: inline; margin: 0; }
#submit-form .form-field { margin: 0 0 14px; }
.submit-status, #sf-status { margin-top: 10px; }

/* footer aligned with the content column when a sidebar is shown */
@media (min-width: 1100px) {
  body:has(.layout:not(.no-sidebar)) .site-footer { padding-left: calc(var(--sidebar-w) + var(--pad)); }
  body:has(.layout:not(.no-sidebar)) .site-footer .footer-grid { margin: 0; }
}
/* collapsible sections: visible marker */
summary { cursor: pointer; display: list-item; }
details > summary::marker { color: var(--accent); font-size: 1.1em; }
details > summary { padding: 4px 0; }

/* phones: wide figures keep a readable size and scroll sideways inside their own frame */
@media (max-width: 799px) {
  .fig-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fig svg { min-width: 720px; max-height: none; }
  .fig-body::after { content: "swipe sideways to see the whole figure"; display: block; font-size: 11px; color: var(--fg-3); padding-top: 4px; }
  .table-wrap { max-height: none; }
}
@media print { .fig-body::after { display: none; } .fig svg { min-width: 0; } }

/* original light-themed charts (kept as published) sit on an explicit light plate in the dark theme */
.page svg[role="img"]:not(.fig svg):not(.ccard svg) { border-radius: 8px; }

/* tables and code */
.table-wrap.short { max-height: none; }
pre { background: var(--card); border: 1px solid var(--stroke); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }
h2 > a, h3 > a { color: inherit; text-decoration: none; }
h2 > a:hover, h3 > a:hover { text-decoration: underline; }
table.heatmap th:first-child, table.heatmap td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
@media (max-width: 799px) {
  table.data:not(.heatmap) th, table.data:not(.heatmap) td { min-width: 6.5rem; }
  table.data:not(.heatmap) td:first-child { min-width: 5rem; }
}

/* ---------- circuit cards ---------- */
.ccard { margin: 18px 0 26px; padding: 16px 18px 18px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--card); max-width: 72rem; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset; }
.ccard[hidden] { display: none; }
.ccard-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ccard-num { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; font: 700 22px/1 var(--mono); color: #fff; background: linear-gradient(135deg, var(--accent-strong), #3b2a8f); box-shadow: 0 0 0 1px var(--stroke), 0 0 18px var(--glow, rgba(124,58,237,.3)); }
.ccard-head h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.25; }
.ccard-meta { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--fg-3); font-size: 12.5px; }
.ccard-meta .chip { padding: 2px 9px; border: 1px solid var(--stroke); border-radius: 999px; color: var(--fg-2); text-decoration: none; background: var(--accent-soft); }
.ccard-svg { background: var(--fig-bg); border: 1px solid var(--stroke); border-radius: 10px; padding: 8px; overflow-x: auto; }
.ccard-svg svg { display: block; width: 100%; height: auto; min-width: 640px; }
.ccard-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-3); }
.ccard-legend li::before, .swatch { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; border-radius: 3px; vertical-align: -1px; }
.lg-blue::before, .sw-blue { background: rgba(88,166,255,.25); border: 2px solid var(--fig-em, #58a6ff); }
.lg-orange::before, .sw-orange { background: rgba(240,136,62,.25); border: 2px solid var(--fig-or, #f0883e); }
.swatch { margin-right: 4px; }
.ccard-eq { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--fig-em, #58a6ff); background: rgba(88,166,255,.06); border-radius: 0 8px 8px 0; }
.ccard-eqlabel { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 4px; }
.ccard-eq math { font-size: 1.35em; color: var(--fg); }
.ccard-eq .katex { display: block; overflow-x: auto; }
.ccard-eqcap { margin: 4px 0 0; font-size: 12.5px; color: var(--fg-3); }
.ccard-take { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--fig-or, #f0883e); background: rgba(240,136,62,.06); border-radius: 0 8px 8px 0; }
.ccard-take p { margin: 3px 0; font-size: 14.5px; line-height: 1.5; }
.ccard-serves { margin-top: 12px; }
.ccard-serves ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ccard-serves li { font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--stroke); border-radius: 999px; color: var(--fg-2); }
.ccard-ascii { margin-top: 10px; font-size: 13px; }
.ccard-ascii pre { margin-top: 6px; }
.ccard-index { columns: 3 260px; list-style: none; padding: 0; margin: 10px 0; font-size: 13.5px; }
.ccard-index li { break-inside: avoid; margin: 2px 0; }
.ccard-index b { font-family: var(--mono); color: var(--accent); margin-right: 4px; }
.ccard-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.ccard-filter select { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--stroke); border-radius: 6px; padding: 6px 8px; }
.ccard-links { list-style: none; padding: 0; margin: 6px 0; }
.ccard-links li { margin: 4px 0; }
.ccard-links b { font-family: var(--mono); color: var(--accent); margin-right: 4px; }
.ccard-links span { color: var(--fg-3); font-size: 12.5px; }
@media (max-width: 799px) { .ccard { padding: 12px; } .ccard-svg svg { min-width: 720px; } .ccard-num { width: 44px; height: 44px; font-size: 18px; } }
@media print { .ccard { break-inside: avoid; box-shadow: none; } .ccard-svg { overflow: visible; } .ccard-svg svg { min-width: 0; } }

/* visible scrollbars on scroll frames (cue that more rows/columns exist) */
.table-wrap, .fig-body, .ccard-svg { scrollbar-width: auto; scrollbar-color: var(--accent-strong) var(--card); }
.table-wrap::-webkit-scrollbar, .fig-body::-webkit-scrollbar, .ccard-svg::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb, .fig-body::-webkit-scrollbar-thumb, .ccard-svg::-webkit-scrollbar-thumb { background: var(--accent-strong); border-radius: 6px; }
.table-wrap::-webkit-scrollbar-track, .fig-body::-webkit-scrollbar-track, .ccard-svg::-webkit-scrollbar-track { background: var(--card); }
a.ext { overflow-wrap: anywhere; font-family: var(--mono); font-size: .92em; }
td a.ext { display: inline-block; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
sup { font-size: .75em; line-height: 0; }

/* round 4: research threads stack on phones, bigger disclosure marker, tidier tables on phones */
@media (max-width: 900px) { .page .grid[style*="repeat(2"] { grid-template-columns: 1fr !important; } }
.sec details > summary::before { font-size: 22px; width: 1.1em; flex: 0 0 auto; }
.sec details > summary h2 { margin: 0; }
@media (max-width: 799px) { .table-wrap table td, .table-wrap table th { padding: 6px 8px; } .table-wrap table td { vertical-align: top; } }

/* round 4b: phone scroll cue for wide tables, scatter chart keeps a readable width and scrolls */
@media (max-width: 799px) {
  .table-wrap::before { content: "Swipe sideways for more columns \2192"; display: block; position: sticky; left: 0; width: max-content; font-size: 12px; color: var(--fg-3); padding: 2px 4px 6px; }
  .chart-wrap { overflow-x: auto; scrollbar-width: auto; scrollbar-color: var(--accent-strong) var(--card); }
  .chart-wrap > svg { min-width: 760px; }
  table.data:not(.heatmap) td { min-width: 8rem; }
}

/* ---- landing page (v2): abstract, updates, status, Day 0 teasers, how to, outline ---- */
.abstract { max-width: 72rem; padding: 16px 20px; border: 1px solid var(--stroke); border-left: 3px solid var(--accent-strong); border-radius: var(--r4); background: var(--card); }
.abstract .text { margin: 0 0 10px; font-size: 16px; line-height: 1.6; }
.abstract .text:last-child { margin-bottom: 0; }
.abstract .lead { color: var(--accent); }
.abstract-goal { font-size: 17px; }
.abstract-outputs { margin: 6px 0 0; padding-left: 1.2rem; }
.abstract-outputs li { margin: 3px 0; }
.abstract-start { padding-top: 10px; border-top: 1px solid var(--stroke); color: var(--fg-2); }
.update { margin: 10px 0; padding: 12px 16px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); max-width: 72rem; }
.update-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.update-head time { color: var(--fg-3); font: 12.5px var(--mono); }
.update ul { margin: 4px 0 0; padding-left: 1.2rem; }
.update li { margin: 4px 0; line-height: 1.5; }
.updates-older { margin: 10px 0; max-width: 72rem; }
.updates-older summary { cursor: pointer; color: var(--fg-2); padding: 4px 0; }
.status-grid, .teaser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0 18px; padding: 0; list-style: none; }
.status-card, .teaser { padding: 12px 14px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); }
.status-card p, .teaser p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.status-top, .teaser-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.teaser h3 { margin: 8px 0 0; font-size: 16px; }
.teaser-q { padding-top: 8px; border-top: 1px dashed var(--stroke); color: var(--fg); }
.teaser-q span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-right: 4px; }
.open-q { margin: 6px 0 0; padding-left: 1.2rem; }
.open-q li { margin: 4px 0; }
.howto { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.howto-step { padding: 12px 14px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); }
.howto-step h3 { margin: 0 0 6px; font-size: 15.5px; }
.howto-step p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.outline { list-style: none; margin: 12px 0; padding: 0; max-width: 72rem; display: grid; gap: 8px; }
.outline-day { border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); }
.outline-day summary { display: grid; grid-template-columns: 4.5rem 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
.outline-day summary::-webkit-details-marker { display: none; }
.outline-n { font: 700 15px var(--mono); color: var(--accent); }
.outline-title { display: flex; flex-direction: column; gap: 2px; }
.outline-title span { font-size: 12.5px; color: var(--fg-3); }
.outline-date { font-size: 12.5px; color: var(--fg-3); min-width: 8.5rem; text-align: right; }
.outline-sessions { margin: 0; padding: 4px 14px 12px 6.2rem; font-size: 14px; color: var(--fg-2); }
.outline-sessions li { margin: 3px 0; }
.ccard-note { margin: 10px 0 0; padding: 8px 14px; border-left: 3px solid var(--stroke); border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--fg-2); }
@media (max-width: 640px) {
  .outline-day summary { grid-template-columns: 1fr auto; }
  .outline-n { grid-column: 1; } .outline-title { grid-column: 1 / -1; grid-row: 2; }
  .outline-date { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .outline-sessions { padding-left: 2rem; }
  .status-grid, .teaser-grid, .howto { grid-template-columns: 1fr; }
}

/* ---- family bento and family overview pages (v3) ---- */
.bento-cluster { margin: 14px 0 22px; max-width: 72rem; }
.bento-cluster h3 { margin: 0 0 2px; font-size: 16px; }
.bento-cluster > p { margin: 0 0 8px; color: var(--fg-3); font-size: 13.5px; }
.bento { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-flow: dense; gap: 10px; }
.bento-cluster { --bento-accent: var(--accent-strong); --bento-glow: var(--glow); }
.bento-cluster, .fam-map-col[data-cluster="waves"] { --bento-accent: var(--info); --bento-glow: color-mix(in srgb, var(--info) 40%, transparent); }
.bento-cluster, .fam-map-col[data-cluster="world"] { --bento-accent: var(--success); --bento-glow: color-mix(in srgb, var(--success) 40%, transparent); }
.bento-cluster, .fam-map-col[data-cluster="pose"] { --bento-accent: var(--accent); --bento-glow: color-mix(in srgb, var(--accent) 40%, transparent); }
.bento-cluster, .fam-map-col[data-cluster="system"] { --bento-accent: var(--warn); --bento-glow: color-mix(in srgb, var(--warn) 40%, transparent); }
.bento-cluster, .fam-map-col[data-cluster="ref"] { --bento-accent: #2cb1bc; --bento-glow: color-mix(in srgb, #2cb1bc 40%, transparent); }
html[data-theme="light"] .bento-cluster[data-cluster="ref"], html[data-theme="light"] .fam-map-col[data-cluster="ref"] { --bento-accent: #0f766e; --bento-glow: color-mix(in srgb, #0f766e 35%, transparent); }
.bento-cluster .bento-code { color: var(--bento-accent); }
.bento-cluster .bento-bar i { background: var(--bento-accent); }
.bento-box a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px 28px 12px 14px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); color: var(--fg); text-decoration: none; cursor: pointer; position: relative; transition: border-color .15s, transform .15s, box-shadow .15s; }
.bento-box a::after { content: "↗"; position: absolute; top: 10px; right: 12px; font-size: 13px; line-height: 1; color: var(--bento-accent); opacity: .4; pointer-events: none; transition: opacity .15s, transform .15s; }
.bento-box a:hover { border-color: var(--bento-accent); transform: translateY(-2px); box-shadow: 0 0 0 1px var(--bento-accent), 0 8px 22px var(--bento-glow); }
.bento-box a:hover::after { opacity: 1; transform: translateX(2px) translateY(-1px); }
.bento-box a:focus-visible { outline: 2px solid var(--bento-accent); outline-offset: 2px; border-color: var(--bento-accent); box-shadow: 0 0 0 1px var(--bento-accent), 0 8px 22px var(--bento-glow); }
.bento-box a:focus-visible::after { opacity: 1; }
.bento-wide { grid-column: span 2; }
.bento-code { font: 700 12px var(--mono); color: var(--accent); letter-spacing: .08em; }
.bento-sum { font-size: 13.5px; line-height: 1.45; color: var(--fg-2); }
.bento-meta { margin-top: 4px; font-size: 12.5px; color: var(--fg-3); }
.bento-bar { display: block; height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.bento-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--info)); }

.bento-cluster-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 10px; }
.bento-glyph { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--bento-accent, var(--accent)); background: color-mix(in srgb, var(--bento-accent, var(--accent)) 16%, transparent); border: 1px solid color-mix(in srgb, var(--bento-accent, var(--accent)) 40%, var(--stroke)); }
.bento-glyph-svg { display: block; }
.bento-cluster-head h3 { margin: 0 0 2px; font-size: 17px; }
.bento-cluster-head p { margin: 0; color: var(--fg-3); font-size: 13.5px; line-height: 1.45; }
.bento-chips { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.bento-chips li { font-size: 11.5px; line-height: 1.3; padding: 2px 8px; border: 1px solid var(--stroke); border-radius: 999px; color: var(--fg-2); background: var(--hover); }
.bento-senses { display: block; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--stroke); }
.bento-senses-l { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 2px; }
.bento-senses ul { margin: 0; padding-left: 1.15rem; }
.bento-senses li { font-size: 12.5px; line-height: 1.4; color: var(--fg-2); margin: 2px 0; }
.fam-map { margin: 14px 0 26px; padding: 16px 16px 18px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); max-width: 72rem; }
.fam-map figcaption { margin: 0 0 12px; font-size: 13.5px; color: var(--fg-2); }
.fam-map-root { display: flex; justify-content: center; }
.fam-map-root span { font-weight: 700; font-size: 14px; padding: 6px 14px; border: 1px solid var(--stroke-strong); border-radius: 999px; background: var(--accent-soft); color: var(--fg); }
.fam-map-branches { display: block; width: 100%; height: 18px; color: var(--stroke-strong); margin: 2px 0 8px; }
.fam-map-cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fam-map-col { padding: 10px 10px 12px; border-top: 3px solid var(--bento-accent, var(--accent)); border-radius: 0 0 10px 10px; background: color-mix(in srgb, var(--bento-accent, var(--accent)) 9%, transparent); }
.fam-map-cl { margin: 6px 0 8px; }
.fam-map-cl strong { display: block; font-size: 13.5px; line-height: 1.3; }
.fam-map-cl span { display: block; font-size: 12px; line-height: 1.4; color: var(--fg-3); margin-top: 2px; }
.fam-map-col > ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.fam-map-col > ul a { display: flex; gap: 6px; align-items: baseline; text-decoration: none; color: var(--fg-2); font-size: 12.5px; line-height: 1.35; padding: 3px 6px; border-radius: 6px; }
.fam-map-col > ul a:hover { color: var(--fg); background: color-mix(in srgb, var(--bento-accent, var(--accent)) 16%, transparent); }
.fam-map-col > ul a:focus-visible { outline: 2px solid var(--bento-accent, var(--accent)); outline-offset: 1px; color: var(--fg); }
.fam-map-code { font: 700 11.5px var(--mono); color: var(--bento-accent, var(--accent)); letter-spacing: .04em; flex: 0 0 auto; }
@media (max-width: 860px) {
  .fam-map-cols { grid-template-columns: 1fr 1fr; }
  .fam-map-branches { display: none; }
}
@media (max-width: 640px) {
  .fam-map-cols { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento-wide { grid-column: auto; }
}

.fam-stats { color: var(--fg-2); }
.mod-group { margin: 10px 0 14px; }
.mod-group h3 { margin: 0 0 6px; font-size: 14.5px; }
.mod-count { font: 12px var(--mono); color: var(--fg-3); margin-left: 4px; }
.mod-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 14px; }
.mod-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.mod-name { flex: 1 1 12rem; }
.mod-card { font: 12px var(--mono); padding: 1px 8px; border: 1px solid var(--stroke); border-radius: 999px; text-decoration: none; background: var(--accent-soft); }
.sl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; max-width: 72rem; }
.sl-col { padding: 10px 14px; border: 1px solid var(--stroke); border-radius: var(--r4); background: var(--card); }
.sl-col h3 { margin: 0 0 4px; font-size: 15px; }
.sl-good { border-left: 3px solid var(--success); } .sl-limit { border-left: 3px solid var(--warn); }
.sl-col ul { margin: 4px 0 0; padding-left: 1.2rem; } .sl-col li { margin: 4px 0; line-height: 1.5; }
.fam-log { list-style: none; padding: 0; margin: 6px 0; } .fam-log li { margin: 6px 0; }
.fam-log time { font: 12.5px var(--mono); color: var(--fg-3); margin: 0 6px; }
.fam-others { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 22px 0 8px; }
.fam-others-title { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin-right: 6px; }
.fam-others a { font-size: 12.5px; padding: 2px 10px; border: 1px solid var(--stroke); border-radius: 999px; text-decoration: none; color: var(--fg-2); }
.fam-others a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-strong); }
@media (max-width: 640px) { .bento { grid-template-columns: 1fr; } .bento-wide { grid-column: auto; grid-row: auto; } .mod-list { grid-template-columns: 1fr; } }
