/* ---------- Compare: up to four pickups side by side ---------- */
.cmp { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0.5rem var(--gutter) calc(var(--bar) + env(safe-area-inset-bottom) + 1.5rem); }
.cmp-head { color: var(--on-page); }
.cmp-head h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.cmp-head h1:focus { outline: 0; }
.cmp-head h1:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cmp-head .note { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--ink); }
.cmp-dropped { margin-top: 0.75rem; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.cmp-intro { max-width: 46rem; margin-top: 0.75rem; font-size: 0.9375rem; color: var(--ink); }

/* Controls: the differences switch, add another, clear all. */
.cmp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.875rem; }
.cmp-switch { display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0 0.875rem 0 0.625rem; border-radius: 0.75rem; background: #fff; box-shadow: var(--glass-shadow); font-weight: 600; text-align: left; }
.cmp-switch .track { position: relative; flex: none; width: 2.5rem; height: 1.5rem; border: 2px solid var(--ink); border-radius: 0.75rem; background: #fff; transition: background-color 0.15s; }
.cmp-switch .knob { position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%; background: var(--ink); transition: transform 0.15s, background-color 0.15s; }
.cmp-switch[aria-checked="true"] .track { background: var(--ink); }
.cmp-switch[aria-checked="true"] .knob { transform: translateX(1rem); background: #fff; }
.cmp-switch:hover { background: var(--raised); }
.cmp-plain { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.5rem; border-radius: 0.5rem; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.cmp-plain:hover { background: var(--on-page-hover); }

/* The table scrolls sideways inside its own white box; the page itself never does.
   `position: relative` keeps hidden screen-reader text inside the box. */
/* Focus moved by keyboard stops clear of the fixed names column, never under it. */
.cmp-box { --fact: 7.25rem; --col: 10.5rem; scroll-padding-left: calc(var(--fact) + 0.5rem); position: relative; margin-top: 0.875rem; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 1.25rem; background: #fff; box-shadow: var(--panel-shadow); }
.cmp-box:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cmp-table { width: 100%; min-width: calc(var(--fact) + var(--n, 2) * var(--col)); table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; text-align: left; }
.cmp-table th, .cmp-table td { padding: 0.625rem 0.75rem; vertical-align: top; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.cmp-table thead th, .cmp-table thead td { border-top: 0; }
.cmp-table td, .cmp-table thead .pk { border-left: 1px solid var(--line); }

/* First column stays in view while the pickups scroll under it. */
.cmp-table .corner, .cmp-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; width: var(--fact); background: #fff; box-shadow: 1px 0 0 var(--line); }
.cmp-table tbody th[scope="row"] { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.flag { display: block; margin-top: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--soft-ink); }
.flag-diff { color: var(--rust-text); font-weight: 700; }
.cmp-table tr.differs td { background: #fff4ee; }

/* Group headings (Type and fit, Build, Electrical); the words stay at the left while scrolling. */
.cmp-table .grp th { padding: 0.875rem 0.75rem 0.375rem; border-top: 1px solid var(--line); background: var(--raised); }
.cmp-table .grp span { position: sticky; left: 0.75rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }

.cmp-table td .line { display: block; color: var(--ink); }
.cmp-table td .line + .line { margin-top: 0.125rem; }
.cmp-table td.muted { color: var(--muted); }
.cmp-table .opt-note { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--soft-ink); }
.cmp-table .warn { display: block; font-size: 0.75rem; font-weight: 700; color: var(--rust-text); }
.cmp-table td.none { border-left: 0; padding: 1rem 0.75rem; color: var(--ink-2); }

/* Column heads: maker, name and code, version, tag, photo, link, remove. */
.pk { width: var(--col); font-weight: 400; }
.pk .maker { font-size: 0.6875rem; }
.pk-name { margin-top: 0.125rem; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.pk-ver { margin-top: 0.125rem; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.pk-tag { display: inline-block; margin-top: 0.375rem; padding: 0.125rem 0.375rem; border-radius: 0.375rem; background: var(--well); color: var(--soft-ink); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.3; }
.pk-photo { display: flex; align-items: center; justify-content: center; height: 4.5rem; margin-top: 0.5rem; }
.pk-photo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgb(28 30 35 / 0.2)); }
.pk-photo span { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.pk-link { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; margin-top: 0.25rem; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.pk-link .icon { width: 1rem; height: 1rem; }
.pk-link:hover { color: var(--rust-text); }
.pk-remove { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; padding: 0 0.75rem 0 0.5rem; border: 1px solid rgb(18 12 8 / 0.16); border-radius: 0.75rem; background: #fff; font-size: 0.875rem; font-weight: 600; transition: background-color 0.15s; }
.pk-remove .icon { width: 1.125rem; height: 1.125rem; }
.pk-remove:hover { background: var(--raised); }

/* Nothing chosen, or one pickup. */
.cmp-empty { max-width: 40rem; margin-top: 1rem; padding: 1.25rem; border-radius: 1.25rem; background: #fff; box-shadow: var(--panel-shadow); }
.cmp-empty h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.cmp-empty p { margin-top: 0.5rem; color: var(--ink-2); }
.cmp-empty p a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cmp-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1rem; }
.cmp-go { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1rem 0 1.25rem; border-radius: 0.75rem; background: var(--brand); color: var(--ink); font-weight: 700; transition: background-color 0.15s; }
.cmp-go:hover { background: var(--brand-hover); }
.cmp-go .icon { width: 1.125rem; height: 1.125rem; }
.cmp-empty .cmp-plain { margin-left: -0.5rem; }

@media (min-width: 48rem) {
  .cmp { padding: 1.5rem 2rem 2.5rem; }
  .cmp-head h1 { font-size: 1.875rem; }
  .cmp-box { --fact: 10rem; --col: 12rem; }
  .cmp-table th, .cmp-table td { padding: 0.75rem 1rem; }
  .cmp-table .grp span { left: 1rem; }
  .pk-photo { height: 5.5rem; }
}
@media (min-width: 64rem) {
  .cmp-table { --fact: 12rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-switch .track, .cmp-switch .knob, .pk-remove, .cmp-go { transition: none; }
}
