/*
Theme Name: OnlineSavings Datasheet
Theme URI: https://onlinesavin.gs
Author: Redfund LLC
Description: Dense, data-forward theme for the onlinesavin.gs PC & software deal engine. Built on the visual language of component datasheets — hairline rules, tabular monospace data, no marketing fluff.
Version: 0.1.0
License: GPLv2 or later
Text Domain: onlinesavings
*/

/* ==========================================================================
   Tokens. Neutrals carry a deliberate cool/blue bias so they read as chosen
   rather than inherited grey. Every component styles THROUGH these, never
   inside a media query, so the theme toggle can override in both directions.
   ========================================================================== */
:root {
  --paper:  #F7F9FB;
  --panel:  #FFFFFF;
  --panel2: #F1F5F9;
  --ink:    #0E1319;
  --text:   #1F2833;
  --muted:  #5B6875;
  --faint:  #8794A2;
  --rule:   #DCE3EB;
  --rule-hi:#C3CEDA;

  --accent:    #0B44C4;   /* engineering blue — interactive only */
  --accent-in: #FFFFFF;
  --accent-sf: #E8EFFD;

  --save: #0B6B3F;        /* semantic: a discount */
  --hot:  #B23A0B;        /* semantic: a steep discount */
  --save-sf: #E6F4EC;
  --hot-sf:  #FCEDE5;

  --shadow: 0 1px 2px rgba(14,19,25,.05);

  --f-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1320px;
  --gap:  16px;
  --r:    3px;            /* deliberate: near-square. rounded-lg everywhere is a tell */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #0A0D12;
    --panel:  #12171F;
    --panel2: #171E28;
    --ink:    #F2F5F8;
    --text:   #DBE2EA;
    --muted:  #94A2B2;
    --faint:  #6B7887;
    --rule:   #212A36;
    --rule-hi:#2E3A49;
    --accent:    #6E9BFF;
    --accent-in: #06122E;
    --accent-sf: #16233E;
    --save: #45C98A;
    --hot:  #FF9257;
    --save-sf: #10281D;
    --hot-sf:  #2A1810;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
/* The viewer's explicit toggle must beat the OS preference in BOTH directions. */
:root[data-theme="dark"] {
  --paper:#0A0D12; --panel:#12171F; --panel2:#171E28; --ink:#F2F5F8; --text:#DBE2EA;
  --muted:#94A2B2; --faint:#6B7887; --rule:#212A36; --rule-hi:#2E3A49;
  --accent:#6E9BFF; --accent-in:#06122E; --accent-sf:#16233E;
  --save:#45C98A; --hot:#FF9257; --save-sf:#10281D; --hot-sf:#2A1810;
  --shadow:0 1px 2px rgba(0,0,0,.4);
}
:root[data-theme="light"] {
  --paper:#F7F9FB; --panel:#FFFFFF; --panel2:#F1F5F9; --ink:#0E1319; --text:#1F2833;
  --muted:#5B6875; --faint:#8794A2; --rule:#DCE3EB; --rule-hi:#C3CEDA;
  --accent:#0B44C4; --accent-in:#FFFFFF; --accent-sf:#E8EFFD;
  --save:#0B6B3F; --hot:#B23A0B; --save-sf:#E6F4EC; --hot-sf:#FCEDE5;
  --shadow:0 1px 2px rgba(14,19,25,.05);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "kern" 1;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1,h2,h3,h4 { font-family: var(--f-cond); font-weight: 700; color: var(--ink);
  margin: 0 0 .4em; line-height: 1.15; text-wrap: balance; letter-spacing: .002em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + .9vw, 1.7rem); }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--panel);
  padding: 10px 14px; border: 1px solid var(--accent); }

/* ==========================================================================
   Masthead — the one place the datasheet metaphor is stated outright.
   ========================================================================== */
.mast { background: var(--panel); border-bottom: 1px solid var(--rule); }
.mast__bar { display: flex; align-items: center; gap: 20px;
  padding: 13px 0; max-width: var(--maxw); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { font-family: var(--f-mono); font-weight: 600; font-size: 13px;
  background: var(--ink); color: var(--paper); padding: 3px 6px; border-radius: 2px; letter-spacing: -.02em; }
.brand__name { font-family: var(--f-cond); font-weight: 700; font-size: 20px;
  color: var(--ink); letter-spacing: .01em; }
.brand__tld { color: var(--accent); }

.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: none; }

.themetog { background: none; border: 1px solid var(--rule); color: var(--muted);
  font-family: var(--f-mono); font-size: 11px; padding: 5px 8px; border-radius: var(--r);
  cursor: pointer; line-height: 1; }
.themetog:hover { color: var(--ink); border-color: var(--rule-hi); }

/* Status strip: live counts, in mono. Reads like a device readout. */
.strip { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .strip, .strip { }
.strip__in { max-width: var(--maxw); margin: 0 auto; padding: 7px 20px;
  display: flex; gap: 26px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .01em; }
.strip b { color: #fff; font-weight: 600; }
:root[data-theme="dark"] .strip { background: #05070A; }
.strip span { color: rgba(255,255,255,.62); }
.strip__dot { color: var(--save); }

/* Category rail */
.rail { background: var(--panel); border-bottom: 1px solid var(--rule); }
.rail__in { max-width: var(--maxw); margin: 0 auto; padding: 4px 20px 0;
  display: flex; gap: 2px 4px; flex-wrap: wrap; }
.rail a { flex: none; font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid transparent; }
@media (max-width: 700px) {
  /* On touch, chips beat a hidden scroll track: tappable, all visible, no gesture to discover. */
  .rail__in { gap: 6px; padding: 10px 16px; }
  .rail a { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 11px;
    font-size: 11px; border-bottom-width: 1px; }
  .rail a.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-in); }
  .mast__bar { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .nav { gap: 12px; width: 100%; margin-left: 0; }
  .nav a { font-size: 13px; }
  .strip__in { gap: 14px; font-size: 10.5px; }
  .strip__hide { display: none; }
}
.rail a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--rule-hi); }
.rail a.is-on { color: var(--accent); border-bottom-color: var(--accent); }

/* ==========================================================================
   Page furniture
   ========================================================================== */
.main { padding: 26px 0 48px; }
.phead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.phead__count { font-family: var(--f-mono); font-size: 12px; color: var(--muted);
  margin-left: auto; font-variant-numeric: tabular-nums; }
.lede { color: var(--muted); max-width: 68ch; margin: -4px 0 20px; }

/* ==========================================================================
   Deal grid + card
   ========================================================================== */
.grid { display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.deal { position: relative; background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease; }
.deal:hover { border-color: var(--rule-hi); box-shadow: var(--shadow); }
/* the single bold move: an accent tick on hover, not a coloured rail on every card */
.deal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); opacity: 0; transition: opacity .12s ease; }
.deal:hover::before { opacity: 1; }

.deal__thumb { position: relative; display: block; aspect-ratio: 4 / 3;
  background: var(--panel2); overflow: hidden; border-bottom: 1px solid var(--rule); }
.deal__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.deal__noimg { display: block; width: 100%; height: 100%;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px),
                    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 14px 14px; opacity: .5; }
.deal__disc { position: absolute; top: 8px; left: 8px; font-family: var(--f-mono);
  font-weight: 600; font-size: 11.5px; padding: 3px 6px; border-radius: 2px;
  background: var(--save); color: #fff; font-variant-numeric: tabular-nums; }
.deal__disc.is-hot { background: var(--hot); }

.deal__body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.deal__cat { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--faint); }
.deal__cat:hover { color: var(--accent); text-decoration: none; }
.deal__title { font-family: var(--f-sans); font-weight: 500; font-size: 13.5px;
  line-height: 1.35; margin: 0; letter-spacing: 0; }
.deal__title a { color: var(--text); }
.deal__title a:hover { color: var(--accent); text-decoration: none; }

.specs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.specs__i { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted);
  background: var(--panel2); border: 1px solid var(--rule); border-radius: 2px;
  padding: 2px 5px; white-space: nowrap; }
.specs__k { color: var(--faint); margin-right: 4px; }
.specs--lg .specs__i { font-size: 12px; padding: 4px 8px; }

.deal__foot { margin-top: auto; display: flex; align-items: baseline; gap: 8px;
  padding-top: 6px; border-top: 1px dashed var(--rule); }
.deal__price { display: flex; align-items: baseline; gap: 6px; }
.deal__now { font-family: var(--f-mono); font-weight: 600; font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.deal__was { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint);
  font-variant-numeric: tabular-nums; }
.deal__merch { margin-left: auto; font-size: 11px; color: var(--muted); text-align: right;
  max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal__code { font-family: var(--f-mono); font-size: 11px; color: var(--save); }
.deal__code code { background: var(--save-sf); padding: 1px 4px; border-radius: 2px; }

/* ==========================================================================
   Single deal
   ========================================================================== */
/* Named .dealview, NOT .single: WordPress body_class() puts a bare `single`
   class on <body> for every singular post, so `.single` here would style the
   body element as well and lay the entire page out as a grid. */
.dealview { display: grid; gap: 22px; grid-template-columns: minmax(0,1fr);
  margin-bottom: 24px; }
@media (min-width: 800px) { .dealview { grid-template-columns: minmax(0,1fr) 320px; align-items: start; } }
.dealview__media { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.dealview__media img { max-height: 420px; width: auto; object-fit: contain; }
.dealview__buy { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 16px; position: sticky; top: 16px; }
.dealview__pricerow { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.dealview__now { font-family: var(--f-mono); font-weight: 600; font-size: 26px; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dealview__was { font-family: var(--f-mono); font-size: 14px; color: var(--faint); }
.dealview__disc { font-family: var(--f-mono); font-size: 12px; font-weight: 600; color: #fff;
  background: var(--save); padding: 3px 6px; border-radius: 2px; }
.dealview__code { font-family: var(--f-mono); font-size: 12.5px; }
.dealview__code code { background: var(--save-sf); color: var(--save); padding: 2px 6px; border-radius: 2px; }
.dealview__hist { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); margin: 10px 0 0;
  font-variant-numeric: tabular-nums; }
.dealview__disc-note { font-size: 11.5px; color: var(--faint); margin: 10px 0 0; line-height: 1.45; }

.btn { display: block; width: 100%; text-align: center; background: var(--accent);
  color: var(--accent-in); font-weight: 600; font-size: 14.5px; padding: 12px 16px;
  border-radius: var(--r); border: 0; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--rule-hi); }

/* ==========================================================================
   Content pages / prose
   ========================================================================== */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.prose code { font-family: var(--f-mono); font-size: .9em; background: var(--panel2);
  padding: 1px 5px; border-radius: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; }
.prose th { background: var(--panel2); font-family: var(--f-cond); }
.tablewrap { overflow-x: auto; }

/* ==========================================================================
   Homepage sections
   ========================================================================== */
.sect { margin-bottom: 34px; }
.sect__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sect__head h2 { margin: 0; }
.sect__more { margin-left: auto; font-family: var(--f-mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; }
.sect__rule { flex: 1; height: 1px; background: var(--rule); }

.cats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 11px 12px; }
.cat:hover { border-color: var(--accent); text-decoration: none; }
.cat__n { font-family: var(--f-cond); font-weight: 700; font-size: 14.5px; color: var(--ink); }
.cat:hover .cat__n { color: var(--accent); }
.cat__c { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint);
  font-variant-numeric: tabular-nums; }

/* Pagination */
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 28px;
  font-family: var(--f-mono); font-size: 12.5px; }
.pager .page-numbers { display: inline-block; padding: 7px 11px; border: 1px solid var(--rule);
  border-radius: var(--r); color: var(--muted); background: var(--panel); }
.pager .page-numbers:hover { border-color: var(--rule-hi); color: var(--ink); text-decoration: none; }
.pager .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Empty / search */
.empty { background: var(--panel); border: 1px dashed var(--rule-hi); border-radius: var(--r);
  padding: 34px; text-align: center; color: var(--muted); }
.searchform { display: flex; gap: 8px; margin: 0 0 20px; }
.searchform input[type=search] { flex: 1; font: inherit; padding: 9px 12px;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); color: var(--text); }
.searchform input[type=search]:focus { border-color: var(--accent); outline: none; }
.searchform button { font: inherit; font-weight: 600; padding: 9px 16px; border: 0;
  border-radius: var(--r); background: var(--ink); color: var(--paper); cursor: pointer; }

/* ==========================================================================
   Footer
   ========================================================================== */
.foot { border-top: 1px solid var(--rule); background: var(--panel); margin-top: 20px; }
.foot__in { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px;
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.foot h4 { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); font-weight: 600; margin-bottom: 9px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 5px; }
.foot a { color: var(--muted); font-size: 13.5px; }
.foot a:hover { color: var(--ink); }
.foot__legal { border-top: 1px solid var(--rule); padding: 15px 20px; max-width: var(--maxw);
  margin: 0 auto; font-size: 12px; color: var(--faint); line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.deal-desc { margin-top: 4px; color: var(--muted); font-size: 14px; }
.deal-desc p { margin-bottom: .7em; }

/* Listing attribute table — the detail page's real content. */
.facts { grid-column: 1 / -1; }
.facts__h { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); font-weight: 600; margin: 0 0 10px; }
.facts__dl { margin: 0; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--panel); overflow: hidden; }
.facts__row { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0,1fr); gap: 0;
  border-bottom: 1px solid var(--rule); }
.facts__row:last-child { border-bottom: 0; }
.facts__row:nth-child(odd) { background: var(--panel2); }
.facts__row dt { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted);
  padding: 9px 12px; text-transform: uppercase; letter-spacing: .03em; }
.facts__row dd { margin: 0; padding: 9px 12px; font-size: 14px; color: var(--text);
  font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .facts__row { grid-template-columns: 1fr; }
  .facts__row dt { padding-bottom: 0; }
  .facts__row dd { padding-top: 2px; }
}
.dealview__media { min-height: 0; }
.dealview__media img { max-height: 460px; }
.dealview__noimg { display: block; width: 100%; min-height: 200px;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px),
                    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 16px 16px; opacity: .55; }
/* ==========================================================================
   Grid overflow guard.
   A `1fr` track's automatic minimum is min-content, so a wide grid item — the
   full-size eBay photo, a long unbroken product code — refuses to shrink and
   pushes the whole page into horizontal scroll. Every grid child needs an
   explicit min-width:0 to opt out of that min-content floor.
   ========================================================================== */
.dealview, .grid, .cats, .facts__row, .foot__in { min-width: 0; }
.dealview > *, .grid > *, .cats > *, .facts__row > *, .foot__in > * { min-width: 0; }

.dealview__media { overflow: hidden; }
.dealview__media img { max-width: 100%; height: auto; }

/* Product titles arrive with unbroken model strings; let them wrap rather than
   widen their column. */
.deal__title, .phead h1, .facts__row dd { overflow-wrap: anywhere; }

/* Belt and braces: nothing should ever scroll the page sideways. */
/* overflow-x:hidden on the ROOT element makes it a scroll container on mobile,
   which breaks position:fixed containment — it left the builder's modal stranded
   off-screen while its backdrop still covered the page. `clip` prevents sideways
   scroll WITHOUT establishing a scroller, and we scope it to body only. */
body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }
/* ==========================================================================
   Guides / blog. Articles are read, not scanned, so they get a measured column
   and generous leading rather than the dense card treatment deals use.
   ========================================================================== */
.posts { display: grid; gap: 0; max-width: 74ch; }
.post { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.post:first-child { padding-top: 4px; }
.post__link { text-decoration: none; }
.post__link:hover { text-decoration: none; }
.post__title { font-size: 1.25rem; margin: 0 0 6px; color: var(--ink); }
.post__link:hover .post__title { color: var(--accent); }
.post__excerpt { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; }
.post__meta { margin: 0; font-family: var(--f-mono); font-size: 11px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .04em; }

/* Article body */
.single-post .prose, .prose--article { max-width: 68ch; font-size: 16px; line-height: 1.68; }
.prose--article h2 { margin-top: 1.7em; padding-top: .2em; }
.prose--article h3 { margin-top: 1.4em; font-family: var(--f-sans); font-weight: 600; font-size: 1rem; }
.prose--article blockquote { margin: 1.4em 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--panel2); color: var(--text); }
.prose--article blockquote p:last-child { margin-bottom: 0; }
.postmeta { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .04em; margin: -6px 0 22px; }
/* Glossary — a definition list is the honest structure for this, so style the
   real <dl> rather than faking it with headings. */
.gl { margin: 0 0 2em; }
.gl dt { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--ink);
  margin-top: 14px; scroll-margin-top: 80px; }
.gl dd { margin: 3px 0 0; padding-left: 0; color: var(--text); font-size: 14.5px; }
.prose--article .gl + h2, .prose .gl + h2 { margin-top: 1.2em; }
.glnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; padding: 12px;
  background: var(--panel2); border: 1px solid var(--rule); border-radius: var(--r); }
.glnav a { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; padding: 5px 9px; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 2px; color: var(--muted); }
.glnav a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
/* ==========================================================================
   PC builder. Same datasheet language as the listings — the warnings are the
   one place colour is allowed to shout, because they carry the liability.
   ========================================================================== */
.pcb { margin: 0 0 40px; }
.pcb__warn { border: 1px solid var(--hot); background: var(--hot-sf); color: var(--text);
  border-left-width: 3px; border-radius: var(--r); padding: 13px 15px; margin-bottom: 20px;
  font-size: 14px; line-height: 1.55; }
.pcb__warn strong { color: var(--hot); }

.pcb__grid { display: grid; gap: 18px; grid-template-columns: minmax(0,1fr); align-items: start; }
@media (min-width: 900px) { .pcb__grid { grid-template-columns: minmax(0,1fr) 300px; } }
.pcb__grid > * { min-width: 0; }

.pcb__slot { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 8px; }
.pcb__slot.is-set { border-left: 3px solid var(--accent); }
.pcb__slot-h { display: flex; align-items: baseline; gap: 10px; }
.pcb__slot-n { font-family: var(--f-cond); font-weight: 700; font-size: 15px; color: var(--ink); }
.pcb__rm { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer;
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pcb__rm:hover { color: var(--hot); }
.pcb__pick { margin-top: 8px; background: var(--panel2); border: 1px dashed var(--rule-hi);
  color: var(--accent); border-radius: var(--r); padding: 9px 13px; cursor: pointer;
  font: inherit; font-weight: 500; font-size: 13.5px; }
.pcb__pick:hover { border-color: var(--accent); }
.pcb__hint { display: block; margin-top: 6px; font-size: 12px; color: var(--faint); }
.pcb__sel { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.pcb__sel a { font-size: 13.5px; color: var(--text); }
.pcb__price { font-family: var(--f-mono); font-weight: 600; font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.pcb__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pcb__chip { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted);
  background: var(--panel2); border: 1px solid var(--rule); border-radius: 2px; padding: 2px 5px; }
.pcb__chip--un { color: var(--hot); border-color: var(--hot); background: var(--hot-sf); }

.pcb__side { display: flex; flex-direction: column; gap: 12px; }
.pcb__total { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 14px; }
.pcb__total-l { display: block; font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; opacity: .7; }
.pcb__total-v { display: block; font-family: var(--f-mono); font-weight: 600; font-size: 26px;
  font-variant-numeric: tabular-nums; margin: 2px 0; }
.pcb__total-n { font-family: var(--f-mono); font-size: 11px; opacity: .65; }

.pcb__issues { display: flex; flex-direction: column; gap: 7px; }
.pcb__issue { border-radius: var(--r); padding: 10px 12px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--rule); background: var(--panel); }
.pcb__issue strong { display: block; font-family: var(--f-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.pcb__issue--error { border-color: var(--hot); background: var(--hot-sf); }
.pcb__issue--error strong { color: var(--hot); }
.pcb__issue--warn strong { color: var(--accent); }
.pcb__issue--info strong { color: var(--faint); }
.pcb__ok { border: 1px solid var(--save); background: var(--save-sf); color: var(--text);
  border-radius: var(--r); padding: 10px 12px; font-size: 13px; line-height: 1.5; }

.pcb__cant { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px;
  background: var(--panel2); }
.pcb__cant h4 { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); margin: 0 0 8px; }
.pcb__cant ul { margin: 0 0 8px; padding-left: 1.1em; }
.pcb__cant li { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.pcb__cant p { margin: 0; font-size: 12px; color: var(--faint); }

/* Shopping list */
.pcb__list { margin-top: 30px; border-top: 2px solid var(--ink); padding-top: 18px; }
.pcb__listnote { font-size: 13px; color: var(--muted); max-width: 70ch; }
.pcb__row { display: grid; grid-template-columns: 130px minmax(0,1fr) auto auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); }
.pcb__row-s { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--faint); }
.pcb__row-t { font-size: 13.5px; color: var(--text); }
.pcb__row-p { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.pcb__row-b { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pcb__row--total { border-bottom: 0; border-top: 2px solid var(--ink); font-size: 16px; }
@media (max-width: 640px) { .pcb__row { grid-template-columns: minmax(0,1fr) auto; }
  .pcb__row-s { grid-column: 1 / -1; } }

/* Picker overlay */
/* The `hidden` attribute hides via a USER-AGENT rule ([hidden]{display:none}), so any
   author `display` declaration silently defeats it. Without this the overlay below is
   permanently displayed: a fixed, full-viewport backdrop sitting on top of the page,
   swallowing every tap, with closePicker() setting an attribute that does nothing. */
.pcb__picker[hidden] { display: none !important; }
.pcb__picker { position: fixed; inset: 0; background: rgba(8,11,16,.62); z-index: 90;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; }
.pcb__picker-in { background: var(--paper); border: 1px solid var(--rule-hi); border-radius: var(--r);
  width: min(760px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.pcb__picker-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--rule); }
.pcb__picker-head h3 { margin: 0; }
.pcb__x { margin-left: auto; background: none; border: 0; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; }
.pcb__picker-body { overflow-y: auto; padding: 12px 16px 18px; }
.pcb__filt, .pcb__unhead { font-size: 12.5px; color: var(--muted); margin: 0 0 10px;
  padding: 8px 10px; background: var(--panel2); border-radius: var(--r); }
.pcb__unhead { color: var(--hot); background: var(--hot-sf); margin-top: 16px; }
.pcb__cand { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 11px; align-items: center;
  width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 9px 11px; margin-bottom: 6px; cursor: pointer; font: inherit; }
.pcb__cand:hover { border-color: var(--accent); }
.pcb__cand.is-unver { border-style: dashed; }
.pcb__cand img { width: 48px; height: 48px; object-fit: contain; background: var(--panel2); }
.pcb__noimg { display: block; width: 48px; height: 48px; background: var(--panel2); }
.pcb__cand-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcb__cand-t { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.pcb__cand-p { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink); white-space: nowrap; }
.pcb__cand-p em { display: block; font-style: normal; font-size: 10.5px; color: var(--save); text-align: right; }
.pcb__loading { color: var(--muted); padding: 20px 0; text-align: center; }
/* Modal: lock the page behind it, and give mobile a full-height sheet whose
   header (and therefore its close button) is always reachable. */
body.pcb-lock { overflow: hidden; }
.pcb__picker-head { position: sticky; top: 0; background: var(--paper); z-index: 2; }
.pcb__x { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.pcb__cancel { display: block; width: 100%; margin-top: 10px; padding: 13px; font: inherit;
  font-weight: 600; background: var(--panel2); color: var(--text); border: 1px solid var(--rule-hi);
  border-radius: var(--r); cursor: pointer; }
.pcb__cancel:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
  .pcb__picker { padding: 0; align-items: stretch; }
  .pcb__picker-in { width: 100%; max-height: 100%; height: 100%; border: 0; border-radius: 0; }
  .pcb__picker-body { flex: 1; -webkit-overflow-scrolling: touch; padding-bottom: 28px; }
  .pcb__cand { grid-template-columns: 44px minmax(0,1fr) auto; padding: 11px; }
  .pcb__cand-t { font-size: 13.5px; }
}
.pcb__list[hidden] { display: none !important; }

/* Sequential steps. The number is not decoration — it encodes the order in which
   each choice constrains the next, which is the tool's whole logic. */
.pcb__step { display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--panel2);
  border: 1px solid var(--rule); color: var(--muted); font-family: var(--f-mono);
  font-size: 11px; flex: none; }
.pcb__slot.is-set .pcb__step { background: var(--accent); border-color: var(--accent); color: var(--accent-in); }
.pcb__slot.is-next { border-color: var(--accent); }
.pcb__slot.is-next .pcb__step { border-color: var(--accent); color: var(--accent); }
.pcb__slot.is-locked { opacity: .5; background: var(--panel2); }
.pcb__locked { display: block; margin-top: 7px; font-size: 12.5px; color: var(--faint); font-style: italic; }
.pcb__skipped { display: inline-block; margin-top: 7px; font-family: var(--f-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.pcb__skip { margin: 8px 0 0 8px; background: none; border: 1px solid var(--rule);
  color: var(--muted); border-radius: var(--r); padding: 9px 13px; cursor: pointer;
  font: inherit; font-size: 13.5px; }
.pcb__skip:hover { border-color: var(--rule-hi); color: var(--ink); }
/* track-level guard: applied minmax(0,1fr) above so no grid track can be forced
   wider than its container by a long word or an intrinsically wide image. */

/* Same-part comparison. The "cheaper elsewhere" line is the most valuable thing
   on the page, so it gets the warning treatment rather than being tucked away. */
.samepart { grid-column: 1 / -1; margin-top: 6px; }
.samepart__better { border: 1px solid var(--hot); background: var(--hot-sf); border-left-width: 3px;
  border-radius: var(--r); padding: 11px 13px; font-size: 14px; margin: 0 0 10px; }
.samepart__best { border: 1px solid var(--save); background: var(--save-sf); border-left-width: 3px;
  border-radius: var(--r); padding: 11px 13px; font-size: 14px; margin: 0 0 10px; }
.samepart__rows { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.samepart__row { display: grid; grid-template-columns: minmax(0,1fr) 110px 90px; gap: 10px;
  align-items: baseline; padding: 9px 12px; border-bottom: 1px solid var(--rule);
  background: var(--panel); color: var(--text); font-size: 13.5px; }
.samepart__row:last-child { border-bottom: 0; }
.samepart__row:hover { background: var(--panel2); text-decoration: none; }
.samepart__t { overflow-wrap: anywhere; }
.samepart__m { font-size: 12px; color: var(--muted); }
.samepart__p { font-family: var(--f-mono); font-weight: 600; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--ink); }
.samepart__note { font-size: 12px; color: var(--faint); margin: 8px 0 0; }
@media (max-width: 560px) {
  .samepart__row { grid-template-columns: minmax(0,1fr) auto; }
  .samepart__m { grid-column: 1; font-size: 11.5px; }
}
/* Price-certainty flags. A negotiable or time-limited price is materially
   different from a fixed one, so it is stated on the card, not buried. */
.deal__flag { position: absolute; top: 8px; right: 8px; font-family: var(--f-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 3px 6px;
  border-radius: 2px; background: var(--panel); border: 1px solid var(--rule-hi); color: var(--muted); }
.deal__flag--auction { background: var(--hot); border-color: var(--hot); color: #fff; }
.dealview__pricerow .deal__flag { position: static; font-size: 11px; padding: 4px 7px; }
/* Revive units. Reserve the height so the iframe cannot shift layout as it loads. */
.osg-ad-wrap { margin: 0 0 20px; }
.osg-ad { margin: 0 auto; }
.osg-ad iframe { display: block; }
.osg-ad--desk { display: none; min-height: 90px; }
.osg-ad--mob  { display: block; min-height: 50px; }
@media (min-width: 760px) {
  .osg-ad--desk { display: block; }
  .osg-ad--mob  { display: none; }
}
.osg-ad--infeed { grid-column: span 1; min-height: 250px; display: flex;
  align-items: center; justify-content: center; background: var(--panel2);
  border: 1px solid var(--rule); border-radius: var(--r); }
/* ==========================================================================
   Deal media sizing — the fix for the desktop overflow.

   `width: auto` + `max-height` makes the browser size the image by HEIGHT
   first, so a tall photo scaled to 460px tall wants ~780px of width. That
   intrinsic width becomes the grid track's min-content contribution, and
   `max-width: 100%` cannot break the circularity because the percentage
   resolves against the track the image is itself defining. Result: a 1fr
   column 62px wider than its container, pushing the sidebar off-screen.

   `width: 100%` removes the intrinsic width contribution entirely — a
   percentage width does not participate in intrinsic sizing — so the track
   is free to be its fair share and the image simply fills it.
   ========================================================================== */
.dealview__media img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
}
.dealview__media { max-width: 100%; }

/* Full-width blocks below the media/buy row, now that they are siblings of
   the grid rather than spanning children. */
.facts, .samepart { max-width: 100%; }