/* StreamLogos — public site styles. No frameworks, one self-hosted variable font, no layout shift. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Metric-matched fallback so text doesn't jump when Inter loads (CLS). */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"), local("Roboto"); ascent-override: 90.49%; descent-override: 22.56%; line-gap-override: 0%; size-adjust: 107.06%; }
:root {
  --bg: #0d0e10;
  --bg-2: #121316;
  --surface: #17191c;
  --surface-2: #1d2024;
  --border: #272a2f;
  --border-2: #34383e;
  --text: #ecedef;
  --muted: #9ba1a9;
  --faint: #6d737b;
  --accent: #e8c26a;
  --accent-ink: #1b1607;
  --link: #9cc0ff;
  --ok: #7bd88f;
  --bad: #ff8a80;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --checker: repeating-conic-gradient(#2a2d32 0% 25%, #1f2226 0% 50%) 50% / 20px 20px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; font-weight: 400; overflow-x: hidden; }
main { flex: 1; padding-block: 1.25rem 3.5rem; width: 100%; }
img, svg, picture { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #c3d8ff; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.55rem, 3.4vw, 2.35rem); font-weight: 700; letter-spacing: -.022em; line-height: 1.18; }
h2 { font-size: clamp(1.15rem, 2.1vw, 1.4rem); font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
code { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: .05em .35em; font-size: .9em; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
.sr { 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 { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: .5rem .8rem; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.icon { flex: none; vertical-align: -.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(13,14,16,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { color: var(--accent); }
.site-nav { display: flex; gap: .15rem; margin-left: .5rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: .45rem .65rem; border-radius: 8px; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-search { margin-left: auto; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 14px; min-width: 0; }
.header-search input { background: transparent; border: 0; color: var(--text); font: inherit; width: 190px; padding: .4rem 0; outline: none; }
.header-search button { background: transparent; border: 0; color: var(--muted); padding: .45rem .55rem; cursor: pointer; display: inline-flex; }
.header-search:focus-within { border-color: var(--accent); }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .4rem; cursor: pointer; }

@media (max-width: 1200px) {
  .header-search input { width: 130px; }
  .site-nav a { padding: .45rem .5rem; font-size: .9rem; }
}
@media (max-width: 1060px) {
  .site-header { position: relative; }
  .header-row { flex-wrap: wrap; gap: .5rem; padding-block: .5rem; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; order: 3; width: 100%; flex-direction: column; margin: 0; padding-bottom: .5rem; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .7rem .5rem; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .header-search { order: 4; width: 100%; margin: 0 0 .25rem; }
  .header-search input { width: 100%; font-size: 16px; } /* 16px stops iOS zooming into the field */
  .nav-toggle { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }
}

/* ---------- Breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.25rem; padding: 0; font-size: .875rem; color: var(--faint); }
.crumbs li + li::before { content: "/"; margin-right: .25rem; color: var(--border-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted); }

/* ---------- Hero / page heads ---------- */
.hero { padding: 2.5rem 0 1.5rem; max-width: 820px; }
.hero h1 { font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin-bottom: .8rem; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 70ch; }
.hero-search { display: flex; gap: .5rem; margin: 1.25rem 0 1rem; max-width: 640px; }
.hero-search input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; color: var(--text); font: inherit; font-size: 1.05rem; padding: .8rem 1rem; }
.hero-search input:focus { outline: none; border-color: var(--accent); }
.hero-search button, .btn-primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; font: inherit; font-weight: 600; padding: .75rem 1.1rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; }
.hero-search button:hover, .btn-primary:hover { filter: brightness(1.07); color: var(--accent-ink); }
.hero-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.hero-links a { color: var(--muted); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; font-weight: 550; }
.hero-links a:hover { color: var(--text); }
.page-head { margin-bottom: 1.5rem; }
.page-head .lead { margin-bottom: 0; }

/* ---------- Sections ---------- */
.section { margin-top: 2.75rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--muted); text-decoration: none; font-size: .95rem; display: inline-flex; gap: .3rem; align-items: center; white-space: nowrap; }
.section-head a:hover { color: var(--text); }
.empty { margin-top: 1.5rem; padding: 2rem; border: 1px dashed var(--border-2); border-radius: var(--radius); color: var(--muted); }
.empty h1, .empty h2 { color: var(--text); }
.empty-404 { text-align: center; padding: 3rem 1.5rem; }
.empty-404 .code { font-size: 4rem; font-weight: 700; color: var(--accent); margin: 0; line-height: 1; }
.empty-404 .hero-search { margin-inline: auto; }

/* ---------- Backgrounds ---------- */
.bg-checker { background: var(--checker); }
.bg-dark { background: radial-gradient(120% 120% at 50% 0%, #22252a 0%, #141518 70%); }
.bg-light { background: #f1f1ee; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { min-width: 0; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-media { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; contain: layout paint; }
/* Logo boxes: the picture is pinned inside the box with an inset, and the image is scaled down to
   fit both width and height, so wide, square and tall (vertical) logos are never cropped. */
.card-media > picture, .viewer-stage > picture, .variant-preview > picture, .timeline-thumb > picture, .mini-thumb > picture, .logo-fit > picture {
  position: absolute; inset: var(--fit-inset, 12%); display: flex; align-items: center; justify-content: center; width: auto; height: auto; }
.card-media > picture img, .viewer-stage > picture img, .variant-preview > picture img, .timeline-thumb > picture img, .mini-thumb > picture img, .logo-fit > picture img {
  width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.card-media { --fit-inset: 13% 12%; }
.card-link:hover .card-media { border-color: var(--border-2); transform: translateY(-2px); }
.card-nologo { color: var(--muted); font-weight: 600; padding: 0 .75rem; text-align: center; line-height: 1.25; }
.card-nologo small { display: block; font-weight: 500; color: var(--faint); font-size: .8rem; margin-top: .3rem; }
.card-title { margin: .65rem 0 .1rem; font-size: .97rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-link:hover .card-title { text-decoration: underline; }
.card-meta { margin: 0; color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px; }
.badge-soon { background: rgba(232,194,106,.16); color: var(--accent); border: 1px solid rgba(232,194,106,.35); }
.card-media .badge { position: absolute; top: 10px; left: 10px; }

/* ---------- Chips / lists ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.chips a { display: inline-flex; gap: .4rem; align-items: center; padding: .4rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .92rem; }
.chips a:hover { border-color: var(--border-2); background: var(--surface-2); }
.chips a span { color: var(--faint); font-size: .8rem; }
.chips .chip-tag { color: var(--muted); }
.term-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: 58px; gap: 10px; }
.term-list li { min-width: 0; }
.term-list a { height: 100%; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 0 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 550; overflow: hidden; }
.term-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-list a:hover { border-color: var(--border-2); background: var(--surface-2); }
.term-list small { color: var(--faint); font-weight: 450; white-space: nowrap; font-size: .82rem; flex: none; }
.term-letters { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-rows: 64px; }
.term-letters a span { font-size: 1.4rem; }
.az { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.5rem; }
.az a { min-width: 2.4rem; min-height: 2.4rem; display: inline-grid; place-items: center; padding: .25rem .5rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 600; }
.az a:hover, .az a[aria-current] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- Network icons ---------- */
.net-icon { width: auto; max-width: 100%; display: inline-block; vertical-align: middle; }
/* Lists with icons (networks): every tile is identical — icon box, one-line name, count. */
.term-list.with-icons { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-rows: 72px; }
.term-list.with-icons a { display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: .85rem; row-gap: 0; align-content: center; justify-content: stretch; padding: 0 .9rem 0 .7rem; }
.term-list.with-icons .term-icon { grid-row: 1 / span 2; }
.term-list.with-icons .term-name { align-self: end; line-height: 1.3; }
.term-list.with-icons small { grid-column: 2; align-self: start; line-height: 1.4; }
.term-icon { display: grid; place-items: center; width: 72px; height: 44px; background: #f1f1ee; border-radius: 7px; padding: 5px 8px; flex: none; overflow: hidden; }
.term-icon .net-icon { max-height: 32px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.term-icon.is-empty { background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); font-weight: 650; font-size: .95rem; letter-spacing: .02em; }
.page-head.with-icon { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.25rem; align-items: center; }
.page-head.with-icon .lead { grid-column: 1 / -1; }
.head-icon { background: #f1f1ee; border-radius: 12px; padding: 10px 16px; display: grid; place-items: center; grid-row: span 1; }
.head-icon .net-icon { max-height: 56px; }
.net-link { display: inline-flex; align-items: center; gap: .5rem; }
.net-link .net-icon { background: #f1f1ee; border-radius: 4px; padding: 2px 4px; height: 22px; }
.brand-logo { height: 34px; width: auto; display: block; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 2.5rem 0 0; }
.pagination a, .pagination span { padding: .5rem .8rem; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--text); min-width: 2.5rem; text-align: center; }
.pagination a:hover { background: var(--surface-2); }
.pagination [aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.pagination .gap { border: 0; color: var(--faint); }

/* ---------- Title page ---------- */
.title-head { max-width: 900px; margin-bottom: 1.25rem; }
.h1-sub { color: var(--muted); font-weight: 600; font-size: .62em; white-space: nowrap; }
.title-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; color: var(--muted); font-size: .95rem; margin-bottom: .9rem; }
.title-meta > span + span::before { content: ""; }
.title-meta .dl-total { display: inline-flex; gap: .3rem; align-items: center; }
.title-meta .dl-total strong { color: var(--text); font-weight: 600; }
.title-meta a { color: var(--muted); }
.title-meta .updated { display: inline-flex; gap: .3rem; align-items: center; color: var(--faint); }
.intro { font-size: 1.08rem; color: #d3d6da; max-width: 75ch; }
.viewer { border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
/* Fixed-height stage: wide logos fill the width, tall logos fit the height — the page never grows. */
.viewer-stage { margin: 0; position: relative; height: clamp(220px, 44vw, 430px); transition: background-color .2s; --fit-inset: clamp(1.25rem, 5vw, 3rem) clamp(1.25rem, 7vw, 4.5rem); contain: layout paint; }
.viewer-stage.bg-custom { background: var(--custom-bg, #3a5ba0); }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .7rem .9rem; border-top: 1px solid var(--border); background: var(--bg-2); }
.tools-label { color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .3rem; }
.viewer-tools button, .custom-bg { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; font: inherit; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.viewer-tools button[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.custom-bg input { width: 24px; height: 20px; border: 0; padding: 0; background: none; cursor: pointer; }
.viewer-empty { padding: 2rem; color: var(--muted); }
.variants { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.variant { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.variant.is-active { border-color: var(--accent); }
.variant-preview { position: relative; display: block; height: 170px; padding: 0; border: 0; border-bottom: 1px solid var(--border); cursor: zoom-in; width: 100%; --fit-inset: 14% 12%; }
.variant-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.variant-body h3 { margin: 0; }
.specs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0; font-size: .87rem; }
.specs div { display: flex; gap: .35rem; }
.specs dt { color: var(--faint); }
.specs dd { margin: 0; color: var(--text); }
.swatches { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.swatch { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: .2rem .5rem .2rem .25rem; cursor: copy; }
.swatch span { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.swatch:hover { color: var(--text); border-color: var(--border-2); }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .5rem .8rem; border-radius: 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border-2); font: inherit; font-size: .9rem; font-weight: 550; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--text); background: #262a2f; }
.btn.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: .5rem .85rem; }
.btn-ghost { background: transparent; color: var(--muted); }
.facts-wrap { max-width: 760px; }
.facts { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.facts th, .facts td { text-align: left; padding: .65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .95rem; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { width: 38%; color: var(--muted); font-weight: 500; }
.facts td { overflow-wrap: anywhere; }
.ext-link { display: inline-flex; align-items: center; gap: .3rem; }
.refs { display: flex; gap: .9rem; }
.timeline { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 14px; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.timeline li { scroll-snap-align: start; }
.timeline-item { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; background: var(--surface); height: 100%; }
.timeline-item[aria-current] { border-color: var(--accent); }
.timeline-item:hover { border-color: var(--border-2); }
.timeline-thumb { position: relative; aspect-ratio: 16 / 8; border-radius: 8px; --fit-inset: 10%; }
.timeline-label { font-weight: 650; }
.timeline-label small { color: var(--faint); font-weight: 500; margin-left: .3rem; }
.notice { margin-top: 2.75rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--muted); font-size: .93rem; max-width: 900px; }
.notice p:last-child { margin: 0; }
.notice a { display: inline-flex; gap: .3rem; align-items: center; }

/* ---------- Article body extras (pasted content) ---------- */
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; }
.prose figure { margin: 1.25rem 0; } .prose figcaption { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.news-card-link { color: inherit; text-decoration: none; display: block; }
.news-card img { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; }
.news-card h3 { margin: .75rem 0 .3rem; font-size: 1.08rem; color: var(--text); }
.news-card-link:hover h3 { text-decoration: underline; }
.news-meta { color: var(--faint); font-size: .85rem; margin: 0 0 .35rem; }
.news-meta a { color: var(--muted); text-decoration: none; }
.news-excerpt { color: var(--muted); font-size: .95rem; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: .55rem .9rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a[aria-current] { color: var(--text); border-color: var(--accent); }
.rss-link { display: inline-flex; gap: .25rem; align-items: center; font-size: .9rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; gap: 1.5rem; } }
.article { max-width: 760px; }
.kicker { margin: 0 0 .5rem; display: flex; gap: .75rem; }
.kicker a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.byline { color: var(--faint); font-size: .9rem; }
.byline span { color: var(--muted); }
.cover { margin: 1.25rem 0 1.75rem; }
.cover img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.prose { font-size: 1.06rem; line-height: 1.75; color: #d9dcdf; }
.prose h2 { margin-top: 2.2rem; font-size: 1.45rem; color: var(--text); }
.prose h3 { margin-top: 1.6rem; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: 1.25rem 0; padding: .4rem 1.1rem; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose blockquote p:last-child { margin: 0; }
.prose img { border-radius: var(--radius-sm); margin: 1rem 0; }
.prose pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; }
.prose pre code { border: 0; background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.article-aside { position: sticky; top: 84px; }
.article-aside h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.mini-list a { display: flex; gap: .75rem; align-items: center; color: var(--text); text-decoration: none; padding: .4rem; border-radius: 10px; border: 1px solid transparent; }
.mini-list a:hover { border-color: var(--border); background: var(--surface); }
.mini-list small { display: block; color: var(--faint); font-size: .8rem; }
.mini-thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 10; border-radius: 8px; border: 1px solid var(--border); --fit-inset: 12%; }
.prose-page { max-width: 780px; }
.prose-page ol, .prose-page ul { padding-left: 1.3rem; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.form label small { color: var(--faint); font-weight: 400; }
.form input:not([type=checkbox]), .form textarea { background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); font: inherit; padding: .65rem .8rem; width: 100%; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; color: var(--muted); }
.form .check input { margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form button { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: .9rem 1.1rem; border-radius: 10px; margin: 1.25rem 0; }
.alert-ok { background: rgba(123,216,143,.1); border: 1px solid rgba(123,216,143,.35); color: #c8f2d1; }
.alert-error { background: rgba(255,138,128,.1); border: 1px solid rgba(255,138,128,.35); color: #ffd1cc; }

/* ---------- Ads ---------- */
.ad { margin-block: 1.25rem; text-align: center; min-height: 0; }
.ad:empty { display: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); color: var(--muted); font-size: .92rem; padding: 2.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }
.footer-grid nav { display: flex; flex-direction: column; gap: .35rem; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-brand { color: var(--text); font-weight: 700; margin-bottom: .3rem; }
.footer-h { color: var(--text); font-weight: 600; margin-bottom: .4rem; }
.social { display: flex; gap: .9rem; }
.disclaimer { margin: 2rem 0 .5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .85rem; display: block; }
.disclaimer .icon { color: var(--accent); }
.attribution, .copyright { font-size: .8rem; color: var(--faint); margin: .25rem 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; font-weight: 600; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; display: inline-flex; gap: .4rem; align-items: center; }
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Phones (kept last so it wins over the rules above) ---------- */
@media (max-width: 640px) {
  main { padding-block: 1rem 2.5rem; }
  .hero { padding: 1.25rem 0 1rem; }
  .hero-search input { font-size: 16px; }
  .lead { font-size: 1rem; }
  .section { margin-top: 2rem; }
  .title-meta { font-size: .88rem; gap: .3rem .75rem; }
  .intro { font-size: 1rem; }
  .viewer-tools { gap: .35rem; padding: .6rem; }
  .viewer-tools .tools-label { width: 100%; }
  .viewer-tools button, .custom-bg { min-height: 40px; }
  .facts th, .facts td { padding: .6rem .75rem; font-size: .9rem; }
  .facts th { width: 42%; }
  .term-list, .term-list.with-icons { grid-template-columns: 1fr 1fr; gap: 8px; }
  .term-list.with-icons { grid-template-columns: 1fr; }
  .term-letters { grid-template-columns: repeat(3, 1fr); }
  .chips a { min-height: 40px; }
  .pagination a, .pagination span { min-width: 40px; min-height: 40px; }
  .footer-grid nav a { padding: .2rem 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .viewer-tools, .actions, .ad { display: none !important; } }

/* ---------- Contact email box ---------- */
.email-box { display: grid; gap: .6rem; margin: 1.5rem 0 2rem; padding: 1.25rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 560px; }
.email-label { color: var(--faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.email-addr { font-size: clamp(1.1rem, 4vw, 1.4rem); font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.email-addr:hover { color: var(--accent); }
.email-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
