/* Penrith storefront styles: mockup F (storefront/design/F-*.dc.html).
 *
 * shadcn/ui look with the Geist fonts and Penrith green (#007a4f) as the
 * primary colour. Colours and corners are named like shadcn's tokens, so the
 * values below are the only place to change them.
 *
 * Kept from the earlier build: normal page scroll, the phone layout, a
 * stretched title link on cards (no link inside a link), 4:3 image boxes,
 * visible focus rings and reduced motion. No dark mode (SPEC, Design).
 */

:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --popover: #ffffff;
  --popover-foreground: #0a0a0a;
  --primary: #007a4f;              /* 5.39:1 against white text */
  --primary-foreground: #ffffff;
  --primary-hover: #006a45;        /* darker, so white text keeps its contrast */
  --secondary: #f5f5f5;
  --secondary-foreground: #171717;
  --muted: #f5f5f5;
  --muted-foreground: #737373;     /* 4.74:1 on white; not used on grey fills */
  --muted-foreground-on-muted: #666666; /* 5.26:1 on #f5f5f5 */
  --accent: #f5f5f5;
  --accent-foreground: #171717;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #007a4f;
  --ring-shadow: 0 0 0 3px rgb(0 122 79 / 0.5);
  --primary-subtle: color-mix(in srgb, var(--primary) 7%, var(--background)); /* the current table row */
  --dot-muted: #a1a1a1;
  --link-hover: #404040;

  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) * 0.6);   /* 7.2px */
  --radius-md: calc(var(--radius) * 0.8);   /* 9.6px */
  --radius-lg: var(--radius);               /* 12px */
  --radius-xl: calc(var(--radius) * 1.4);   /* 16.8px */

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: 32px;
}

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

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

/* The footer sits at the bottom even on short pages. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; width: 100%; }

img { max-width: 100%; }

a { color: var(--foreground); }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 { text-wrap: balance; }

.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* Elements given display rules below must still hide when marked hidden. */
[hidden] { display: none !important; }

/* A green ring at half strength. The transparent outline shows in Windows'
   high-contrast mode, where box shadows are dropped. */
:focus-visible {
  outline: 3px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--ring-shadow);
}

::placeholder { color: var(--muted-foreground); opacity: 1; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: var(--primary-foreground); }

.container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--foreground); }

.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-foreground); }

.btn-outline {
  border-color: var(--border);
  background: var(--background);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-dashed { border-style: dashed; }

.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }

.btn-sm { height: 32px; padding: 0 10px; gap: 6px; }
.btn-lg { height: 40px; padding: 0 16px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 36px; padding: 0; }

/* The ring is drawn by :focus-visible; keep the button's own shadow off it. */
.btn:focus-visible { box-shadow: var(--ring-shadow); }

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-outline { border-color: var(--border); color: var(--foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-primary { background: var(--primary); color: var(--primary-foreground); }
.badge-qty { font-variant-numeric: tabular-nums; }
.badge .dot { margin-right: 2px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--primary);
}
.dot-muted { background: var(--dot-muted); }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-foreground-on-muted);
  font: 500 12px/16px var(--font-sans);
}
.kbd-hint { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }

.separator-v {
  display: inline-block;
  flex-shrink: 0;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--border);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.site-header {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; border-radius: var(--radius-sm); }
.brand img { display: block; height: 28px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
}
.main-nav a:hover { background: var(--accent); color: var(--accent-foreground); }
.main-nav a[aria-current="page"], .main-nav a.is-active { background: var(--muted); color: var(--secondary-foreground); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }

/* The unit page's search box: a real form that opens the catalog with ?q=. */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 256px;
  min-width: 140px;
  flex-shrink: 1;
  height: 32px;
  margin: 0;
  padding: 0 6px 0 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--muted-foreground-on-muted);
}
.header-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font: 500 14px/20px var(--font-sans);
}
.header-search input::placeholder { color: var(--muted-foreground-on-muted); }
.header-search input:focus-visible { box-shadow: none; }
.header-search:focus-within { box-shadow: var(--ring-shadow); }
.header-search kbd { border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); }
.header-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* The phone menu: a disclosure, so it works with no script. */
.mobile-menu { display: none; position: relative; margin-left: auto; }
.mobile-menu summary { list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: var(--shadow-md);
}
.mobile-menu-panel a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
}
.mobile-menu-panel a:not(.btn):hover { background: var(--accent); }
.mobile-menu-panel a[aria-current="page"] { background: var(--muted); }
.mobile-menu-panel .btn { height: 44px; margin-top: 4px; }

.sample-banner {
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-weight: 500;
  text-align: center;
}

/* ── Catalog: hero, search and tabs ──────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 24px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.05em;
}
/* Shown at its own size: the PNG is 260 x 78, so drawing it larger would blur it. */
.hero-logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
}
.hero-lead {
  margin: 12px 0 0;
  max-width: 896px;
  font-size: 18px;
  line-height: 28px;
  text-wrap: balance;
}

.search { width: 672px; max-width: 100%; margin: 24px 0 0; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  box-shadow: var(--shadow-sm);
}
.search-box:focus-within { border-color: var(--ring); box-shadow: var(--ring-shadow); }
.search-icon { opacity: 0.5; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font: 400 16px/24px var(--font-sans);
}
.search-box input:focus-visible { box-shadow: none; }

/* The tab list scrolls sideways when it is wider than the screen. The padding
   leaves room for the focus ring, which would otherwise be clipped.
   position: relative keeps the hidden " cards" words inside the scroll box,
   so they never widen the page on phones. */
.tabs-scroll {
  position: relative;
  width: calc(100% + 8px);
  margin: 12px -4px 0;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
/* When the tabs overflow, a soft edge shows there are more to scroll to
   (catalog.js sets the classes). */
.tabs-scroll.more-start { --fade-start: 32px; }
.tabs-scroll.more-end { --fade-end: 32px; }
.tabs-scroll.more-start, .tabs-scroll.more-end {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-start, 0px),
    #000 calc(100% - var(--fade-end, 0px)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-start, 0px),
    #000 calc(100% - var(--fade-end, 0px)), transparent 100%);
}
.tabs {
  display: flex;
  width: max-content;
  margin: 0 auto;
  align-items: center;
  height: 36px;
  padding: 3px;
  border-radius: var(--radius-lg);
  background: var(--muted);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: rgb(10 10 10 / 0.6);          /* 5.1:1 on the grey tab list */
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.tabs a:hover { color: var(--foreground); }
.tabs a[aria-current="page"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
.tabs a:focus-visible { box-shadow: var(--ring-shadow); }
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: rgb(115 115 115 / 0.3);
  color: var(--secondary-foreground);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
.tabs a[aria-current="page"] .tab-count { background: var(--primary); color: var(--primary-foreground); }

/* ── Catalog: toolbar ────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 32px;
  margin-bottom: 16px;
}
/* On wide screens the summary and the filter panel lay their parts out in the toolbar row. */
.toolbar-summary, .filter-panel { display: contents; }
.filter-toggle { display: none; }

.count { order: 2; margin: 0; color: var(--muted-foreground); }
.count strong { color: var(--foreground); font-weight: 500; font-variant-numeric: tabular-nums; }

.email-note {
  order: 3;
  margin: 0 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
}
.plain-email { color: var(--foreground); font-weight: 500; overflow-wrap: anywhere; }

.section-filter { order: 1; position: relative; display: inline-flex; align-items: center; }
.section-filter::after {
  content: '';
  width: 1px;
  height: 16px;
  margin-left: 16px;
  background: var(--border);
}
.section-current { display: inline-flex; align-items: center; gap: 6px; }
.section-current .badge { border-radius: var(--radius-sm); padding: 0 6px; font-weight: 400; }

/* The section pop-over. */
.section-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 208px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: var(--shadow-md);
}
.section-filter.is-open .section-panel { display: block; }
.section-panel-label {
  margin: 0;
  padding: 6px 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  font: 400 14px/20px var(--font-sans);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { background: var(--accent); }
.chip[aria-pressed="true"] { font-weight: 500; }
.chip-check { visibility: hidden; color: var(--primary); }
.chip[aria-pressed="true"] .chip-check { visibility: visible; }

/* The sort menu: a native select dressed as shadcn's select. */
.select-wrap {
  order: 4;
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-left: 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  box-shadow: var(--shadow-xs);
}
.select-wrap label { margin-right: 4px; color: var(--muted-foreground); white-space: nowrap; }
.select-wrap select {
  height: 100%;
  min-width: 0;
  padding: 0 36px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font: 400 14px/20px var(--font-sans);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.select-wrap select:focus-visible { box-shadow: none; }
.select-wrap:focus-within { border-color: var(--ring); box-shadow: var(--ring-shadow); }
.select-chevron { position: absolute; right: 12px; top: 50%; margin-top: -8px; opacity: 0.5; pointer-events: none; color: var(--muted-foreground); }

/* ── Messages: loading, empty state, no results, not listed, 404 ─────────── */

.loading { margin: 48px 0; color: var(--muted-foreground); text-align: center; }
.search-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 16px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--muted); color: var(--muted-foreground-on-muted);
}
.search-note svg { flex: none; margin-top: 3px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 24px auto;
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  text-align: center;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--foreground);
}
.empty h1, .empty-title { margin: 0; font-size: 18px; line-height: 28px; font-weight: 600; }
.empty-text { margin: 0; font-size: 16px; line-height: 24px; text-wrap: balance; }
.empty-note { margin: 0; color: var(--muted-foreground); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ── Catalog: card grid ──────────────────────────────────────────────────── */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid > li { display: flex; min-width: 0; }

.card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}

/* A search's best matches: a soft, blurred green glow. It has no crisp edge, so it never
   reads as the focus ring (a solid 3px green ring) or as a selected card. */
.card.card-top {
  border-color: rgb(0 122 79 / 0.32);
  box-shadow: var(--shadow-sm), 0 0 18px 2px rgb(0 122 79 / 0.16);
}

/* The image strip: a 4:3 box, whole image shown on white. */
.card-media {
  position: relative;
  margin: 0;
  height: 161px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0;
  background: var(--background);
}
.card-media .img-box { width: 213px; height: 160px; max-width: 100%; }
.card-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-media figcaption {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 2px 8px 2px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);          /* solid, so the label stays readable over any image */
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.card-media .caption-icon { position: absolute; top: 15px; left: 19px; z-index: 1; color: var(--muted-foreground); }
.caption-skid { display: block; color: var(--foreground); font-weight: 600; }

.tile {
  flex-direction: column;
  gap: 8px;
  background: var(--muted);
  color: var(--muted-foreground-on-muted);
  font-weight: 500;
}

.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 0 24px;
}
.card-title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-height: 44px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

/* The title link covers the whole card; the email button sits above it. */
.card-link { color: var(--card-foreground); text-decoration: none; }
.card-link::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 1;
  border-radius: var(--radius-xl);
}
.card-link:hover { color: var(--card-foreground); text-decoration: underline; text-underline-offset: 3px; }
.card-link:focus-visible { box-shadow: none; }
.card-link:focus-visible::after { box-shadow: var(--ring-shadow); }

.card-refs {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.card-refs .mono { font-size: 13px; color: var(--foreground); }
.card-yard { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.card-aside {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.card-price {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-badges { padding: 0 24px; }

.card-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 24px;
}
.btn-card { height: 36px; padding: 0 12px; }
.card-foot .btn-primary { z-index: 2; }
/* Not a link of its own: a click here lands on the stretched title link. */
.card:hover .card-more { background: var(--accent); }

/* ── Unit page ───────────────────────────────────────────────────────────── */

.unit-page { padding-top: 24px; }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted-foreground);
  word-break: break-word;
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb a { color: var(--muted-foreground); text-decoration: none; border-radius: 4px; }
.breadcrumb a:hover { color: var(--foreground); }
.breadcrumb [aria-current="page"] { color: var(--foreground); }

.unit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
}
.unit-head-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.unit-head h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.025em; }
.unit-sub { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted-foreground); }
.unit-sub .mono { font-size: 15px; color: var(--foreground); }
.unit-head .badges { margin-top: 4px; }
.unit-back { flex-shrink: 0; }

.unit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 496px;
  gap: 24px;
  margin-top: 24px;
  align-items: stretch;
}

/* A shadcn card: header, body and footer, each with side padding. */
.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 0 24px;
}
.panel-head > :first-child { grid-column: 1; grid-row: 1; margin: 0; }
.panel-head h2 { font-size: 16px; line-height: 1; font-weight: 600; }
.panel-description { grid-column: 1; grid-row: 2; margin: 0; color: var(--muted-foreground); }
.panel-description .mono { color: var(--foreground); }
.panel-aside { grid-column: 2; grid-row: 1 / span 2; align-self: start; justify-self: end; }
.panel-body { padding: 0 24px; }
.panel-foot { margin: 0; padding: 0 24px; }
.separator { flex-shrink: 0; height: 1px; margin: 0 24px; background: var(--border); }
.note { color: var(--muted-foreground); font-size: 12px; line-height: 16px; }

.unit-rows, .line-ref { margin-top: 24px; }

/* Images: the first large, any others below it. Each carries its caption. */
.gallery .figure {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 8px;
  row-gap: 24px;
}
.gallery-main { flex: 1; padding: 0 24px; }
.gallery .img-box {
  grid-column: 1 / -1;
  align-self: start;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--background);
}
.gallery .img-box img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery .caption-icon { margin-top: 2px; color: var(--muted-foreground); }
.gallery figcaption { color: var(--muted-foreground); }
.gallery-more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 24px;
}
.gallery-more .figure { row-gap: 8px; grid-template-rows: auto auto; }
.gallery-more figcaption { font-size: 12px; line-height: 16px; }
.gallery-more .caption-icon { width: 12px; height: 12px; }
.tile-large {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 24px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
}

/* The price card. */
.action-price {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.action { display: flex; flex-direction: column; gap: 8px; }

.details-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
  margin-bottom: 12px;
}
.details-head h2 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.details-head p { margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.details-head .mono { color: var(--foreground); }
.skid-label {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

/* A compact definition list: label on the left, value on the right. */
.spec-list {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 8px;
  margin: 0;
}
.spec-list dt { color: var(--muted-foreground); }
.spec-list dd { margin: 0; overflow-wrap: anywhere; }
.spec-list dd.mono { font-size: 13px; }

/* The units table. position: relative keeps the hidden "Email" header text inside the scroll box. */
.table-wrap { position: relative; width: 100%; overflow-x: auto; border-radius: var(--radius-sm); }
.units-tbl { width: 100%; border-collapse: collapse; }
.units-tbl thead tr { border-bottom: 1px solid var(--border); }
.units-tbl thead th {
  height: 40px;
  padding: 0 8px;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  white-space: nowrap;
}
.units-tbl tbody tr { border-bottom: 1px solid var(--border); }
.units-tbl tbody tr:last-child { border-bottom: 0; }
.units-tbl tbody tr:hover { background: rgb(245 245 245 / 0.5); }
.units-tbl tbody th, .units-tbl td { padding: 8px; text-align: left; vertical-align: middle; white-space: nowrap; }
.units-tbl tbody th { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.units-tbl td .mono { font-size: 13px; }
.units-tbl tr.current, .units-tbl tr.current:hover { background: var(--primary-subtle); }
.units-tbl tr.current th { box-shadow: inset 2px 0 0 var(--primary); }
.tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font: 500 11px/18px var(--font-sans);
  vertical-align: 1px;
}
.status { display: inline-flex; align-items: center; gap: 6px; }

/* The line reference card: one family, or two side by side with a rule between. */
.families { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.families-two { grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); }
.families > .separator { width: 1px; height: auto; margin: 0; }
.family h3 { margin: 0 0 12px; font-size: 14px; line-height: 20px; font-weight: 600; }
.family-blurb { margin: 0 0 16px; line-height: 22px; }
.family h4 { margin: 16px 0 8px; color: var(--muted-foreground); font-size: 12px; line-height: 16px; font-weight: 500; }
.family .note { margin: 0; font-size: 14px; line-height: 20px; }
.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.docs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
}
.docs a:hover { text-decoration-color: currentColor; }
.docs .icon { color: var(--muted-foreground); }

.unit .not-affiliated { margin: 24px 0 0; color: var(--muted-foreground); }

/* ── The enquiry form (js/enquiry.js) ────────────────────────────────────── */

/* A real <dialog> opened with showModal(), so the browser draws the backdrop and
   keeps focus inside. The panel is the same card look as the rest of the page. */
.enquiry {
  width: 880px;   /* two columns on a wide screen; one on a phone */
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--shadow-md);
  /* clip, not hidden, so nothing can scroll the panel itself and take the title
     out of view when focus moves into a field. hidden is the fallback. */
  overflow: hidden;
  overflow: clip;
}
.enquiry::backdrop { background: rgb(0 0 0 / 0.5); }
.enquiry[open] { display: flex; flex-direction: column; }
/* The question form is the short one: the four contact fields and the question,
   so it needs none of the width the two-column quote form does. */
.enquiry-plain { width: 560px; }
/* The question form on the contact page: a card on the page, not a dialog. */
.enquiry.enquiry-inline {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 24px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  /* Clipped like the dialog, so the white bottom strip keeps the rounded corners. */
  overflow: hidden;
  overflow: clip;
}
.enquiry-inline .enquiry-body { overflow: visible; }

.enquiry-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 24px 12px;
}
.enquiry-head h2 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
}
.enquiry-close { flex-shrink: 0; margin: -6px -8px 0 0; color: var(--muted-foreground); }

.enquiry-form { display: contents; }
.enquiry-body { flex: 1 1 auto; padding: 0 24px; overflow-y: auto; }

/* What the button was for: the card title, then its refs with any prices. */
.enquiry-about {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}
.enquiry-about-title { margin: 0; font-weight: 600; text-wrap: balance; }
.enquiry-refs {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 120px;   /* exactly five rows, so none is cut in half */
  overflow-y: auto;
  color: var(--muted-foreground-on-muted);
}
.enquiry-refs li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.enquiry-refs .mono { color: var(--foreground); font-size: 13px; }
.enquiry-ref-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.enquiry-about-count { margin: 2px 0 0; color: var(--muted-foreground-on-muted); }
.enquiry-about-count:empty { display: none; }

.enquiry-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }

/* The two columns of the Resin8 form: what they want on the left, where it goes
   on the right, and the conditions across the bottom. */
.enquiry-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
.enquiry-col { min-width: 0; }
.enquiry-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
.enquiry-reqs { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.enquiry-h3 { margin: 24px 0 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.enquiry-reqs .enquiry-h3 { margin-top: 0; }

.enquiry-field { margin-top: 16px; }
.enquiry-field label, .enquiry-label { display: block; margin-bottom: 6px; font-weight: 500; }
.enquiry-required { margin-left: 2px; color: var(--primary); }
.enquiry-optional { color: var(--muted-foreground); font-weight: 400; }

/* A quiet line under a field or a heading: the address hint, the currency note,
   and how many units the card covers. */
.enquiry-help { margin: 6px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 18px; }
.enquiry-help:empty { display: none; }
.enquiry-help-lead { margin-top: 4px; }

/* The pricing preference: two buttons in one groove, the pressed one raised. */
.enquiry-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--muted);
}
.enquiry-seg-btn {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground-on-muted);
  font: 500 14px/20px var(--font-sans);
  cursor: pointer;
}
.enquiry-seg-btn:hover { color: var(--foreground); }
.enquiry-seg-btn[aria-pressed="true"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.enquiry-seg-btn:focus-visible { outline: none; box-shadow: var(--ring-shadow); }

/* The money box: the currency sits beside the field and is never typed. */
.enquiry-money { position: relative; }
.enquiry-money-sign, .enquiry-money-code {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--muted-foreground);
  pointer-events: none;
}
.enquiry-money-sign { left: 12px; }
.enquiry-money-code { right: 12px; font-variant-numeric: tabular-nums; }
.enquiry-money-input { padding-left: 24px; padding-right: 48px; }

/* Our own boxes, not the browser's steppers: the form's own check is the rule. */
.enquiry-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.enquiry-input[type="number"]::-webkit-outer-spin-button,
.enquiry-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.enquiry-qty { max-width: 160px; }
.enquiry-upper { text-transform: uppercase; }

/* The timeline menu: a native select dressed like the rest of the form. */
.enquiry-select { position: relative; display: block; }
.enquiry-select select { padding-right: 36px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.enquiry-select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -8px;
  opacity: 0.5;
  color: var(--muted-foreground);
  pointer-events: none;
}

/* The conditions. A real checkbox, in Penrith green. */
.enquiry-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-weight: 500;
  cursor: pointer;
}
.enquiry-check input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.enquiry-check input:focus-visible { outline: none; box-shadow: var(--ring-shadow); }

.enquiry-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  box-shadow: var(--shadow-xs);
}
.enquiry-textarea { height: auto; padding: 8px 12px; resize: vertical; min-height: 84px; }
/* The ring is restated here because the box's own shadow above would otherwise
   take the site-wide one's place, leaving a keyboard user with nothing to see.
   It is drawn outside the border, so it still shows on a field marked wrong. */
.enquiry-input:focus-visible { border-color: var(--ring); box-shadow: var(--ring-shadow); }
.enquiry-input[aria-invalid="true"] { border-color: #b42318; }

/* Empty until there is something to say, so it takes no room in the layout. */
.enquiry-error { margin: 0; color: #b42318; font-size: 13px; line-height: 18px; }
.enquiry-error:empty { display: none; }

/* The honeypot: no person ever sees it, and the tab order skips it. */
.enquiry-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.enquiry-turnstile { margin-top: 16px; }

.enquiry-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.enquiry-privacy { margin: 0; color: var(--muted-foreground); }
/* The form's spoken status: "Sending...", and every message from the server that
 * belongs to no one field. It is never hidden, even while it is empty. Hiding an
 * empty live region takes it out of the accessibility tree, and a screen reader
 * will usually say nothing at all when the text and the element arrive together.
 * It keeps one line's height instead, so the layout does not jump. */
.enquiry-status {
  margin: 0;
  min-height: 20px;
  color: var(--foreground);
  font-weight: 500;
  line-height: 20px;
}
.enquiry-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.enquiry-fallback { margin: 0; color: var(--muted-foreground); text-align: right; }
.enquiry-fallback a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }

/* After a request has gone. */
.enquiry-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 32px;
  text-align: center;
}
/* Focus lands on this panel so a screen reader reads what it says instead of the
   word "Close". It runs to the dialog's own edges, so its ring is drawn inside:
   an outside one is clipped to a stray green line along the top. */
.enquiry-done:focus-visible { box-shadow: inset var(--ring-shadow); }
.enquiry-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: var(--primary-subtle);
  color: var(--primary);
}
.enquiry-done-title { margin: 0; font-size: 16px; font-weight: 600; }
.enquiry-done-text { margin: 0; max-width: 40ch; color: var(--muted-foreground); text-wrap: balance; }

/* ── Text pages: terms, takedown, 404 ────────────────────────────────────── */

.text-page { max-width: 832px; padding-top: 24px; }
.text-page .breadcrumb { margin-bottom: 16px; }
.prose { display: block; padding: 32px; }
.prose h1 { margin: 0 0 16px; font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.025em; }
.prose h2 { margin: 32px 0 8px; font-size: 18px; line-height: 28px; font-weight: 600; }
.prose p, .prose li { font-size: 16px; line-height: 26px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.details { margin: 0; border-top: 1px solid var(--border); }
.details div {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.details dt { color: var(--muted-foreground); }
.details dd { margin: 0; }
.placeholder-box {
  padding: 16px;
  border: 1px dashed #d97706;
  border-radius: var(--radius-lg);
  background: #fffbeb;
  color: #92400e;
}
.placeholder-box p:last-child { margin-bottom: 0; }
.placeholder {
  padding: 0 4px;
  border: 1px dashed #d97706;
  border-radius: var(--radius-sm);
  background: #fef3c7;
  color: #92400e;
  font-weight: 500;
}
.back { margin: 16px 0 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer { margin-top: 40px; border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 24px;
  color: var(--muted-foreground);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.footer-row p, .footer-links { margin: 0; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.footer-brand img { display: block; height: 24px; width: auto; }
.footer-email a { color: var(--foreground); font-weight: 500; text-decoration: none; border-radius: 4px; }
.footer-email a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* The footer's address opens the question form (js/enquiry.js) instead of a mail
   app, so it is a button now and has to look exactly like the link it replaced.
   The focus ring is the site-wide one. */
.link-button {
  font: inherit;
  color: var(--foreground);
  font-weight: 500;
  background: none;
  border: 0;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer .not-affiliated { max-width: 760px; }
.updated::after { content: '·'; margin: 0 8px; }
.footer-links a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 4px; border-radius: 4px; }
.footer-links a:hover { text-decoration-color: currentColor; }

/* ── Motion: only when the visitor has not asked for less ────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .tabs a, .main-nav a, .search-box, .select-wrap, .header-search,
  .docs a, .footer-links a {
    transition-property: color, background-color, border-color, box-shadow, text-decoration-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* No key hint where there is no keyboard to press it on. */
@media (hover: none) {
  .kbd-hint { display: none; }
}

/* ── In between: two card columns, one unit column ───────────────────────── */

@media (max-width: 1100px) {
  .unit-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery .img-box { max-width: 480px; margin-inline: auto; width: 100%; }
  .tile-large { width: calc(100% - 48px); max-width: 480px; margin-inline: auto; }
}

/* Below 1200px the toolbar row is too short for everything: the email note
   takes its own row and the sort menu stays at the right end. */
@media (max-width: 1199px) {
  .email-note { flex-basis: 100%; order: 5; margin-left: 0; }
  .select-wrap { margin-left: auto; }
}

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-search { width: 200px; }
}

/* ── Phones (F-Phone at 390px) ───────────────────────────────────────────── */

@media (max-width: 767px) {
  :root { --gutter: 16px; }

  .hide-sm { display: none !important; }

  .site-header { height: 56px; }
  .header-inner { padding: 0 6px 0 16px; gap: 12px; }
  .brand { min-height: 44px; }
  .brand img { height: 24px; }
  .main-nav, .header-actions { display: none; }
  .mobile-menu { display: block; }
  .btn-icon { width: 44px; height: 44px; }

  .hero { align-items: stretch; text-align: left; padding-top: 20px; padding-bottom: 12px; }
  .hero h1 { font-size: 24px; line-height: 32px; letter-spacing: -0.025em; }
  .hero-logo { width: 180px; }
  .hero-lead { display: none; }
  .search { width: 100%; margin-top: 16px; }
  .kbd-hint { display: none; }
  .tabs-scroll { width: auto; margin: 8px -16px 0; padding: 4px 16px; }
  .tabs { margin: 0; height: 50px; }
  .tabs a { padding: 0 12px; }

  /* The toolbar: counts on the left, a Filter button that opens the section and sort controls. */
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .toolbar-summary { display: block; min-width: 0; }
  .count { margin: 0; }
  .email-note { margin: 0; font-size: 12px; line-height: 16px; }
  .filter-toggle { display: inline-flex; height: 44px; padding: 0 14px; }
  .filter-count { padding: 0 6px; min-width: 20px; justify-content: center; }
  .filter-panel {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
  }
  .toolbar.filters-open .filter-panel { display: flex; }
  .section-filter { display: block; }
  .section-filter::after, .section-button { display: none; }
  .section-panel {
    display: block;
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .section-panel-label { padding: 0 0 8px; }
  .chips { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .chip {
    width: auto;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
  }
  .chip-check { display: none; }
  .chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
  .chip[aria-pressed="true"] .chip-check { display: inline-block; color: var(--primary-foreground); }
  .select-wrap { width: 100%; height: 44px; margin-left: 0; }
  .select-wrap select { flex: 1; }

  .grid { grid-template-columns: minmax(0, 1fr); }
  .card-media { height: 145px; }
  .card-media .img-box { width: 192px; height: 144px; }
  .card-title .card-link { display: block; min-height: 44px; }
  .btn-card { height: 44px; }
  .card-foot { justify-content: flex-start; }
  .card-foot .btn-primary { flex: 1; }
  .card-more { padding: 0 16px; }

  .unit-page { padding-top: 16px; }
  .unit-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .unit-head h1 { font-size: 24px; line-height: 32px; }
  .unit-grid { margin-top: 16px; gap: 16px; }
  .unit-rows, .line-ref { margin-top: 16px; }
  .panel { gap: 20px; padding: 20px 0; }
  .panel-head, .panel-body, .panel-foot, .gallery-main, .gallery-more { padding-inline: 16px; }
  .separator { margin-inline: 16px; }
  .tile-large { width: auto; margin-inline: 16px; }
  .spec-list, .details div { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .families-two { grid-template-columns: minmax(0, 1fr); }
  .families > .separator { width: auto; height: 1px; }
  /* Every button is at least 44px tall on phones, as in F-Phone. */
  .btn, .btn-lg, .btn-sm { min-height: 44px; }

  /* The form fills the screen, one field per row, and its buttons stretch. */
  .enquiry {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .enquiry-head, .enquiry-body { padding-inline: 16px; }
  .enquiry-foot { padding: 16px; }
  .enquiry-fields, .enquiry-cols, .enquiry-pair { grid-template-columns: minmax(0, 1fr); }
  .enquiry-input { height: 44px; }
  .enquiry-textarea { height: auto; }
  .enquiry-qty { max-width: none; }
  .enquiry-seg-btn { min-height: 40px; }
  .enquiry-check { min-height: 44px; align-items: center; }
  .enquiry-actions { flex-direction: column; }
  .enquiry-actions .btn { width: 100%; }
  .enquiry-fallback { text-align: center; }

  .prose { padding: 20px 16px; }
  .prose h1 { font-size: 24px; line-height: 32px; }

  .footer-row { flex-direction: column; align-items: flex-start; }
}

/* ── Resin8 search in the top box (Hugo 2026-11-09) ─────────────────────────
   Shown only when /api/chat says Resin8 search is on. The notice sits under the
   box in small print; the Resin8 line above the results reuses the search note. */
.search-ask { flex-shrink: 0; margin-right: 6px; }
.resin8-note { border-color: rgb(0 122 79 / 0.32); background: rgb(0 122 79 / 0.06); color: var(--foreground); }
.resin8-note strong { font-weight: 600; }
.resin8-note .resin8-para { display: block; }
.resin8-note .resin8-para + .resin8-para { margin-top: 6px; }
.resin8-note .resin8-unit { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.resin8-note.is-thinking { background: var(--muted); color: var(--muted-foreground-on-muted); border-color: var(--border); }

/* ── Ask Resin8: the chat in a panel on the right (Hugo 2026-11-19) ──────────
   After the reference layout Hugo gave (SPEC.md): the list on the left and the panel on the
   right, which stays in view with its own scroll while the list scrolls, and folds to a
   strip from the tab on its inner edge. The list keeps normal page scroll, so Back and
   shared links still land where they should. Phones and tablets get a full-screen sheet
   from the "Ask Resin8" button instead. */
.catalog-layout { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; min-width: 0; }

.ask-panel { display: none; background: var(--background); }
.ask-toggle { display: none; }
.ask-body { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.ask-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; }
.ask-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
/* Focus lands on the title only when the sheet opens; it is not a control. */
.ask-title:focus, .ask-title:focus-visible { outline: none; box-shadow: none; }
.ask-close { display: none; margin: -6px -8px 0 0; color: var(--muted-foreground); }
.ask-lead { grid-column: 1 / -1; margin: 0; color: var(--muted-foreground); text-wrap: pretty; }
.ask-examples-label { margin: 0 0 8px; color: var(--muted-foreground); font-size: 12px; line-height: 16px; font-weight: 500; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--background);
  color: var(--foreground);
  font: 500 12px/16px var(--font-sans);
  text-align: left;
  cursor: pointer;
}
.ask-chip:hover { background: var(--accent); }
.ask-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ask-input {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 8px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font: 400 14px/20px var(--font-sans);
  resize: vertical;
  box-shadow: var(--shadow-xs);
}
/* Restated so the box's own shadow does not hide the site-wide focus ring. */
.ask-input:focus-visible { border-color: var(--ring); box-shadow: var(--ring-shadow); }
.ask-actions { display: flex; gap: 8px; }
.ask-submit { flex: 1; }

/* The conversation: always in the page while the panel shows, since it is the live region. */
.ask-reply { flex: 1 0 auto; display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--border); }
.ask-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: auto 0;
  padding: 16px 8px;
  color: var(--muted-foreground);
  text-align: center;
  text-wrap: balance;
}
.ask-empty p { margin: 0; max-width: 34ch; }
.ask-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--foreground);
}
.ask-turn { padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-md); overflow-wrap: anywhere; }
.ask-turn-q { align-self: flex-end; max-width: 90%; background: var(--muted); color: var(--foreground); }
.ask-turn-a { border-color: rgb(0 122 79 / 0.32); background: rgb(0 122 79 / 0.06); color: var(--foreground); }
.ask-turn-a.is-thinking { border-color: var(--border); background: var(--muted); color: var(--muted-foreground-on-muted); }
.ask-who { display: block; margin-bottom: 2px; color: var(--muted-foreground-on-muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.ask-turn-a .ask-who { color: var(--primary); }
.ask-turn-a.is-thinking .ask-who { color: var(--muted-foreground-on-muted); }
.ask-turn strong { font-weight: 600; }
.ask-turn .resin8-para { display: block; }
.ask-turn .resin8-para + .resin8-para { margin-top: 6px; }
.ask-turn .resin8-unit { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ask-picks-note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.ask-picks-note .icon { color: var(--primary); }
/* Phones only: the sheet covers the list, so the answer offers the way to the picks. */
.ask-see-picks { display: none; }

/* The way back to the whole list, next to the count while a question is set. */
.search-reset { order: 2; }

.ask-open {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  height: 48px;
  padding: 0 18px 0 16px;
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: no-preference) {
  .ask-chip, .ask-toggle, .ask-input {
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Phones and tablets: the sheet covers the screen and scrolls on its own. These are exactly
   the widths the wide panel does not take, so no width (1023.5px at some zoom levels) gets
   neither. */
@media not all and (min-width: 1024px) {
  .catalog-layout:not(.ask-off) ~ .site-footer { padding-bottom: 72px; }   /* room for the Ask Resin8 button */
  html.ask-sheet-open { overflow: hidden; }
  .ask-panel.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ask-panel.is-open .ask-body { min-height: 100%; padding: 16px; }
  .ask-close { display: inline-flex; }
  .ask-chip { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .ask-see-picks { display: inline-flex; justify-content: center; }
}

/* Phones: the examples two to a row, so the box and the answer are not pushed off screen. */
@media (max-width: 767px) {
  .ask-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ask-chip { min-height: 44px; padding: 6px 10px; border-radius: var(--radius-md); line-height: 18px; }
}

/* Wide screens: the panel beside the list. */
@media (min-width: 1024px) {
  .catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .ask-open { display: none; }
  /* --ask-top is how far below the window's top the panel starts (the header, near the
     page's top); catalog.js keeps it as the page scrolls, so the panel's end stays on screen. */
  .ask-panel {
    display: block;
    position: sticky;
    top: 0;
    width: clamp(300px, 24vw, 380px);
    height: calc(100vh - var(--ask-top, 0px));
    height: calc(100dvh - var(--ask-top, 0px));
    border-left: 1px solid var(--border);
  }
  .ask-body { height: 100%; overflow-y: auto; }
  .ask-toggle {
    display: inline-flex;
    position: absolute;
    top: 22px;
    left: -14px;
    z-index: 3;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--background);
    color: var(--foreground);
    font: 500 14px/20px var(--font-sans);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }
  .ask-toggle:hover { background: var(--accent); }
  .ask-toggle-text { display: none; }
  .catalog-layout.ask-collapsed .ask-panel { width: 44px; }
  .catalog-layout.ask-collapsed .ask-body { display: none; }
  .catalog-layout.ask-collapsed .ask-toggle {
    position: static;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    height: auto;
    padding: 20px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .catalog-layout.ask-collapsed .ask-toggle:hover { background: var(--accent); }
  .catalog-layout.ask-collapsed .ask-toggle .icon { transform: rotate(180deg); }
  .catalog-layout.ask-collapsed .ask-toggle-text { display: block; writing-mode: vertical-rl; }
  /* With the panel open, Resin8 answers there rather than above the list as well. */
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .resin8-note { display: none; }
  /* Beside the panel the list is narrower: two card columns until the screen is wide, and
     compact cards, so the two buttons share a row and the location is never cut. */
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .catalog { --gutter: 24px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card { gap: 16px; padding-bottom: 16px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-head,
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-badges,
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-foot { padding: 0 16px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .btn-card { height: 32px; padding: 0 10px; gap: 6px; font-size: 13px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-more .icon { display: none; }
  /* The location on a line of its own: the dot before it becomes the line break. */
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-refs { flex-wrap: wrap; row-gap: 2px; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .card-refs .sep-dot { flex-basis: 100%; height: 0; overflow: hidden; }
}

@media (min-width: 1024px) and (max-width: 1599px) {
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .email-note { flex-basis: 100%; order: 5; margin-left: 0; }
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .select-wrap { margin-left: auto; }
}

@media (min-width: 1280px) {
  .catalog-layout:not(.ask-collapsed):not(.ask-off) .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
