/* ============================================================================
 * Mullion site -- shared styles for index.html, features.html, feature.html.
 *
 * Windows 11 / Fluent 2 tokens. Light is the base; dark applies under
 * prefers-color-scheme unless [data-theme="light"] is set, and always under
 * [data-theme="dark"], so an explicit choice wins in either direction.
 * ========================================================================== */
:root,
:root[data-theme="light"] {
  --bg: #f4f4f3;
  --bg-alt: #ebebea;
  --card: #ffffff;
  --control: #fbfbfb;
  --control-hover: #f0f0f0;
  --control-active: #e6e6e6;
  --border: #dedede;
  --stroke-subtle: #ebebeb;
  --text: #1b1b1b;
  --muted: #4f4f4f;
  --text-tertiary: #666666;
  --accent: #005fb8;
  --accent-hover: #0a6cc7;
  --on-accent: #ffffff;
  --accent-text: #005fb8;
  --accent-soft: rgba(0, 95, 184, 0.08);
  --accent-border: rgba(0, 95, 184, 0.35);
  --success: #0f7b0f;
  --success-bg: #dff6dd;
  --bug: #a4262c;
  --bug-bg: #fde7e9;
  --focus: #005fb8;
  --header-bg: rgba(244, 244, 243, 0.86);
  --shadow-card: 0 0 2px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-raised: 0 0 2px rgba(0, 0, 0, 0.08), 0 6px 18px rgba(0, 0, 0, 0.09);
  --shadow-pop: 0 0 2px rgba(0, 0, 0, 0.14), 0 16px 40px rgba(0, 0, 0, 0.18);
  --hero-glow: rgba(0, 95, 184, 0.10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1c; --bg-alt: #232324; --card: #2a2a2b; --control: #323233; --control-hover: #3a3a3b;
    --control-active: #444445; --border: #3d3d3e; --stroke-subtle: #333334;
    --text: #f3f3f3; --muted: #c9c9c9; --text-tertiary: #a3a3a3;
    --accent: #60cdff; --accent-hover: #7bd6ff; --on-accent: #000000; --accent-text: #99ebff;
    --accent-soft: rgba(96, 205, 255, 0.10); --accent-border: rgba(96, 205, 255, 0.40);
    --success: #6ccb5f; --success-bg: #22351f; --focus: #99ebff;
    --bug: #ff99a4; --bug-bg: #3b2224;
    --header-bg: rgba(27, 27, 28, 0.86);
    --shadow-card: 0 0 2px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-raised: 0 0 2px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 0 2px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.55);
    --hero-glow: rgba(96, 205, 255, 0.10);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1b1c; --bg-alt: #232324; --card: #2a2a2b; --control: #323233; --control-hover: #3a3a3b;
  --control-active: #444445; --border: #3d3d3e; --stroke-subtle: #333334;
  --text: #f3f3f3; --muted: #c9c9c9; --text-tertiary: #a3a3a3;
  --accent: #60cdff; --accent-hover: #7bd6ff; --on-accent: #000000; --accent-text: #99ebff;
  --accent-soft: rgba(96, 205, 255, 0.10); --accent-border: rgba(96, 205, 255, 0.40);
  --success: #6ccb5f; --success-bg: #22351f; --focus: #99ebff;
    --bug: #ff99a4; --bug-bg: #3b2224;
  --header-bg: rgba(27, 27, 28, 0.86);
  --shadow-card: 0 0 2px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-raised: 0 0 2px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 0 2px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.55);
  --hero-glow: rgba(96, 205, 255, 0.10);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
img, video, svg { max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }
h1, h2, h3 {
  font-family: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
code, .mono {
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 0.9em;
}
p code, li code, td code {
  background: var(--control);
  border: 1px solid var(--stroke-subtle);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 8px; height: 56px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 650; font-size: 1.06rem; letter-spacing: -0.01em;
  margin-right: auto; border-radius: 6px;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand-mark .frame { fill: var(--accent-soft); stroke: var(--accent); }
.brand-mark .bar { fill: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  color: var(--muted); font-size: 0.93rem; font-weight: 500;
}
.site-nav a:hover { background: var(--control-hover); color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--control-active); }
.site-nav .ext { width: 12px; height: 12px; opacity: 0.7; }
@media (max-width: 420px) {
  .site-nav a { padding: 6px 9px; }
  .site-nav .ext { display: none; }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--control-hover); color: var(--text); }
.icon-btn[aria-expanded="true"] { background: var(--control-active); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- settings popover */
.settings-pop {
  position: fixed; inset: auto; top: 64px; right: 16px; left: auto; bottom: auto;
  margin: 0; padding: 0;
  width: min(22rem, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-pop);
  z-index: 60;
}
.settings-pop::backdrop { background: transparent; }
.pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 10px 8px 18px;
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.pop-head h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.pop-head .icon-btn { width: 32px; height: 32px; }
.pop-head .icon-btn svg { width: 16px; height: 16px; }
.pop-body { padding: 0 18px 4px; }
.pop-group { border: 0; margin: 0; padding: 12px 0; border-top: 1px solid var(--stroke-subtle); min-width: 0; }
.pop-group:first-child { border-top: 0; padding-top: 4px; }
.pop-group legend {
  float: left; width: 100%; padding: 0; margin-bottom: 8px;
  font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.pop-group > :not(legend) { clear: both; }
.pop-note { margin: 6px 0 0; font-size: 0.8rem; color: var(--text-tertiary); }
/* A choice that belongs to the switch above it (the before/after view, under
 * Screenshots), indented on a guide line. */
.pop-sub { margin: 2px 0 8px 2px; padding: 2px 0 4px 12px; border-left: 2px solid var(--stroke-subtle); }
.pop-sub-label { display: block; font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 6px; }
.pop-sub .segmented { grid-template-columns: 1fr 1fr; }
.pop-section[hidden], .pop-sub[hidden], .pop-group[hidden], .seg-option[hidden] { display: none; }
.pop-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 14px; border-top: 1px solid var(--stroke-subtle);
}
.pop-saved { font-size: 0.8rem; color: var(--success); }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  padding: 3px; border-radius: 8px;
  background: var(--bg-alt); border: 1px solid var(--border);
}
.seg-option {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 6px; border-radius: 6px;
  font-size: 0.8rem; color: var(--muted); cursor: pointer; user-select: none;
}
.seg-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg-option svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.seg-option:hover { color: var(--text); background: var(--control-hover); }
.seg-option:has(input:checked) { background: var(--card); color: var(--text); box-shadow: var(--shadow-card); font-weight: 600; }
.seg-option:has(input:checked) svg { stroke: var(--accent); }
.seg-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Text-only options (no icon), as many as there are, wrapping on a phone. */
.segmented-text { grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); }
.segmented-text .seg-option { padding: 7px 6px; white-space: nowrap; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 7px 0; cursor: pointer;
}
.switch-text { display: flex; flex-direction: column; min-width: 0; }
.switch-label { font-size: 0.9rem; }
.switch-hint { font-size: 0.78rem; color: var(--text-tertiary); line-height: 1.35; }
.switch {
  -webkit-appearance: none; appearance: none;
  flex: 0 0 auto; position: relative;
  width: 40px; height: 20px; margin: 0;
  border-radius: 999px; border: 1px solid var(--text-tertiary);
  background: var(--control); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.switch:hover::after { transform: scale(1.12); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--on-accent); }
.switch:checked:hover::after { transform: translateX(20px) scale(1.12); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- section visibility
 * site.js puts hide-<id> on <html> for every section switched off. */
.hide-media [data-section="media"],
.hide-problem [data-section="problem"],
.hide-how [data-section="how"],
.hide-steps [data-section="steps"],
.hide-settings [data-section="settings"],
.hide-notes [data-section="notes"],
.hide-upstream [data-section="upstream"],
.hide-stats [data-section="stats"],
.hide-commits [data-section="commits"] { display: none !important; }

/* ---------------------------------------------------------------- buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 6px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--card); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-card); }
.btn-secondary:hover { background: var(--control-hover); }
.btn-quiet { background: transparent; border-color: var(--border); color: var(--text); }
.btn-quiet:hover { background: var(--control-hover); }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; font-weight: 500; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px;
  background: var(--control); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.tag-success { background: var(--success-bg); border-color: transparent; color: var(--success); }
.tag-bug { background: var(--bug-bg); border-color: transparent; color: var(--bug); }
/* A tag that explains itself on hover. It sits above a card's stretched
   title link, which would otherwise swallow the hover. */
.has-tip { position: relative; z-index: 1; cursor: help; }

.tooltip {
  position: fixed; z-index: 200; max-width: min(18rem, calc(100vw - 16px));
  padding: 7px 10px; border-radius: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  font-size: 0.8rem; font-weight: 400; line-height: 1.4; letter-spacing: 0;
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.12s;
}
.tooltip.shown { opacity: 1; visibility: visible; transition-delay: 0.15s; }

/* Styled dropdown (Mullion.dropdown in site.js) over a hidden native select. */
.dropdown { position: relative; display: inline-flex; }
.dropdown-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 11rem; height: var(--control-h, 38px); padding: 0 10px 0 12px;
  border-radius: 6px; border: 1px solid var(--border); border-bottom-color: var(--text-tertiary);
  background: var(--card); color: var(--text); font-size: var(--control-fs, 0.88rem);
  cursor: pointer; text-align: left; white-space: nowrap;
}
.dropdown-trigger:hover { background: var(--control-hover); }
.dropdown-trigger[aria-expanded="true"] { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.dropdown-trigger svg, .dropdown-menu svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-trigger svg { color: var(--text-tertiary); transition: transform 0.15s; }
.dropdown-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.dropdown-value { overflow: hidden; text-overflow: ellipsis; }
.dropdown-menu {
  position: absolute; z-index: 50; top: calc(100% + 4px); right: 0; min-width: 100%;
  margin: 0; padding: 4px; list-style: none; max-height: 20rem; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop);
}
.dropdown.drop-up .dropdown-menu { top: auto; bottom: calc(100% + 4px); }
.dropdown-menu:focus { outline: none; }
.dropdown-menu li {
  display: flex; align-items: center; gap: 8px; position: relative;
  padding: 0 12px 0 8px; height: 34px; border-radius: 4px;
  font-size: var(--control-fs, 0.88rem); color: var(--text); cursor: pointer; white-space: nowrap;
}
.dropdown-menu li svg { visibility: hidden; color: var(--accent-text); }
.dropdown-menu li[aria-selected="true"] svg { visibility: visible; }
.dropdown-menu li[aria-selected="true"] { font-weight: 600; }
.dropdown-menu li.active { background: var(--control-hover); }
.dropdown-menu:focus-visible li.active { outline: 2px solid var(--focus); outline-offset: -2px; }

.kicker {
  font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent-text);
}

.commit-link {
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 0.75rem; padding: 2px 7px; border-radius: 4px;
  background: var(--control); border: 1px solid var(--border); color: var(--accent-text);
}
.commit-link:hover { background: var(--control-hover); text-decoration: none; }
.stat-add { color: var(--success); }
.stat-del { color: var(--muted); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 28px 0 36px; color: var(--text-tertiary); font-size: 0.86rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-text); }

/* ---------------------------------------------------------------- shared media */
.shot {
  display: block; width: 100%; height: auto;
  border-radius: 10px; border: 1px solid var(--border);
  box-shadow: var(--shadow-raised);
  background: var(--card);
}

/* ======================================================================
 * Home (index.html)
 * ==================================================================== */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60rem 28rem at 85% -10%, var(--hero-glow), transparent 70%),
    radial-gradient(40rem 24rem at -10% 110%, var(--hero-glow), transparent 70%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 88px 0 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; }
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.06;
  margin: 18px 0 18px;
}
.hero h1 .accent { color: var(--accent-text); }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--muted); margin: 0 0 28px; max-width: 36rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: 0.88rem; color: var(--text-tertiary);
}
.hero-facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero-facts svg { width: 15px; height: 15px; fill: none; stroke: var(--success); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-figure { margin: 0; }
.hero-figure figcaption { margin-top: 12px; font-size: 0.86rem; color: var(--text-tertiary); }
@media (max-width: 480px) {
  .hero .actions .btn { flex: 1 1 100%; }
}

.section { padding: 64px 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 6px 0 0; font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 700; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 40rem; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.more-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Spotlights: text + screenshot, alternating on wide screens. */
.spotlights { display: flex; flex-direction: column; gap: 20px; }
.spotlight {
  display: grid; gap: 24px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 22px;
}
@media (min-width: 860px) {
  .spotlight { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; padding: 36px; }
  .spotlight.flip .spotlight-text { order: 2; }
}
.spotlight h3 { margin: 8px 0 10px; font-size: 1.45rem; font-weight: 700; }
.spotlight p { margin: 0 0 16px; color: var(--muted); }
.spotlight .shot { box-shadow: var(--shadow-card); }
.code-figure { margin: 0; min-width: 0; }
.code-figure figcaption { margin-top: 10px; font-size: 0.86rem; color: var(--text-tertiary); }
.code-block {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 0.84rem; line-height: 1.7; color: var(--text);
}
.code-block .c { color: var(--text-tertiary); }
.code-block .p { color: var(--success); font-weight: 700; }
.code-block .p.r { color: var(--accent-text); }

/* Feature groups. */
.groups { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.group {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 22px;
}
.group-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-text); margin-bottom: 14px;
}
.group-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.group h3 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 650; }
.group ul { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.group li { position: relative; padding-left: 16px; color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.group li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
.group li strong { color: var(--text); font-weight: 600; }
.group .more-link { font-size: 0.9rem; margin-top: auto; }

/* Recently added. */
.recent { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); overflow: hidden; }
.recent li + li { border-top: 1px solid var(--stroke-subtle); }
.recent a {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline;
  padding: 16px 20px; color: var(--text);
}
.recent a:hover { background: var(--control-hover); text-decoration: none; }
.recent a:hover .recent-title { color: var(--accent-text); }
.recent-title { font-weight: 600; }
.recent-meta { font-size: 0.84rem; color: var(--text-tertiary); white-space: nowrap; }
.recent-desc { grid-column: 1 / -1; font-size: 0.9rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .recent a { grid-template-columns: 1fr; padding: 14px 16px; }
}
/* A hub page's list: each row's description shows on hover (site.js's
 * popover), inline on touch screens, which have no hover. */
.hub-list { margin-top: 12px; }
.hub-list .desc { display: none; }
@media (hover: none) {
  .hub-list .desc { display: block; padding: 0 20px 14px; margin-top: -8px; font-size: 0.9rem; color: var(--muted); }
}

/* Principles / build. */
.pair { display: grid; gap: 16px; }
@media (min-width: 860px) { .pair { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); padding: 24px; }
.panel h3 { margin: 0 0 10px; font-size: 1.15rem; font-weight: 650; }
.panel p { margin: 0 0 12px; color: var(--muted); }
.panel p:last-child { margin-bottom: 0; }
.slot-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 4px 0 12px; }
.slot-table th, .slot-table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--stroke-subtle); vertical-align: top; }
.slot-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 650; }
.slot-table td { color: var(--muted); }
.slot-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

/* ======================================================================
 * Feature list (features.html)
 * ==================================================================== */
.page-head { padding-top: 40px; padding-bottom: 8px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 4.5vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); max-width: 44rem; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-top: 16px; padding-bottom: 16px; margin-bottom: 8px;
}
@media (min-width: 900px) {
  .toolbar-wrap { position: sticky; top: 56px; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); }
}
/* Search, sort and layout share one height and one type size, so the row
   reads as a single bar rather than three controls that happen to touch. */
.toolbar { --control-h: 38px; --control-fs: 0.88rem; }
.search-box { position: relative; flex: 1 1 16rem; min-width: 0; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--text-tertiary); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-box input {
  width: 100%; height: var(--control-h); padding: 0 40px 0 34px;
  border-radius: 6px; border: 1px solid var(--border); border-bottom-color: var(--text-tertiary);
  background: var(--card); color: var(--text); font-size: var(--control-fs);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.search-box kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.72rem;
  padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-tertiary); background: var(--control);
}
/* The category pills get a row of their own under search, sort and layout:
   sharing one, they wrapped wherever the count happened to push them. */
.toolbar .chip-row { flex-basis: 100%; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.84rem; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--control-hover); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip .count { font-size: 0.74rem; opacity: 0.75; }
.toolbar-end { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }
@media (max-width: 640px) {
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar-end .dropdown { flex: 1 1 auto; min-width: 0; }
}
.view-switch { display: inline-flex; height: var(--control-h, 38px); border-radius: 6px; border: 1px solid var(--border); overflow: hidden; background: var(--card); }
.view-switch button {
  border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 0 14px; font-size: var(--control-fs, 0.88rem); cursor: pointer;
}
.view-switch button:first-child { border-left: 0; }
.view-switch button:hover { background: var(--control-hover); color: var(--text); }
.view-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.view-switch button:focus-visible { outline-offset: -2px; }

.result-count { color: var(--text-tertiary); font-size: 0.86rem; margin: 16px 0 14px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--border); border-radius: 12px; }

.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.feature-grid.preview { grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 20px; }
.fcard {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 20px;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.fcard:hover { box-shadow: var(--shadow-raised); border-color: var(--accent-border); }
.fcard:focus-within { border-color: var(--accent-border); }
.fcard h3 { margin: 0; font-size: 1.08rem; font-weight: 650; }
/* The title link stretches over the whole card, so the card is one target;
 * commit links sit above that overlay and keep their own destinations. */
.fcard h3 a { color: var(--text); }
.fcard h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.fcard h3 a:hover { text-decoration: none; }
.fcard:hover h3 a { color: var(--accent-text); }
.fcard h3 a:focus-visible { outline: none; }
.fcard h3 a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.fcard .desc { margin: 0; color: var(--muted); font-size: 0.9rem; flex-grow: 1; }
.fcard .card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--text-tertiary); }
.commit-row { display: flex; flex-wrap: wrap; gap: 5px; position: relative; z-index: 1; }
/* Dates sit above the card's link overlay so their tooltip still shows. */
.fcard .meta-row time { position: relative; z-index: 1; }
time[data-date] { text-decoration: underline dotted; text-decoration-color: var(--border); text-underline-offset: 0.2em; cursor: help; }

.fcard .thumb {
  margin: -20px -20px 6px; height: 11rem; overflow: hidden;
  border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0;
  background: repeating-linear-gradient(135deg, var(--control) 0 10px, var(--card) 10px 20px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 0.8rem;
}
.fcard .thumb picture { display: block; width: 100%; height: 100%; }
.fcard .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }

.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); }
table.feature-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 40rem; }
table.feature-table th, table.feature-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--stroke-subtle); vertical-align: top; }
table.feature-table tr:last-child td { border-bottom: 0; }
table.feature-table th { background: var(--bg-alt); font-weight: 600; font-size: 0.82rem; white-space: nowrap; padding: 0; }
table.feature-table th button {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%;
  padding: 10px 14px; cursor: pointer;
}
table.feature-table th button:hover { background: var(--control-hover); }
table.feature-table th button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.feature-table th .plain { display: block; padding: 10px 14px; }
table.feature-table th[aria-sort] button { color: var(--accent-text); }
/* Sort arrows: a hint on hover, the direction once a column is sorted. */
table.feature-table th button::after { content: ""; width: 0.9em; opacity: 0.55; }
table.feature-table th button:hover::after { content: "\2195"; }
table.feature-table th[aria-sort="ascending"] button::after { content: "\2191"; opacity: 1; }
table.feature-table th[aria-sort="descending"] button::after { content: "\2193"; opacity: 1; }
table.feature-table tr.empty-row td { color: var(--muted); text-align: center; padding: 28px 14px; }
table.feature-table tbody tr.empty-row:hover td { background: none; }
table.feature-table tbody tr:hover td { background: var(--control-hover); }
table.feature-table td.title-cell a { font-weight: 600; color: var(--text); }
table.feature-table td.title-cell a:hover { color: var(--accent-text); }
table.feature-table td.title-cell .desc { display: block; font-size: 0.84rem; color: var(--muted); margin-top: 2px; }
/* Descriptions: inline when the table shows them, and on touch screens (no
   hover); otherwise in a popover on the title (site.js). */
table.feature-table td.title-cell .has-desc ~ .desc { display: none; }
table.feature-table.show-desc td.title-cell .has-desc ~ .desc { display: block; }
@media (hover: none) { table.feature-table td.title-cell .has-desc ~ .desc { display: block; } }
/* A long list scrolls in its own box, so the filters above it and its header
   row stay in view. */
.table-scroll.scroll-y { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); overflow: auto; }
.table-scroll.scroll-y table.feature-table thead th { position: sticky; top: 0; z-index: 2; }
@media (max-width: 640px) {
  .table-scroll.scroll-y { max-height: none; }
  .table-scroll.scroll-y table.feature-table thead th { position: static; }
}
table.feature-table td.nowrap { white-space: nowrap; color: var(--muted); }

/* ======================================================================
 * Upstream issues (upstream.html)
 * ==================================================================== */
.upstream h2 { margin: 0 0 12px; font-size: 1.3rem; font-weight: 700; }
.upstream-note { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 0.9rem; max-width: 44rem; }
.upstream-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.upstream-foot { margin-top: 28px; }
.tabs { display: flex; gap: 4px; margin: 28px 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font-size: 0.95rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline-offset: -2px; }
.tabs .count { font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--control-hover); color: var(--muted); }
.tabs [aria-selected="true"] .count { background: var(--accent-soft); color: var(--accent-text); }
[role="tabpanel"]:focus-visible { outline-offset: 4px; }
table.upstream-table { min-width: 0; width: 100%; }
table.upstream-table { table-layout: fixed; }
table.upstream-table th[data-key="n"] { width: 7.5rem; }
table.upstream-table th[data-key="k"] { width: 7rem; }
table.upstream-table th[data-key="d"] { width: 8.5rem; }
table.upstream-table th[data-key="f"] { width: 22%; }
table.upstream-table th[data-key="s"] { width: 10rem; }
table.upstream-table th[data-key="cov"] { width: 8rem; }
.desc-pop {
  position: fixed; z-index: 200; max-width: min(28rem, calc(100vw - 16px));
  padding: 10px 12px; border-radius: 8px;
  background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  font-size: 0.85rem; line-height: 1.5;
}
.desc-pop[hidden] { display: none; }
.desc-pop a { color: var(--accent-text); }
.desc-pop code { font-size: 0.8rem; }
.upstream-bar { padding-top: 4px; padding-bottom: 12px; margin-bottom: 0; }
.fields-menu { position: relative; }
.fields-menu .dropdown-trigger { min-width: 8rem; }
.fields-pop {
  position: absolute; z-index: 50; top: calc(100% + 4px); right: 0; min-width: 12rem;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop);
}
.fields-pop[hidden] { display: none; }
.fields-pop label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.fields-pop label:hover { background: var(--control-hover); }
.fields-pop label[hidden] { display: none; }
.fields-pop input { accent-color: var(--accent); }
.fields-reset { margin-top: 4px; padding: 6px 8px; border: 0; border-top: 1px solid var(--stroke-subtle); background: none; color: var(--accent-text); font-size: 0.84rem; text-align: left; cursor: pointer; }
/* The whole # cell opens the ticket. */
table.upstream-table td.id-cell { position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.upstream-table td.id-cell a { font-weight: 600; color: var(--accent-text); }
table.upstream-table td.id-cell a::after { content: ""; position: absolute; inset: 0; }
table.upstream-table td.id-cell:hover { background: var(--control-hover); }
/* +N: the same ask filed again upstream. Above the cell-wide link, so it can
 * be hovered, focused and tapped; its list opens in the description popover. */
.rel-badge {
  position: relative; z-index: 1; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--control); color: var(--muted);
  font: inherit; font-size: 0.75rem; font-weight: 600; line-height: 1.5; cursor: pointer; vertical-align: 1px;
}
.rel-badge:hover, .rel-badge[aria-describedby] { color: var(--accent-text); border-color: var(--accent-border); background: var(--accent-soft); }
td.id-cell .desc { display: none; }
.desc-pop .rel-head { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.desc-pop .rel-list { list-style: none; margin: 0; padding: 0; max-height: min(22rem, 60vh); overflow-y: auto; }
.desc-pop .rel-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; padding: 3px 0; }
.desc-pop .rel-list li + li { border-top: 1px solid var(--stroke-subtle); }
.desc-pop .rel-list a { font-weight: 600; font-variant-numeric: tabular-nums; }
.desc-pop .rel-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desc-pop .rel-meta { grid-column: 2; font-size: 0.78rem; color: var(--text-tertiary); }
table.upstream-table td.title-cell .desc code { font-size: 0.8rem; }
table.upstream-table td.age-cell { color: var(--muted); white-space: nowrap; }
table.upstream-table td.age-cell time { cursor: help; text-decoration: underline dotted; text-decoration-color: var(--border); text-underline-offset: 0.2em; }
table.upstream-table .closed-on { display: block; font-size: 0.8rem; }
/* The row a link like upstream.html#issue-10534 points at. */
table.upstream-table tr.is-target td { background: var(--accent-soft); }
table.upstream-table .age-label { display: none; }
table.upstream-table td.title-cell .desc a { font-weight: 400; color: var(--accent-text); }
@media (max-width: 640px) {
  .tabs { gap: 0; }
  .tabs [role="tab"] { padding: 10px 10px; }
  table.upstream-table thead { display: block; background: var(--bg-alt); border-bottom: 1px solid var(--stroke-subtle); }
  table.upstream-table thead tr { display: flex; flex-wrap: wrap; padding: 4px 4px; }
  table.upstream-table thead th { display: block; width: auto !important; background: transparent; border: 0; }
  table.upstream-table thead th button { padding: 8px 10px; }
  table.upstream-table, table.upstream-table tbody, table.upstream-table tr, table.upstream-table td { display: block; width: auto; }
  table.upstream-table tr { padding: 10px 0; border-bottom: 1px solid var(--stroke-subtle); }
  table.upstream-table tr:last-child { border-bottom: 0; }
  table.upstream-table td { border: 0; padding: 3px 14px; }
  table.upstream-table td.id-cell { padding-top: 0; padding-bottom: 0; }
  table.upstream-table .age-label { display: inline; }
  table.upstream-table .closed-on { display: inline; font-size: inherit; }
  table.upstream-table .closed-on::before { content: ", "; }
}

/* ======================================================================
 * Mentions (mentions.html)
 * ==================================================================== */
.mentions-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
/* Two or more pill rows side by side, wrapping as a group. */
.chip-groups { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.toolbar .chip-groups .chip-row { flex-basis: auto; }
.mentions-toggle-all { height: var(--control-h); }
.mentions-toggle-all[hidden] { display: none; }
.mention-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--control); border: 1px solid var(--stroke-subtle); color: var(--text); }
.mention-logo svg { width: 20px; height: 20px; }
.mention-venue { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 0.84rem; color: var(--muted); overflow-wrap: anywhere; }
.mention-when { color: var(--text-tertiary); font-size: 0.84rem; }
.mention-when time { cursor: help; text-decoration: underline dotted; text-decoration-color: var(--border); text-underline-offset: 0.2em; }

.mentions-timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; max-width: 54rem; }
.mentions-timeline[hidden] { display: none; }
.mentions-timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.mentions-month { margin: 4px 0 10px; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
.mention { position: relative; margin-bottom: 18px; }
.mention::before { content: ""; position: absolute; left: -25px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.mention-card { background: var(--card); border: 1px solid var(--stroke-subtle); border-radius: 10px; box-shadow: var(--shadow-card); }
.mention-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.mention-head-text { flex: 1; min-width: 0; display: grid; gap: 6px; }
.mention-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mention-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.mention-title a { color: var(--text); }
.mention-title a:hover { color: var(--accent-text); }
.mention-card details { border-top: 1px solid var(--stroke-subtle); }
.mention-card summary { cursor: pointer; padding: 10px 16px; color: var(--accent-text); font-size: 0.9rem; list-style: none; }
.mention-card summary::-webkit-details-marker { display: none; }
.mention-card summary::before { content: "\25B8\00a0\00a0"; }
.mention-card details[open] summary::before { content: "\25BE\00a0\00a0"; }
.mention-card .mention-posted { padding: 4px 16px 16px; }

/* The posted text, as GitHub rendered it. */
.mention-posted { font-size: 0.94rem; line-height: 1.55; overflow-wrap: anywhere; }
.mention-posted > :first-child { margin-top: 0; }
.mention-posted > :last-child { margin-bottom: 0; }
.mention-posted p, .mention-posted ul { margin: 0 0 12px; }
.mention-posted ul { padding-left: 1.3em; }
.mention-posted img { max-width: 100%; height: auto; border-radius: 6px; }
.mention-posted table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 12px; }
.mention-posted th, .mention-posted td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; font-size: 0.86rem; text-align: left; }
.mention-posted td img { width: 100%; }
.mention-posted code { font-size: 0.86em; padding: 1px 4px; border-radius: 4px; background: var(--bg-alt); }
.mention-missing { color: var(--text-tertiary); font-style: italic; }

/* A directory listing as submitted: hero, alternatives, shots, ticks, facts. */
.listing { display: grid; gap: 14px; }
.listing p, .listing ul, .listing dl, .listing figure, .listing blockquote { margin: 0; }
.listing-hero { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 10px; border: 1px solid var(--accent-border);
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 70%), var(--bg-alt); }
.listing-icon { flex: none; width: 64px; height: 64px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18)); }
.listing-hero-text { min-width: 0; display: grid; gap: 6px; }
.listing-name { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); line-height: 1.2; }
.listing-tagline { color: var(--muted); }
.listing-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.listing-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.8rem;
  background: var(--card); border: 1px solid var(--stroke-subtle); color: var(--text); }
.listing-chip-strong { background: var(--success-bg); border-color: transparent; color: var(--success); font-weight: 600; }
.listing-label { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
.listing-alts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.listing-alt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 6px; font-weight: 600; font-size: 0.86rem;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-text); }
.listing-alt::before { content: "\21C4"; font-weight: 400; }
.listing-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.listing-shots figure { display: grid; gap: 6px; align-content: start; }
.listing-shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 8px;
  border: 1px solid var(--stroke-subtle); box-shadow: var(--shadow-card); }
.listing-shots figcaption { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.mention-posted .listing-features { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.listing-features li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--text); }
.listing-features li::before { content: "\2713"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.7rem; font-weight: 700; background: var(--success-bg); color: var(--success); }
.listing-desc { padding: 12px 14px; border-radius: 8px; background: var(--bg-alt); }
.listing-desc p, .listing-desc ul { margin: 0 0 8px; }
.listing-desc > :last-child { margin-bottom: 0; }
.listing-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-radius: 8px; overflow: hidden;
  background: var(--stroke-subtle); border: 1px solid var(--stroke-subtle); }
.listing-facts > div { padding: 8px 12px; background: var(--card); min-width: 0; }
.listing-facts dt { font-size: 0.74rem; color: var(--text-tertiary); }
.listing-facts dd { margin: 2px 0 0; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-note { display: grid; gap: 4px; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--bg-alt); color: var(--muted); }
@media (max-width: 640px) {
  .listing-hero { align-items: flex-start; }
  .listing-icon { width: 48px; height: 48px; }
  .listing-shots { grid-template-columns: 1fr; }
  .listing-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

table.mentions-table { min-width: 0; table-layout: fixed; }
table.mentions-table th[data-key="d"] { width: 8rem; }
table.mentions-table th[data-key="venue"] { width: 30%; }
table.mentions-table th[data-key="kind"] { width: 9rem; }
table.mentions-table th[data-key="status"] { width: 7rem; }
table.mentions-table tbody tr { cursor: pointer; }
table.mentions-table tbody tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.mentions-table tbody tr.is-selected td { background: var(--accent-soft); }
table.mentions-table td.mention-where { display: flex; gap: 8px; align-items: center; }
table.mentions-table .mention-logo { width: 26px; height: 26px; }
table.mentions-table .mention-logo svg { width: 15px; height: 15px; }
table.mentions-table .mentions-label { display: none; }

.mentions-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.32); opacity: 0; transition: opacity 0.2s ease; }
.mentions-scrim.open { opacity: 1; }
.mentions-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(40rem, 100vw);
  display: flex; flex-direction: column; background: var(--card); box-shadow: var(--shadow-pop);
  transform: translateX(105%); transition: transform 0.2s ease;
}
.mentions-drawer.open { transform: none; }
.mentions-drawer .mention-head { border-bottom: 1px solid var(--stroke-subtle); }
.mentions-drawer .mention-posted { padding: 16px; overflow: auto; flex: 1; }
.mentions-close svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mentions-drawer-open, .mentions-drawer-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .mentions-drawer, .mentions-scrim { transition: none; } }

@media (max-width: 640px) {
  .mentions-timeline { padding-left: 20px; }
  .mention::before { left: -19px; }
  .mention-head { padding: 12px; }
  .mention-logo { width: 30px; height: 30px; }
  table.mentions-table thead { display: block; background: var(--bg-alt); border-bottom: 1px solid var(--stroke-subtle); }
  table.mentions-table thead tr { display: flex; flex-wrap: wrap; padding: 4px; }
  table.mentions-table thead th { display: block; width: auto !important; background: transparent; border: 0; }
  table.mentions-table thead th button { padding: 8px 10px; }
  table.mentions-table, table.mentions-table tbody, table.mentions-table tr, table.mentions-table td { display: block; width: auto; }
  table.mentions-table tr { padding: 10px 0; border-bottom: 1px solid var(--stroke-subtle); }
  table.mentions-table tr:last-child { border-bottom: 0; }
  table.mentions-table td { border: 0; padding: 3px 14px; }
  table.mentions-table td.mention-where { display: flex; }
  table.mentions-table .mentions-label { display: inline; }
}

/* ======================================================================
 * One feature (feature.html)
 * ==================================================================== */
.doc { max-width: 52rem; margin: 0 auto; padding: 28px 16px 0; }
@media (min-width: 640px) { .doc { padding: 36px 24px 0; } }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-tertiary); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-text); }
.crumbs .sep { opacity: 0.6; }
.doc h1 { font-size: clamp(1.8rem, 4.6vw, 2.5rem); line-height: 1.15; margin: 10px 0 14px; font-weight: 700; letter-spacing: -0.02em; }
.doc h2 { font-size: 1.3rem; margin: 44px 0 12px; font-weight: 650; }
.doc p { margin: 0 0 14px; }
.doc .lede { font-size: 1.12rem; color: var(--muted); margin-bottom: 24px; }
.doc .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 1px;
  margin: 0 0 8px; border-radius: 10px; overflow: hidden;
  background: var(--border); border: 1px solid var(--border);
}
.stat { background: var(--card); padding: 12px 16px; }
.stat .n { font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 0.78rem; color: var(--text-tertiary); }

.doc figure { margin: 0 0 24px; }
.doc figure img, .doc figure video { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-card); }
.doc figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }

/* Screenshots ship in both themes; show the one matching the page. */
.shot-dark { display: none !important; }
:root[data-theme="dark"] .shot-light { display: none !important; }
:root[data-theme="dark"] .shot-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-light { display: none !important; }
  :root:not([data-theme="light"]) .shot-dark { display: block !important; }
}
/* A capture that exists in only one theme is shown in both rather than
 * leaving the other blank -- the wrong background beats no picture. */
.absent { display: none !important; }
figure:not(.compare):has(.shot-light.absent) .shot-dark { display: block !important; }
figure:not(.compare):has(.shot-dark.absent) .shot-light { display: block !important; }
/* A comparison falls back per side, never across sides: a missing "before"
 * must not switch on the other theme's "after" (it did, and both showed). */
.compare-layer:has(.shot-light.absent) .shot-dark { display: block !important; }
.compare-layer:has(.shot-dark.absent) .shot-light { display: block !important; }
/* A capture that does not exist renders nothing (compare.js), and a section
 * left with no figure in it goes too. */
figure.no-media, .section-empty { display: none !important; }

/* ---- Documentation (docs/index.html) ---------------------------------
 * Drawn to match the Settings UI's Documentation page: a card per topic,
 * then the topic on one card with ruled headings, numbered lists, striped
 * tables and tinted callouts. */
.mdocs { padding-top: 28px; padding-bottom: 56px; max-width: 64rem; }
.mdoc-crumbs { display: flex; align-items: center; gap: 6px; font-size: 1.35rem; font-weight: 600; margin-bottom: 18px; }
.mdoc-crumbs a { color: var(--muted); }
.mdoc-crumbs a:hover { color: var(--accent-text); }
.mdoc-crumbs svg { width: 14px; height: 14px; fill: none; stroke: var(--text-tertiary); stroke-width: 1.8; }
.mdoc-intro { color: var(--muted); margin: 0 0 16px; }
.mdoc-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mdoc-topic {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.mdoc-topic:hover { background: var(--control-hover); text-decoration: none; }
.mdoc-topic:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mdoc-topic-icon svg, .mdoc-topic > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mdoc-topic > svg { width: 14px; height: 14px; margin-left: auto; color: var(--text-tertiary); }
.mdoc-topic-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mdoc-topic-title { font-weight: 550; }
.mdoc-topic-desc { font-size: 0.86rem; color: var(--muted); }

.mdoc {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 24px 28px; line-height: 1.6; overflow-wrap: anywhere;
}
.mdoc h1 { font-size: 2rem; font-weight: 600; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); letter-spacing: -0.01em; }
.mdoc h2 { font-size: 1.45rem; font-weight: 600; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mdoc h3 { font-size: 1.15rem; font-weight: 600; margin: 22px 0 10px; }
.mdoc p { margin: 0 0 12px; }
.mdoc ul, .mdoc ol { margin: 0 0 12px; padding-left: 26px; }
.mdoc li { margin: 4px 0; }
/* Plain bold monospace, as the app draws it: no chip behind inline code. */
.mdoc code { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 0.9em; font-weight: 600; background: none; border: 0; padding: 0; border-radius: 0; }
.mdoc pre {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; margin: 0 0 14px; line-height: 1.45;
}
.mdoc pre code { font-weight: 400; font-size: 0.86rem; }
.mdoc table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 0.92rem; display: block; overflow-x: auto; }
.mdoc th, .mdoc td { text-align: left; padding: 8px 12px; border: 1px solid var(--stroke-subtle); vertical-align: top; }
.mdoc th { font-weight: 600; background: var(--bg-alt); }
.mdoc tbody tr:nth-child(even) td { background: var(--bg-alt); }
.mdoc blockquote { margin: 0 0 14px; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.mdoc hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.mdoc-callout {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 12px 16px;
  border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.mdoc-callout > svg { width: 18px; height: 18px; flex: none; margin-top: 3px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; }
.mdoc-callout p:last-child { margin-bottom: 0; }
.mdoc-callout-warning, .mdoc-callout-caution { background: rgba(196, 107, 0, 0.10); border-color: rgba(196, 107, 0, 0.40); }
.mdoc-callout-warning > svg, .mdoc-callout-caution > svg { stroke: #c46b00; }
.mdoc-loading { color: var(--text-tertiary); margin: 0; }
.mdoc-source { font-size: 0.82rem; color: var(--text-tertiary); margin: 12px 0 0; }
@media (max-width: 640px) {
  .mdoc { padding: 18px 16px; }
  .mdoc h1 { font-size: 1.6rem; }
  .mdoc-crumbs { font-size: 1.1rem; flex-wrap: wrap; }
}

/* ---- Home page: every feature, by area (index.html) ------------------ */
.feature-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 12px 28px; }
.index-group h3 { font-size: 0.98rem; margin: 0 0 8px; font-weight: 650; display: flex; align-items: baseline; gap: 8px; }
.index-group h3 a { color: var(--text); }
.index-group h3 a:hover { color: var(--accent-text); }
.index-count { font-size: 0.75rem; font-weight: 600; color: var(--text-tertiary); background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.index-group ul { list-style: none; margin: 0 0 12px; padding: 0; }
.index-group li { padding: 4px 0; border-bottom: 1px solid var(--stroke-subtle); font-size: 0.92rem; }
.index-group li:last-child { border-bottom: 0; }
.index-group li a { color: var(--muted); }
.index-group li a:hover { color: var(--accent-text); }
.index-standout { color: var(--accent); font-size: 0.8rem; }

/* ---- Before / after (compare.js) -------------------------------------
 * The stage is one grid cell holding both layers, so they overlay exactly;
 * each mode only changes what is visible, clipped or blended. The frame
 * (border, radius) is on the stage, not the images, or two borders would
 * fight in the overlay modes. */
.doc figure.compare img { border: 0; border-radius: 0; box-shadow: none; width: 100%; }
.compare-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.compare-chip {
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border);
}
.compare.peek .compare-chip { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.compare-modes { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--border); margin-left: auto; }
.compare-modes button {
  font: inherit; font-size: 0.78rem; color: var(--muted); background: transparent; border: 0;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.compare-modes button:hover { color: var(--text); background: var(--control-hover); }
.compare-modes button[aria-checked="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow-card); font-weight: 600; }
.compare-modes button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.compare-stage {
  --split: 50%;
  position: relative; display: grid; grid-template-columns: 1fr; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-card); background: var(--card); touch-action: pan-y;
}
.compare-stage:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.compare-layer { grid-area: 1 / 1; position: relative; min-width: 0; }
.compare-label {
  display: none; position: absolute; top: 8px; left: 8px;
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.62); color: #fff; pointer-events: none;
}
.compare-handle { display: none; }

/* hover: before, with after fading in on peek */
.compare[data-mode="hover"] .compare-after { opacity: 0; transition: opacity 0.18s ease; }
.compare[data-mode="hover"].peek .compare-after { opacity: 1; }

/* split: before on the left of the divider, after on the right */
.compare[data-mode="split"] .compare-stage { cursor: ew-resize; user-select: none; touch-action: none; }
.compare[data-mode="split"] .compare-after { clip-path: inset(0 0 0 var(--split)); }
.compare[data-mode="split"] .compare-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); z-index: 1; }
.compare[data-mode="split"] .compare-label { display: block; }
.compare[data-mode="split"] .compare-after .compare-label { left: auto; right: 8px; }
.compare[data-mode="split"] .compare-handle {
  display: block; position: absolute; top: 0; bottom: 0; left: var(--split); z-index: 2;
  width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.compare-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; line-height: 1.4;
  background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.compare-handle:focus-visible span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* side by side and stacked: two framed shots, each headed by its label.
 * Stacked gives each the full width of the column; side by side becomes
 * stacked on a phone. */
.compare[data-mode="side"] .compare-stage,
.compare[data-mode="stack"] .compare-stage { gap: 8px; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
.compare[data-mode="side"] .compare-stage { grid-template-columns: 1fr 1fr; }
.compare[data-mode="side"] .compare-before, .compare[data-mode="stack"] .compare-before { grid-area: 1 / 1; }
.compare[data-mode="side"] .compare-after { grid-area: 1 / 2; }
.compare[data-mode="stack"] .compare-after { grid-area: 2 / 1; }
.compare[data-mode="side"] .compare-layer,
.compare[data-mode="stack"] .compare-layer { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-card); align-self: start; background: var(--card); }
.compare[data-mode="side"] .compare-label,
.compare[data-mode="stack"] .compare-label {
  display: block; position: static; border-radius: 0; padding: 4px 10px;
  background: var(--bg-alt); color: var(--muted); border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .compare[data-mode="side"] .compare-stage { grid-template-columns: 1fr; }
  .compare[data-mode="side"] .compare-after { grid-area: 2 / 1; }
}

/* only the after shot exists: a single image, no buttons */
.compare[data-mode="after-only"] .compare-bar { display: none; }
.compare[data-mode="after-only"] .compare-before { display: none; }

/* frame: "square", for a shot whose own corners are what it shows */
.compare.frame-square .compare-stage, .compare.frame-square .compare-layer { border-radius: 0; }

/* ---- Evidence, rendered (compare.js) ---------------------------------
 * Text evidence as a table: the probe or command that produced it, then
 * upstream's result above Mullion's, the rows the caption names marked.
 * Each table is its own card (.table-scroll); the figure adds no frame. */
.evidence-source { margin: 0 0 14px; padding: 8px 12px; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--stroke-subtle); overflow-x: auto; }
.evidence-source code { font-size: 0.82rem; white-space: pre; background: none; border: 0; padding: 0; }
.evidence-side + .evidence-side { margin-top: 16px; }
.evidence-label { margin: 0 0 6px; font-size: 0.86rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.evidence-which {
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 4px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted);
}
.doc .evidence .table-scroll table { min-width: 28rem; }
.doc .evidence td { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 0.84rem; }
.doc .evidence tr.marked td { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.evidence .none { color: var(--text-tertiary); font-style: italic; font-family: inherit; }
.evidence-note { margin: 10px 0 0; font-size: 0.82rem; color: var(--text-tertiary); }
@media (prefers-reduced-motion: reduce) {
  .compare-after, .compare-before { transition: none !important; }
}

.doc ol.steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; }
.doc ol.steps li { position: relative; padding: 0 0 14px 42px; counter-increment: step; }
.doc ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 650; font-size: 0.85rem;
}
.doc ul.notes { margin: 0 0 14px; padding-left: 22px; }
.doc ul.notes li { margin-bottom: 8px; }
.doc .callout { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 18px; }
.doc .callout p:last-child { margin-bottom: 0; }

.doc .table-scroll table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 32rem; }
.doc .table-scroll th, .doc .table-scroll td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stroke-subtle); vertical-align: top; }
.doc .table-scroll tr:last-child td { border-bottom: 0; }
.doc .table-scroll td code { white-space: nowrap; overflow-wrap: normal; }
.doc .table-scroll th { color: var(--text-tertiary); font-weight: 650; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-alt); }

.commits { display: flex; flex-wrap: wrap; gap: 8px; }
.commits .commit-link { font-size: 0.82rem; padding: 4px 10px; }

.pager { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  min-width: 0;
}
.pager a:hover { border-color: var(--accent-border); text-decoration: none; }
.pager a .dir { font-size: 0.8rem; color: var(--text-tertiary); }
.pager a .t { font-weight: 600; overflow-wrap: anywhere; }
.pager a.next { text-align: right; grid-column: 2; }
@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: 1; }
}
.missing { padding: 60px 0; text-align: center; color: var(--muted); }
