/* Brickwright base stylesheet: tokens, reset, type, layout, header, footer and shared components.
   Implements docs/DESIGN.md. Mobile first; breakpoints at 600px, 900px and 1024px.
   Module stylesheets (storefront.css, checkout.css, content.css, admin.css) build on these tokens and
   classes and never redefine them. No gradients except the pegboard dots, no card shadows, radius 4px. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F3EF;
  --shelf: #EEEAE3;
  --ink: #23201B;
  --ink-2: #3A352E;
  --muted: #6E675D;
  --rule: #E6E1D8;
  --rule-strong: #23201B;
  --accent: #2F5B52;
  --accent-ink: #244740;
  --green: #2F5B52;
  --green-soft: #DDE7E2;
  --amber: #B7791F;
  --amber-ink: #8A5A12;
  --amber-soft: #F4E6CC;
  --red-soft: #F5DDD3;
  --footer-bg: #1A4D2E;
  --footer-ink: #F2ECE1;
  --footer-muted: #CFE3D3;
  --peg: rgba(35, 32, 27, 0.07);

  --brick-red: #C64B22;
  --brick-yellow: #E2A93B;
  --brick-blue: #2F5D8A;
  --brick-navy: #1F3A5A;
  --brick-green: #4F7F45;
  --brick-tan: #CDB48A;
  --brick-brown: #7A5230;
  --brick-white: #F7F3EA;
  --brick-grey: #9A958C;
  --brick-black: #2A2723;
  --brick-pink: #E7A3B5;
  --brick-lavender: #7B6BB0;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --t-display: clamp(36px, 5vw, 56px);
  --t-h1: clamp(30px, 4vw, 44px);
  --t-h2: clamp(24px, 3vw, 30px);
  --t-h3: 20px;
  --t-lead: 19px;
  --t-body: 16px;
  --t-small: 14px;
  --t-eyebrow: 12px;
  --t-mono: 14px;
  --t-legal: 13px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --max: 1200px;
  --gutter: 16px;
  --gap: 24px;
  --section-pad: 56px;
  --header-h: 64px;
  --sticky-top: 88px;

  --r: 4px;
  --r-pill: 999px;
  --shadow-overlay: 0 12px 32px rgba(35, 32, 27, 0.16);
  --focus: 2px solid var(--accent);
  --ease: 150ms ease;
  --cut: 1px dashed var(--rule);

  color-scheme: light;
}
@media (min-width: 600px) {
  :root { --t-body: 17px; --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --section-pad: 96px; }
}

/* ------------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--s-5); }
@media (min-width: 900px) { html { scroll-padding-top: calc(var(--header-h) + var(--s-5)); } }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; border-spacing: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.site-main { flex: 1 0 auto; outline: none; }

/* Focus: always visible, never removed. */
:focus-visible { outline: var(--focus); outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: var(--focus); outline-offset: 2px; }

::selection { background: var(--amber-soft); color: var(--ink); }

/* -------------------------------------------------------------- typography */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1, .h1 { font-size: var(--t-h1); line-height: 1.1; letter-spacing: -0.01em; }
h2, .h2 { font-size: var(--t-h2); line-height: 1.2; }
h3, .h3 { font-size: var(--t-h3); line-height: 1.3; }
h4, .h4 { font-size: 17px; line-height: 1.35; }
.display { font-family: var(--font-serif); font-size: var(--t-display); line-height: 1.05; font-weight: 600; letter-spacing: -0.015em; }
p, li, dd { max-width: 68ch; }
.lead { font-size: var(--t-lead); line-height: 1.5; max-width: 56ch; color: var(--ink-2); }
.small, small { font-size: var(--t-small); line-height: 1.45; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--font-sans); font-size: var(--t-eyebrow); line-height: 1.3; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.mono, code, kbd, samp { font-family: var(--font-mono); font-size: var(--t-mono); line-height: 1.4; font-weight: 500; }
.legal { font-size: var(--t-legal); line-height: 1.45; }
.num, .tabular { font-variant-numeric: tabular-nums; }
a { color: var(--accent-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: color var(--ease); }
a:hover { color: var(--ink); }
strong, b { font-weight: 600; }
hr, .cut { border: 0; border-top: var(--cut); margin: 0; height: 0; }

/* Text flow inside prose blocks. */
.prose > * + * { margin-top: var(--s-4); }
.prose > h2 { margin-top: var(--s-7); }
.prose > h3 { margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--s-2); }
.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-6); }

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: calc(800px + 2 * var(--gutter)); }
.container--reading { max-width: calc(720px + 2 * var(--gutter)); }
.section { padding: var(--section-pad) 0; }
.section--tight { padding: var(--s-7) 0; }
.section + .section, .section--cut { border-top: var(--cut); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-3) var(--s-5); margin-bottom: var(--s-6); }
.section__head > div > * + * { margin-top: var(--s-2); }
.page { padding-top: var(--s-5); padding-bottom: var(--s-8); }
.page-head { margin: var(--s-4) 0 var(--s-6); }
.page-head > * + * { margin-top: var(--s-3); }
.page--status { padding-top: var(--s-7); }

.grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* 7 and 5 of 12 at 1024px and up (hero, product, checkout). */
.split { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7); }
  .split--reverse > :first-child { order: 2; }
  .sticky-col { position: sticky; top: var(--sticky-top); align-self: start; }
}
/* Collection pages: 240px filter rail and the grid. */
.rail-layout { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .rail-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .rail-layout__rail { position: sticky; top: var(--sticky-top); align-self: start; }
}
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.cluster--tight { gap: var(--s-2); }
.between { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }

/* Pegboard dots (the one allowed CSS gradient, rendering as dots). */
.pegboard { background: var(--bg); }
/* Mounted-print panel around art. */
.mounted { background: var(--surface); border: 1px solid var(--ink); padding: var(--s-2); border-radius: var(--r); }
.mounted img { border-radius: 2px; width: 100%; }

/* ---------------------------------------------------------- accessibility */
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-3); top: -100px; z-index: 100; padding: var(--s-3) var(--s-4);
  background: var(--ink); color: var(--bg); border-radius: var(--r); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: var(--s-3); color: var(--bg); }

/* ------------------------------------------------------------------ header */
.announce { background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.3; }
.announce__inner { min-height: 32px; display: flex; align-items: center; justify-content: center; text-align: center; padding-top: 6px; padding-bottom: 6px; }
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); position: relative; z-index: 40; }
@media (min-width: 900px) { .site-header { position: sticky; top: 0; } }
.site-header__row { min-height: var(--header-h); display: flex; align-items: center; gap: var(--s-3); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; min-height: 44px; }
.wordmark:hover { color: var(--ink); }
.wordmark__mark { width: 56px; height: 56px; flex: none; display: block; }
@media (max-width: 639px) { .wordmark__mark { width: 44px; height: 44px; } }
.footer-stamp { display: block; width: 112px; height: auto; margin-bottom: var(--s-4); }
.wordmark__text { font-family: var(--font-serif); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.menu-toggle {
  min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--ink); border-radius: var(--r);
  background: transparent; font-weight: 600; font-size: 15px;
}
.menu-toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.cart-link {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-1);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.cart-link:hover { color: var(--accent-ink); }
.cart-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px;
  border: 1px solid var(--ink); border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 12px;
  font-weight: 500; line-height: 1; background: var(--surface); font-variant-numeric: tabular-nums;
}
.cart-count[data-count="0"] { color: var(--muted); border-color: var(--rule); }
.cart-count.is-bumped { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Mobile: the menu is a full-width sheet under the header. */
.site-menu {
  display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 45;
  background: var(--surface); border-bottom: 1px solid var(--ink); box-shadow: var(--shadow-overlay);
  padding: var(--s-4) var(--gutter) var(--s-5);
}
.site-menu.is-open { display: block; }
.site-nav ul { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0; }
.site-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 var(--s-1); border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px;
}
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.site-search { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.site-search__input { flex: 1; min-width: 0; }
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .wordmark { margin-right: 0; }
  .site-menu {
    display: flex !important; position: static; flex: 1; align-items: center; gap: var(--s-4);
    background: transparent; border: 0; box-shadow: none; padding: 0;
  }
  .site-nav { flex: 1; display: flex; justify-content: center; }
  .site-nav ul { flex-direction: row; gap: var(--s-1); }
  .site-nav a { border: 0; min-height: 44px; padding: 0 var(--s-2); font-size: 15px; border-bottom: 2px solid transparent; white-space: nowrap; }
  .site-nav a:hover { color: var(--accent-ink); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); }
  .site-search { margin: 0; width: 180px; flex: none; }
  .site-search .input { min-height: 36px; font-size: 15px; padding: 6px 10px; }
  .site-search .site-search__btn { display: none; }
}
@media (min-width: 1200px) { .site-search { width: 240px; } }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding: var(--s-7) 0 var(--s-6); margin-top: auto; }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--bg); text-decoration-color: var(--accent); }
.site-footer :focus-visible { outline-color: var(--bg); }
.footer-cols { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.footer-col__title { font-size: var(--t-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--footer-muted); margin-bottom: var(--s-3); }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li + li { margin-top: var(--s-2); }
.footer-col a { text-decoration: none; font-size: 15px; display: inline-block; padding: 2px 0; }
.footer-col a:hover { text-decoration: underline; }
.footer-contact { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px dashed rgba(242, 236, 225, 0.25); font-size: 15px; }
.footer-contact > * + * { margin-top: var(--s-1); }
.footer-email { font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.footer-legal { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid rgba(242, 236, 225, 0.15); color: var(--footer-muted); font-size: var(--t-legal); line-height: 1.45; }
.footer-legal > * + * { margin-top: var(--s-2); }
.footer-legal a { color: var(--footer-muted); margin-right: var(--s-3); }
.trademark { font-size: var(--t-legal); line-height: 1.45; color: var(--footer-muted); max-width: none; }
.site-footer--minimal { padding: var(--s-4) 0; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 12px 20px; border: 1px solid var(--ink); border-radius: var(--r);
  font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer; transition: background-color var(--ease), color var(--ease), border-color var(--ease);
  -webkit-appearance: none; appearance: none;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn--secondary { background: transparent; color: var(--ink); }
.btn--secondary:hover { background: var(--surface); color: var(--ink); }
.btn--quiet { background: none; border-color: transparent; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 0.18em; padding-left: var(--s-1); padding-right: var(--s-1); }
.btn--quiet:hover { color: var(--ink); }
.btn--danger { background: transparent; border-color: var(--accent-ink); color: var(--accent-ink); }
.btn--danger:hover { background: var(--red-soft); }
.btn--full { width: 100%; }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--primary[disabled]:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn-row--equal > .btn { flex: 1 1 200px; }

/* -------------------------------------------------------------- bench card */
.bench-card {
  position: relative; background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r);
  padding: 20px 20px 20px 44px; color: var(--ink);
}
.bench-card::before {
  content: ""; position: absolute; left: 14px; top: 14px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); box-shadow: 0 0 0 1px var(--rule);
}
.bench-card--string::after {
  content: ""; position: absolute; left: 20px; top: 20px; width: 56px; height: 1px; background: var(--muted);
  transform-origin: 0 0; transform: rotate(-150deg);
}
.bench-card > * + * { margin-top: var(--s-3); }
.bench-card__title { font-family: var(--font-serif); font-size: var(--t-h3); line-height: 1.3; font-weight: 600; }
.bench-card__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2) var(--s-4); }
.bench-card__row { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: var(--s-3); align-items: baseline; padding-top: var(--s-2); border-top: 1px dashed var(--rule); }
.bench-card__row:first-child { border-top: 0; padding-top: 0; }
.bench-card__row dt { font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bench-card__row dd { font-family: var(--font-mono); font-size: var(--t-mono); line-height: 1.4; font-weight: 500; overflow-wrap: anywhere; }
.bench-card--large { padding: 28px 28px 28px 52px; }
.bench-card--large .bench-card__title { font-size: var(--t-h2); line-height: 1.2; }
.bench-card--compact { padding: 14px 16px 14px 38px; }
.bench-card--compact::before { left: 12px; top: 12px; width: 10px; height: 10px; }
.bench-card--compact.bench-card--string::after { display: none; }
.bench-card .link-list { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); list-style: none; padding: 0; }
.bench-card .inline-form, .inline-form { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.inline-form .input { flex: 1 1 200px; min-width: 0; }

/* ------------------------------------------------------------ product card */
.product-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .product-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.product-card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r); color: var(--ink); text-decoration: none; overflow: hidden; transition: border-color var(--ease);
}
.product-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
  opacity: 0; transition: opacity var(--ease);
}
.product-card:hover { border-color: var(--rule-strong); color: var(--ink); }
.product-card:hover::after, .product-card:focus-visible::after { opacity: 1; }
.product-card__media {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* The shelf band: the bottom 16% of the tile, slightly darker. Generated art carries the same band
   and fills the tile edge to edge, so the two line up; photographs sit on it. */
.product-card__media::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16%; background: var(--shelf); }
.product-card__media img { position: relative; width: 100%; height: 100%; object-fit: cover; transition: transform var(--ease); }
/* LEGO product photos (jpg) are shot on white: show the whole model, never crop it. */
.product-card__media img[src$=".jpg"], .pdp__art img[src$=".jpg"], .pdp__thumb img[src$=".jpg"], .cart-line__media img[src$=".jpg"] { object-fit: contain; background: #fff; padding: 6%; }
.product-card:hover .product-card__media img { transform: translateY(-2px); }
.product-card__media .set-tag { position: absolute; z-index: 1; top: var(--s-3); left: var(--s-3); }
.product-card__body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); flex: 1; }
.product-card__title { font-family: var(--font-serif); font-size: 20px; line-height: 1.25; font-weight: 600; }
.product-card__blurb {
  font-size: var(--t-small); line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__foot { margin-top: auto; padding-top: var(--s-2); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-3); }
.price { font-family: var(--font-sans); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price--product { font-family: var(--font-serif); font-size: 30px; line-height: 1.1; }
.price-vat { font-size: var(--t-small); color: var(--muted); font-weight: 400; margin-left: var(--s-2); }
.price-note { font-size: var(--t-small); color: var(--muted); line-height: 1.45; }
.availability { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.availability--shelf { color: var(--green); }
.availability--to-order { color: var(--accent-ink); }
.availability--service { color: var(--muted); }

/* ------------------------------------------------------- tags, pills, chips */
.set-tag {
  display: inline-block; padding: 2px 6px; background: var(--bg); border: 1px solid var(--ink); border-radius: 2px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--ink); letter-spacing: 0.02em;
}
.pill {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 10px; border-radius: var(--r-pill);
  border: 1px solid transparent; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; white-space: nowrap;
}
.pill--pending_payment, .pill--open { background: var(--amber-soft); color: var(--amber-ink); }
.pill--paid, .pill--quoted { background: var(--green-soft); color: var(--green); }
.pill--in_production { background: var(--bg); color: var(--ink); border-color: var(--ink); }
.pill--shipped { background: var(--ink); color: var(--bg); }
.pill--collected, .pill--handled { background: var(--green); color: var(--surface); }
.pill--cancelled { background: var(--red-soft); color: var(--accent-ink); text-decoration: line-through; }
.pill--overdue { background: var(--red-soft); color: var(--accent-ink); }
.glue-tag {
  display: inline-block; padding: 1px 8px; border: 1px solid var(--ink); border-radius: 2px; font-size: 12px;
  font-weight: 600; line-height: 1.5; color: var(--ink); background: transparent;
}
.glue-tag--glued { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-ink); }
.chips {
  display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px 2px var(--s-2); margin: -2px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent);
}
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); white-space: nowrap; flex: none;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-pill); color: var(--ink);
  font-size: 15px; font-weight: 500; text-decoration: none; transition: border-color var(--ease), background-color var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* -------------------------------------------------------------- options */
.options { border: 0; padding: 0; margin: 0; min-width: 0; }
.options + .options { margin-top: var(--s-5); }
.options__legend { padding: 0; margin-bottom: var(--s-3); font-size: 14px; font-weight: 600; display: flex; gap: var(--s-2); align-items: baseline; }
.option-tiles { display: grid; gap: var(--s-2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .option-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.option-tile { position: relative; display: block; cursor: pointer; }
.option-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-tile__box {
  position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 56px; padding: var(--s-3);
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); transition: border-color var(--ease), background-color var(--ease);
}
.option-tile:hover .option-tile__box { border-color: var(--muted); }
.option-tile input:checked + .option-tile__box { border-color: var(--ink); background: var(--bg); }
.option-tile input:checked + .option-tile__box::after { content: ""; position: absolute; top: 6px; right: 6px; width: 4px; height: 4px; background: var(--accent); }
.option-tile input:focus-visible + .option-tile__box { outline: var(--focus); outline-offset: 2px; }
.option-tile input:disabled + .option-tile__box { opacity: 0.5; cursor: not-allowed; }
.option-tile__value { font-size: 15px; font-weight: 600; line-height: 1.3; }
.option-tile__delta { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.option-tile__help { font-size: var(--t-small); line-height: 1.4; color: var(--ink-2); margin-top: var(--s-1); }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: var(--s-4); }
.field-row { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-row > .field + .field { margin-top: 0; } }
.field__label, .label { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.field__req { font-weight: 400; color: var(--muted); font-size: 13px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font-size: 17px; line-height: 1.4;
  transition: border-color var(--ease); -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { min-height: 112px; resize: vertical; }
.select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2323201B' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--accent); }
.field__help { font-size: var(--t-small); line-height: 1.45; color: var(--muted); }
.field__error { font-size: var(--t-small); line-height: 1.45; color: var(--accent-ink); border-left: 2px solid var(--accent); padding-left: var(--s-2); }
.counter { font-family: var(--font-mono); font-size: 13px; color: var(--muted); text-align: right; }
.counter.is-over { color: var(--accent-ink); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; flex: none; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; cursor: pointer; min-height: 44px; padding: var(--s-2) 0; }
.check input { margin-top: 2px; }
.check__text { font-size: 16px; line-height: 1.45; }
.check__text .field__help { display: block; margin-top: 2px; }
fieldset.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset__legend { padding: 0; margin-bottom: var(--s-3); font-weight: 600; }

/* ---------------------------------------------------------------- notices */
.notice {
  border-left: 4px solid var(--ink); background: var(--surface); padding: 14px 16px; border-radius: 0 var(--r) var(--r) 0;
  font-size: 15px; line-height: 1.5;
}
.notice > * + * { margin-top: var(--s-2); }
.notice__body > * + * { margin-top: var(--s-2); }
.notice__title { font-weight: 600; }
.notice--success { background: var(--green-soft); border-left-color: var(--green); }
.notice--warning { background: var(--amber-soft); border-left-color: var(--amber); }
.notice--error { background: var(--red-soft); border-left-color: var(--accent); }
.notice--error .notice__title { color: var(--accent-ink); }

/* ------------------------------------------------------------------ toast */
.toast-region {
  position: fixed; z-index: 90; left: var(--s-3); right: var(--s-3); bottom: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none;
}
@media (min-width: 600px) { .toast-region { left: auto; right: var(--s-5); bottom: var(--s-5); width: 360px; } }
.toast { pointer-events: auto; box-shadow: var(--shadow-overlay); }
.toast .btn-row { margin-top: var(--s-3); }
.toast__close { position: absolute; top: 6px; right: 6px; min-width: 36px; min-height: 36px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); }
.toast__close:hover { color: var(--ink); }

/* ----------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; font-size: var(--t-small); line-height: 1.45; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.table thead th {
  background: var(--surface-2); font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .mono { font-size: 13px; }
.table tfoot td, .table tfoot th { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 0; }
/* Stacked rows on phones: give every cell data-label="Header". */
@media (max-width: 599px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td, .table--stack th { display: block; width: 100%; }
  .table--stack tr { padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td, .table--stack th { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: var(--s-3); text-align: left; }
  .table--stack td.num { text-align: left; }
  .table--stack td::before, .table--stack th::before {
    content: attr(data-label); font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  }
}

/* ----------------------------------------------------------- definition */
.spec-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-2) var(--s-5); }
.spec-list dt { font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.spec-list dd { font-family: var(--font-mono); font-size: var(--t-mono); }

/* --------------------------------------------------------- bench strip */
.bench-strip { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); }
.bench-strip__item { padding: var(--s-5) 0; }
.bench-strip__item + .bench-strip__item { border-top: 1px solid var(--rule); }
.bench-strip__label { font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.bench-strip__text { margin-top: var(--s-1); font-size: var(--t-small); color: var(--muted); }
@media (min-width: 900px) {
  .bench-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bench-strip__item { padding: var(--s-5) var(--s-5); }
  .bench-strip__item:first-child { padding-left: 0; }
  .bench-strip__item + .bench-strip__item { border-top: 0; border-left: 1px solid var(--rule); }
}

/* ------------------------------------------------------------------ steps */
.steps { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); counter-reset: step; list-style: none; padding: 0; }
@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { display: flex; flex-direction: column; gap: var(--s-2); }
.step__num { font-family: var(--font-serif); font-size: 40px; line-height: 1; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.step__title { font-family: var(--font-serif); font-size: var(--t-h3); line-height: 1.3; font-weight: 600; }
.step__text { font-size: var(--t-small); color: var(--ink-2); }
.steps--compact .step__num { font-size: 28px; }

/* --------------------------------------------------------------- timeline */
.timeline { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.timeline__step { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); align-content: start; gap: var(--s-3); padding-bottom: var(--s-5); }
.timeline__step::before { content: ""; position: absolute; left: 5.5px; top: 14px; bottom: 0; width: 1px; background: var(--rule); }
.timeline__step:last-child { padding-bottom: 0; }
.timeline__step:last-child::before { display: none; }
.timeline__mark { width: 12px; height: 12px; margin-top: 5px; border: 1px solid var(--ink); background: var(--surface); }
.timeline__step.is-done .timeline__mark { background: var(--ink); }
.timeline__step.is-current .timeline__mark { background: var(--accent); border-color: var(--accent); }
.timeline__step.is-done::before { background: var(--ink); }
.timeline__label { font-weight: 600; font-size: 15px; }
.timeline__date { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
@media (min-width: 600px) {
  .timeline { grid-template-columns: repeat(var(--timeline-steps, 5), minmax(0, 1fr)); }
  .timeline__step { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding: 0 var(--s-3) 0 0; }
  .timeline__step::before { left: 12px; right: 0; top: 11px; bottom: auto; width: auto; height: 1px; }
  .timeline__mark { margin-top: 5px; }
}

/* ---------------------------------------------------------------- fits box */
.fits-box { border: 1px dashed var(--ink); border-radius: var(--r); padding: var(--s-4); background: transparent; }
.fits-box > * + * { margin-top: var(--s-2); }
.fits-box__line { font-size: 15px; }
.fits-box .mono { white-space: nowrap; }

/* -------------------------------------------------------------- qty stepper */
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.qty__btn { min-width: 36px; min-height: 36px; border: 0; background: transparent; font-size: 18px; font-weight: 600; line-height: 1; color: var(--ink); }
.qty__btn:hover { background: var(--surface-2); }
.qty__btn:disabled { color: var(--rule); cursor: not-allowed; background: transparent; }
.qty__input {
  width: 44px; min-height: 36px; border: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule);
  text-align: center; font-family: var(--font-mono); font-size: 15px; background: transparent; -moz-appearance: textfield; appearance: textfield;
}
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------------------- breadcrumbs */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); list-style: none; padding: 0; font-size: var(--t-small); color: var(--muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--s-2); }
.breadcrumbs li + li::before { content: "/"; color: var(--rule); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* ------------------------------------------------------------ disclosure */
details.disclosure { border-top: 1px solid var(--rule); }
details.disclosure:last-of-type { border-bottom: 1px solid var(--rule); }
details.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; padding: var(--s-3) 0; font-family: var(--font-serif); font-size: 19px; font-weight: 600;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-family: var(--font-mono); font-size: 22px; line-height: 1; transition: transform var(--ease); flex: none; }
details.disclosure[open] > summary::after { transform: rotate(45deg); }
details.disclosure > :not(summary) { padding-bottom: var(--s-4); }

/* ----------------------------------------------------------- panels, misc */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s-5); }
.panel--sunken { background: var(--surface-2); border-color: transparent; }
.panel--ink { border-color: var(--ink); }
.panel > * + * { margin-top: var(--s-3); }
.empty-state { max-width: 560px; margin: var(--s-6) auto; }
.trust-lines { list-style: none; padding: 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.trust-lines li + li { margin-top: var(--s-1); }
.trust-lines li::before { content: "\2713"; color: var(--green); margin-right: var(--s-2); }
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--green); width: 0; transition: width var(--ease); }
.link-list { list-style: none; padding: 0; }
.status-search { margin-top: var(--s-4); }
.status-search .field__label { display: block; margin-bottom: 6px; }
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--s-2) !important; }
.mt-4 { margin-top: var(--s-4) !important; }
.mt-6 { margin-top: var(--s-6) !important; }

/* Shown only when JavaScript is off; app.js sets html.js on load. */
.js .no-js-only { display: none !important; }
html:not(.js) .js-only { display: none !important; }

/* --------------------------------------------------------- motion, print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .product-card:hover .product-card__media img { transform: none; }
  details.disclosure[open] > summary::after { transform: none; content: "\2212"; }
}
@media print {
  .announce, .site-header, .site-footer, .toast-region, .skip-link, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .bench-card, .panel, .table { background: #fff; }
}
