/* ===========================================================================
   Counter — sell.catrp.com
   ===========================================================================

   The design boards write every rule inline, because a design board is one
   self-contained file you can open on its own. A site cannot work that way, so
   this is the same design expressed once: tokens at the top, then the chrome
   every page shares.

   Colours are taken from the Foundations board rather than from individual
   boards, which drifted slightly as they were built.

   Only the chrome lives here. Page components arrive as their pages are built,
   so this file stays something you can read start to finish.
   ======================================================================== */

:root {
  /* --- Surfaces ---------------------------------------------------------
     paper is the page, card is anything raised off it, sunk is a well that
     sits below it (image boxes, inset panels), stripe is a zebra row. */
  --paper:        #F4F1EA;
  --card:         #FFFDF8;
  --sunk:         #F7F3E9;
  --stripe:       #FAF7F0;

  /* --- Ink ---------------------------------------------------------------
     A four-step scale, not an arbitrary set of greys. ink is headings and
     anything you must read; ink-70 is body copy; ink-55 is secondary prose;
     ink-40 is a label or a mono caption; ink-30 is deliberately quiet — a
     struck-through "was" price, and little else. */
  --ink:          #1A1714;
  --ink-70:       #4A443C;
  --ink-55:       #5A534B;
  --ink-40:       #736B62;
  --ink-30:       #8A8176;

  /* --- Lines -------------------------------------------------------------
     Four weights. line is a card edge, line-2 a chip or divider, line-3 an
     inner rule within a card, line-4 the faintest separation that still
     reads. line-strong is for a border that must hold against a photograph. */
  --line:         #C9C1B1;
  --line-2:       #DDD6C8;
  --line-3:       #E4DDCE;
  --line-4:       #F0EADC;
  --line-strong:  #B5AB99;

  /* --- Brand -------------------------------------------------------------
     red is CATRP's, and it is load-bearing: it marks the one action on a
     screen, and it marks a boost. green is MONEY ONLY — a payout figure, a
     boosted price. Never a success message, or it stops meaning money. */
  --red:          #CB1017;
  --red-dark:     #8E1810;
  --green:        #1F6F43;

  /* --- Notice ------------------------------------------------------------
     The amber block: something the reader needs before they act. */
  --notice:       #FFF8E6;
  --notice-line:  #E0C97A;
  --notice-ink:   #4A3A12;

  /* --- Type --------------------------------------------------------------
     Gabarito only ever appears at 900 and uppercase — it is a poster face,
     not a text face. Spline Sans carries everything you read. Spline Sans
     Mono carries every number, so figures align in a column and a price never
     reflows as it changes. */
  --font-display: Gabarito, system-ui, sans-serif;
  --font-body:    "Spline Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, monospace;

  /* --- Measure -----------------------------------------------------------
     1200px content, 32px gutters on desktop; 16px gutters on a phone. The
     gutter is 16 and not 12 because a thumb reaching the edge of a 390px
     screen covers about that much. */
  --measure:      1200px;
  --gutter:       32px;
  --gutter-sm:    16px;

  /* Every interactive target is at least this tall. Non-negotiable: the
     search field is used as a barcode scanner, one item after another. */
  --tap:          44px;
}

/* ===========================================================================
   Base
   ======================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--red); }
a:hover { color: var(--red-dark); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.018em;
  line-height: 1.04;
  margin: 0 0 12px;
}
h1 { font-size: 48px; }
h2 { font-size: 28px; }
h3 { font-size: 18px; letter-spacing: -0.012em; }

img { max-width: 100%; }

/* Every figure on the site. Tabular numerals so a column of prices lines up
   and a changing total does not jitter. */
.num, .money, .money-paid, .money-was {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
/* What CATRP pays. Green, and bold enough to be the thing you see first. */
.money-paid { color: var(--green); font-weight: 700; }
/* The price before a promotion. Struck through and quiet — it is context for
   the figure next to it, not a number anyone needs to read. */
.money-was  { color: var(--ink-30); text-decoration: line-through; font-size: 11px; }

/* A keyboard user must always be able to see where they are. */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===========================================================================
   Page primitives

   Added as the first content page needed them, not invented up front. Each one
   appears on at least two boards; anything that appears once stays in the page
   that uses it.
   ======================================================================== */

/* A short red label above a heading — says what KIND of page this is before
   the heading says which one. */
.eyebrow {
  margin: 0 0 9px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); font-weight: 600;
}

/* The trail above an h1. Four pages had a byte-identical copy of this in their
   own stylesheet — browse, categories, item and the condition guide — which is
   two more than this file's own rule for being a primitive, so it lives here
   now and the copies are gone. The 22px gap BELOW it is the page's, not the
   trail's: .browse-head and .guide h1 both set it, because what follows the
   crumbs differs per page (a head block, a heading, an eyebrow). */
.crumbs ol {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-55);
}
.crumbs a { color: var(--ink-55); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* The sentence under an h1. Wider than body copy and darker, but capped so
   the eye does not lose the line it is on over the return sweep.
   
   READ THE UNIT BEFORE TUNING THIS. `ch` is the advance width of the "0"
   glyph, and Spline Sans sets tabular figures, so its "0" is 10px where the
   average character in a real sentence here measures 6.95px. 66ch therefore
   buys about 92 characters a line, not 66 — already at the long end of the
   45-75 that this cap exists to stay inside, so the honest direction to move
   it is DOWN. A true 65 characters would be about 46ch.
   
   Measured on /boosts at 1440px: 640px wide, 92 characters on the longest
   line. Not guessed from the number in the declaration. */
.lede {
  margin: 0 0 26px;
  font-size: 17px; line-height: 1.55;
  color: var(--ink-70); max-width: 66ch;
}

.prose { max-width: 70ch; }
.prose p { margin: 0 0 14px; color: var(--ink-70); }

/* Raised off the paper. panel is the emphatic one (2px, for something that
   matters); panel-soft is the everyday card. */
.panel      { background: var(--card); border: 2px solid var(--ink); padding: 22px 24px; }
.panel-soft { background: var(--card); border: 1px solid var(--line); padding: 18px 20px; }

/* Amber: something the reader needs BEFORE they act, not after. The red left
   edge is what stops it reading as decoration. */
.notice {
  background: var(--notice);
  border: 1px solid var(--notice-line);
  border-left: 4px solid var(--red);
  padding: 15px 17px;
  color: var(--notice-ink);
}
.notice p { margin: 0 0 10px; color: var(--notice-ink); }
.notice p:last-child { margin-bottom: 0; }
.notice strong { font-weight: 700; }

/* The hidden attribute must win.
   The browser's own rule is `[hidden] { display: none }`, which any class
   that sets a display loses to on specificity — so a card styled
   `.plat { display: flex }` stayed on screen with hidden="" set on it, and
   the categories filter appeared to do nothing but change a count. It is
   never right for an element to be marked hidden and still render, so this
   is one of the few places !important earns its keep. */
[hidden] { display: none !important; }

/* One filled button per screen — it is the thing to do next. Everything else
   that is clickable but not the point is a ghost. */
.cta, .cta-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  /* 1px off the top (Ken, 2026-11-24: "they're slightly off across the
     board"). The label does sit high: measured off the rendered pixels at
     4x, a .cta has 16.75px of red above the glyphs and 17.75px below, and a
     .cta-ghost 14.75 above against 17.75 below.

     It is a HALF pixel of correction, not a whole one: box-sizing is
     border-box and min-height holds the box at 44px, so padding-top shrinks
     the content box from the top and align-items: center puts half of that
     back. 1px and 2px here render identically once the subpixel position is
     rounded; 1px is the one that says what was meant.

     The box does not grow -- 44px before and after -- so nothing reflows.
     Two rules in shipments.css use the padding SHORTHAND and would reset
     this to zero; both carry the same 1px. */
  min-height: var(--tap); padding: 1px 22px 0;
  text-decoration: none; font-weight: 600; font-size: 15px;
  /* These are for the <button> case. Both classes started life on <a>, where
     the UA adds nothing; on a button it adds a border, a grey background and
     a default cursor, which is why the first one to appear on a form came out
     with a dark outline round it. */
  border: 0; cursor: pointer; appearance: none; text-align: center;
  font-family: inherit; line-height: 1;
}
.cta {
  background: var(--red); color: #FFFFFF;
  font-family: var(--font-display); font-weight: 900;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.cta:hover { background: var(--red-dark); color: #FFFFFF; }
.cta-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.cta-ghost:hover { background: var(--ink); color: var(--paper); }

/* ===========================================================================
   Utility bar — the promise, and the way in
   ======================================================================== */

.u-bar {
  background: var(--red);
  color: #FFFFFF;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.u-bar .wrap {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding-top: 9px; padding-bottom: 9px;
}
.u-bar a { color: #FFFFFF; font-weight: 600; }
.u-bar a:hover { color: #FFFFFF; }
.u-bar .u-signup { text-decoration: underline; }
/* The links, which used to carry this as an inline style on the <span>. */
.u-links { display: flex; gap: 20px; align-items: center; }
/* The short strapline is the phone's; it only appears below the breakpoint. */

/* ===========================================================================
   Masthead — logo, search, shipment

   Sticky on a phone and nowhere else. Customers use the search field as a
   barcode scanner, scanning one item after another, so on a phone it has to
   stay put while the page under it moves. On a desktop the field is already
   in view and pinning it only costs vertical space.
   ======================================================================== */

/*
 * ANCHORS HAVE TO CLEAR THE PINNED MASTHEAD (Ken, 2026-11-23: "clicking
 * 'send condition photos' scrolls too far, so the photo panel is hidden by
 * the top bar").
 *
 * .masthead is position: sticky, top: 0 — so the browser scrolls a #target to
 * y=0 and the bar then sits on top of it. scroll-padding-top on the scroll
 * container is the fix, and it is one line here rather than scroll-margin-top
 * on each target, because every in-page anchor on this site has the same
 * problem and none of them had an offset.
 *
 * ~85px is the bar: 16px padding, a 132px-wide logo whose source is 706x277
 * so it renders about 52px tall, 16px padding and the border. 100px leaves a
 * little air above whatever was clicked, so it reads as "here it is" rather
 * than "flush under the bar".
 *
 * Under 900px the masthead is TALLER, not shorter — the search field moves to
 * its own row — hence the larger value in that block.
 *
 * collection-photos.js overrides this with the bar's measured height where it
 * runs. This is the floor, and what a visitor with no scripting gets.
 */
html { scroll-padding-top: 100px; }

.masthead {
  /* card, not paper: this is the site's white, and the token means "anything
     raised off the page", which a pinned masthead is. It also separates the
     logo-and-search row from the nav row below it, which stays paper — the
     two were the same colour and read as one undifferentiated band. */
  background: var(--card);
  border-bottom: 1px solid var(--line-2);
  /* Pinned, as it already was on a phone and for the same reason: the field
     doubles as a barcode scanner and people use it to add one thing after
     another, so it has to stay put. It also keeps the shipment control — and
     the confirmation that hangs off it — on screen when something is added
     from the bottom of a long page, which is where most adds happen.

     The utility bar and the nav row scroll away underneath it; only this
     sticks, so the pinned strip stays about 76px rather than half the window. */
  position: sticky; top: 0; z-index: 40;

  /* Only the colours and the shadow move. Transitioning anything that affects
     layout in a bar that pins mid-scroll would shift the page under the
     reader; a box-shadow is painted outside the box and costs no layout. */
  transition: background-color 220ms ease, border-color 220ms ease,
              box-shadow 220ms ease;
}

/* ---------------------------------------------------------------------------
   PINNED: THE MASTHEAD INVERTS

   Unpinned it is --card on --paper, which works because the nav row and the
   utility bar sit above and below giving it edges. Pinned over scrolling
   content those edges are gone and two near-whites with a 1px line between
   them read as washed out rather than as a layer.

   Red is the one colour on the site that cannot be mistaken for the page, and
   it is already the brand's. The class is set by assets/js/masthead.js --
   there is no CSS selector for "this sticky element is stuck".
   --------------------------------------------------------------------------- */
.masthead-sentinel {
  /* 1px, then pulled straight back out again, so watching for it costs the
     layout nothing. */
  height: 1px; margin-bottom: -1px;
}

.masthead.is-stuck {
  background: var(--red);
  /* Black, not --ink and not red: the bar needs a hard bottom edge to sit ON
     the page rather than bleed into it, and pure black is what the shadow
     below is made of, so the crisp line and its falloff are one colour.
     Unpinned the border stays --line-2 -- there it divides two near-whites
     and a black rule would be a scar across the page.

     The x-offset is inert here and that is fine: the bar is full-bleed, so
     both of its vertical edges are off-screen and only the y component can
     be seen. Do not copy this value onto anything narrower than the window
     expecting symmetry. */
  border-bottom-color: #000;
  box-shadow: 5px 5px 15px 5px rgba(0, 0, 0, 0.2);
}

/* The mark is a single flat red on transparency -- checked, 100% of its
   opaque pixels -- so brightness(0) flattens it and invert(1) lifts it to
   white, with the cut-out intact. A one-colour logo is the only kind this
   trick is safe on, which is why it is written down. */
.masthead-logo img { transition: filter 220ms ease; }
.masthead.is-stuck .masthead-logo img { filter: brightness(0) invert(1); }

/* The box keeps its white fill, and its outline goes white so it reads as one
   clean panel rather than a muddy ink line on red. */
.masthead.is-stuck .search-box { border-color: var(--card); }

/* THE SEARCH BUTTON HAS TO LEAVE RED.
   It is the last thing inside the box, so with a white outline its red sits
   directly against the red bar and the two merge -- the button loses its edge
   and reads as the word SEARCH floating on the masthead. White is no good
   either: it is on a white box. Ink is the only value that separates from
   both, and it pairs the button with Shipment, which is already ink. */
.masthead.is-stuck .search-go { background: var(--ink); }
.masthead.is-stuck .search-go:hover { background: #2B2621; }
/* The focus ring is a red glow, which on red is no ring at all. */
.masthead.is-stuck .search-box:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55); }

@media (prefers-reduced-motion: reduce) {
  .masthead, .masthead-logo img { transition: none; }
}

/* The panel and its toast hang off the masthead, so they ride along with it.
   Above the page, below nothing else — there are no other layers.

   THAT SENTENCE STOPPED BEING TRUE when the phone sheet got a scrim. See the
   note beside .ship-scrim in the 900px block: because this rule gives the
   wrap a z-index, the wrap is a STACKING CONTEXT, and the panel's own
   z-index: 60 is spent inside it rather than against anything outside. What
   competes with the scrim is this 41, not that 60. */
.masthead .shipment-wrap { z-index: 41; }
.masthead .wrap {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
  padding-top: 16px; padding-bottom: 16px;
}
.masthead-logo { flex: 0 0 auto; display: block; line-height: 0; }
.masthead-logo img { display: block; width: 132px; height: auto; }

.search { flex: 999 1 420px; min-width: 0; position: relative; }
.search-box {
  display: flex; flex-wrap: nowrap;
  border: 2px solid var(--ink);
  background: var(--card);
}
.search-box:focus-within { box-shadow: 0 0 0 3px rgba(203, 16, 23, 0.28); }
.search-input {
  flex: 999 1 0; min-width: 0;
  border: 0; background: transparent;
  padding: 13px 16px;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
}
.search-input:focus { outline: none; }   /* the ring is on .search-box */
.search-scan, .search-go {
  flex: 0 0 auto; border: 0; cursor: pointer; min-height: var(--tap);
  display: flex; align-items: center; justify-content: center;
}
.search-scan {
  width: 52px; background: var(--card); color: var(--ink);
  border-left: 1px solid var(--line-2);
}
.search-go {
  background: var(--red); color: #FFFFFF; padding: 0 24px;
  font-family: var(--font-display); font-weight: 900; font-size: 15px;
  letter-spacing: 0.02em; text-transform: uppercase;
}

.shipment-link {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--paper); text-decoration: none;
  padding: 11px 16px; min-height: var(--tap);
  font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms, box-shadow 150ms, transform 80ms;
}
.shipment-link:hover { background: #2B2621; color: var(--paper); }
/* A real press. 80ms and one pixel — enough to feel, too quick to notice. */
.shipment-link:active { transform: translateY(1px); }
.shipment-link:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* Open state: the ring the design board draws round it, so the button says
   which of its two jobs it is currently doing. */
.shipment-link[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--red); }

/* The count changes under the pointer more often than anything else on the
   page, so it gets its own beat when it does. */
.shipment-count { transition: transform 160ms; }
.ship-bump .shipment-count { transform: scale(1.35); }
.shipment-link:hover { color: var(--paper); }
.shipment-count {
  background: var(--red); color: #FFFFFF;
  font-family: var(--font-mono); font-size: 11px; padding: 1px 7px;
}

/* ===========================================================================
   Primary nav
   ======================================================================== */

.nav-main {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.nav-main .wrap { display: flex; flex-wrap: wrap; gap: 26px; }
.nav-main a {
  color: var(--ink-70); text-decoration: none;
  font-weight: 500; font-size: 15px; padding: 13px 0;
}
.nav-main a:hover { color: var(--ink); }
.nav-main a[aria-current="page"] {
  color: var(--ink); font-weight: 600;
  border-bottom: 3px solid var(--red); margin-bottom: -2px;
}

/* ===========================================================================
   Footer
   ======================================================================== */

/* See the note at the top of inc/footer.php for how this one was picked. */
.site-footer {
  background: var(--ink);
  color: var(--line);
  margin-top: 56px;
}
.site-footer a { color: var(--line); text-decoration: none; font-size: 15px; }
.site-footer a:hover { color: #FFFFFF; }

/* brightness(0) takes every opaque pixel to black, invert(1) takes it to
   white, and alpha is left alone — so one logo file serves the red masthead
   and the dark footer and the two can never drift apart. */
.foot-logo { display: block; width: 132px; height: auto; filter: brightness(0) invert(1); }
.foot-strap { margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-30); }

/* The group heading the old footer never had. Mono and tracked, the same
   treatment every other label on the site gets. */
.foot-k {
  margin: 0 0 12px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-40);
}
.foot-nav { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }

.foot-base { border-top: 1px solid rgba(255, 255, 255, 0.11); }
.foot-base .wrap {
  display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between;
  padding-top: 16px; padding-bottom: 18px;
}
.foot-base p { margin: 0; font-size: 12.5px; color: var(--ink-40); }

/* Brand, then the three groups. The brand column is wider because it holds a
   logo and two lines of prose against single words.

   Chosen from three that were built side by side (columns / band / centred)
   and the other two are deleted rather than left behind a flag, which is what
   building them over one markup was for. */
.foot-in {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
  padding-top: 44px; padding-bottom: 36px;
}

/* ===========================================================================
   Phone

   One breakpoint, at 900px. The boards are drawn at 1360 and 390, and
   everything between those two behaves like one or the other — there is no
   third layout to design, so there is no second breakpoint to maintain.
   ======================================================================== */

@media (max-width: 900px) {
  :root { --gutter: var(--gutter-sm); }

  /* All three variants collapse to the same stack. At 390px there is one
     column whichever desktop layout was chosen, so three phone answers would
     be three ways to write the same thing. */
  .site-footer .foot-in {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 26px; text-align: left;
    padding-top: 30px; padding-bottom: 26px;
  }
  .site-footer .foot-logo { width: 120px; margin: 0; }
  .site-footer .foot-brand { display: block; }
  .site-footer .foot-k { display: block; margin-bottom: 9px; }
  .site-footer .foot-nav { flex-direction: column; align-items: flex-start; gap: 9px; }
  .foot-base .wrap { justify-content: flex-start; text-align: left; }
  /* The one line that earns its place on a phone is the copyright. */
  .foot-base-note { display: none; }

  h1 { font-size: 28px; letter-spacing: -0.016em; }
  h2 { font-size: 22px; }

  /* The 2002 history and Create account go; both survive in the footer. The
     14-day promise stays, in its shorter form. */
  /* The strap stays on a phone now — there is only one of them, and
     "Integrity and excellence since 2002" fits beside a Log in link at 11px.
     Create account is still the thing that goes. */
  /* "Create account" only, and never the logout.
     This was `.u-bar .u-signup`, which is the class on BOTH that link and the
     logged-in "Log out" — so signing in on anything under 900px left "Account"
     alone and no way out of the account at all. Its own hook now, on the one
     link that is genuinely optional here: somebody who needs to make an
     account can do it from the Log in page, and somebody who wants to sign out
     has nowhere else to go. */
  .u-bar .u-bar-wide { display: none; }
  .u-bar .wrap { padding-top: 7px; padding-bottom: 7px; font-size: 11px; }

  /* Taller here: the search field takes a row of its own below the logo. */
  html { scroll-padding-top: 150px; }

  .masthead {
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid var(--line);
    /* The soft lift it has at rest. Once it pins, .is-stuck's heavier shadow
       takes over on specificity, which is the right way round: white bar
       floating, red bar cast. */
    box-shadow: 0 6px 14px rgba(26, 23, 20, 0.10);
  }
  .masthead .wrap {
    gap: 11px; padding-top: 12px; padding-bottom: 12px;
    /* logo and shipment share a line; search takes the full width below */
    justify-content: space-between;
  }
  .masthead-logo img { width: 104px; }
  .search { flex: 1 0 100%; order: 3; }
  .search-input { padding: 0 13px; min-height: 46px; }
  .search-scan { width: 48px; min-height: 46px; }
  .search-go { padding: 0 15px; font-size: 13px; min-height: 46px; }
  .shipment-link { padding: 0 13px; font-size: 13px; }

  /* Sideways rather than a hamburger: every destination stays one tap away,
     and a hamburger on a site with six links hides them for no reason. */
  .nav-main .wrap {
    flex-wrap: nowrap; overflow-x: auto; white-space: nowrap;
    gap: 20px; scrollbar-width: none;
  }
  .nav-main .wrap::-webkit-scrollbar { height: 0; }
  .nav-main a { font-size: 13px; }

  .site-footer .wrap { gap: 18px; padding-top: 26px; padding-bottom: 30px; }
  .site-footer a { font-size: 13px; padding: 6px 0; }
}

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

/* ===========================================================================
   The shipment control and its pop-out
   ---------------------------------------------------------------------------
   Chrome, so it lives here rather than with a page. A panel hanging off the
   masthead button on desktop; a sheet across the bottom of a phone, where a
   430px panel anchored to a button is most of the screen anyway and anchoring
   it buys nothing.
   =========================================================================== */

.shipment-wrap { position: relative; flex: 0 0 auto; }

@keyframes ship-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.ship-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  animation: ship-in 160ms ease-out;
  width: 430px; max-width: calc(100vw - 32px);
  background: var(--card); border: 2px solid var(--ink);
  box-shadow: 0 16px 30px rgba(26, 23, 20, 0.20);
  text-align: left;
}

.ship-panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line-3);
  display: flex; gap: 12px; align-items: baseline;
}
.ship-panel-head p {
  margin: 0; flex: 999 1 auto;
  font-family: var(--font-display); font-weight: 900; font-size: 15px;
  letter-spacing: -0.008em; text-transform: uppercase;
}
.ship-panel-head .num { font-size: 11px; color: var(--ink-55); }
/* Desktop closes by clicking away; the sheet needs a control. */
.ship-close { display: none; }

.ship-rows { max-height: 400px; overflow-y: auto; }
.ship-row { padding: 15px 18px; display: flex; gap: 14px; align-items: flex-start; }
.ship-row + .ship-row { border-top: 1px solid var(--line-4); }
.ship-row-main { flex: 999 1 auto; min-width: 0; }
.ship-row-side { flex: 0 0 auto; text-align: right; }

/* ship-ROW-to. It was .ship-to, which shipment.css also defines -- as a card
   with a 2px border and a 6px red top -- so on /shipment, and only there,
   this two-word label in the masthead panel came out inside a bordered box.
   This panel is shared by every page, so its class names have to be ones no
   page stylesheet would reach for; the siblings are already ship-row-main
   and ship-row-side. */
.ship-row-to {
  margin: 0 0 3px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-40);
}
.ship-partner {
  margin: 0 0 5px; font-family: var(--font-display); font-weight: 900;
  font-size: 18px; line-height: 1.15; letter-spacing: -0.012em;
}
.ship-sum { margin: 0; font-size: 13px; color: var(--ink-70); }
.ship-sum strong { color: var(--green); font-weight: 700; }
.ship-dot { color: var(--line); }
.ship-lock {
  margin: 5px 0 0; display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-55);
}
.ship-order { margin: 0 0 7px; font-size: 11px; color: var(--ink-40); }

.ship-go {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); color: #FFFFFF; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 9px 13px;
  min-height: 40px; white-space: nowrap; transition: background-color 150ms;
}
.ship-go:hover { background: var(--red-dark); color: #FFFFFF; }
.ship-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ship-foot { padding: 13px 18px; border-top: 2px solid var(--ink); background: var(--sunk); }
.ship-foot > div { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.ship-foot .num { font-size: 11px; letter-spacing: 0.04em; color: var(--ink-55); }
.ship-foot .ship-total { font-size: 18px; font-weight: 700; color: var(--green); letter-spacing: 0; }
.ship-foot p { margin: 6px 0 0; font-size: 11px; line-height: 1.45; color: var(--ink-55); }

.ship-empty { padding: 26px 18px; text-align: center; }
.ship-empty-head {
  margin: 0 0 4px; font-family: var(--font-display); font-weight: 900;
  font-size: 18px; text-transform: uppercase; letter-spacing: -0.008em;
}
.ship-empty p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--ink-55); }

/* --- The confirmation ------------------------------------------------------
   Shown after an add while the panel stays shut, so the page does not jump
   under somebody who is halfway through adding a second thing. */

.ship-toast {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 55;
  animation: ship-in 160ms ease-out;
  margin: 0; padding: 11px 17px;
  background: var(--ink); color: var(--paper);
  display: flex; gap: 11px; align-items: center; white-space: nowrap;
}
.ship-toast svg { stroke: #7BD6A0; flex: 0 0 auto; }
.ship-toast span { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; }
/* The little pointer up at the button it belongs to. */
.ship-toast::before {
  content: ""; position: absolute; top: -7px; right: 34px;
  width: 13px; height: 13px; background: var(--ink); transform: rotate(45deg);
}

/* The toast and the search panel both hang off the masthead, and adding from
   a search result opens the toast while the panel is still up — so by default
   it lands squarely on the panel's header strip. Dropped below that strip
   instead: the right-hand side of a result row is empty in most results, and
   the header text is not. */
body.search-open .ship-toast { top: calc(100% + 56px); }

/* ---------------------------------------------------------------------------
   The barcode camera
   A sheet over everything, because a viewfinder tucked into a dropdown is a
   viewfinder nobody can aim. Fixed rather than absolute so it does not move
   with the masthead while somebody is lining a box up.
   --------------------------------------------------------------------------- */
.scan-sheet {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(26, 23, 20, 0.86);
  display: flex; justify-content: center;
  padding: var(--gutter-sm);
  /*
   * TOP-ALIGNED AND SCROLLABLE (Ken, 2026-11-23: on an iPhone the photo
   * button "is then hidden by the full-screen scan window").
   *
   * It was align-items: center with no overflow. An iPhone's rear camera is
   * portrait, the video is sized from its WIDTH and so comes out taller than
   * the screen, and a centred flex child that overflows spills past BOTH
   * edges with nothing able to reach it — the button off the bottom, and the
   * header on its way off the top.
   *
   * Not fixed by constraining the video: html5-qrcode computes its scan
   * region from the video's rendered size, so cropping or letterboxing it
   * would move the part of the frame being decoded away from the part being
   * aimed at. The video keeps its own geometry and the SHEET gives way.
   */
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /*
   * 100svh, not inset: 0 (Ken, 2026-11-23: it "displays outside the screen",
   * by about 40px).
   *
   * A fixed element with inset: 0 on iOS Safari is sized to the LARGE
   * viewport — the one you get with the toolbars hidden — so the bottom of it
   * lives behind the browser's bottom bar whether that bar is showing or not.
   * 40px is about exactly what that bar costs.
   *
   * svh is the small viewport: the height that is visible with the chrome
   * SHOWN. It is the conservative one of the three, which is what a control
   * that has to be reachable wants — dvh would move the footer while the
   * toolbar animates in and out.
   */
  height: 100vh;      /* anything that has not heard of svh */
  height: 100svh;
}
.scan-sheet[hidden] { display: none; }
/* As wide as the screen will give.
   html5-qrcode decodes a canvas sized from the DISPLAYED width of the video,
   not from the camera — so the viewfinder's width on screen IS the scanner's
   resolution. At 480px a barcode filling a third of the frame arrived at the
   decoder about one pixel per bar, and nothing ever decoded. */
.scan-inner {
  width: 100%; max-width: 900px;
  background: var(--card);
  border: 2px solid var(--ink);
}
/* The library writes an inline width on the video it injects; this is the one
   place where overriding an inline style with !important is the right answer,
   because that number is the thing being fixed. */
#scanReader video { width: 100% !important; height: auto !important; }
.scan-head {
  margin: 0;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-3);
  font-size: 15px; font-weight: 600;
}
/*
 * The note and the photo button, pinned to the bottom of the screen.
 *
 * sticky rather than fixed, so it stays inside the sheet's own box and keeps
 * its width and border without being positioned by hand. While the viewfinder
 * is shorter than the screen this does nothing at all and the block simply
 * sits under it; once the video is taller — which on a phone it always is —
 * the controls stay on screen and the camera scrolls behind them.
 *
 * The background is opaque for the same reason it is sticky: a live camera
 * passing under translucent text is unreadable.
 */
.scan-foot {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line-3);
  /* And the home indicator on top of that, on a phone without a home button.
     Zero everywhere else, so it costs nothing to ask. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.scan-close {
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 7px 13px; min-height: 40px; cursor: pointer;
}
.scan-close:hover { background: var(--ink); color: var(--paper); }
/* The library injects a <video> that fills this. A min-height stops the sheet
   collapsing to nothing in the moment between opening and the camera
   starting, which otherwise reads as a dialog that failed to open. */
.scan-reader { min-height: 260px; background: var(--ink); }
.scan-reader canvas { display: none; }
.scan-reader video { display: block; width: 100%; height: auto; }
.scan-note { margin: 0; padding: 11px 14px; font-size: 13px; color: var(--ink-55); }
body.scan-open { overflow: hidden; }

@media (max-width: 900px) {
  /* Full bleed. Every pixel of width is decoder resolution — the gutter and
     the border were costing about 10% of it, which is 10% of the detail the
     thing has to work with. */
  .scan-sheet { padding: 0; }
  .scan-inner {
    max-width: none;
    border: 0;
    display: flex; flex-direction: column;
    /*
     * WHAT ACTUALLY HID THE PHOTO BUTTON ON A PHONE.
     *
     * This was `align-items: stretch` on the sheet with
     * `justify-content: center` here — so the inner box was pinned to exactly
     * the viewport height and its children were centred inside it. An iPhone's
     * rear camera is portrait, the video is as tall as its width makes it, and
     * the children came to more than the box: centred, they spilled past the
     * top AND the bottom at once, and because the BOX still fitted the sheet,
     * nothing had anything to scroll.
     *
     * Content-sized and top-aligned now, with the sheet scrolling (see
     * .scan-sheet) and the note and button pinned by .scan-foot. min-height
     * keeps it filling the screen on the short-video case, which is what
     * stretch was there for.
     */
    min-height: 100%;
  }
  .scan-reader { min-height: 0; }
}

.ship-scrim { display: none; }

@media (max-width: 900px) {
  /* A sheet, not a panel. It is sized by its content — an empty sheet filling
     the screen is a lot of ceremony for one sentence. */
  .ship-panel {
    position: fixed; inset: auto 0 0 0; width: auto; max-width: none;
    max-height: 80vh; border: 0; border-top: 2px solid var(--ink);
    box-shadow: 0 -12px 30px rgba(26, 23, 20, 0.28);
    display: flex; flex-direction: column;
  }
  .ship-panel[hidden] { display: none !important; }

  .ship-panel-head { flex: 0 0 auto; padding: 11px 16px 12px; }
  .ship-panel-head p { font-size: 22px; }
  .ship-close {
    display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--ink);
    width: 44px; height: 44px; margin: -10px -10px -10px 0; cursor: pointer;
  }
  .ship-close:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

  .ship-rows { flex: 999 1 auto; min-height: 0; max-height: none; }
  /* Stacked: the Complete button is the point of the row and wants the width. */
  .ship-row { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-4); }
  .ship-row + .ship-row { border-top: 0; }
  .ship-row-side { text-align: left; }
  .ship-order { margin: 0 0 9px; }
  .ship-go { display: flex; justify-content: center; min-height: 48px; font-weight: 700; }

  .ship-foot { flex: 0 0 auto; padding: 12px 16px 15px; }

  .ship-scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(26, 23, 20, 0.52);
  }
  .ship-scrim[hidden] { display: none !important; }

  /*
   * THE SHEET HAS TO OUT-RANK ITS OWN SCRIM (Ken, 2026-11-25: on a phone the
   * open shipments panel "appears behind a fader window, causing the buttons
   * to be unclickable").
   *
   * .ship-panel already says z-index: 60 and it was never going to help. The
   * panel lives inside .shipment-wrap, which carries z-index: 41 and is
   * therefore a stacking context, so 60 only orders the panel against its own
   * siblings. Out here the thing being compared is the WRAP's 41 against the
   * scrim's 50, and 41 loses -- so the scrim painted over the sheet and
   * swallowed every tap meant for it.
   *
   * Desktop never showed it because .ship-scrim is display: none there.
   *
   * 55 rather than raising .ship-panel, because the panel's number is not the
   * one being read. Everything else in the masthead stays below 50 and is
   * still dimmed, which is what the scrim is for; only the sheet and the
   * control it hangs off come forward.
   */
  .masthead .shipment-wrap { z-index: 55; }

  /* Across the bottom above the sheet's place, rather than hanging off a
     button that is only 44px tall. */
  .ship-toast {
    position: fixed; inset: auto 16px 16px 16px; z-index: 55;
    justify-content: center; white-space: normal; text-align: center;
  }
  .ship-toast::before { display: none; }
}

/* Nobody who has asked the operating system for less motion gets any of the
   above. The states still change; they just stop moving. */
@media (prefers-reduced-motion: reduce) {
  .ship-panel, .ship-toast { animation: none; }
  .shipment-link, .shipment-count { transition: none; }
  .shipment-link:active { transform: none; }
  .ship-bump .shipment-count { transform: none; }
}


/* ===========================================================================
   Search: the clear button, and the type-ahead panel
   ---------------------------------------------------------------------------
   Here rather than in search.css because the field is in every masthead, so
   the panel can open on any page on the site — including ones that never load
   the results stylesheet.
   =========================================================================== */

/* Chrome draws its own clear cross inside a type=search field, so without
   this there are two of them side by side. Ours is kept because the native
   one is invisible until focus, is not styled with anything else in the bar,
   and does not exist in Firefox at all. */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.search-clear {
  flex: 0 0 auto;
  width: 40px; min-height: 44px;
  border: 0; border-left: 1px solid var(--line-2);
  background: var(--card); color: var(--ink-55);
  font-size: 19px; line-height: 1;
  cursor: pointer;
}
.search-clear:hover { color: var(--ink); }

/* The panel hangs off the field; the field does not move and does not lose
   focus. Somebody scanning a shelf scans, adds, and scans the next one, and
   a page that navigates or a control that steals focus ends that. */
.search-panel {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 1;
  max-width: 760px;
  max-height: min(70vh, 620px);
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 0 22px 40px rgba(26, 23, 20, 0.30);
  /* The ROWS scroll; the head and the foot do not. Scrolling the whole panel
     put "See all 276" and the barcode hint below the fold of a box that was
     already a dropdown — reachable only by scrolling inside a thing most
     people would not think to scroll. */
  display: flex; flex-direction: column;
}
.search-panel[hidden] { display: none; }
.sp-rows { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* Dims the page, never the masthead: the field being searched from has to
   stay bright, and the nav under it is the way out. z-index sits below the
   masthead's 40 for exactly that reason. */
body.search-open::after {
  content: "";
  position: fixed; inset: 0; z-index: 35;
  background: rgba(26, 23, 20, 0.38);
}

.sp-head, .sp-foot {
  margin: 0;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--paper);
  font-size: 13px; color: var(--ink-55);
}
.sp-head { border-bottom: 1px solid var(--line-3); flex: 0 0 auto; }
.sp-foot { border-top: 1px solid var(--line-3); flex: 0 0 auto; }
.sp-count {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-40);
}
.sp-head kbd {
  font-family: var(--font-mono); font-size: 11px;
  border: 1px solid var(--line); background: var(--card);
  padding: 2px 6px;
}
.sp-foot a { color: var(--red-dark); font-weight: 600; white-space: nowrap; }
.sp-note { margin: 0; padding: 16px 18px; font-size: 14px; color: var(--ink-70); }
.sp-note a { color: var(--red-dark); font-weight: 600; }

@media (max-width: 900px) {
  /* On a phone the panel is the page, not a floating layer: a dropdown over a
     390px viewport leaves nothing useful behind it, and the dim would just be
     a black screen. It breaks out to the full width and scrolls. */
  .search-panel {
    left: calc(var(--gutter-sm) * -1);
    right: calc(var(--gutter-sm) * -1);
    top: calc(100% + 8px);
    max-width: none;
    max-height: calc(100vh - 190px);
    border-left: 0; border-right: 0;
  }
  body.search-open::after { display: none; }
  .sp-head, .sp-foot { padding: 10px 16px; }
  .sp-hint { display: none; }
}

/* ===========================================================================
   One result row — shared by the page and the panel
   ---------------------------------------------------------------------------
   Defined here and in counter.css by the same names, because the panel can
   open on a page that never loads this file. Keep the two in step; the panel
   copy is the authority since it is the one that is always present.
   =========================================================================== */

.sr {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-3);
}
.sr:last-child { border-bottom: 0; }

.sr-art {
  flex: 0 0 auto;
  display: block; width: 58px; height: 58px;
  background: var(--sunk); border: 1px solid var(--line-3);
  overflow: hidden;
}
.sr-art img { display: block; width: 100%; height: 100%; object-fit: contain; }

.sr-main { flex: 999 1 auto; min-width: 0; }

.sr-head {
  margin: 0 0 8px;
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
}
.sr-title {
  font-size: 15px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.sr-title:hover { border-bottom-color: var(--ink); }
.sr-plat {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-70);
  border: 1px solid var(--line-2); background: var(--paper);
  padding: 2px 7px;
}
.sr-none { margin: 0; font-size: 13px; color: var(--ink-40); }

.sr-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.sr-chip {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line);
  background: var(--card);
}
.sr-chip-body { display: flex; flex-direction: column; justify-content: center; padding: 5px 9px; }
.sr-chip-k {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-40); line-height: 1.3;
}
.sr-chip-p { display: flex; gap: 6px; align-items: baseline; }
.sr-chip-p .num { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.sr-chip-p s { font-family: var(--font-mono); font-size: 11px; color: var(--ink-30); }
/* Green is money, and only money. A boosted figure is the one the seller
   actually gets, so it is the one that gets the colour and the weight. */
.sr-now { font-weight: 700; color: var(--green); }

.sr-add {
  flex: 0 0 auto;
  width: 30px; min-height: 38px;
  border: 0; border-left: 1px solid var(--line-2);
  background: var(--paper); color: var(--red);
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.sr-add:hover { background: var(--red); color: #FFFFFF; }
.sr-add.is-on { background: var(--ink); color: var(--paper); }
.sr-add.is-busy { opacity: 0.5; }
.sr-add.is-bad { background: var(--red); color: #FFFFFF; }

@media (max-width: 900px) {
  .sr { padding: 12px 13px; gap: 12px; }
  /* The + is a thumb target on a phone, not a mouse one. */
  .sr-add { width: 38px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .sr-add { transition: none; }
}

/* ===========================================================================
   By category — the masthead panel
   ---------------------------------------------------------------------------
   Lives here rather than in its own stylesheet because the masthead is on
   every page, and a second request for ~2KB of CSS on every page costs more
   than the bytes do.

   The panel is a full-width band under the nav, not a dropdown anchored to the
   nav item: six columns of platforms will not fit under one 90px word, and a
   band can use the whole measure without any positioning arithmetic.
   ======================================================================== */

/* The nav item, while its panel is open. The red rule sits on the nav's own
   2px bottom border, which is why the negative margin is -2px and not -3px. */
.nav-main a#megaToggle {
  display: inline-flex; align-items: center; gap: 7px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.nav-main a#megaToggle[aria-expanded="true"] {
  border-bottom-color: var(--red);
  color: var(--ink);
}
.mega-caret { transition: transform 150ms ease; }
@media (prefers-reduced-motion: reduce) { .mega-caret { transition: none; } }
.nav-main a#megaToggle[aria-expanded="true"] .mega-caret { transform: rotate(180deg); }

.mega {
  background: var(--card);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 14px 22px rgba(26, 23, 20, 0.14);
}
.mega-inner { padding-top: 26px; padding-bottom: 22px; }

.mega-cols {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}
.mega-col { min-width: 0; }

.mega-fam {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red);
}

.mega-list { margin: 0; padding: 0; list-style: none; }

/* The hairline is on the row, not the link, so a platform and its chips sit
   inside one bounded block rather than being split by a rule through them.

   It separates rows and so it does not belong after the last one: a rule
   with nothing under it is not a separator, it is a box that failed to
   close. It read worst in the columns whose last platform has no
   subcategory chips — Skylanders, Amiibo — where the hairline landed
   directly under the word with only the descender gap beneath it. */
.mega-row { border-bottom: 1px solid var(--line-4); }
.mega-row:last-child { border-bottom: none; }

.mega-plat {
  display: block;
  /* 2px at the bottom for the chip-less rows, where the link is the whole
     row and the hairline would otherwise sit on the text. Where there ARE
     chips it is the gap between the platform and them, which wants a little
     too. (This replaces a :last-child rule that zeroed a bottom padding the
     link did not have — dead since the padding went to 0, and written for
     the hairline that the row above now drops.) */
  padding: 5px 8px 2px 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1.3;
}
.mega-plat:hover { color: var(--red-dark); text-decoration: underline; }

/* Flex, so a chip that does not fit drops to the next line on its own with
   no punctuation left stranded at either end. column-gap does the separating
   that the middots used to; row-gap stays 0 so a two-line row is no taller
   than the line-height already allows for. */
.mega-subs {
  margin: 0; padding: 0 0 5px;
  display: flex; flex-wrap: wrap;
  column-gap: 11px; row-gap: 0;
  line-height: 1.45;
}

.mega-sub {
  display: inline-block;
  padding: 1px 0;
  text-decoration: none;
  /* 12.5px rather than 13: at six columns on a 1200px measure a column is
     about 190px, and "Games · Consoles · Accessories" needs a shade over 200
     at 13px. Half a pixel buys the whole line and is invisible; the colour is
     ink-70 on card, about 9:1, so it is still comfortably readable. */
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-70);
}
.mega-sub:hover { color: var(--red-dark); text-decoration: underline; }

/* No rule above the button. The panel already ends in a hard 2px border and
   a shadow, so a third horizontal line inside it was one boundary too many —
   and with the row hairlines no longer running to the foot of each column,
   it was the only full-width line left, which made it read as the panel's
   edge rather than as a divider. The 36px is what the margin and the
   padding-top added up to before; whitespace separates it now. */
.mega-foot {
  margin: 36px 0 0;
  display: flex; justify-content: flex-end;
}
.mega-all {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 22px;
  background: var(--ink); color: var(--paper);
  text-decoration: none; font-weight: 600; font-size: 15px;
}
.mega-all:hover { background: var(--red); color: #FFFFFF; }

/* Six columns need the full desktop measure. Below that the panel would be
   six 120px columns of wrapped words, so it steps down rather than squeezing;
   under 900px megamenu.js does not open it at all and the nav item stays a
   plain link to /categories, which is the better page at that width. */
@media (max-width: 1180px) {
  .mega-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mega { display: none; }
}

/* ===========================================================================
   Item notes — the crew's own words about one item
   ---------------------------------------------------------------------------
   In counter.css rather than a page sheet because all four surfaces that
   show one are here: the search row (panel and page), /browse, /boosts
   and the item page. See lib/item-note.php for what the field actually
   holds and why it earns this much attention.

   AMBER, BUT NOT THE RED EDGE. `.notice` above uses a red left edge and
   says so: it is for something the reader must do. A crew note is not an
   instruction to the reader, it is a fact about the item — and half of them
   are good news ("No deductions for dry save battery"). So it keeps the
   amber, which is the site's "read this before you act" colour, and takes
   an INK edge instead of a red one. That also stops the item page stacking
   two red-edged blocks when an anonymous visitor gets the login nudge
   underneath a note, which is the common case on the Pokémon titles.
   =========================================================================== */

.crewnote {
  /* Flex with a baseline, so the mono label sits on the first line of the
     text rather than the top of the box when the note wraps to three.

     It wraps, and the text below carries a 180px flex-basis, so in a column
     too narrow to hold both the label drops onto its own line and the
     sentence gets the full width. Flexbox decides that on the BASIS, before
     any shrinking, which is what makes it respond to the column rather than
     to the viewport — the same note is in a 682px browse cell and a 162px
     boosts card at the same screen width. Without it the boosts
     card rendered "Must have battery cover." one word per line. */
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px;
  margin: 0;
  padding: 6px 9px;
  background: var(--notice);
  border-left: 3px solid var(--ink);
  font-size: 12.5px; line-height: 1.5;
  color: var(--notice-ink);
}

.crewnote-k {
  flex: 0 0 auto;
  /* nowrap: "Crew" and "note" on separate lines reads as two labels. */
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  /* Full notice-ink, not a faded version. At 10px a 55%-opacity brown on
     amber is under the 4.5:1 floor. */
  color: var(--notice-ink);
}

/* min-width:0 so a long unbroken token (a model number) wraps inside the
   row instead of widening it past its container. */
.crewnote-t { flex: 1 1 180px; min-width: 0; }

/* --- The item page's own, where there is room to say it properly -------- */

.crewnote-lg {
  display: block;
  margin: 18px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--notice-line);
  border-left: 4px solid var(--ink);
}
.crewnote-lg .crewnote-k {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 7px;
  font-size: 11px;
}
.crewnote-lg .crewnote-t {
  margin: 0;
  font-size: 15px; line-height: 1.6;
}

/* --- Per-surface spacing ------------------------------------------------ */

/* On a result row the note is a footnote under the prices: there is nothing
   to choose on a row, so it qualifies a figure the reader has already seen.
   On the item page it sits ABOVE the condition picker instead, because
   there it is a precondition for the choice being made. */
.sr .crewnote { margin-top: 9px; }

/* In a table cell. The title column is the left-hand column on desktop and
   the top of the card on a phone, so the note lands with the title it
   belongs to in both layouts. m-item is the same cell in the shipment
   manifest, on the open basket and on the sent record alike. The packing
   slip uses the same markup but carries its own print rules — it is a
   standalone document and never loads this file. */
.col-title .crewnote,
.td-item .crewnote,
.m-item .crewnote {
  margin-top: 7px;
  /* Undo what the cell imposes on its contents. A row header is bold and
     centred, and the boosted-items table tracks its title cell out to 0.14em — fine on
     "Rumble Pak", wrong on a sentence, and it made the same note look like a
     different typeface there than on /browse. */
  font-weight: 400; text-align: left; letter-spacing: normal;
  /* The striped rows alternate --stripe behind this, so the amber needs to
     be opaque — it is, but the left edge is what carries it at a glance. */
}

/* ===========================================================================
   The site message bar, and the interrupt
   ---------------------------------------------------------------------------
   Three tiers in two components. The bar carries tiers 1 and 2 — the
   generated promotions line and the crew's own message — and the interrupt is
   tier 3, which is the bar PLUS a dialog.

   GREEN FOR MONEY, INK FOR NEWS. The promotions line is the one thing on this
   site that is only ever good news, and green is already what a boosted price
   is printed in, so the bar agrees with the figures it is talking about. A
   crew message is ink: it may be a closure or a delay, and painting "payments
   are late" in the money colour would be a small lie. Neither is red — red is
   the brand and the call to action, and a red bar across every page would
   compete with every button underneath it.
   =========================================================================== */

/* THE BAR'S VISIBILITY IS NOT DECIDED HERE. It is hidden by default and
   revealed by `.msg-show`, both rules inline in <head> beside the probe that
   sets the class — see the long note there. Putting either of them in this
   file would make the bar's first paint depend on this stylesheet having
   arrived, which is the race the inline version exists to end. */

.sitebar {
  padding: 11px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}
.sitebar-promo  { background: var(--green); color: #F2FBF6; }
.sitebar-notice { background: var(--ink);   color: var(--paper); }

.sitebar-in {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 14px;
}

/* The ring is drawn in currentColor so it works on both backgrounds without a
   second rule. */
.sitebar-mark {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 23px;
  border: 1.5px solid currentColor; border-radius: 50%;
}

/* Grows to fill, shrinks to 320px, then wraps the link and close button onto
   their own line rather than squeezing the sentence to one word per line.
   The flex item is now the WRAPPER, so the lede, the offers and the closing
   line stack inside one column instead of each one trying to be a row of the
   bar. */
.sitebar-body {
  /* 240px, not 320. At 320 the basis was wider than what is left of a 375px
     phone once the 23px icon and the gap are taken off, so the icon wrapped
     onto a row of its own and the bar paid 31px for an empty line. */
  flex: 999 1 240px; min-width: 0;
}
.sitebar-text {
  margin: 0;
  font-size: 14.5px; line-height: 1.5;
}

/* THE OFFERS, AS CHIPS.
   Six of them stacked is a bar that owns the top of the screen; six that wrap
   is two rows on a desktop and three on a phone. The border is currentColor
   so one rule works on the green promo bar and the ink notice bar alike —
   same trick as .sitebar-mark. nowrap because "+10% on ALL SEGA" broken
   across two lines stops reading as one offer. */
.sitebar-chips {
  /* A GRID, not a flex wrap, and this is the whole difference on a phone.
     Flexed and nowrap, "+10% on ALL handheld consoles & games" is 254px wide,
     so on a 343px phone each offer took a row to itself: six rows, 174px, and
     a bar owning 41% of the screen. auto-fit with a 120px floor puts two to a
     row at phone width and lets the long ones wrap inside their own cell
     instead of pushing everything else off. */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px 6px;
  list-style: none; margin: 8px 0 0; padding: 0;
}
.sitebar-chips li {
  font-size: 11.5px; line-height: 1.35; font-weight: 600;
  padding: 2px 7px;
  border: 1px solid currentColor; border-radius: 2px;
}

/* The closing line — "added automatically", "start your submission". Quieter
   than the offers, because it is the part a reader already assumes. */
.sitebar-fine {
  margin: 8px 0 0;
  font-size: 12.5px; line-height: 1.45; opacity: 0.82;
}
.sitebar-text strong { font-weight: 700; }

.sitebar-link {
  flex: 0 0 auto;
  color: inherit; font-size: 14.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
/* White, not inherit.
   The global `a:hover { color: var(--red-dark) }` is MORE specific than
   .sitebar-link's `color: inherit` (0,1,1 beats 0,1,0), so without an
   explicit colour here the link hovers to --red-dark: measured 1.5:1 on the
   green bar and 1.9:1 on the ink one. Both are effectively invisible, and
   writing `color: inherit` again would be a rule that looks like a no-op to
   the next reader. Every other dark surface on the site already does exactly
   this — see .u-bar a:hover and .site-footer a:hover. White also gives the
   hover a colour change of its own, so the underline is not carrying it
   alone: 6.2:1 on green, 17.9:1 on ink. */
.sitebar-link:hover { color: #FFFFFF; border-bottom-color: currentColor; }
.sitebar-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.sitebar-x {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  /* 36px rather than the 44px floor. The target sits in a 45px-tall bar, and
     a 44px button would touch both edges of it; the bar is also the one
     control on the page where an accidental hit costs nothing — the message
     comes back on the next edit, and until then it is still on /terms and in
     whatever email went with it. */
  width: 36px; height: 36px; margin: -7px -8px -7px 0;
  background: transparent; border: 0; color: inherit;
  opacity: 0.65; cursor: pointer;
  transition: opacity 140ms ease;
}
.sitebar-x:hover { opacity: 1; }
.sitebar-x:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; opacity: 1; }

/* --- Tier 3: the interrupt ---------------------------------------------- */

.intr {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(26, 23, 20, 0.72);
}
/* The page behind must not scroll while a dialog claims to be modal. */
body.intr-open { overflow: hidden; }

.intr-box {
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--card);
  border: 2px solid var(--ink);
  /* The one red edge on this feature, and it is on the tier that earns it:
     a dialog somebody chose to put in front of every seller. */
  border-top: 8px solid var(--red);
  padding: 26px 30px 24px;
}

.intr-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red-dark);
}
.intr-head {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 900; font-size: 27px; line-height: 1.1;
  letter-spacing: -0.016em; text-transform: uppercase;
  color: var(--ink);
}
.intr-body {
  margin: 0 0 20px;
  font-size: 15px; line-height: 1.6;
  color: var(--ink-70);
}
.intr-actions { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.intr-more { font-size: 15px; font-weight: 600; color: var(--red-dark);
             text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* This one starts at --red-dark, which is also what the global a:hover sets,
   so hovering it changed nothing at all. 9:1 on the card is the best contrast
   available to a red link here and worth keeping, so the underline carries
   the hover instead of the colour — and thickness costs no layout, because an
   underline is painted outside the box. */
.intr-more:hover { text-decoration-thickness: 2px; text-underline-offset: 2px; }

@media (max-width: 640px) {
  .sitebar { padding: 10px 0; }
  .sitebar-text { font-size: 13.5px; }
  /*
   * THE BODY TAKES THE ROW, less the icon beside it.
   *
   * Left to flex, the "See them all" link and the close button sit on the
   * body's row at 430px and wrap below it at 375 — so the body was 256px
   * wide on the WIDER phone and 306px on the narrower one, and the offers
   * went from two columns to one as the screen got bigger. calc(100% - 37px)
   * is the icon (23px) and the gap (14px), so the body always gets the rest
   * of the row and the link and cross always drop beneath it.
   */
  .sitebar-body { flex: 1 1 calc(100% - 37px); }
  .sitebar-link { font-size: 13.5px; }
  /* The reassurance half of the generated line. See site_strip() for why this
     is the half that goes: every boosted price on every page already carries
     a badge saying the same thing. */
  .sitebar-aside { display: none; }
  /* Beside the first line rather than floating against the middle of three. */
  .sitebar-in { align-items: flex-start; }
  .sitebar-mark { margin-top: 1px; }
  .intr-box { padding: 20px 18px 20px; }
  .intr-head { font-size: 22px; }
  /* Full width, because a 48px button beside a link wraps to two lines at
     this width and the acknowledgement is the thing being asked for. */
  .intr-actions .cta { width: 100%; justify-content: center; }
}

/* A dialog that animates in is a dialog that is still moving when somebody
   reaches for the button. It appears; it does not arrive. */
@media (prefers-reduced-motion: reduce) {
  .sitebar-link, .sitebar-x { transition: none; }
}

/* --- The preview switcher (test boxes only) ----------------------------- */
/* Not part of the message component. It sits under it and is styled to look
   like tooling rather than site chrome, so nobody reviewing the bar above
   mistakes this for part of what they are reviewing. */
.prev-bar {
  background: repeating-linear-gradient(45deg,
    var(--sunk), var(--sunk) 8px, var(--line-4) 8px, var(--line-4) 16px);
  border-bottom: 1px dashed var(--ink-30);
  padding: 7px 0;
}
.prev-in {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  font-family: var(--font-mono); font-size: 11px;
}
.prev-tag {
  background: var(--ink); color: var(--paper);
  padding: 3px 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.prev-say { color: var(--ink-55); }
.prev-links { display: flex; gap: 6px; margin-left: auto; }
.prev-links a {
  padding: 3px 9px;
  border: 1px solid var(--line-strong); background: var(--card);
  color: var(--ink-70); text-decoration: none;
}
.prev-links a:hover { border-color: var(--ink); color: var(--ink); }
.prev-links a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.prev-links a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@media (max-width: 640px) {
  .prev-say { display: none; }
  .prev-links { margin-left: 0; }
}

/* --- Subcategory chips -----------------------------------------------------

   Shared because two pages draw them: /categories, where they are the way into
   a platform's consoles or accessories, and /browse, where the same row sits
   under the heading so the control somebody clicked to get there is still in
   front of them. They started in categories.css and moved here when /browse
   grew its strip, since browse.css is loaded without categories.css.

   Every subcategory is bought, so every chip carries the same weight. Games is
   simply first; a filled red chip made its siblings read as disabled, as
   though consoles and accessories were not wanted. The current-page state on
   /browse is in browse.css, and is ink rather than red for that reason. */
.chip-sub {
  text-decoration: none; font-size: 13px; font-weight: 500; padding: 6px 10px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-70);
  transition: border-color 150ms, background-color 150ms, color 150ms;
}
.chip-sub:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }
.chip-sub:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@media (max-width: 900px) {
  /* 44px targets: on /categories these are the taps the page exists for. */
  .chip-sub { padding: 0 11px; min-height: var(--tap); display: inline-flex; align-items: center; }
}
