/* research_site — layout «rich»: an editorial research brief, quiet and readable.
   System fonts only (no external resources). Tokens on :root, a designed dark palette via
   prefers-color-scheme and [data-theme]. Status colours live only in pills, rails and dots;
   everything else is ink on paper. Prose keeps a 70ch measure, tables and cards may use the
   full 1080px column. Phone width 400px: hero stacks, stat tiles go two per row, tables
   scroll inside their own container. Print: light tokens; niche pages carry no JS, so collapsed
   <details> are opened for print through ::details-content (Chromium 131+, Safari 18.4+). */

:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --sunken: #eeece7;
  --ink: #1f1d1a;
  --muted: #625d55;
  --faint: #736d63;  /* 5.1:1 on the surface: legend percentages and anchors stay readable */
  --line: #e2ded6;
  --line-strong: #c7c1b6;
  --accent: #245e8a;
  --accent-soft: #e6eef5;
  --code-bg: #ecebe6;
  /* status palette: text on soft background ≥ 4.5:1 in both themes */
  --ok: #1f6b47;    --ok-soft: #dff0e6;
  --mid: #8a5a08;   --mid-soft: #f7ebd4;
  --no: #a1332e;    --no-soft: #f6e0dd;
  --na: #5b6170;    --na-soft: #e9ebf0;
  --info: #335c9e;  --info-soft: #e3eaf6;
  --fire: var(--ok); --good: var(--ok); --maybe: var(--mid); --nocol: var(--no); --incomplete: var(--na); --wip: var(--info);
  --radius: 10px;
  --radius-s: 6px;
  --measure: 70ch;
  --col: 1080px;
  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181c;
    --surface: #1e2126;
    --sunken: #121417;
    --ink: #e8e6e1;
    --muted: #a39e95;
    --faint: #8f8980;
    --line: #2c3037;
    --line-strong: #40464f;
    --accent: #7fb3dc;
    --accent-soft: #1d2a36;
    --code-bg: #262a30;
    --ok: #6fcf97;    --ok-soft: #173224;
    --mid: #e2b15a;   --mid-soft: #342a15;
    --no: #ee8c86;    --no-soft: #3a1f1d;
    --na: #a6adb9;    --na-soft: #252a33;
    --info: #86a9e0;  --info-soft: #1e2838;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #16181c; --surface: #1e2126; --sunken: #121417; --ink: #e8e6e1; --muted: #a39e95; --faint: #8f8980;
  --line: #2c3037; --line-strong: #40464f; --accent: #7fb3dc; --accent-soft: #1d2a36; --code-bg: #262a30;
  --ok: #6fcf97; --ok-soft: #173224; --mid: #e2b15a; --mid-soft: #342a15; --no: #ee8c86; --no-soft: #3a1f1d;
  --na: #a6adb9; --na-soft: #252a33; --info: #86a9e0; --info-soft: #1e2838; --shadow: none;
}

/* --- base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.6 var(--f-body);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
.wrap { width: 100%; max-width: calc(var(--col) + 32px); margin: 0 auto; padding: 0 16px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(28px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.01em; margin: 6px 0 14px; }
h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(21px, 2.6vw, 28px); margin: 0 0 14px; }
h3 { font-size: 1.02rem; font-weight: 650; margin: 1.5rem 0 0.55rem; }
h4 { font-size: 0.95rem; font-weight: 650; margin: 1.1rem 0 0.4rem; }
.h-note { font-family: var(--f-body); font-weight: 400; font-size: 0.78rem; color: var(--muted); letter-spacing: 0; margin-left: 0.5rem; }

p, ul, ol { margin: 0 0 0.9rem; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.25rem 0; }
.prose, .prose p, .prose li, .thesis, .plain, .axis-text, .box-body p, .box-body li { max-width: var(--measure); }
.prose ul, .prose ol, .box-body ul, .box-body ol { max-width: var(--measure); }
.prose > :first-child, .box-body > :first-child { margin-top: 0; }
.prose h2, .box-body h2 { font-family: var(--f-body); font-size: 1.08rem; font-weight: 650; margin: 1.4rem 0 0.5rem; }
.prose h3, .box-body h3 { font-size: 1rem; }
.prose p.lead { margin-bottom: 0.45rem; }
.prose p.lead + :not(.lead) { margin-top: 0.9rem; }
.prose hr, .box-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
/* the seam of a joined «(продолжение)» message: thin, and invisible between two halves of one list */
.prose hr.cont, .box-body hr.cont { margin: 0.3rem 0; border-top: 1px dashed var(--line); }
.prose ol + hr.cont:has(+ ol), .box-body ol + hr.cont:has(+ ol) { display: none; }
.prose blockquote, .box-body blockquote { margin: 0 0 1rem; padding: 0.2rem 0 0.2rem 1rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.prose img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a.quiet, a.quiet:hover { color: inherit; text-decoration: none; }
a.quiet:hover .src, a.quiet:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }
a.term { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: help; }
a.term:hover { color: var(--accent); }
strong, b { font-weight: 650; }
code, kbd { font-family: var(--f-mono); font-size: 0.86em; background: var(--code-bg); padding: 0.06em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 0.8rem 1rem; border-radius: var(--radius-s); overflow-x: auto; }
pre code { background: none; padding: 0; }
time { white-space: nowrap; }
time.estimated { font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.num, .tbl td, .stat .v, .tile { font-variant-numeric: tabular-nums; }
.src { text-decoration: underline dotted; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; cursor: help; }
[title] { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 0.4rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s); z-index: 10; }
.skip:focus { left: 8px; }

/* --- head / foot ------------------------------------------------------------- */

.site-head { padding-top: 1.3rem; padding-bottom: 0.2rem; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.4rem; }
.crumbs span { color: var(--ink); }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.88rem; flex-wrap: wrap; }
.prevnext a { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prevnext a[rel="next"] { margin-left: auto; }
.site-foot { margin-top: 3.5rem; padding: 1.3rem 16px 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.site-foot p { margin: 0 0 0.6rem; }
.site-foot code { font-size: 0.84em; }
.site-foot .prevnext a { max-width: 100%; }

/* --- pills, chips, badges ---------------------------------------------------- */

.pill, .chip, .badge {
  display: inline-block; font-size: 0.78rem; line-height: 1.35; font-weight: 600;
  padding: 0.12rem 0.6rem; border-radius: 999px; vertical-align: middle; white-space: nowrap; max-width: 100%;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.mid { background: var(--mid-soft); color: var(--mid); }
.pill.no { background: var(--no-soft); color: var(--no); }
.pill.na { background: var(--na-soft); color: var(--na); }
.pill.info { background: var(--info-soft); color: var(--info); }
.chip { background: var(--surface); color: var(--muted); border: 1px solid var(--line-strong); font-weight: 550; }
.chip.soft { background: var(--sunken); border-color: transparent; }
.chip.legacy { border-style: dashed; }
.chip.control { color: var(--info); border-color: var(--info); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; vertical-align: middle; }
p.chips { display: flex; margin: 0.6rem 0; }
/* chips with lists inside (billing players) wrap instead of forcing a horizontal page scroll */
.chips .chip, p.chips .chip { white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.3; }
.badge { border-radius: var(--radius-s); border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); white-space: normal; text-wrap: balance; }
.badge.st-fire, .badge.st-good { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.badge.st-maybe { color: var(--mid); border-color: var(--mid); background: var(--mid-soft); }
.badge.st-no { color: var(--no); border-color: var(--no); background: var(--no-soft); }
.badge.st-incomplete { color: var(--na); border-color: var(--na); background: var(--na-soft); }
.badge.st-wip { color: var(--info); border-color: var(--info); background: var(--info-soft); }
.outcome-note { font-size: 0.85rem; }

/* --- hero ------------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 40px; align-items: start; padding: 1rem 0 1.8rem; border-bottom: 1px solid var(--line); margin-bottom: 0.4rem; }
.hero.with-side { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); }
.hero-main { min-width: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.2rem; }
.verdict-row { margin: 0.3rem 0 0.8rem; }
.verdict { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.02rem; padding: 0.42rem 1rem 0.42rem 0.85rem; border-radius: 999px; background: var(--na-soft); color: var(--na); max-width: 100%; white-space: normal; }
.verdict i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.verdict .hint { font-weight: 500; }
.verdict.st-fire, .verdict.st-good { background: var(--ok-soft); color: var(--ok); }
.verdict.st-maybe { background: var(--mid-soft); color: var(--mid); }
.verdict.st-no { background: var(--no-soft); color: var(--no); }
.verdict.st-incomplete { background: var(--na-soft); color: var(--na); }
.verdict.st-wip { background: var(--info-soft); color: var(--info); }
.verdict-why { font-size: 1.02rem; margin: 0 0 0.6rem; max-width: 60ch; }
.thesis { font-size: 1.14rem; line-height: 1.5; color: var(--muted); max-width: 58ch; margin: 0.2rem 0 0.9rem; text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; font-size: 0.88rem; color: var(--muted); margin: 0.6rem 0 0.4rem; align-items: center; }
.note { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--muted); max-width: var(--measure); }
.note.correction { color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 0.4rem 0.7rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.hero-side { min-width: 0; }
.hero-stats { margin: 0.4rem 0 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- stat tiles ------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0.4rem 0 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
.stat .v { font-family: var(--f-mono); font-size: 1.35rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.stat .v .pill { font-family: var(--f-body); font-size: 0.82rem; }
.stat .l { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.4; }
.stat.spark .v { font-size: 1.15rem; }
.stat .chart { margin-top: 0.4rem; color: var(--accent); }
.stat .chart svg { display: block; width: 100%; height: auto; max-height: 48px; }

/* --- sections ----------------------------------------------------------------- */

section.blk { padding: 2rem 0 0.4rem; }
section.blk.sub { padding-top: 1.4rem; }
section.blk > h2 { margin-bottom: 0.9rem; }
.divider { display: flex; align-items: center; gap: 0.6rem; margin: 0.9rem 0 0.4rem; font-size: 0.86rem; color: var(--muted); }
.divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); margin: 0; max-width: none; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list.dated li { display: flex; gap: 0.8rem; align-items: baseline; }
.plain-list.dated .muted { flex: none; font-variant-numeric: tabular-nums; }
.tnote { font-size: 0.84rem; color: var(--muted); margin: -0.4rem 0 1rem; max-width: var(--measure); }
.qlines { font-size: 0.9rem; line-height: 1.7; }

/* --- «Простыми словами» ------------------------------------------------------ */

.plain { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: var(--shadow); max-width: none; }
.plain.prose { padding: 16px 22px 6px; }
.plain ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; max-width: none; }
.plain li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; margin: 0; align-items: baseline; max-width: none; }
.plain .k { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 0.25rem; }
.plain .t { max-width: var(--measure); }

/* --- axes --------------------------------------------------------------------- */

.axes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.axes-grid.one { grid-template-columns: minmax(0, 1fr); }
.axis { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: var(--shadow); }
.axis-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.axis-name { font-weight: 650; }
.axis-text { font-size: 0.92rem; margin: 0; max-width: none; }
.axis-data { font-size: 0.84rem; color: var(--muted); margin: 0; }
.axis-note { font-size: 0.92rem; color: var(--muted); margin: 0.9rem 0 0; max-width: var(--measure); }
.axis-note b { color: var(--ink); }

/* --- tables --------------------------------------------------------------------- */

.tbl { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 0.2rem 0 1.1rem; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.tbl table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.9rem; line-height: 1.45; min-width: 640px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--sunken); font-size: 0.72rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.tbl th[title] { cursor: help; text-decoration: underline dotted; text-decoration-color: var(--line-strong); text-underline-offset: 0.25em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.tbl td .pill { white-space: normal; }
.tbl td .chart.inline { margin-top: 0.25rem; color: var(--accent); }
.tbl td .chart.inline svg { display: block; height: 24px; width: auto; max-width: 120px; }
.tbl.info { border-style: dashed; }
.tbl tr.divider-row td { background: var(--sunken); color: var(--muted); font-size: 0.84rem; padding: 6px 13px; border-top: 1px dashed var(--line-strong); }
.tbl tr.info td { color: var(--muted); }
.tbl tr.info td:first-child { font-weight: 500; }
/* numeric columns per table (cells carry no class to keep pages light) */
.tbl.channels td:nth-child(3), .tbl.competitors td:nth-child(2), .tbl.competitors td:nth-child(3),
.tbl.competitors td:nth-child(n+5), .tbl.queries td:nth-child(n+2):nth-child(-n+5),
.tbl.econ td:nth-child(n+2):nth-child(-n+7), .tbl.leaders td:nth-child(3), .tbl.v1 td:nth-child(n+2):nth-child(-n+6) {
  font-family: var(--f-mono); font-size: 0.84rem; white-space: nowrap;
}
.tbl.queries td:nth-child(2) { font-weight: 600; }
.tbl.queries td:first-child code { font-size: 0.84rem; }
.tbl.channels td:nth-child(5), .tbl.revenue td:nth-child(2), .tbl.giants td:nth-child(2) { font-size: 0.86rem; color: var(--muted); }
.tbl.channels td:first-child { font-weight: 550; }
.tbl.channels td:first-child code, .tbl.econ td:first-child code { font-weight: 500; }
.tbl.econ td:nth-child(2), .tbl.econ td:nth-child(4), .tbl.econ td:nth-child(5) { font-weight: 550; }
/* v1 table: the last column is a status pill, the payback cell carries a summary sentence */
.tbl.v1 td:nth-child(2), .tbl.v1 td:nth-child(4) { font-weight: 550; }
.tbl.v1 td:last-child { font-family: var(--f-body); font-size: 0.9rem; white-space: normal; }
.tbl.v1 td .muted { display: block; white-space: normal; font-family: var(--f-body); font-size: 0.82rem; max-width: 34ch; margin-top: 0.15rem; }
.tbl.giants table, .tbl.leaders table, .tbl.revenue table { min-width: 560px; }
.tbl.queries table { min-width: 520px; }
h3.db { display: flex; align-items: center; gap: 0.4rem; margin-top: 1.1rem; }

/* --- charts -------------------------------------------------------------------- */

.chart { color: var(--accent); }
.chart svg { max-width: 100%; height: auto; display: block; }
.chart svg .spark-dot { stroke: var(--surface); }
.slices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 0.8rem 0 1rem; }
figure.slice { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
figure.slice figcaption { font-size: 0.88rem; margin-bottom: 0.5rem; }
figure.slice .chart svg { width: 100%; height: 12px; }
figure.slice .legend { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0; }
.seg-legend { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 2px 10px; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-legend li { margin: 0; display: flex; gap: 0.35rem; align-items: baseline; white-space: nowrap; }
.seg-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); flex: none; position: relative; top: 1px; }
.seg-name { color: var(--ink); }
.seg-val { font-weight: 600; }
.seg-pct { color: var(--faint); }
.seg-legend li.zero { opacity: 0.55; }
.sparks { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.trend-group { margin: 0.6rem 0 1rem; }
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.trend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; box-shadow: var(--shadow); }
.trend-h { font-size: 0.9rem; margin-bottom: 0.4rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tile .tl { font-size: 0.7rem; color: var(--muted); line-height: 1.3; }
span.trend { display: inline-flex; align-items: center; gap: 0.25rem; font-family: var(--f-mono); font-size: 0.92rem; font-weight: 600; background: none; border: 0; padding: 0; white-space: nowrap; }
span.trend i { font-style: normal; font-size: 0.7em; }
.trend-up { color: var(--ok); }
.trend-down { color: var(--no); }
.trend-flat { color: var(--muted); }
.trend-na { color: var(--faint); }

/* --- quotes, creatives, related ------------------------------------------------- */

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0.4rem 0 1rem; }
blockquote.quote { margin: 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 12px 14px; font-size: 0.92rem; box-shadow: var(--shadow); min-width: 0; }
blockquote.quote p { margin: 0; max-width: none; }
blockquote.quote .qsrc { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }
blockquote.quote.neg { border-left-color: var(--no); }
blockquote.quote.pos { border-left-color: var(--ok); }
.quote-list { list-style: none; padding: 0; font-size: 0.9rem; }
.quote-list li { padding: 0.35rem 0 0.35rem 0.8rem; border-left: 3px solid var(--line-strong); margin: 0.4rem 0; max-width: none; }
.quote-list li.qneg, .quote-list li.q.neg { border-left-color: var(--no); }
.quote-list li.qpos, .quote-list li.q.pos { border-left-color: var(--ok); }
.creatives { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.creative { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 0.9rem; min-width: 0; }
.creative .c-h { font-weight: 650; margin-bottom: 0.4rem; }
.angles { padding-left: 1.1rem; margin: 0 0 0.5rem; max-width: none; }
.angles li { margin: 0.15rem 0; color: var(--muted); }
.creative .ad { margin: 0; font-style: italic; }
.related { list-style: none; padding: 0; }
.related li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; max-width: none; }
.related li:last-child { border-bottom: 0; }
.freq { max-width: var(--measure); }
.sparse code { margin-right: 0.15rem; }
.plain .verdict-rest { margin: 0 0 0.9rem; color: var(--ink); }

/* --- boxes: risk, plan, details ---------------------------------------------------- */

.risk-box { background: var(--no-soft); border-radius: 14px; padding: 16px 20px 6px; margin-bottom: 1rem; max-width: none; }
.risk-box a { color: var(--no); }
.risk-box :first-child { margin-top: 0; }
.plan-box { background: var(--surface); border: 1px solid var(--accent); border-left-width: 4px; border-radius: 14px; padding: 16px 20px 6px; max-width: none; }
.plan-box .plan-facts { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.9rem; }
.plan-box ol { counter-reset: n; list-style: none; padding: 0; }
.plan-box ol > li { counter-increment: n; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0.5rem 0; }
.plan-box ol > li::before { content: counter(n); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-family: var(--f-mono); font-size: 0.78rem; margin-top: 0.1rem; }
.plan-box ol > li[value]::before { content: attr(value); }

details.box { margin: 0.9rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.box > summary { cursor: pointer; padding: 0.65rem 1rem; font-weight: 600; color: var(--accent); list-style-position: inside; }
details.box[open] > summary { border-bottom: 1px solid var(--line); }
details.box .box-body { padding: 0.9rem 1rem 0.2rem; }
details.box.nested { margin: 0.8rem 0 1rem; background: var(--bg); }
details.box.report > summary, details.box.more > summary { font-weight: 550; font-size: 0.92rem; }
details.box.more { background: transparent; }
.reeval-meta { color: var(--muted); font-size: 0.9rem; }
.card-head { margin: 0 0 0.6rem; }
.followups, .reevals { padding-top: 1.6rem; }
.followups h2, .reevals h2 { margin-bottom: 0.6rem; }
.fu-list { list-style: none; padding: 0; }
.fu-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; max-width: none; }
.fu-list li:last-child { border-bottom: 0; }
.fu-id { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 0.3rem; }
.fu-meta { font-size: 0.86rem; color: var(--muted); display: inline-flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.report .sec > :first-child { margin-top: 0; }
hr.thin { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }

/* --- index -------------------------------------------------------------------- */

.index-head { padding-top: 1.8rem; }
.lede { color: var(--muted); max-width: 60ch; font-size: 1.02rem; margin: 0 0 0.8rem; }
.counts { list-style: none; padding: 0; margin: 0.6rem 0 0.2rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.9rem; color: var(--muted); }
.counts li { margin: 0; }
.counts b { color: var(--ink); font-weight: 650; }
.toplinks { margin: 0.7rem 0 0; font-size: 0.95rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.legend { margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); max-width: var(--measure); }
.legend summary { cursor: pointer; color: var(--accent); }
.legend ul { list-style: none; padding: 0; margin: 0.6rem 0; }
.legend li { margin: 0.35rem 0; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: 0.6rem 0.9rem; align-items: end; margin: 1.4rem 0 1.6rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 0.88rem; box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: 0.25rem; color: var(--muted); margin: 0; min-width: 0; }
.filters .f-q { grid-column: 1 / -1; }
.filters .check { flex-direction: row; align-items: center; gap: 0.5rem; padding-bottom: 0.45rem; }
.filters input, .filters select, .filters button { font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 0.4rem 0.55rem; min-height: 2.3rem; width: 100%; min-width: 0; }
.filters input[type="checkbox"] { min-height: 0; width: 1.05rem; height: 1.05rem; padding: 0; margin: 0; accent-color: var(--accent); }
.filters button { width: auto; cursor: pointer; background: var(--sunken); }
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.f-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.shown { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-style: italic; }

.month h2 { font-family: var(--f-body); font-size: 0.95rem; color: var(--muted); font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; margin: 2rem 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
.month:first-child h2 { margin-top: 0.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.8rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 0.8rem 1rem 0.85rem 0.95rem; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; box-shadow: var(--shadow); }
.card.st-fire, .card.st-good { border-left-color: var(--ok); }
.card.st-maybe { border-left-color: var(--mid); }
.card.st-no { border-left-color: var(--no); }
.card.st-incomplete { border-left-color: var(--na); }
.card.st-wip { border-left-color: var(--info); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-top .num { font-weight: 650; color: var(--ink); font-family: var(--f-mono); font-size: 0.78rem; }
.axes-mini { display: inline-flex; gap: 4px; margin-left: auto; }
.axes-mini .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--na); display: inline-block; }
.axes-mini .ax-pass, .axes-mini .ax-pass_if { background: var(--ok); }
.axes-mini .ax-warn { background: var(--mid); }
.axes-mini .ax-fail { background: var(--no); }
.axes-mini .ax-incomplete, .axes-mini .ax-n\/a { background: var(--na); }
.card-title { font-family: var(--f-display); font-size: 1.12rem; margin: 0; line-height: 1.3; text-wrap: pretty; font-weight: 700; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); text-decoration: underline; }
.card-verdict { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.5; max-width: none; }
.card-verdict .detail { display: -webkit-box; margin-top: 0.3rem; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-fu { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* --- glossary ----------------------------------------------------------------- */

dl.glossary { margin: 0; }
.term-row { padding: 0.9rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
.term-row:last-child { border-bottom: 0; }
.term-row:target { background: var(--accent-soft); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-s); }
.term-row dt { font-weight: 650; font-size: 1.02rem; }
.term-row dd { margin: 0.25rem 0 0; max-width: var(--measure); }
a.anchor { color: var(--faint); text-decoration: none; font-weight: 400; margin-left: 0.3rem; }
a.anchor:hover { color: var(--accent); }

/* --- small screens --------------------------------------------------------------- */

@media (max-width: 760px) {
  .hero.with-side { grid-template-columns: minmax(0, 1fr); }
  .plain li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .stats, .hero-stats, .sparks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 1.15rem; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.7rem 0.75rem; }
  .filters .f-q, .filters .check, .f-actions { grid-column: 1 / -1; }
  .prevnext { flex-direction: column; gap: 0.3rem; }
  .prevnext a { max-width: 100%; }
  .prevnext a[rel="next"] { margin-left: 0; }
  .cards, .quotes, .creatives, .trends, .slices, .axes-grid { grid-template-columns: minmax(0, 1fr); }
  .plain { padding: 14px 16px; }
  .tbl { max-height: none; }
  .tbl table { font-size: 0.86rem; }
  .verdict { font-size: 0.95rem; }
}
@media (max-width: 400px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .meta, .card-top { gap: 0.3rem 0.6rem; }
  .thesis { font-size: 1.04rem; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .tile .tl { font-size: 0.64rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* --- print ----------------------------------------------------------------------- */

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --sunken: #f3f3f3; --ink: #000; --muted: #333; --faint: #555;
    --line: #bbb; --line-strong: #999; --accent: #000; --accent-soft: #eee; --code-bg: #f2f2f2;
    --ok: #1f6b47; --ok-soft: #eef7f1; --mid: #7a4f06; --mid-soft: #fbf3e4; --no: #a1332e; --no-soft: #fbeeed;
    --na: #444; --na-soft: #f0f0f0; --info: #335c9e; --info-soft: #eef2f9; --shadow: none;
  }
  body { font-size: 10.5pt; line-height: 1.42; }
  .skip, .filters, .toplinks, .prevnext, .legend, .site-foot a, #shown, #empty, script, a.anchor { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .prose a[href^="http"]:not(.bare):not([href*="t.me/"])::after, .box-body a[href^="http"]:not(.bare):not([href*="t.me/"])::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; word-break: break-all; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .tbl { max-height: none; overflow: visible; border-radius: 0; }
  .tbl th { position: static; }
  .tbl table { min-width: 0; }
  section.blk, .stat, .axis, .card, blockquote.quote, figure.slice, .trend, details.box, .plain { break-inside: avoid; box-shadow: none; }
  details.box > summary { color: #000; list-style: none; }
  details.box > summary::-webkit-details-marker { display: none; }
  details.box::details-content { content-visibility: visible; display: block; }
  .card-verdict .detail { display: block; -webkit-line-clamp: none; }
}
