:root {
  --bg: #f6f6f4; --surface: #fcfcfb; --line: #e3e2dd; --text: #0b0b0b; --text-2: #52514e;
  --muted: #6f6e69; --accent: #256abf; --accent-ink: #fff; --series: #2a78d6;
  --good: #0a7a0a; --good-bg: #e2f3e2; --err: #b3261e; --err-bg: #fbe9e7;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --surface: #1a1a19; --line: #33332f; --text: #f0efec; --text-2: #c3c2b7;
    --muted: #9c9b93; --accent: #5598e7; --accent-ink: #0b0b0b; --series: #3987e5;
    --good: #5fd35f; --good-bg: #17331a; --err: #ff8a80; --err-bg: #3a1c1a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 8px; padding-bottom: 48px; min-height: 70vh; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; margin: 24px 0 12px; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 0; }
section { margin-top: 36px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 20px; } .top nav a { color: var(--text-2); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.top nav { margin-left: auto; }
@media (max-width: 640px) {
  .top__in { padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  .top nav { order: 3; width: 100%; margin-left: 0; }
  .langs { order: 2; margin-left: auto; }
}
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.langs a { padding: 3px 8px; font-size: .8125rem; font-weight: 600; color: var(--text-2); text-decoration: none; }
.langs a[aria-current] { background: var(--text); color: var(--surface); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; padding: 20px 0 32px; }
.foot p { margin: 0 0 6px; max-width: 70ch; }

.hero { margin-top: 24px; } .lead { color: var(--text-2); max-width: 60ch; margin: 0 0 20px; }
input, select, button, .btn { font: inherit; border-radius: 10px; min-height: 46px; }
input[type=text], input[type=search], select { background: var(--surface); color: var(--text);
  border: 1px solid var(--line); padding: 0 12px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 0 18px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn--ghost { background: transparent; color: var(--accent); }
.add, .filters { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .add { grid-template-columns: minmax(0, 1fr) 190px auto; }
  .filters { grid-template-columns: minmax(0, 1fr) 170px 210px auto; }
}
.error { background: var(--err-bg); color: var(--err); padding: 10px 14px; border-radius: 10px; margin: 12px 0 0; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 8px; justify-content: space-between; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  color: var(--text); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drop { background: var(--good-bg); color: var(--good); font-weight: 600; font-size: .875rem; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.was { color: var(--muted); text-decoration: line-through; font-size: .875rem; white-space: nowrap; }
.tag { margin-left: auto; color: var(--muted); font-size: .8125rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; text-decoration: none; }
a.tag { margin-left: 0; color: var(--accent); padding: 4px 12px; display: inline-block; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 24px; color: var(--muted); }

.crumbs { color: var(--muted); font-size: .875rem; margin: 20px 0 0; } .crumbs + h1 { margin-top: 6px; }
.now { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.now__price { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.now + p { margin: 4px 0 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg a { padding: 6px 12px; color: var(--text-2); text-decoration: none; font-size: .875rem; }
.seg a[aria-current] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.stats dt { color: var(--muted); font-size: .8125rem; } .stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd.small { font-weight: 400; }

.chart { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .endlabel { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart svg [hidden] { display: none; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 8px;
  padding: 6px 10px; font-size: .8125rem; display: flex; flex-direction: column; white-space: nowrap; }
.tip[hidden] { display: none; }
.chart--narrow { display: none; }
@media (max-width: 560px) { .chart--wide { display: none; } .chart--narrow { display: block; } }

.changes { margin-top: 12px; } .changes summary { cursor: pointer; color: var(--accent); }
.changes div, .changes table { margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: .875rem; }
.prose { max-width: 68ch; } .prose h2 { margin: 28px 0 8px; } .prose li { margin-bottom: 6px; }
