/*
 * korshunov.ai — editorial ML news aggregator
 * Light/dark tokens, density + accent + font driven by user prefs.
 * Ported from the design handoff (reference/styles.css) — scope reduced
 * to feed/today/saved/search; sidebar, slide-over, onboarding, and
 * tweaks panel are intentionally not ported.
 */

:root {
  --font-serif: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans:  "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono:  "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-head:  var(--font-sans);

  /* Accent. User-selectable later; default vermilion. */
  --accent:     oklch(0.58 0.19 28);
  --accent-ink: oklch(0.99 0.01 28);

  /* Light theme (default). */
  --bg:        oklch(1 0 0);
  --bg-2:      oklch(0.965 0.003 75);
  --surface:   oklch(1 0 0);
  --ink:       oklch(0.24 0.012 58);
  --ink-soft:  oklch(0.46 0.012 58);
  --ink-faint: oklch(0.63 0.010 60);
  --line:      oklch(0.90 0.006 70);
  --line-soft: oklch(0.935 0.005 72);
  --tag-bg:    oklch(0.95 0.006 80);
  --shadow:    0 1px 2px oklch(0.4 0.02 60 / 0.05),
               0 8px 28px oklch(0.4 0.02 60 / 0.07);

  --radius: 4px;
  --maxw:   1320px;

  /* Density (regular default; --row-pad overridden below). */
  --row-pad: 22px;
}

[data-theme="dark"] {
  --bg:        oklch(0.185 0.008 70);
  --bg-2:      oklch(0.165 0.008 70);
  --surface:   oklch(0.222 0.009 70);
  --ink:       oklch(0.93 0.006 82);
  --ink-soft:  oklch(0.72 0.008 78);
  --ink-faint: oklch(0.56 0.008 76);
  --line:      oklch(0.31 0.008 70);
  --line-soft: oklch(0.26 0.008 70);
  --tag-bg:    oklch(0.27 0.009 70);
  --shadow:    0 1px 2px oklch(0 0 0 / 0.3),
               0 12px 36px oklch(0 0 0 / 0.4);
  --accent-ink: oklch(0.16 0.01 28);
}

[data-density="compact"] { --row-pad: 14px; }
[data-density="comfy"]   { --row-pad: 30px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--font-mono); }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* -------- Top bar -------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  /* Tracks the content column so the brand wordmark sits above the
     left edge of the feed (matches the redesign reference). */
  max-width: 880px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px; height: 58px;
}
.brand { display: flex; align-items: baseline; gap: 10px; user-select: none; }
.brand-mark {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.01em;
  font-size: 17px; color: var(--ink);
}
.brand-dot { color: var(--accent); }

.topbar-spacer { flex: 1; }

/* Section tabs sit in their own row below the masthead — separated by a
   soft hairline so the active accent underline reads cleanly. Matches
   the redesign reference (СЕГОДНЯ / НЕДЕЛЯ / ВСЕ СТАТЬИ). */
.tabs { border-top: 1px solid var(--line-soft); }
.tabs-inner {
  max-width: 880px; margin: 0 auto; width: 100%;
  display: flex; align-items: baseline; gap: 4px;
  padding: 0 28px;
}
.tab-btn {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 11px 12px; position: relative;
  transition: color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); }
.tab-btn.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--accent);
}
@media (max-width: 680px) {
  .topbar-inner, .tabs-inner { padding-left: 18px; padding-right: 18px; }
  .topbar-inner { height: 52px; }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius); color: var(--ink-soft);
  transition: color .15s, background .15s; position: relative;
}
.icon-btn:hover { color: var(--ink); background: var(--bg-2); }

/* Language pill (also used by the React island). */
.lang-wrap { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft);
  transition: border-color .15s, color .15s;
}
.lang-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 6px; min-width: 184px;
}
.lang-menu-head {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); padding: 6px 10px 8px;
}
.lang-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 5px;
  font-size: 13.5px; color: var(--ink); transition: background .12s;
}
.lang-item:hover { background: var(--bg-2); }
.lang-item .sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }
.lang-item.sel { color: var(--accent); }
.lang-item.sel .sub { color: var(--accent); }

/* -------- Layout (single centered column) -------- */
.layout {
  /* 880px column tracks the topbar inner — keeps the wordmark, tab
     underline, and feed rows on the same vertical rule. */
  max-width: 880px; margin: 0 auto; width: 100%;
  padding: 0 28px; flex: 1;
}
@media (max-width: 600px) { .layout { padding: 0 18px; } }

.main { padding: 30px 0 90px; min-width: 0; }

.section-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px;
}
.section-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.section-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); white-space: nowrap; }

/* Sort pills sit on the right of the .section-bar; same baseline as
   .section-meta so the bottom rule reads as one line. */
.sort-pills { display: inline-flex; gap: 4px; }
.sort-pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--ink-faint); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.sort-pill:hover { color: var(--ink); border-color: var(--ink-soft); }
.sort-pill.active {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
@media (max-width: 600px) {
  .sort-pills { gap: 2px; }
  .sort-pill { padding: 3px 7px; font-size: 10px; }
}

/* -------- ⋯ filter menu (vanilla <details>) -------- */
.filter-menu { position: relative; }

/* The <summary> default marker varies across browsers — Chrome ships
   `::-webkit-details-marker`, Firefox/Safari render a list-item
   triangle. Hide all of them so only our "⋯" glyph shows. */
.filter-menu-toggle::-webkit-details-marker { display: none; }
.filter-menu-toggle::marker { content: ""; }
.filter-menu-toggle {
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 22px;
  font-family: var(--font-mono); font-size: 16px; line-height: 1;
  color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 6px;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
  user-select: none;
}
.filter-menu-toggle:hover { color: var(--ink); border-color: var(--ink-soft); }
.filter-menu[open] .filter-menu-toggle {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}

.filter-menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  width: 300px; max-width: calc(100vw - 24px);
  background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 16px;
  display: grid; gap: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,.22);
}

/* Strip default <fieldset> chrome — we treat it as a labelled radio group. */
.filter-menu-panel fieldset {
  border: none; padding: 0; margin: 0;
  display: grid; gap: 6px;
}
.filter-menu-panel legend {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 0; margin-bottom: 4px;
}
.filter-menu-radio {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 13px; color: var(--ink);
  cursor: pointer; padding: 2px 0;
}
.filter-menu-radio input[type="radio"] {
  accent-color: var(--accent);
  margin: 0; width: 14px; height: 14px;
}

.filter-menu-field {
  display: grid; gap: 4px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
}
/* Theme-aware select: drop browser chrome, paint our own chevron so
   the dropdown reads native to the dark/light theme. */
.filter-menu-field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0;
  text-transform: none; color: var(--ink);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 28px 8px 10px;
  cursor: pointer;
}
.filter-menu-field select:focus {
  outline: none; border-color: var(--ink-soft);
}

.filter-menu-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 10px; margin-top: 2px;
  border-top: 1px solid var(--line);
}
.filter-menu-actions .btn.small {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  padding: 7px 14px; border-radius: 6px;
}
.filter-menu-actions a.btn.small {
  color: var(--ink-faint); background: transparent; border: 1px solid var(--line);
}
.filter-menu-actions a.btn.small:hover {
  color: var(--ink); border-color: var(--ink-soft);
}

/* -------- Chip strip (active-filter pills above the feed) -------- */
.chip-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 8px 0 18px;
}
.chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--ink); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--ink-soft); white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip-reset { color: var(--ink-faint); border-color: var(--line); }

/* -------- Importance dots (3-pip indicator on feed rows) -------- */
.imp {
  display: inline-flex; gap: 3px; align-items: center;
  vertical-align: middle;
  cursor: help;
}
.imp i {
  display: block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line);
}
.imp i.on { background: var(--accent); }

/* -------- Benchmark chip (per-card) -------- */
.bench-chip {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .03em;
  color: var(--accent-ink); background: var(--accent); border-radius: 4px;
  padding: 2px 6px; white-space: nowrap;
  cursor: help;  /* signal that title= hover shows the evidence quote */
}

/* -------- Per-benchmark page (/{locale}/benchmark/{slug}/) -------- */
.benchmark-head { margin-bottom: 18px; }
.benchmark-title {
  font-family: var(--font-display); font-size: 28px; letter-spacing: -.01em;
  margin: 4px 0 8px;
}
.benchmark-desc {
  color: var(--ink-faint); font-size: 14px; line-height: 1.45;
  margin: 0 0 12px;
}
.benchmark-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.benchmark-chart {
  margin: 12px 0 24px; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px;
}
.benchmark-chart svg { display: block; width: 100%; height: auto; }
.benchmark-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.legend-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
}
.benchmark-timeline { list-style: none; padding: 0; margin: 4px 0; }
.benchmark-timeline-item { border-bottom: 1px solid var(--line); }
.benchmark-timeline-link {
  display: grid;
  grid-template-columns: 90px 140px 80px 1fr;
  gap: 12px; align-items: baseline;
  padding: 10px 0;
}
.benchmark-timeline-date { color: var(--ink-faint); font-size: 12px; }
.benchmark-timeline-model { font-size: 12px; }
.benchmark-timeline-score {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--accent); cursor: help;
}
.benchmark-timeline-article { font-size: 14px; color: var(--ink); }
@media (max-width: 600px) {
  .benchmark-timeline-link {
    grid-template-columns: 80px 1fr;
    grid-template-areas: "date model" "score article";
  }
  .benchmark-timeline-date { grid-area: date; }
  .benchmark-timeline-model { grid-area: model; }
  .benchmark-timeline-score { grid-area: score; }
  .benchmark-timeline-article { grid-area: article; }
}

/* Pager — centered "Older" link below the feed. Echoes the sort-pill
   shape but a touch bigger so it reads as a primary action. */
.pager { display: flex; justify-content: center; margin: 28px 0 12px; }
.btn-older {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--ink); padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--ink-soft); white-space: nowrap;
  text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-older:hover {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}

/* "All articles" CTA below the /today/ top-5. Echoes the pager
   geometry (.btn-older) so the bottom-of-page action looks consistent
   across landing surfaces. */
.all-articles-cta { display: flex; justify-content: center; margin: 28px 0 12px; }

/* Numbered pager used by the /articles/ archive family. Cursor URLs
   under the hood (?before=<id>), but the visible widget is a classic
   « first ‹ prev 1 2 3 4 5 … 73 74 75 76 77 next › last » strip. */
.pager-numbered {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px; margin: 28px 0 12px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .04em;
}
.pager-step {
  color: var(--ink); padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--ink-soft); white-space: nowrap;
  text-transform: uppercase; transition: color .15s, border-color .15s, background .15s;
}
.pager-step:hover {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
.pager-step.disabled {
  color: var(--ink-faint); border-color: var(--ink-soft); opacity: .55; cursor: default;
}
.pager-numbers {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  list-style: none; margin: 0 6px; padding: 0;
}
.pager-num {
  display: inline-flex;
}
.pager-num a, .pager-num span {
  display: inline-block; min-width: 28px; padding: 6px 8px; text-align: center;
  border-radius: 6px; border: 1px solid transparent; color: var(--ink);
}
.pager-num a:hover {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
.pager-num.is-current span {
  border-color: var(--ink); font-weight: 600;
}
.pager-ellipsis {
  display: inline-block; padding: 6px 4px; color: var(--ink-faint);
}
@media (max-width: 600px) {
  .pager-step { padding: 5px 8px; font-size: 11px; }
  .pager-num a, .pager-num span { min-width: 24px; padding: 5px 6px; }
}

/* -------- Article page -------- */
.article-page { max-width: 760px; margin: 12px auto 80px; }
.article-crumbs { font-family: var(--font-mono); font-size: 11px; margin-bottom: 18px; }
.article-crumbs a { color: var(--ink-faint); }
.article-crumbs a:hover { color: var(--ink); }
.article-header { margin-bottom: 28px; }
.article-title {
  font-family: var(--font-serif, var(--font-sans, ui-serif));
  font-size: 36px; line-height: 1.15; margin: 14px 0 12px; letter-spacing: -.01em;
}
.article-prov { margin-top: 6px; }
.article-body p {
  font-size: 17px; line-height: 1.6; color: var(--ink);
  margin: 0 0 16px;
}
.article-actions { display: flex; gap: 14px; align-items: center; margin-top: 30px; }
@media (max-width: 600px) {
  .article-title { font-size: 28px; }
  .article-body p { font-size: 16px; }
}

/* -------- Article metadata block (importance + tags + benchmarks) --------
   Sits between the body and the actions row. The importance score,
   active flag callouts, and source/lab/topic links collapse into one
   `.meta-tags` row of MEDIA-styled chips so the footer reads with the
   same typographic weight as the header meta-row. Benchmarks keep
   their own `.meta-block` for the score table. The whole section is
   hidden by Jinja when the article hasn't been evaluated yet. */
.article-meta {
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid; gap: 22px;
}
.meta-block-title {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 10px;
}
.meta-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meta-tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
  background: var(--tag-bg); color: var(--ink-soft); white-space: nowrap;
  transition: color .15s, background .15s;
}
a.meta-tag:hover { color: var(--accent); }
/* Per-type text hues echo the .tag.type.* palette used in meta-row.
   Background stays neutral (--tag-bg) so chips read as a coherent row
   instead of competing for attention. */
.meta-tag-score { color: oklch(0.58 0.19 28); }     /* accent red */
.meta-tag-trust { color: oklch(0.58 0.16 200); }    /* teal */
.meta-tag-flag  { color: oklch(0.58 0.16 60); }     /* amber */
.meta-tag-source { color: oklch(0.55 0.14 250); }   /* media blue */
.meta-tag-lab    { color: oklch(0.55 0.16 145); }   /* green */
.meta-tag-topic  { color: oklch(0.55 0.16 300); }   /* purple */
.meta-tag-lab.is-primary {
  color: var(--accent-ink); background: var(--accent);
}
.meta-tag-lab.is-primary:hover { color: var(--accent-ink); }
.meta-benchmarks {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.meta-benchmarks th, .meta-benchmarks td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
.meta-benchmarks th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
}
.meta-benchmarks tr:last-child td { border-bottom: none; }
.meta-benchmarks-score { text-align: right; }
.meta-bench-name { color: var(--ink); }
.meta-bench-name:hover { color: var(--accent); }
.meta-bench-notes {
  display: block; font-size: 11px; color: var(--ink-faint); margin-top: 2px;
}
.meta-bench-model { color: var(--ink-soft); }
.meta-bench-score {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--accent); text-align: right; cursor: help;
}
@media (max-width: 600px) {
  .meta-benchmarks th, .meta-benchmarks td { padding: 6px 6px; }
  .meta-benchmarks-score, .meta-bench-score { font-size: 12px; }
}

/* Muted variant of mono tags — used for time labels on the feed card
   meta line so the title gets the visual weight. */
.tag.mono.faint { color: var(--ink-faint); }

/* -------- Meta line -------- */
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.tag.type {
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px; background: var(--tag-bg);
  color: var(--ink-soft); letter-spacing: .08em; font-size: 9.5px;
}
.tag.type.lab    { color: oklch(0.55 0.16 28); }
.tag.type.arxiv  { color: oklch(0.55 0.13 145); }
.tag.type.github { color: oklch(0.5  0.04 280); }
.tag.type.media  { color: oklch(0.55 0.14 250); }
.tag.type.blog   { color: oklch(0.56 0.13 300); }
.dot-sep { color: var(--line); }
.topic-tag { color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.hot-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 1px 5px; white-space: nowrap;
}

/* -------- Top story (text only) -------- */
.feature {
  display: block; padding: 24px 0 30px; border-bottom: 1px solid var(--line);
}
.feature-link { display: block; color: inherit; }
.feature-link:hover .feature-title { color: var(--accent); }
.feature-title {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(28px, 4.6vw, 40px);
  line-height: 1.08; letter-spacing: -0.018em; margin: 14px 0 14px; transition: color .15s;
  text-wrap: pretty;
}
.feature-body { font-family: var(--font-serif); font-size: 18px; line-height: 1.55; color: var(--ink-soft); }
.feature-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }

/* -------- Feed rows (single-column ranked cards) -------- */
.feed { display: flex; flex-direction: column; }
.row {
  display: block; padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.row:hover { background: color-mix(in oklab, var(--accent) 4%, transparent); }
.row:hover .r-title { color: var(--accent); }
.row:last-child { border-bottom: none; }
.row-link { display: block; color: inherit; }

.r-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 5px;
}
.r-title {
  font-family: var(--font-head); font-weight: 500; font-size: 20px; line-height: 1.16;
  letter-spacing: -0.005em; transition: color .15s; text-wrap: pretty;
}
[data-density="compact"] .r-title { font-size: 18px; }
.r-body {
  font-family: var(--font-serif); font-size: 14px; line-height: 1.5;
  color: var(--ink-soft); margin-top: 6px; max-width: 74ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-density="compact"] .r-body { -webkit-line-clamp: 1; }

/* Translation provenance — kept for the article detail page. Feed cards
   no longer render it to stay close to the redesign reference. */
.prov {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 10.5px; letter-spacing: .02em; color: var(--ink-faint);
}
.prov svg { color: var(--accent); }

@media (max-width: 680px) {
  .row { padding: 11px 0; }
  .r-title {
    font-size: 16.5px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  /* Mobile cards lean on the kind chip + time + importance dots; source
     name + its bullet separator (.r-src) and the 2-line excerpt drop out
     so each row stays scannable on a narrow column. */
  .r-src, .r-body { display: none; }
  /* Tabs row swaps to horizontal scroll if the labels would overflow.
     Hide the scrollbar so the tab strip stays clean — overflow is a
     fallback, not a primary affordance. */
  .tabs-inner { overflow-x: auto; scrollbar-width: none; }
  .tabs-inner::-webkit-scrollbar { display: none; }
}

/* -------- /all/ archive — topic mosaic (3 columns at desktop) -------- */
.mosaic { column-count: 3; column-gap: 30px; margin-top: 6px; }
@media (max-width: 900px) { .mosaic { column-count: 2; } }
@media (max-width: 620px) { .mosaic { column-count: 1; } }
/* `break-inside: avoid` keeps each topic block together — CSS columns
   would otherwise split a block across the column boundary. */
.mblock { break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: 24px; }
.mblock-head {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; margin-bottom: 2px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink);
  transition: color .15s, border-color .15s;
}
.mblock-head:hover { color: var(--accent); border-color: var(--accent); }
.mblock-head .cnt { color: var(--ink-faint); letter-spacing: .04em; }
.mitem { display: block; padding: 9px 0; border-bottom: 1px solid var(--line-soft); color: inherit; }
.mitem:last-child { border-bottom: none; }
.mitem:hover .mi-title { color: var(--accent); }
.mi-meta { display: flex; gap: 7px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.mi-title {
  font-family: var(--font-head); font-weight: 500; font-size: 14.5px; line-height: 1.2;
  letter-spacing: -.003em; text-wrap: pretty; transition: color .15s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mmore {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); padding: 9px 0 2px;
  transition: color .15s;
}
.mmore:hover { color: var(--accent); }

/* Save / link buttons. */
.save-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--radius); color: var(--ink-faint); transition: color .15s, background .15s;
}
.save-btn:hover { color: var(--accent); background: var(--bg-2); }
.save-btn.on { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .03em; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--ink); transition: all .15s;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }

/* -------- Empty / digest -------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px; color: var(--ink-faint);
}
.empty .e-glyph { color: var(--line); margin-bottom: 16px; }
.empty .e-text { font-family: var(--font-serif); font-size: 18px; max-width: 36ch; color: var(--ink-soft); }
