/* ALLCUT — /compare/
   Page head + colour legend · selection bar and range-grouped picker · the comparison table.
   2–4 machines: roomy columns. 5–8 (screens ≥ 1200 px): dense — smaller type and images, bars,
   dimmed identical rows, sticky names. Colour per range comes from .rc-<range> (--rc, --rc-ink, --rc-tint). */

/* ───────────── head ───────────── */
.cx-head__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 64px; align-items: end; }
.cx-legend { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 28px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); }
.cx-legend li { display: flex; align-items: center; white-space: nowrap; }
@media (max-width: 860px) { .cx-head__row { grid-template-columns: 1fr; } .cx-legend { grid-template-columns: repeat(4, auto); justify-content: start; } }
@media (max-width: 520px) { .cx-legend { grid-template-columns: repeat(2, auto); } }

/* ───────────── selection bar ───────────── */
.cx-pick { border-bottom: 1px solid var(--rule); background: var(--white); }
.cx-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; padding-block: 18px; }
.cx-bar__title { margin: 0; white-space: nowrap; }
.cx-bar__title .num { color: var(--ink); }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-items: center; }
.cx-chip { display: inline-flex; align-items: center; height: 36px; padding-left: 11px; border: 1px solid var(--rule-2); background: var(--paper); font-size: 14px; font-weight: 600; }
.cx-chip .swatch { margin-right: 8px; }
.cx-chip a:hover { color: var(--rc-ink); }
.cx-chip__x { width: 34px; height: 100%; margin-left: 6px; border: 0; border-left: 1px solid var(--rule); background: transparent; font-size: 18px; line-height: 1; color: var(--ink-3); transition: color .15s, background-color .15s; }
.cx-chip__x:hover { color: var(--ink); background: var(--tint); }
.cx-bar__tools { display: flex; gap: 8px; }
.cx-bar__tools [hidden] { display: none; }
@media (max-width: 760px) {
  .cx-bar { grid-template-columns: 1fr auto; }
  .cx-chips { grid-column: 1 / -1; grid-row: 2; }
  .cx-bar__tools { grid-column: 2; grid-row: 1; }
}

/* ───────────── picker ───────────── */
.cx-picker { padding-bottom: 32px; }
.cx-picker[hidden] { display: none; }
.cx-picker__top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; padding: 8px 0 20px; border-top: 1px solid var(--rule); }
.cx-picker__search { flex: 0 1 380px; }
.cx-picker__note { margin: 0; min-height: 1.5em; color: var(--ink-2); font-size: 14.5px; }
.cx-picker__ranges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px clamp(16px, 2vw, 28px); align-items: start; }
.cx-range { margin: 0; padding: 0; border: 0; min-width: 0; }
.cx-range[hidden] { display: none; }
.cx-range__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 0 0 9px;
  border-top: 3px solid var(--rc); padding-top: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.cx-range__name { display: inline-flex; align-items: baseline; }
.cx-range__name .swatch { display: none; }
.cx-range__n { font: 500 12px/1 var(--f-mono); color: var(--ink-3); }
.cx-range__all {
  display: block; margin: 0 0 8px; padding: 0; border: 0; background: none; font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em; text-transform: uppercase; color: var(--rc-ink); text-decoration: underline; text-underline-offset: 3px;
}
.cx-range__all:hover { color: var(--ink); }
.cx-opts { display: grid; gap: 4px; }
.cx-opts li[hidden] { display: none; }
.cx-opt {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; gap: 10px; width: 100%;
  min-height: 52px; padding: 4px 10px 4px 4px; text-align: left; background: var(--paper); border: 1px solid var(--rule);
  transition: border-color .15s, background-color .15s;
}
.cx-opt:hover { border-color: var(--ink-4); background: var(--white); }
.cx-opt__img { width: 44px; height: 44px; display: grid; place-items: center; }
.cx-opt__img img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.cx-opt__txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-opt__name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-opt__kf { font: 400 11.5px/1.3 var(--f-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-opt__mark { width: 16px; height: 16px; border: 1px solid var(--rule-2); background: var(--white); position: relative; }
.cx-opt[aria-pressed="true"] { border-color: var(--rc); background: var(--rc-tint); }
.cx-opt[aria-pressed="true"] .cx-opt__mark { background: var(--rc); border-color: var(--rc); }
.cx-opt[aria-pressed="true"] .cx-opt__mark::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.cx-opt.is-full { opacity: .45; }
.cx-opt.is-full:hover { border-color: var(--rule); background: var(--paper); cursor: not-allowed; }
@media (max-width: 1180px) { .cx-picker__ranges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cx-picker__ranges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cx-picker__ranges { grid-template-columns: 1fr; } }

/* ───────────── tools ───────────── */
.cx-main { padding-block: clamp(32px, 4vw, 56px) clamp(56px, 7vw, 104px); }
.cx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 20px; }
.cx-tools[hidden] { display: none; }
.cx-tools__title { margin: 0 12px 0 0; font-size: clamp(22px, 2vw, 30px); font-weight: 700; letter-spacing: -0.025em; }
.cx-switch { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; cursor: pointer; user-select: none; }
.cx-switch input { appearance: none; width: 34px; height: 20px; margin: 0; border: 1px solid var(--ink-4); background: var(--white); position: relative; cursor: pointer; transition: background-color .15s, border-color .15s; }
.cx-switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; background: var(--ink-4); transition: transform .15s var(--ease), background-color .15s; }
.cx-switch input:checked { background: var(--ink); border-color: var(--ink); }
.cx-switch input:checked::after { transform: translateX(14px); background: var(--white); }
.cx-tools__hidden { margin: 0; }
.cx-tools__end { margin-left: auto; display: flex; gap: 8px; }
.cx-notice { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid var(--ink); background: var(--white); font-size: 14.5px; color: var(--ink-2); }
.cx-notice[hidden] { display: none; }
.cx-empty { padding: 48px 0 24px; border-top: 1px solid var(--ink); }
.cx-empty[hidden] { display: none; }
.cx-empty .body { margin-top: 10px; }
.cx-foot { margin: 20px 0 0; font-size: 13.5px; color: var(--ink-3); max-width: 80ch; }
.cx-foot[hidden] { display: none; }

/* ───────────── table ───────────── */
.cx-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cx-scroll[hidden] { display: none; }
.cx-table {
  --lab: 200px; --minc: 150px; --maxc: 330px;
  table-layout: fixed; border-collapse: separate; border-spacing: 0;
  width: min(100%, calc(var(--lab) + var(--n) * var(--maxc)));
  min-width: calc(var(--lab) + var(--n) * var(--minc));
}
.cx-table.is-dense { --lab: 168px; --minc: 112px; width: 100%; }
.cx-c-label { width: var(--lab); }

/* sticky first column */
.cx-corner, .cx-label, .cx-group__row > th { position: sticky; left: 0; z-index: 2; background: var(--paper); }

/* header */
.cx-table thead > tr > * { vertical-align: top; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.cx-corner { padding: 16px 16px 16px 0; vertical-align: bottom !important; }
.cx-col { position: relative; padding: 18px 14px 14px 0; text-align: left; font-weight: 400; }
.cx-col::before { content: ""; position: absolute; left: 0; right: 14px; top: -1px; height: 3px; background: var(--rc); }
.cx-col__range { display: block; }
.cx-col__name { display: block; margin-top: 6px; font-size: clamp(17px, 1.4vw, 21px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; transition: color .15s; }
.cx-col__name:hover { color: var(--rc-ink); }
.cx-col__sub { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.cx-col__img { display: flex; align-items: flex-end; justify-content: center; height: 150px; margin: 14px 0 12px; }
.cx-col__img img { max-height: 100%; max-width: 100%; width: auto; height: auto; }
.cx-col__acts { display: flex; gap: 6px; }
.cx-act {
  min-height: 30px; padding: 0 9px; border: 1px solid var(--rule-2); background: var(--white);
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  transition: border-color .15s, color .15s, background-color .15s;
}
.cx-act:hover { border-color: var(--ink); color: var(--ink); }
.cx-act[aria-pressed="true"] { border-color: var(--rc); background: var(--rc-tint); color: var(--ink); }
.cx-act--x { width: 30px; padding: 0; font: 400 17px/1 var(--f-sans); letter-spacing: 0; }

/* groups + rows */
.cx-group__row > th { padding: 26px 0 8px; border-bottom: 1px solid var(--ink-4); text-align: left; }
.cx-group__name { font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.cx-label {
  padding: 11px 16px 11px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top;
  font: 500 11.5px/1.35 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
}
.cx-cell { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: top; transition: background-color .12s; }
.cx-v { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; font-variant-numeric: tabular-nums; }
.cx-row.is-same .cx-v { color: var(--ink-3); font-weight: 500; }
.cx-row.is-same .cx-label { color: var(--ink-4); }
.cx-na { color: var(--ink-4); font-weight: 400; }
.cx-row:hover .cx-label { color: var(--ink); }

/* bars: one value = bar from zero · a range = a segment · a set of options = dots */
.cx-meter { position: relative; display: none; height: 3px; margin-top: 9px; background: var(--rule); }
.has-bars .cx-meter { display: block; }
.cx-meter__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--rc); }
.cx-meter__fill--range { min-width: 2px; }
.cx-meter__dot { position: absolute; top: -2px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--rc); }
.cx-delta { display: block; margin-top: 6px; font: 500 11.5px/1.2 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cx-delta.is-zero { color: var(--ink-4); }
.cx-dot { display: inline-block; width: 9px; height: 9px; background: var(--rc); vertical-align: 0.05em; }
.cx-dot--opt { background: transparent; border: 1.5px solid var(--rc); margin-right: 7px; }

/* reference column */
.has-ref .is-ref { background: var(--rc-tint); }

/* crosshair: the hovered column */
.cx-table[data-hc="0"] [data-c="0"]:not(.is-ref), .cx-table[data-hc="1"] [data-c="1"]:not(.is-ref),
.cx-table[data-hc="2"] [data-c="2"]:not(.is-ref), .cx-table[data-hc="3"] [data-c="3"]:not(.is-ref),
.cx-table[data-hc="4"] [data-c="4"]:not(.is-ref), .cx-table[data-hc="5"] [data-c="5"]:not(.is-ref),
.cx-table[data-hc="6"] [data-c="6"]:not(.is-ref), .cx-table[data-hc="7"] [data-c="7"]:not(.is-ref) {
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
}

.cx-doc { font: 500 12px/1.3 var(--f-mono); letter-spacing: .02em; border-bottom: 1px solid var(--rule-2); padding-bottom: 2px; transition: color .15s, border-color .15s; }
.cx-doc:hover { color: var(--rc-ink); border-color: var(--rc); }
.cx-quote { font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--rule-2); padding-bottom: 2px; transition: color .15s, border-color .15s; }
.cx-quote::after { content: " →"; font-family: var(--f-mono); }
.cx-quote:hover { color: var(--red-ink); border-color: var(--red); }

/* dense: 5–8 machines */
.is-dense .cx-col { padding: 16px 10px 12px 0; }
.is-dense .cx-col::before { right: 10px; }
.is-dense .cx-col__name { font-size: 16px; }
.is-dense .cx-col__sub { display: none; }
.is-dense .cx-col__img { height: 88px; margin: 10px 0; }
.is-dense .cx-act { padding: 0 7px; font-size: 9.5px; }
.is-dense .cx-act--x { width: 28px; }
.is-dense .cx-label { padding: 9px 12px 9px 0; font-size: 10.5px; }
.is-dense .cx-cell { padding: 9px 10px 9px 0; }
.is-dense .cx-v { font-size: 13.5px; }
.is-dense .cx-delta { font-size: 10.5px; }
.is-dense .cx-quote { font-size: 12.5px; }

/* sticky names bar (JS) */
.cx-sticky { position: sticky; top: var(--header-h); z-index: 6; height: 0; }
.cx-sticky[hidden] { display: none; }
.cx-sticky__clip {
  position: absolute; left: 0; right: 0; top: 0; overflow: hidden; background: var(--paper);
  border-bottom: 1px solid var(--rule-2); opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.cx-sticky.is-on .cx-sticky__clip { opacity: 1; transform: none; }
.cx-sticky__in { display: flex; white-space: nowrap; will-change: transform; }
.cx-sticky__in > span { flex: none; overflow: hidden; text-overflow: ellipsis; }
.cx-sticky__col { position: relative; display: flex; align-items: center; padding: 12px 12px 11px 0; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.cx-sticky__col::before { content: ""; position: absolute; left: 0; right: 12px; top: 0; height: 3px; background: var(--rc); }
.cx-sticky__col .swatch { display: none; }

/* phones: label column narrows, two machines fit on screen, more scroll sideways */
@media (max-width: 699px) {
  .cx-table, .cx-table.is-dense { --lab: 104px; --minc: calc((100vw - 2 * var(--gutter) - var(--lab)) / 2); --maxc: var(--minc); width: auto; }
  .cx-col { padding-right: 10px; }
  .cx-col::before { right: 10px; }
  .cx-col__name { font-size: 16px; }
  .cx-col__sub { display: none; }
  .cx-col__img { height: 90px; margin: 10px 0; }
  .cx-act { padding: 0 6px; font-size: 9.5px; }
  .cx-label { padding-right: 10px; font-size: 10px; letter-spacing: .02em; }
  .cx-cell { padding-right: 10px; }
  .cx-v { font-size: 13.5px; }
  .cx-tools__end { margin-left: 0; }
  .cx-sticky__col { font-size: 13px; }
}

/* print: just the comparison */
@media print {
  .site-header, .site-footer, .cx-pick, .cx-tools, .cx-sticky, .cta-band, .page-head .crumbs, .cx-col__acts, .skip-link { display: none !important; }
  .page-head { padding: 0 0 12px; border: 0; }
  .cx-main { padding: 0; }
  .cx-scroll { overflow: visible; }
  .cx-table, .cx-table.is-dense { width: 100%; min-width: 0; }
  .cx-corner, .cx-label, .cx-group__row > th { position: static; }
  .cx-meter { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
