/* ------------------------------------------------------------------------- *
 * site.css — The Daily Watch (thedaily.watch). Editorial paper-and-brass theme.
 * Copied verbatim into site/assets/ by build_site.py.
 * ------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --plane:      #f4f1ea;   /* page plane   */
  --surface:    #fffdf9;   /* cards, chart surface */
  --surface-2:  #faf7f0;   /* insets, image wells  */
  --ink:        #14130f;
  --ink-2:      #55524a;
  --muted:      #8b8578;
  --line:       #e3ded1;
  --line-soft:  #efebe0;

  --accent:      #8a6a2f;  /* brass */
  --accent-ink:  #6d5324;
  --accent-wash: #f4eddc;

  --good:      #0ca30c;
  --good-ink:  #006300;
  --warn-ink:  #8a5a00;
  --warn-wash: #fdf1d8;
  --crit:      #d03b3b;
  --crit-ink:  #a52b2b;
  --crit-wash: #fbeaea;

  --s1: #2a78d6;           /* chart series 1 — validated categorical slot 1 */
  --s2: #eb6834;           /* chart series 2 — validated categorical slot 2 */
  --s3: #1baf7a;           /* chart series 3 — validated categorical slot 3 */
  --s4: #8b8578;           /* pooled "Other" — neutral, never a real series   */

  --shadow:    0 1px 2px rgba(20,19,15,.05), 0 10px 28px -20px rgba(20,19,15,.28);
  --shadow-lg: 0 2px 4px rgba(20,19,15,.06), 0 18px 40px -24px rgba(20,19,15,.34);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane:      #0d0e0f;
    --surface:    #1a1b1d;
    --surface-2:  #202124;
    --ink:        #f3f0e9;
    --ink-2:      #b9b5aa;
    --muted:      #8d8a80;
    --line:       #2b2d30;
    --line-soft:  #232528;

    --accent:      #c9a35a;
    --accent-ink:  #dcbc7c;
    --accent-wash: #2a2418;

    --good:      #0ca30c;
    --good-ink:  #4cc24c;
    --warn-ink:  #e0ae4e;
    --warn-wash: #2b2312;
    --crit:      #d03b3b;
    --crit-ink:  #ef8181;
    --crit-wash: #2c1a1a;

    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #8d8a80;

    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 28px -20px rgba(0,0,0,.8);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 40px -22px rgba(0,0,0,.9);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:      #0d0e0f;
  --surface:    #1a1b1d;
  --surface-2:  #202124;
  --ink:        #f3f0e9;
  --ink-2:      #b9b5aa;
  --muted:      #8d8a80;
  --line:       #2b2d30;
  --line-soft:  #232528;

  --accent:      #c9a35a;
  --accent-ink:  #dcbc7c;
  --accent-wash: #2a2418;

  --good:      #0ca30c;
  --good-ink:  #4cc24c;
  --warn-ink:  #e0ae4e;
  --warn-wash: #2b2312;
  --crit:      #d03b3b;
  --crit-ink:  #ef8181;
  --crit-wash: #2c1a1a;

  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #8d8a80;

  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 28px -20px rgba(0,0,0,.8);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 40px -22px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  overflow-x: hidden;
}

a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* --- masthead ------------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
}
.masthead-inner { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 26px 20px 0; max-width: 1180px; margin: 0 auto; }

.wordmark { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; margin-right: auto; }
.crown { width: 26px; height: 26px; flex: none; color: var(--accent); }
.wordmark h1 { font: 600 25px/1.05 var(--serif); letter-spacing: -.015em; margin: 0; }
.wordmark .tag { display: block; font: 500 10.5px/1.4 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.masthead nav { display: flex; gap: 2px; align-items: flex-end; }
.masthead nav a {
  padding: 9px 13px; border-radius: 8px 8px 0 0; font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.masthead nav a:hover { background: color-mix(in srgb, var(--accent-wash) 70%, transparent); color: var(--ink); }
.masthead nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
  margin-bottom: 6px;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-sun { display: block; }
  :root:where(:not([data-theme="light"])) .theme-toggle .icon-moon { display: none; }
}

/* --- run meta line ------------------------------------------------------- */

.runline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 13px 0 0; font-size: 13px; color: var(--ink-2);
}
.runline .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--good); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.runline b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.runline .sep { color: var(--line); }

.notice {
  margin: 16px 0 0; padding: 11px 14px; border-radius: 10px; font-size: 13.5px;
  background: var(--warn-wash); color: var(--warn-ink); border: 1px solid color-mix(in srgb, var(--warn-ink) 22%, transparent);
}
.notice.bad { background: var(--crit-wash); color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }

/* --- section headings ---------------------------------------------------- */

section { margin: 34px 0 0; }
.sechead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.sechead h2 { font: 600 20px/1.2 var(--serif); margin: 0; letter-spacing: -.01em; }
.sechead p { margin: 0; font-size: 13px; color: var(--muted); }
.rule { height: 1px; background: var(--line); flex: 1 1 40px; min-width: 20px; }

/* --- hero (top drops) --------------------------------------------------- */

.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .hero { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .hero { grid-template-columns: 1fr; } }

.hero .card { box-shadow: var(--shadow-lg); }
.hero .rank {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: var(--ink); color: var(--surface);
  font: 600 13px/26px var(--sans); text-align: center; letter-spacing: .01em;
}
.hero .thumb { aspect-ratio: 4 / 3; }
.hero .price { font-size: 26px; }

/* --- deal grid ---------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* The image is absolutely placed so aspect-ratio — not the photo's own
   proportions — decides the well's height; otherwise portrait shots stretch
   the card and the row stops lining up. */
.thumb {
  display: block; position: relative; flex: none; aspect-ratio: 1 / 1;
  background: #fff; border-bottom: 1px solid var(--line-soft);
}
.thumb img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #b9b3a6; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.off {
  position: absolute; right: 8px; bottom: 8px;
  background: var(--crit); color: #fff; font: 600 12px/1 var(--sans);
  padding: 5px 7px; border-radius: 6px; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}

.body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.eyebrow { font: 600 10.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent-ink); }
.eyebrow .store { color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: none; font-size: 11px; }

.title {
  font: 500 14px/1.35 var(--sans); color: var(--ink); margin: 0; text-decoration: none;
  min-height: 2.7em;   /* two lines, so prices line up across a row */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
a.title:hover { color: var(--accent-ink); }

.prices { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.foot { margin-top: auto; display: flex; flex-direction: column; gap: 9px; }
.price { font: 600 20px/1.1 var(--sans); letter-spacing: -.01em; }
.was { font-size: 13px; color: var(--muted); text-decoration: line-through; }

.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.stars { color: var(--accent-ink); letter-spacing: .04em; }
.meta .num { font-variant-numeric: tabular-nums; }

.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 10.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 7px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; flex: none; }
.badge.new  { background: var(--accent-wash); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge.drop { background: var(--crit-wash);   color: var(--crit-ink);   border-color: color-mix(in srgb, var(--crit) 26%, transparent); }
.badge.low  { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 30%, transparent); }

.trackline { display: flex; align-items: center; gap: 9px; padding-top: 3px; border-top: 1px solid var(--line-soft); }
.trackline .spark { flex: none; }
.trackline .spark path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.trackline .spark .fill { fill: color-mix(in srgb, var(--muted) 14%, transparent); stroke: none; }
.trackline .spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.trackline small { font-size: 11.5px; color: var(--muted); }
.trackline small b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.buy {
  display: block; text-align: center; text-decoration: none;
  background: var(--ink); color: var(--surface); border-radius: 9px;
  padding: 9px 12px; font: 600 12.5px/1.2 var(--sans); letter-spacing: .01em;
}
.buy:hover { background: var(--accent-ink); color: #fff; }

/* --- filter bar --------------------------------------------------------- */

.filters {
  position: sticky; top: 0; z-index: 20; margin: 0 0 16px;
  background: color-mix(in srgb, var(--plane) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 11px 0;
}
.filters-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.filters input[type="search"], .filters select, .filters input[type="number"] {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 8px 10px; font: 400 13.5px var(--sans); min-width: 0;
}
.filters input[type="search"] { flex: 1 1 210px; min-width: 160px; }
.filters input[type="number"] { width: 104px; }
.filters select { cursor: pointer; }
.filters input:focus-visible, .filters select:focus-visible, .chip:focus-visible, .buy:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.fgroup { display: flex; gap: 6px; align-items: center; }
.fgroup > label { font-size: 12px; color: var(--muted); }

.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 7px 12px; font: 500 12.5px var(--sans); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .n { opacity: .6; font-variant-numeric: tabular-nums; margin-left: 3px; }

.count { font-size: 12.5px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); font-weight: 600; }
.reset { border: 0; background: none; color: var(--accent-ink); font: 500 12.5px var(--sans); cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 2px; }

/* --- tags ---------------------------------------------------------------- */

/* A labelled chip row per short family; the long tail lives in the Tags panel. */
.tagline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 100%; }
.tagline .tl {
  font: 600 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-right: 2px; min-width: 62px;
}

.tagmenu { position: relative; flex: 0 0 auto; }
.tagmenu > summary {
  list-style: none; cursor: pointer; user-select: none;
  font: 500 12.5px var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; display: inline-flex; align-items: center; gap: 6px;
}
.tagmenu > summary::-webkit-details-marker { display: none; }
.tagmenu > summary::after { content: "▾"; font-size: 10px; color: var(--muted); }
.tagmenu[open] > summary { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tagmenu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tagpanel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  width: min(660px, calc(100vw - 40px));
  max-height: min(62vh, 440px); overflow-y: auto;
  /* A grid, not CSS columns: with a capped height, columns overflow sideways
     and hide the groups that do not fit, where a grid just scrolls. Group
     heights are wildly uneven (25 features, 2 band types), so the tall
     families are ordered last in tags.FAMILIES to keep the holes at the bottom. */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 2px 20px; align-content: start; grid-auto-rows: min-content;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 14px 16px;
}
.taggroup { min-width: 0; margin-bottom: 8px; }
.taggroup h4 {
  margin: 6px 0 4px; font: 600 10.5px var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.tagbox {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font: 400 12.5px var(--sans); color: var(--ink); padding: 3px 2px; border-radius: 6px;
}
.tagbox:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tagbox input { accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.tagbox > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.tagbox .n, .tagline .n, .tagmenu .n { color: var(--muted); font-size: 11px; }

/* Tags printed on the card itself. */
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.tagrow .tg {
  font: 500 10.5px var(--sans); letter-spacing: .02em; color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 5px; padding: 2px 6px; white-space: nowrap;
}

/* --- show more ----------------------------------------------------------- */

.more { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px 4px; }
.btn-more {
  font: 600 13.5px var(--sans); color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 26px; box-shadow: var(--shadow);
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.btn-more:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.btn-more:active { transform: none; }
.btn-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-note { margin: 0; font: 500 12px var(--sans); color: var(--muted); }
body.no-results .more { display: none; }

.empty { display: none; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h3 { font: 600 17px var(--serif); color: var(--ink); margin: 0 0 6px; }
body.no-results .empty { display: block; }
body.no-results .grid { display: none; }

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

.brandgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.brandcard {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow); transition: border-color .14s ease, transform .14s ease;
}
.brandcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); }
.brandcard h3 { font: 600 16px/1.2 var(--serif); margin: 0; }
.brandcard .n { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.brandcard .best { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brandcard.quiet { background: var(--surface-2); box-shadow: none; }
.brandcard.quiet h3 { color: var(--ink-2); font-weight: 500; }

/* --- stats: tiles ------------------------------------------------------- */

.hero-figure { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.hero-figure .label { font: 500 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero-figure .value { font: 600 clamp(44px, 8vw, 60px)/1 var(--sans); letter-spacing: -.03em; margin: 8px 0 4px; }
.hero-figure .sub { font-size: 13px; color: var(--ink-2); }
.hero-figure .sub .delta { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow); }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font: 600 25px/1.1 var(--sans); letter-spacing: -.02em; margin: 5px 0 0; }
.tile .delta { font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.delta.up { color: var(--good-ink); }
.delta.down { color: var(--crit-ink); }
.delta svg { width: 11px; height: 11px; flex: none; }

/* --- stats: charts ------------------------------------------------------ */

.figure { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 12px; box-shadow: var(--shadow); position: relative; }
.figure > figcaption { margin: 0 0 2px; font: 600 15px/1.3 var(--sans); }
.figure .note { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.figure .plot { overflow-x: auto; }
/* Capped at its design width so tick text never scales up past 11px. */
.figure svg.chart { display: block; width: 100%; height: auto; max-width: 900px; min-width: 520px; margin: 0 auto; touch-action: pan-y; }
.charts { display: grid; gap: 16px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .key.s1 { background: var(--s1); }
.legend .key.s2 { background: var(--s2); }
.legend .key.s3 { background: var(--s3); }
.legend .key.s4 { background: var(--s4); }

svg.chart .grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
svg.chart .axis-line { stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1; shape-rendering: crispEdges; }
svg.chart .tick { fill: var(--muted); font: 400 11px var(--sans); font-variant-numeric: tabular-nums; }
svg.chart .dlabel { fill: var(--ink-2); font: 600 11.5px var(--sans); font-variant-numeric: tabular-nums; }
svg.chart .seg.s1, svg.chart .bar.s1 { fill: var(--s1); }
svg.chart .seg.s2 { fill: var(--s2); }
svg.chart .seg.s3 { fill: var(--s3); }
svg.chart .seg.s4 { fill: var(--s4); }
svg.chart .area { fill: var(--s1); opacity: .1; }
svg.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
svg.chart .crosshair { stroke: var(--muted); stroke-width: 1; opacity: 0; shape-rendering: crispEdges; }
svg.chart .hit { fill: transparent; }
svg.chart .hilite { fill: var(--ink); opacity: 0; }

.tooltip {
  position: absolute; z-index: 30; pointer-events: none; opacity: 0; transform: translate(-50%, -100%);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; min-width: 96px;
  transition: opacity .08s linear;
}
.tooltip[data-show="1"] { opacity: 1; }
.tooltip .tt-title { font-weight: 600; margin-bottom: 4px; white-space: nowrap; }
.tooltip .tt-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tooltip .tt-row .key { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tooltip .tt-row .key.s1 { background: var(--s1); }
.tooltip .tt-row .key.s2 { background: var(--s2); }
.tooltip .tt-row .key.s3 { background: var(--s3); }
.tooltip .tt-row .key.s4 { background: var(--s4); }
.tooltip .tt-row .v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.tooltip .tt-total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }

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

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font: 600 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-wash) 55%, transparent); }
td a { color: var(--ink); }

details.tableview { margin-top: 10px; }
details.tableview > summary { cursor: pointer; font-size: 12.5px; color: var(--accent-ink); padding: 4px 0; }
details.tableview > summary::marker { color: var(--muted); }

/* --- stale / archive list ---------------------------------------------- */

/* minmax(0,1fr) + min-width:0 stop the nowrap title from setting the row's
   min-content width and blowing the page out sideways. */
.pastlist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pastrow {
  min-width: 0;
  display: flex; align-items: center; gap: 12px; padding: 10px 13px;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 13.5px;
}
.pastrow img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
/* min-width:0 is what lets a nowrap flex child shrink and ellipsise. */
.pastrow .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastrow .p { flex: none; }
.pastrow .t a { color: var(--ink-2); text-decoration: none; }
.pastrow .t a:hover { color: var(--accent-ink); text-decoration: underline; }
.pastrow .p { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- footer ------------------------------------------------------------- */

footer {
  margin-top: 52px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent);
  padding: 22px 0 34px; font-size: 12.5px; color: var(--muted);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; }
footer p { margin: 0; max-width: 62ch; }
footer .disclosure { color: var(--ink-2); }

@media print {
  .filters, .theme-toggle, .buy, .more, footer { display: none; }
  .card, .figure, .tile { box-shadow: none; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
