/* Side by side. Loaded only on /compare/, so the page-local overrides below stay off every other page.
   Colours come from the tier tokens --t0 to --t3: a mouse keeps the same colour in its picker slot, its
   outline, its legend pill and its table column, which is the only thing tying the drawing to the numbers. */

.cmp-intro{margin:0 0 22px;color:var(--muted)}

/* ---------- Picker ----------
   Four slots, always. A filled one is the same tile the table columns use; a free one shows what is left
   to spend and hands the focus to the search field below. */
.cmp-picker{margin:0}
.cmp-slots{list-style:none;padding:0!important;margin:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(150px,auto);gap:12px}
.cmp-slot{max-width:none;position:relative;min-width:0}
.cmp-slot.is-filled{overflow:hidden;padding-bottom:13px}
.cmp-slot.is-filled::before{content:"";display:block;height:3px;background:var(--c)}
.cmp-plate{display:grid;place-items:center;background:var(--photo);overflow:hidden;padding:10px}
.cmp-plate img{width:100%;object-fit:contain}
.cmp-plate .monogram{font-size:20px}
.cmp-slot .cmp-plate{height:84px}
.cmp-slot .cmp-plate img{max-height:64px}
.cmp-slot-brand{font-size:var(--fs-xs);color:var(--muted);line-height:1.2;margin:10px 0 0;padding:0 13px}
.cmp-slot-name{font-family:var(--display);font-size:20px;font-weight:700;line-height:1.1;margin:2px 0 0;padding:0 13px;overflow-wrap:anywhere}
.cmp-slot-remove{position:absolute;top:9px;right:9px;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;color:var(--muted);background:color-mix(in srgb,var(--surface) 82%,transparent);box-shadow:inset 0 0 0 1px var(--line-strong);transition:background var(--fast),color var(--fast)}
.cmp-slot-remove .ui-icon{width:13px;height:13px;flex-basis:13px;vertical-align:0}
.cmp-add{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;border-radius:var(--r-lg);border:1.5px dashed var(--line-strong);color:var(--muted);font-size:var(--fs-sm);font-weight:500;transition:border-color var(--fast),color var(--fast),background var(--fast)}
.cmp-add .ui-icon{width:18px;height:18px;flex-basis:18px;vertical-align:0}
@media (hover:hover){
  .cmp-slot-remove:hover{background:var(--surface-2);color:var(--ink)}
  .cmp-add:hover{border-color:var(--ink);color:var(--ink);background:var(--surface)}
}

.cmp-field{position:relative;max-width:520px;margin:14px 0 0}
.cmp-field input{width:100%;min-width:0;padding-left:38px}
.cmp-field-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);display:grid;color:var(--muted);pointer-events:none}
.cmp-field-icon .ui-icon{width:17px;height:17px;flex-basis:17px;vertical-align:0}
.cmp-results{position:absolute;z-index:5;top:calc(100% + 6px);left:0;right:0;list-style:none;margin:0;padding:6px!important;background:var(--surface);border-radius:var(--r-md);box-shadow:var(--elev-3),inset 0 0 0 1px var(--line-strong);max-height:min(46vh,340px);overflow-y:auto}
.cmp-results li{max-width:none}
.cmp-results button{display:block;width:100%;text-align:left;padding:8px 10px;border-radius:var(--r-sm);font-size:var(--fs-base);font-weight:500;line-height:1.35}
.cmp-results button span{display:block;font-size:var(--fs-xs);font-weight:400;color:var(--muted)}
.cmp-no-results{padding:9px 10px;font-size:var(--fs-base);color:var(--muted)}
.cmp-hint{font-size:var(--fs-sm);color:var(--muted);margin:10px 0 0}
.cmp-hint:empty{display:none}
@media (hover:hover){.cmp-results button:hover{background:var(--surface-2)}}

/* ---------- Sections ---------- */
.cmp-section{margin:32px 0 0}
.cmp-section>h2{margin:0 0 14px}
.cmp-note,.cmp-source-note,.cmp-foot{font-size:var(--fs-sm);color:var(--muted);margin:12px 0 0;max-width:80ch}

/* ---------- At a glance ----------
   Computed from the recorded specs of the picked mice only: the lighter one by how much, the longer
   battery claim, the cheaper recorded price. Nothing here is an opinion. */
.cmp-glance{margin:24px 0 0;padding:16px 18px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line);box-shadow:var(--elev-1)}
.cmp-glance h2{font-size:var(--fs-h3);margin:0 0 10px}
.cmp-glance ul{list-style:none;padding:0!important;margin:0;display:grid;gap:6px;font-size:var(--fs-md)}
.cmp-glance li{max-width:none;display:flex;gap:10px;align-items:baseline}
.cmp-glance .cmp-swatch{position:relative;top:1px;flex:none}
.cmp-glance strong{font-weight:600}
.cmp-glance .cmp-by{color:var(--muted);font-size:var(--fs-base)}

/* ---------- boardzy's head-to-head ----------
   Shown only when one of his videos names both picked mice. The facade is the site's usual thumbnail
   button; the frame follows the yt-embed rules from style.css. */
.cmp-video{margin:24px 0 0;display:grid;grid-template-columns:minmax(0,420px) minmax(0,1fr);gap:16px 24px;align-items:center;padding:16px 18px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line);box-shadow:var(--elev-1)}
.cmp-video .yt-embed{margin:0;max-width:none}
.cmp-video-copy h2{font-size:var(--fs-h3);margin:0 0 6px}
.cmp-video-copy p{margin:0;color:var(--muted);font-size:var(--fs-base);line-height:1.5;max-width:none}
.cmp-video-copy p+p{margin-top:6px}
.cmp-video-copy a{color:var(--ink)}

/* ---------- Shape ----------
   One SVG holds both panels so they share a millimetre scale; compare.js swaps between a row and a column
   layout at the same breakpoint as the media query below. The viewBox is in millimetres, so every length
   here, stroke widths and font sizes included, is a real millimetre on the drawing. compare.js sets the
   inline max-width that caps the drawing's height, which is what keeps it a figure instead of the page. */
.cmp-figure{margin:0;padding:14px 16px 16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--elev-1)}
.cmp-figure-head{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin:0 0 14px}
.cmp-svg{display:block;width:100%;height:auto;margin-inline:auto}
.cmp-svg text{font-family:var(--body);fill:var(--muted)}
.cmp-board{fill:var(--ground);stroke:var(--line);stroke-width:.3}
.cmp-grid{fill:none;stroke:var(--line);stroke-width:.25}
.cmp-guide{fill:none;stroke:var(--line-strong);stroke-width:.3;stroke-dasharray:2 2}
.cmp-outline{fill:color-mix(in srgb,var(--c) 20%,transparent);stroke:var(--c);stroke-width:.8;stroke-linejoin:round}
.cmp-hand-line{fill:none;stroke:var(--ink);stroke-width:.4;stroke-dasharray:2.5 2}
.cmp-hand-label{font-size:4.6px}
.cmp-panel-label{font-size:5.4px;font-weight:600}
.cmp-bar{fill:none;stroke:var(--muted);stroke-width:.4}
.cmp-bar-label{font-size:4.6px}
.cmp-figure figcaption{font-size:var(--fs-xs);color:var(--muted);margin:14px 0 0;max-width:80ch}

/* Legend pills carry the mouse colour and its dimensions source; the source is the only link here. */
.cmp-legend{list-style:none;padding:0!important;margin:0;display:flex;flex-wrap:wrap;gap:7px}
.cmp-legend li{max-width:none;display:inline-flex;align-items:center;gap:7px;padding:5px 9px 5px 10px;border-radius:var(--r-pill);background:var(--ground);box-shadow:inset 0 0 0 1px var(--line);font-size:var(--fs-xs);font-weight:500;line-height:1.25}
.document-page .cmp-legend a{display:inline-grid;place-items:center;color:var(--muted);border-radius:4px;transition:color var(--fast)}
.cmp-legend .ui-icon{width:13px;height:13px;flex-basis:13px;vertical-align:0}
.cmp-swatch{width:11px;height:11px;flex:0 0 11px;border-radius:3px;background:color-mix(in srgb,var(--c) 35%,transparent);box-shadow:inset 0 0 0 1.5px var(--c)}
@media (hover:hover){.document-page .cmp-legend a:hover{color:var(--ink)}}

.cmp-hand{display:inline-flex;align-items:center;gap:8px;margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}
.cmp-hand-input{position:relative;display:inline-flex;align-items:center}
.cmp-hand-input input{width:92px;min-height:var(--control-h-sm);padding:5px 32px 5px 11px;font-size:var(--fs-base);color:var(--ink);background:var(--ground);appearance:textfield;-moz-appearance:textfield}
.cmp-hand-input input::-webkit-outer-spin-button,.cmp-hand-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.cmp-hand-input>span{position:absolute;right:11px;font-size:var(--fs-xs);color:var(--muted);pointer-events:none}
.cmp-hand-clear{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;color:var(--muted);transition:background var(--fast),color var(--fast)}
.cmp-hand-clear .ui-icon{width:13px;height:13px;flex-basis:13px;vertical-align:0}
@media (hover:hover){.cmp-hand-clear:hover{background:var(--surface-2);color:var(--ink)}}

/* ---------- Table ----------
   Equal columns: the row labels take what they need and the mice share the rest evenly, so the second
   column never reads as the important one. Nothing is tinted: a row every mouse agrees on is dimmed, a
   value outside the majority takes weight and a bar in its column colour, and the single best number in
   a row with a direction gets a check. */
.cmp-table-scroll{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.cmp-table{border-collapse:collapse;width:100%;table-layout:fixed}
/* A single mouse is a spec sheet, not a comparison: the table stops stretching one column across the page. */
.cmp-table.is-solo{width:auto;min-width:min(100%,460px);table-layout:auto}
.cmp-table th,.cmp-table td{padding:9px 12px;text-align:left;border-bottom:1px solid var(--line);font-size:var(--fs-base)}
.cmp-table th[scope=row]{position:sticky;left:0;z-index:1;background:var(--ground);font-family:var(--body);font-size:var(--fs-xs);font-weight:500;white-space:nowrap;width:132px}
.cmp-corner{position:sticky;left:0;z-index:1;width:132px;background:var(--ground);border-bottom:1px solid var(--line-strong);padding:0}
/* Relative so the screen-reader text on a best-value mark is contained by the scroller, not the page. */
.cmp-table td{position:relative;font-weight:500;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.cmp-table td.is-none{color:var(--muted);font-weight:400}
.cmp-table tr.is-same th[scope=row],.cmp-table tr.is-same td{color:var(--muted);font-weight:400}
.cmp-table td.is-diff{font-weight:600;box-shadow:inset 3px 0 0 var(--c)}
.cmp-best{width:13px;height:13px;flex-basis:13px;color:var(--accent-text);margin-right:5px;vertical-align:-2px}

.cmp-group th{position:static;background:none;border-bottom:1px solid var(--line-strong);padding:20px 0 5px}
.cmp-group span{position:sticky;left:0;display:inline-block;font-size:var(--fs-xs);font-weight:600;color:var(--ink);background:var(--ground);padding-right:12px}
.cmp-table tbody:first-of-type .cmp-group th{padding-top:12px}

.cmp-col{vertical-align:top;padding:0 12px 13px;border-top:3px solid var(--c);border-bottom:1px solid var(--line-strong)}
.cmp-col .cmp-plate{height:88px;margin:11px 0 0;border-radius:var(--r-md);box-shadow:inset 0 0 0 1px var(--line)}
.cmp-col .cmp-plate img{max-height:66px}
.cmp-col-brand{font-size:var(--fs-xs);color:var(--muted);margin:10px 0 0;line-height:1.2}
.cmp-col-name{font-family:var(--display);font-size:20px;font-weight:700;line-height:1.1;margin:2px 0 0;overflow-wrap:anywhere}
.cmp-col-actions{display:flex;flex-wrap:wrap;gap:6px;margin:11px 0 0}
.cmp-col-actions .button{flex:1 1 calc(50% - 3px);min-width:0;padding:0 8px}
.cmp-col-actions .cmp-shop{flex-basis:100%}
.cmp-col-actions .ui-icon{width:14px;height:14px;flex-basis:14px;vertical-align:0}
.cmp-shop-note{margin:10px 0 0;font-size:var(--fs-xs);color:var(--muted);line-height:1.4}
.cmp-rating-value{margin-left:7px;font-weight:400;color:var(--muted)}
.cmp-table .star{width:14px;height:14px;flex-basis:14px}
/* Four columns need room; the scroller takes over below the width the table wants. */
.cmp-table:not(.is-solo){min-width:calc(132px + var(--cols,2) * 200px)}

/* ---------- Empty state ---------- */
.cmp-empty{margin:32px 0 0}
.cmp-empty>p{max-width:70ch;margin:0 0 26px}
.cmp-empty>h2{margin:0 0 14px}
.cmp-suggestions{list-style:none;padding:0!important;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cmp-suggestions li{max-width:none}
.cmp-suggestions button{display:block;width:100%;text-align:left;overflow:hidden;transition:border-color var(--fast),box-shadow var(--fast),transform .18s var(--ease-out)}
.cmp-pair-photos{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line)}
.cmp-suggestions .cmp-plate{height:104px}
.cmp-suggestions .cmp-plate img{max-height:82px}
.cmp-pair-label{display:block;font-family:var(--display);font-size:21px;font-weight:700;line-height:1.15;padding:13px 16px 0}
.cmp-pair-names{display:block;font-size:var(--fs-sm);color:var(--muted);line-height:1.45;padding:3px 16px 15px}
@media (hover:hover){.cmp-suggestions button:hover{border-color:var(--line-strong);box-shadow:var(--elev-2);transform:translateY(-2px)}}

@media (max-width:800px){
 .cmp-slots{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(136px,auto)}
 .cmp-field{max-width:none}
 .cmp-hand{margin-left:0}
 .cmp-suggestions{grid-template-columns:1fr}
 .cmp-suggestions .cmp-plate{height:92px}
 .cmp-video{grid-template-columns:1fr}
 .cmp-col{padding:0 10px 12px}
 .cmp-col .cmp-plate{height:74px}
 .cmp-col .cmp-plate img{max-height:56px}
 .cmp-col-name{font-size:18px}
 .cmp-table th,.cmp-table td{padding:8px 10px;font-size:var(--fs-sm)}
 .cmp-table th[scope=row],.cmp-corner{width:104px}
 .cmp-table:not(.is-solo){min-width:calc(104px + var(--cols,2) * 168px)}
}
@media (prefers-reduced-motion:reduce){
 .cmp-suggestions button:hover{transform:none}
}

#compare{min-width:0;max-width:100%}
