/* The offer-history site — one stylesheet for the generated pages
   (server/src/angebotePages.js) and the static hub/tools. A site of its own, not the
   EasyEinkauf app's look: warm ink + a price-tag orange (chart marks validated against
   both surfaces with the dataviz checks). System fonts; the only third-party request is
   Cloudflare Turnstile, loaded on the Preis-Wecker form's first focus.
   Dark mode follows the OS. */
:root {
  --accent: #d9480f; --link: #c2410c; --btn: #c2410c;
  --text: #1c1917; --text-light: #57534e; --muted: #78716c;
  --bg: #ffffff; --bg-soft: #f7f5f2; --border: #e7e5e4; --grid: #eeece9;
  --good: #15803d; --bad: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --link: #fb923c;
    --text: #f5f5f4; --text-light: #d6d3d1; --muted: #a8a29e;
    --bg: #14161a; --bg-soft: #1e2127; --border: #34373d; --grid: #2a2d33;
    --good: #4ade80; --bad: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
main, .top, .foot { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.top { padding-top: 16px; padding-bottom: 8px; }
.brand { font-weight: 800; color: var(--text); text-decoration: none; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 12px 0 8px; }
h2 { font-size: 21px; margin: 40px 0 12px; }
.answer { font-size: 19px; margin: 0 0 4px; }
.stamp, .note { font-size: 14px; color: var(--muted); margin: 4px 0; }

table { width: 100%; border-collapse: collapse; margin: 16px 0 4px; font-size: 15px; }
caption { text-align: left; font-weight: 700; padding: 8px 0; }
th, td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {               /* the deal table: drop pack + validity columns */
  .deals th:nth-child(3), .deals td:nth-child(3), .deals th:nth-child(6), .deals td:nth-child(6) { display: none; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.stats div { background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats small { display: block; font-size: 14px; font-weight: 400; color: var(--text-light); }
.freq th { font-weight: 400; width: 30%; }
.freq td:nth-child(2) { width: 60%; }
.bar { display: block; height: 8px; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }

.verdict { background: var(--bg-soft); border-left: 4px solid var(--muted); border-radius: 0 12px 12px 0; padding: 12px 16px; }
.verdict-top, .verdict-gut { border-color: var(--good); }
.verdict-teuer { border-color: var(--bad); }

.chart { width: 100%; max-width: 640px; height: auto; display: block; margin: 8px 0; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 17px; }
.chart .ref { stroke: var(--text-light); stroke-width: 1; }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart g:hover .dot { r: 6; }

.cta { background: var(--bg-soft); border-radius: 16px; padding: 4px 20px 16px; margin: 40px 0; }
.cta h2 { margin-top: 16px; }
.btn { display: inline-block; background: var(--btn); color: #fff; font-weight: 600; text-decoration: none; padding: 10px 18px; border-radius: 10px; margin: 4px 8px 4px 0; }
.btn-ghost { background: transparent; color: var(--link); border: 1px solid var(--btn); }
details { border-bottom: 1px solid var(--border); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }
.related ul, .all { padding-left: 20px; columns: 2 200px; }
.pill { font-size: 12px; background: var(--btn); color: #fff; border-radius: 99px; padding: 1px 8px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.tools a { display: block; background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.foot { border-top: 1px solid var(--border); margin-top: 48px; padding-top: 12px; padding-bottom: 32px; font-size: 14px; color: var(--muted); }
.foot a { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.key-dot, .key-line { display: inline-block; vertical-align: middle; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.key-line { width: 18px; height: 1px; background: var(--text-light); }
/* the e-mail Preis-Wecker: a plain form; the API redirects back to #wecker-… */
.wecker { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.wecker input[type=email] { flex: 1 1 220px; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }
.wecker .btn { margin: 0; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.hp { position: absolute; left: -9999px; }
.flash { display: none; font-weight: 600; margin: 8px 0; }
.flash:target { display: block; }
.flash-error { color: var(--bad); }
.wecker .wunsch { flex-basis: 100%; font-size: 15px; color: var(--text-light); }
.wecker .wunsch input { width: 5.5em; font: inherit; padding: 6px 8px; margin: 0 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.wecker .cf-turnstile { flex-basis: 100%; }
