/* Compare your car (public/compare.html, public/js/compare.js).
   Colours come from site.css tokens so light mode follows. */

.cmp { display: flex; flex-direction: column; gap: 28px; margin-top: 32px; }
.cmp-intro h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.cmp-intro .lede { max-width: 760px; }

.cmp-form { gap: 18px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.cmp-hint { margin-top: 10px; }
.cmp-hint:empty { display: none; }
.cmp .seg.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.cmp-results { display: flex; flex-direction: column; gap: 20px; }
.cmp-summary { margin: 0; font-size: 21px; line-height: 1.45; color: var(--text); }
.cmp-summary b { color: var(--amber); font-weight: 600; }

.cmp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.cmp-stats div { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--inset); border: 1px solid var(--line); border-radius: 12px; }
.cmp-stats b { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--text); }
.cmp-stats div:nth-child(2) b { color: var(--amber); }
.cmp-stats span { font-size: 13px; color: var(--dim); }

/* Charts: geometry is set as SVG attributes by compare.js; only paint here. */
.cmp-chart { width: 100%; min-width: 0; }
.cmp-chart svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.cmp-chart text { font-family: var(--sans); font-size: 13px; fill: var(--muted); }
.cmp-chart text.user { fill: var(--text); font-weight: 600; }
.cmp-chart text.cmp-val { font-family: var(--mono); font-size: 12px; }
.cmp-chart text.cmp-val.user { fill: var(--amber); }
.cmp-bar { fill: var(--dim); opacity: 0.45; }
.cmp-bar.user { fill: var(--amber); opacity: 1; }
.cmp-gridline { stroke: var(--line); stroke-width: 1; }
.cmp-chart text.cmp-tick { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.cmp-line { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.cmp-line.s1 { stroke-dasharray: 7 5; }
.cmp-line.s2 { stroke-dasharray: 2 5; }
.cmp-line.s3 { stroke-dasharray: 12 4 3 4; }
.cmp-line.cheap { stroke: var(--cyan); }
.cmp-line.user { stroke: var(--amber); stroke-width: 3.5; }

.cmp-legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.cmp-legend li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cmp-legend li.user { color: var(--text); font-weight: 600; }
.cmp-legend .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-legend .num { margin-left: auto; font-family: var(--mono); white-space: nowrap; }
.cmp-swatch { flex: none; width: 28px; height: 0; border-top: 3px solid var(--muted); }
.cmp-swatch.s1 { border-top-style: dashed; }
.cmp-swatch.s2 { border-top-style: dotted; }
.cmp-swatch.s3 { border-top-style: dashed; border-top-width: 2px; }
.cmp-swatch.cheap { border-top-color: var(--cyan); }
.cmp-swatch.user { border-top-color: var(--amber); border-top-width: 4px; }

.cmp-numbers summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.cmp-table { overflow-x: auto; margin-top: 12px; }
.cmp-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.cmp-table th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.cmp-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.cmp-table tr.user td { color: var(--amber); font-weight: 600; }

@media (max-width: 560px) {
  .cmp-summary { font-size: 18px; }
  .cmp .seg.four span { font-size: 13px; }
  .cmp-stats b { font-size: 22px; }
}
