:root {
  --bg: #fafafa; --fg: #1d1d1f; --muted: #6b6b70; --line: #e3e3e6; --card: #fff;
  --a: #2f6fd6; --b: #d9772b; --accent: #2f6fd6; --win: #1f8a4c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --fg: #ececee; --muted: #9a9aa2; --line: #2a2b2f; --card: #1a1b1e;
    --a: #6ea0f0; --b: #f0a060; --accent: #6ea0f0; --win: #4cc283;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;
}
a { color: var(--accent); }
h1 { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.25; margin: 0 0 .4em; }
h2 { font-size: 1.2rem; margin: 2em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.muted, .meta, .tagline, .card-meta { color: var(--muted); }
.dot { margin: 0 .4em; }

.site-header { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.tagline { font-size: .9rem; }
.site-footer { padding: 24px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* Main column + global side column (templates/_sidebar.html).
   Wide screens: side column on the right, 300px. Phones: stacked below main, full width. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; max-width: 1180px; margin: 0 auto; padding: 24px 16px; }
.side-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; align-self: start; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.side-card h2 { font-size: 1rem; margin: 0 0 .3em; padding: 0; border: 0; }
.side-card p { margin: 0; color: var(--muted); }
/* Future ad slot: height reserved up front so a late-loading ad cannot shift the layout. */
.ad-slot { min-height: 280px; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* Home */
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.report-card { display: flex; gap: 14px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.report-card:hover { border-color: var(--accent); }
.report-card img { width: 160px; height: 90px; object-fit: cover; border-radius: 6px; flex: none; background: var(--line); }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-title { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { .report-card img { width: 112px; height: 63px; } }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.empty { color: var(--muted); }

/* Report */
.report-head .actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn { display: inline-block; padding: 6px 12px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; }
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.winner { font-size: 1.15rem; margin: 0 0 .4em; }
.verdict-text { margin: 0 0 .8em; }
.share { width: 100%; height: 12px; display: block; border-radius: 6px; }
.share-labels { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin: 4px 0 0; }

.debaters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.debater { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--a); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; }
.debater-b { border-top-color: var(--b); }
.debater-score { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { align-self: flex-start; font-size: .75rem; font-weight: 600; color: var(--win); border: 1px solid var(--win); border-radius: 999px; padding: 0 8px; }
.is-winner { box-shadow: 0 0 0 1px var(--win); }

table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scores td { text-align: right; }
.scores thead th:not(:first-child) { text-align: right; }
.scores tr.total { font-weight: 700; }
.sources td:last-child { overflow-wrap: anywhere; }
.sources { font-size: .9rem; }
details summary { cursor: pointer; color: var(--accent); }

.highlights { padding-left: 1.2em; }
.highlights li { margin-bottom: 1.2em; }
.hl-head { margin: 0 0 .3em; }
blockquote { margin: 0 0 .4em; padding: 4px 12px; border-left: 3px solid var(--line); font-style: italic; }
.why { margin: 0; color: var(--muted); }
.report-text p { overflow-wrap: anywhere; }

/* Charts (inline SVG, colours via classes because inline styles are blocked by CSP) */
.chart { margin: 0 0 24px; }
.chart figcaption { font-weight: 600; margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.lbl { font-size: 13px; fill: var(--fg); }
.val { font-size: 11px; fill: var(--muted); }
.bar-a, .dot-a { fill: var(--a); }
.bar-b, .dot-b { fill: var(--b); }
.line-a { stroke: var(--a); stroke-width: 2; }
.line-b { stroke: var(--b); stroke-width: 2; }
.axis { stroke: var(--line); stroke-width: 1; }
.legend { font-size: .9rem; color: var(--muted); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 6px 0 12px; vertical-align: -1px; }
.key:first-child { margin-left: 0; }
.key-a { background: var(--a); }
.key-b { background: var(--b); }
