/* Dovetail Parts: an example trade catalogue by In Good Order. Fictional business, parts and prices.
   Art direction: an engineering drawing on light-blue drafting paper. Navy ink for type, rules and primary actions;
   one compact heavy grotesk for headlines and part numbers; hairline rules instead of cards.
   Shapes: actions and steppers 8-10px radius, the angle filter a pill, everything else square. */

@font-face {
  font-family: "Dovetail Grotesk";
  src: url(/bearing/fonts/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #d1e1f1;  /* the photograph's own backdrop, so the hinge sits on the page */
  --paper-light: #dce8f5;
  --paper-sheet: #f6f9fd;
  --navy: #0e2352;
  --navy-hover: #183476;
  --ink: #0f1c38;
  --ink-dim: rgba(15, 28, 56, 0.72);
  --rule: rgba(14, 35, 82, 0.18);
  --rule-strong: rgba(14, 35, 82, 0.42);
  --wash: rgba(255, 255, 255, 0.42);
  --green: #24894a;
  --amber: #a8650f;
  --font: "Dovetail Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(18px, 4vw, 56px);
  --max: 1440px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --radius: 9px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-padding-top: 16px; }
body { min-height: 100vh; background: var(--paper); }
/* Tabular figures only where numbers line up (Inter's tnum also widens hyphens). */
.c-price, .c-stock, .qty, .dims dd, .breaks dd, .totals dd, .ql-total, .ql-each, .sheet-table .num, .quote-count, .sheet-meta dd { font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -80px; z-index: 50; padding: 10px 14px; background: var(--navy); color: #fff; border-radius: var(--radius); }
.skip:focus { top: 10px; }
.part-no { font-weight: 750; letter-spacing: -0.01em; color: var(--navy); }

/* ---------- Example notice ---------- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding: 8px var(--pad); background: var(--navy); color: #e6eefb; font-size: 13.5px; }
.demo-bar strong { font-weight: 650; color: #fff; }
.demo-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.demo-bar a { display: inline-flex; align-items: center; min-height: 32px; color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.45); text-underline-offset: 3px; }
.demo-bar a:hover { text-decoration-color: #fff; }
.demo-bar :focus-visible { outline-color: #fff; }

/* ---------- Header ---------- */
.top {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; column-gap: clamp(16px, 2.4vw, 36px);
  max-width: var(--max); margin: 0 auto; padding: 18px var(--pad); border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding-right: clamp(16px, 2.4vw, 36px); border-right: 1px solid var(--rule-strong); }
.brand-mark { width: 44px; height: 26px; fill: var(--navy); }
.brand-name { font-size: clamp(22px, 2.2vw, 30px); font-weight: 650; letter-spacing: -0.03em; color: var(--navy); white-space: nowrap; }
.top-nav { display: flex; gap: clamp(14px, 2vw, 30px); }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16.5px; font-weight: 560; color: var(--ink); text-decoration: none; background: linear-gradient(var(--navy), var(--navy)) left calc(100% - 8px) / 0 2px no-repeat; transition: background-size .3s var(--ease); }
.top-nav a:hover { background-size: 100% 2px; }
.search-jump {
  justify-self: end; display: inline-flex; align-items: center; gap: 12px; width: min(100%, 340px); min-height: 46px; padding: 0 12px 0 14px;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); color: var(--ink-dim); font-size: 15px; text-align: left; transition: border-color .2s;
}
.search-jump:hover { border-color: var(--navy); }
.search-jump-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: 600 12px/1 var(--font); padding: 4px 7px; border: 1px solid var(--rule-strong); border-radius: 5px; color: var(--ink-dim); }
.search-glass { position: relative; flex: none; width: 17px; height: 17px; }
.search-glass::before { content: ""; position: absolute; inset: 0 3px 3px 0; border: 2px solid currentColor; border-radius: 50%; }
.search-glass::after { content: ""; position: absolute; right: 0; bottom: 0; width: 6px; height: 2px; background: currentColor; transform: rotate(45deg); transform-origin: right center; }
.quote-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 6px 0 16px; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; color: var(--navy); border: 1.5px solid var(--navy); transition: background .2s, color .2s;
}
.quote-button:hover { background: var(--navy); color: #fff; }
.quote-count { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 700; }
.quote-button:hover .quote-count { background: #fff; color: var(--navy); }
.quote-count.bump { animation: bump .42s var(--ease); }
@keyframes bump { 40% { transform: scale(1.22); } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 5.4fr) minmax(0, 6.6fr); gap: 32px clamp(24px, 4vw, 64px); align-items: center;
  max-width: var(--max); margin: 0 auto; padding: clamp(36px, 5vw, 72px) var(--pad) clamp(40px, 5vw, 72px);
}
.hero h1 {
  font-size: clamp(56px, 6.9vw, 112px); font-weight: 820; line-height: 0.9; letter-spacing: -0.058em; color: var(--navy);
  padding-bottom: 0.06em; text-wrap: balance;
}
.hero-lede { margin-top: clamp(20px, 2.4vw, 30px); max-width: 33em; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; color: var(--ink-dim); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: clamp(24px, 3vw, 36px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 52px; padding: 0 24px;
  border-radius: var(--radius); font-size: 17px; font-weight: 620; text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-ghost { border: 1.5px solid var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--wash); }
.hero .btn-primary { min-height: 62px; padding: 0 30px; font-size: clamp(17px, 1.4vw, 21px); }
.chev { width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-top: 2.5px solid currentColor; transform: rotate(45deg); transition: transform .25s var(--ease); }
.btn:hover .chev { transform: translateX(3px) rotate(45deg); }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 560; color: var(--navy); text-decoration: underline; text-decoration-thickness: 1.5px; text-decoration-color: var(--rule-strong); text-underline-offset: 5px; }
.text-link:hover { text-decoration-color: var(--navy); }

.hero-figure { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(120px, 13vw, 190px); grid-template-areas: "photo photo" "spec swing"; gap: 0 clamp(16px, 2vw, 28px); align-items: end; }
.hero-photo { grid-area: photo; position: relative; }
.hero-photo img {
  display: block; width: 100%; height: auto;
  /* Feather the photograph's edges into the paper. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}
/* Dimension callouts drawn over the photograph, in the photograph's own coordinates. */
.dim-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dim-overlay marker path { fill: var(--navy); }
.dim .dl { stroke: var(--navy); stroke-width: 2.6; }
.dim .ext { stroke: var(--navy); stroke-width: 1.6; opacity: 0.6; }
.dim .cup-ring { fill: none; stroke: var(--navy); stroke-width: 2.2; stroke-dasharray: 10 8; opacity: 0.75; }
.dim text { font: 600 40px/1 var(--font); fill: var(--navy); letter-spacing: -0.01em; }
.hero-photo.is-missing .dim-overlay { display: none; }
/* The callouts draw in once the photograph is on screen. */
.js .dim { opacity: 0; transition: opacity .5s var(--ease); }
.js .dim .dl { stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset .9s var(--ease); }
.js .dims-on .dim { opacity: 1; }
.js .dims-on .dim .dl { stroke-dashoffset: 0; }
.js .dims-on .dim-height, .js .dims-on .dim-height .dl { transition-delay: .25s; }
.js .dims-on .dim-cup, .js .dims-on .dim-cup .dl { transition-delay: .5s; }
.photo-missing { display: none; }
.hero-photo.is-missing img { visibility: hidden; }
.hero-photo.is-missing .photo-missing {
  display: grid; place-items: center; position: absolute; inset: 6% 4%; border: 1.5px dashed var(--rule-strong); border-radius: 4px;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.hero-spec { grid-area: spec; padding-top: 14px; border-top: 1.5px solid var(--navy); }
.hero-spec-part { font-size: 15px; color: var(--ink-dim); }
.hero-spec-part .part-no { margin-right: 8px; font-size: 17px; }
.dims { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; margin-top: 12px; }
.dims div { padding: 0 clamp(12px, 1.6vw, 22px); border-left: 1px solid var(--rule-strong); }
.dims div:first-child { padding-left: 0; border-left: 0; }
.dims dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.dims dd { margin-top: 2px; font-size: clamp(17px, 1.5vw, 21px); font-weight: 650; letter-spacing: -0.01em; color: var(--navy); white-space: nowrap; }
.hero-swing { grid-area: swing; }

/* The door-swing drawing (hero and filter gauge). */
.swing { display: block; width: 100%; height: auto; overflow: visible; }
.swing .carcass { stroke: var(--navy); stroke-width: 1.5; }
.swing .hatch-line { stroke: var(--navy); stroke-width: 1.2; }
.swing .closed-line { stroke: var(--navy); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: 0.55; }
.swing .door { fill: var(--paper-sheet); stroke: var(--navy); stroke-width: 1.6; }
.swing .swing-arc { fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 5 4; }
.swing .swing-label { font: 650 22px/1 var(--font); fill: var(--navy); letter-spacing: -0.02em; }

/* ---------- Filters ---------- */
.catalogue { max-width: var(--max); margin: 0 auto; }
.filters {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "angle gauge" "selects gauge"; align-items: center; gap: 16px clamp(20px, 3vw, 48px);
  padding: 20px var(--pad); background: var(--paper-light); border-block: 1px solid var(--rule);
}
.angle-set { grid-area: angle; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; border: 0; }
.selects { grid-area: selects; padding-top: 16px; border-top: 1px solid var(--rule); }
/* A live drawing of the chosen opening angle. */
.gauge { grid-area: gauge; align-self: stretch; display: grid; align-content: center; justify-items: center; width: clamp(150px, 14vw, 210px); padding-left: clamp(20px, 3vw, 48px); border-left: 1px solid var(--rule-strong); }
.gauge-caption { margin-top: 2px; font-size: 12px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.angle-set legend { float: left; font-size: 19px; font-weight: 680; letter-spacing: -0.015em; color: var(--navy); }
.segments { display: inline-flex; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.25); }
.segments label { position: relative; display: block; }
.segments input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segments span { display: grid; place-items: center; min-width: 64px; min-height: 46px; padding: 0 16px; font-size: 17px; font-weight: 560; color: var(--ink); transition: background .25s var(--ease), color .25s; }
.segments label + label span { border-left: 1px solid var(--rule); }
.segments input:hover + span { background: var(--wash); }
.segments input:checked + span { background: var(--navy); color: #fff; }
.segments input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: -5px; border-radius: 999px; box-shadow: inset 0 0 0 3px #fff; }
.swing-gauge { width: 100%; }
.swing-gauge .swing-label { font-size: 24px; }
.selects { display: flex; flex-wrap: wrap; align-items: center; gap: 14px clamp(16px, 2.4vw, 32px); }
.c-angle, .c-overlay, .c-mount, .c-cup, .c-stock { white-space: nowrap; }
.select { display: inline-flex; align-items: center; gap: 12px; }
.select > span, .sort > span { font-size: 15px; font-weight: 650; color: var(--ink); }
select {
  appearance: none; min-height: 46px; padding: 0 40px 0 14px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  /* A drawn chevron: two half-filled squares, so no image is needed. */
  background-color: rgba(255, 255, 255, 0.3);
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 21px) 52%, calc(100% - 15px) 52%; background-size: 6px 6px; background-repeat: no-repeat;
  font-size: 16px; cursor: pointer; transition: border-color .2s;
}
select:hover { border-color: var(--navy); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; font-size: 15.5px; font-weight: 560; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); cursor: pointer; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px clamp(16px, 2.4vw, 32px); padding: 22px var(--pad) 8px; }
.cats { display: flex; flex-wrap: wrap; gap: 4px clamp(14px, 2vw, 26px); }
.cats button { min-height: 44px; font-size: 16px; font-weight: 560; color: var(--ink-dim); background: linear-gradient(var(--navy), var(--navy)) left calc(100% - 6px) / 0 2px no-repeat; transition: background-size .3s var(--ease), color .2s; }
.cats button:hover { color: var(--ink); }
.cats button[aria-pressed="true"] { color: var(--navy); font-weight: 680; background-size: 100% 2px; }
.search { position: relative; display: flex; align-items: center; flex: 1 1 320px; max-width: 560px; margin-left: auto; color: var(--ink-dim); }
.search .search-glass { position: absolute; left: 15px; }
.search input {
  width: 100%; min-height: 48px; padding: 0 14px 0 44px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.3); font-size: 16px; color: var(--ink); transition: border-color .2s, background .2s;
}
.search input::placeholder { color: rgba(15, 28, 56, 0.6); }
.search input:hover { border-color: var(--navy); }
.search input:focus { outline: none; border-color: var(--navy); background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 3px rgba(14, 35, 82, 0.16); }
.sort { display: inline-flex; align-items: center; gap: 10px; }
.result-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 6px var(--pad) 12px; font-size: 14.5px; color: var(--ink-dim); }
.result-line [data-result-count] { font-weight: 650; color: var(--ink); }
.link-button { display: inline; min-height: 0; padding: 0; font-weight: 600; color: var(--navy); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.link-button:hover { text-decoration-color: var(--navy); }

/* ---------- Parts table ---------- */
.table-wrap { padding: 0 calc(var(--pad) - 18px); }
.parts { width: 100%; border-collapse: collapse; font-size: 16px; }
.parts thead th { padding: 14px 18px 12px; font-size: 12px; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-dim); text-align: left; border-bottom: 1.5px solid var(--navy); white-space: nowrap; }
.parts td, .parts tbody th { padding: 10px 18px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); font-weight: 400; }
.part-row { transition: background .2s; }
.part-row:hover, .part-row.is-expanded { background: var(--wash); }
.part-row[hidden], .spec-row[hidden] { display: none; }
.part-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-align: left; }
.part-toggle .part-no { font-size: 19px; }
.toggle-mark { position: relative; width: 18px; height: 18px; border: 1.5px solid var(--rule-strong); border-radius: 50%; transition: border-color .2s, transform .3s var(--ease); }
.toggle-mark::before, .toggle-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 1.5px; background: var(--navy); transform: translate(-50%, -50%); }
.toggle-mark::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .3s var(--ease); }
.part-toggle:hover .toggle-mark { border-color: var(--navy); }
.part-toggle[aria-expanded="true"] .toggle-mark::after { transform: translate(-50%, -50%) rotate(0deg); }
.c-desc { min-width: 220px; }
@media (min-width: 1440px) { .c-desc { min-width: 260px; } }
.cat-tag { display: none; }
.na { display: inline-block; width: 14px; height: 1.5px; vertical-align: middle; background: var(--rule-strong); }
.c-price { font-weight: 600; white-space: nowrap; }
.stock { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.stock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.stock.is-low { color: var(--amber); }
.stock.is-low .stock-dot { background: var(--amber); }
.c-buy { width: 1%; white-space: nowrap; }
.buy { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.no-js .buy { display: none; }
.stepper { display: inline-flex; align-items: stretch; height: 42px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.35); }
.step { width: 38px; font-size: 19px; line-height: 1; color: var(--navy); transition: background .15s; }
.step:hover { background: var(--wash); }
.step:first-child { border-radius: 7px 0 0 7px; }
.step:last-child { border-radius: 0 7px 7px 0; }
.qty { width: 46px; border: 0; background: transparent; text-align: center; font-size: 16.5px; font-weight: 600; -moz-appearance: textfield; }
.qty::-webkit-outer-spin-button, .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty:focus { outline: none; }
.stepper:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14, 35, 82, 0.16); }
.add {
  position: relative; display: inline-grid; place-items: center; min-width: 96px; height: 44px; padding: 0 18px; border-radius: var(--radius);
  background: var(--navy); color: #fff; font-size: 16px; font-weight: 650; transition: background .2s, transform .15s;
}
.add:hover { background: var(--navy-hover); }
.add:active { transform: translateY(1px); }
.add.is-added { background: var(--green); }

/* Row entrance when filters bring a part back into the list. */
.part-row.is-entering { animation: row-in .32s var(--ease) both; animation-delay: var(--delay, 0ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }

/* Specification row: opens by height, then its content settles. */
.spec-row td { padding: 0; border-bottom: 1px solid var(--rule); background: var(--wash); }
.spec-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .34s var(--ease); }
.spec-row.is-open .spec-wrap { grid-template-rows: 1fr; }
.no-js .spec-wrap { grid-template-rows: 1fr; }
.spec-inner { overflow: hidden; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px clamp(24px, 4vw, 56px); }
.spec-row.is-open .spec-inner, .no-js .spec-inner { padding: 22px 18px 26px; }
.spec-inner { padding: 0 18px; transition: padding .34s var(--ease); }
.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; }
.spec-grid div { padding-top: 8px; border-top: 1px solid var(--rule); }
.spec-grid dt, .spec-head, .breaks dt { font-size: 11.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.spec-grid dd { margin-top: 3px; font-size: 15.5px; font-weight: 560; color: var(--ink); }
.spec-side { padding-left: clamp(16px, 2.4vw, 32px); border-left: 1.5px solid var(--navy); }
.breaks { margin-top: 10px; }
.breaks div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.breaks dd { font-weight: 650; }
.spec-pair { margin-top: 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }
.spec-pair strong { font-weight: 700; color: var(--navy); }
.spec-pair .link-button { display: inline-block; margin-top: 6px; }
.no-js .spec-pair .link-button { display: none; }
.no-js .spec-row[hidden] { display: table-row; }
.no-js .toggle-mark { display: none; }

.empty { padding: 48px 18px 56px; border-bottom: 1px solid var(--rule); }
.empty-head { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.empty p + p { margin-top: 8px; color: var(--ink-dim); }
.fine { padding: 16px var(--pad) 0; font-size: 13.5px; color: var(--ink-dim); }

/* ---------- Guide ---------- */
.guide { max-width: var(--max); margin: clamp(64px, 8vw, 112px) auto 0; padding: 0 var(--pad); }
.guide h2 { font-size: clamp(38px, 4.6vw, 64px); font-weight: 800; line-height: 0.98; letter-spacing: -0.05em; color: var(--navy); padding-bottom: 0.05em; }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(24px, 3.6vw, 56px); margin-top: clamp(24px, 3vw, 40px); padding-top: 22px; border-top: 1.5px solid var(--navy); }
.guide-item h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: var(--navy); }
.guide-item p { margin-top: 10px; max-width: 34em; font-size: 16px; line-height: 1.6; color: var(--ink-dim); text-wrap: pretty; }
.guide-item a { color: var(--navy); font-weight: 600; text-underline-offset: 3px; }
.guide-angle p { font-size: 18px; color: var(--ink); }
.overlay-diagram { display: block; width: 100%; max-width: 300px; height: auto; margin-top: 14px; }
.ov-side { fill: none; stroke: var(--navy); stroke-width: 1.4; }
.ov-door { fill: var(--navy); }
.overlay-diagram text { font: 600 11px/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--ink-dim); }

/* ---------- Footer ---------- */
.foot { max-width: var(--max); margin: clamp(64px, 8vw, 112px) auto 0; padding: 26px var(--pad) 40px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 14px clamp(24px, 4vw, 56px); align-items: start; font-size: 14.5px; color: var(--ink-dim); }
.foot-brand { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; color: var(--navy); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Quote drawer ---------- */
dialog { color: var(--ink); }
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); max-width: 100vw; height: 100%; max-height: 100%; margin: 0 0 0 auto;
  border: 0; border-left: 1px solid var(--rule-strong); background: #eaf1f9; box-shadow: -24px 0 60px rgba(14, 35, 82, 0.18);
}
.drawer::backdrop, .review::backdrop { background: rgba(14, 35, 82, 0.32); }
.drawer[open] { animation: drawer-in .34s var(--ease); }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } }
.drawer-inner { display: flex; flex-direction: column; min-height: 100%; padding: 22px clamp(18px, 3vw, 28px) 28px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1.5px solid var(--navy); }
.drawer-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; color: var(--navy); }
.close { position: relative; width: 44px; height: 44px; border-radius: var(--radius); }
.close:hover { background: var(--wash); }
.close span::before, .close span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; background: var(--navy); transform: translate(-50%, -50%) rotate(45deg); }
.close span::after { transform: translate(-50%, -50%) rotate(-45deg); }
.drawer-note { margin-top: 10px; font-size: 13.5px; color: var(--ink-dim); }
.quote-empty { margin-top: 28px; padding: 26px 0; border-block: 1px dashed var(--rule-strong); color: var(--ink-dim); }
.quote-empty[hidden] { display: none; }
.quote-lines { list-style: none; margin-top: 12px; }
.quote-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what total" "controls controls" "warn warn"; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.quote-line.is-new { animation: line-in .4s var(--ease); }
@keyframes line-in { from { background: rgba(255, 255, 255, 0.85); } }
.ql-what { grid-area: what; }
.ql-what .part-no { font-size: 17px; }
.ql-desc { display: block; font-size: 14.5px; color: var(--ink-dim); }
.ql-each { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink-dim); }
.ql-each .break { color: var(--green); font-weight: 600; }
.ql-total { grid-area: total; font-size: 17px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.ql-controls { grid-area: controls; display: flex; align-items: center; gap: 16px; }
.ql-controls .stepper { height: 40px; }
.ql-warn { grid-area: warn; font-size: 13.5px; color: var(--amber); }
.ql-warn[hidden] { display: none; }
.quote-foot { margin-top: auto; padding-top: 22px; }
.quote-foot[hidden] { display: none; }
.ref { display: grid; gap: 6px; font-size: 14.5px; font-weight: 600; }
.ref .optional { font-weight: 400; color: var(--ink-dim); }
.ref input { min-height: 46px; padding: 0 14px; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.5); font-size: 16px; }
.ref input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14, 35, 82, 0.16); }
.totals { margin-top: 18px; }
.totals div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 15.5px; }
.totals dt { color: var(--ink-dim); }
.totals dd { font-weight: 600; }
.totals .grand { margin-top: 4px; padding-top: 12px; border-top: 1.5px solid var(--navy); font-size: 20px; }
.totals .grand dt { color: var(--navy); font-weight: 700; }
.totals .grand dd { color: var(--navy); font-weight: 800; letter-spacing: -0.01em; }
.quote-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }

/* ---------- Review sheet ---------- */
.review { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; padding: 0; border: 0; border-radius: 4px; background: var(--paper-sheet); box-shadow: 0 30px 80px rgba(14, 35, 82, 0.28); }
.review[open] { animation: sheet-in .36s var(--ease); }
@keyframes sheet-in { from { transform: translateY(14px); opacity: 0; } }
.sheet { padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 52px) 20px; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-bottom: 18px; border-bottom: 2px solid var(--navy); }
.sheet-brand { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; color: var(--navy); }
.sheet-sub { font-size: 14px; color: var(--ink-dim); }
.sheet-meta { display: grid; grid-template-columns: auto auto; gap: 4px 18px; font-size: 14.5px; }
.sheet-meta div { display: contents; }
.sheet-meta dt { font-size: 11.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); align-self: center; }
.sheet-meta dd { font-weight: 600; }
.sheet-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 15px; }
.sheet-table th, .sheet-table td { padding: 9px 10px 9px 0; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet-table thead th { font-size: 11.5px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1.5px solid var(--navy); }
.sheet-table .num { text-align: right; white-space: nowrap; padding-right: 0; padding-left: 10px; }
.sheet-table tbody th { font-weight: 700; color: var(--navy); white-space: nowrap; }
.sheet-table tfoot th { text-align: right; font-weight: 500; color: var(--ink-dim); }
.sheet-table tfoot .grand th, .sheet-table tfoot .grand td { padding-top: 12px; border-top: 1.5px solid var(--navy); border-bottom: 0; font-size: 18px; font-weight: 800; color: var(--navy); }
.sheet-note { margin-top: 14px; font-size: 13.5px; color: var(--ink-dim); }
.sheet-note[hidden] { display: none; }
.review-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px clamp(20px, 4vw, 52px) 22px; background: var(--paper-sheet); border-top: 1px solid var(--rule); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 18px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 520;
  box-shadow: 0 14px 40px rgba(14, 35, 82, 0.3); transform: translateX(-50%);
}
.toast[hidden] { display: none; }
.toast.is-showing { animation: toast-in .3s var(--ease); }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }
.toast button { min-height: 36px; padding: 0 12px; border-radius: 7px; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 650; }
.toast button:hover { background: rgba(255, 255, 255, 0.24); }
.toast :focus-visible { outline-color: #fff; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1180px) {
  .top { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 10px; }
  .top-nav { grid-column: 1 / -1; grid-row: 2; }
  .brand { border-right: 0; padding-right: 0; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .spec-inner { grid-template-columns: minmax(0, 1fr); }
  .spec-side { padding-left: 0; border-left: 0; padding-top: 14px; border-top: 1.5px solid var(--navy); }
  .guide-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .guide-angle { grid-column: 1 / -1; }
  .foot { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  /* The table becomes one ruled block per part. */
  .table-wrap { padding: 0 var(--pad); }
  .parts thead { display: none; }
  .parts, .parts tbody { display: block; }
  .part-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
  .part-row:hover, .part-row.is-expanded { background: none; }
  .parts .part-row > * { padding: 0; border: 0; }
  .parts .c-part { grid-column: 1 / -1; }
  .parts .c-desc { grid-column: 1 / -1; min-width: 0; margin-top: -4px; color: var(--ink-dim); }
  .parts .c-angle, .parts .c-overlay, .parts .c-mount, .parts .c-cup { font-size: 15px; }
  .parts td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
  .parts .c-stock, .parts .c-price { grid-column: span 2; margin-top: 6px; }
  .parts .c-buy { grid-column: 1 / -1; width: auto; margin-top: 6px; }
  .buy { justify-content: stretch; }
  .buy .add { flex: 1; }
  .spec-row { display: block; }
  .spec-row td { display: block; background: none; border: 0; }
  .spec-row.is-open { border-bottom: 1px solid var(--rule); }
  .spec-row.is-open .spec-inner, .no-js .spec-inner { padding: 4px 0 20px; }
  .spec-inner { padding: 0; }
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .no-js .spec-row[hidden] { display: block; }
  .search { margin-left: 0; flex-basis: 100%; max-width: none; order: -1; }
}
@media (max-width: 700px) {
  .top { grid-template-columns: minmax(0, 1fr) auto; padding-block: 12px; }
  .search-jump { display: none; }
  .top-nav { flex-wrap: wrap; gap: 0 20px; }
  .top-nav a { white-space: nowrap; font-size: 15.5px; min-height: 40px; }
  .brand-mark { width: 36px; height: 22px; }
  .quote-button { padding-left: 12px; font-size: 15px; }
  .hero-figure { grid-template-columns: minmax(0, 1fr) 96px; }
  .dim-overlay { display: none; }
  .dims { grid-template-columns: repeat(2, minmax(0, auto)); row-gap: 10px; }
  .dims div:nth-child(3) { padding-left: 0; border-left: 0; }
  .filters { padding-block: 16px; }
  .angle-set { width: 100%; }
  .angle-set legend { float: none; width: 100%; margin-bottom: 2px; }
  .segments { width: 100%; }
  .segments label { flex: 1; }
  .segments span { min-width: 0; padding: 0 4px; font-size: 15.5px; }
  .filters { grid-template-columns: minmax(0, 1fr); grid-template-areas: "angle" "selects"; }
  .gauge { display: none; }
  .selects { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .select { display: grid; gap: 4px; }
  .select > span { font-size: 13px; }
  .select select { width: 100%; padding-right: 30px; background-position: calc(100% - 17px) 52%, calc(100% - 11px) 52%; }
  .check { grid-column: 1 / -1; min-height: 40px; }
  .toolbar { padding-top: 18px; }
  .sort { width: 100%; }
  .sort select { flex: 1; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; border-left: 0; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 52px; }
  .segments span { font-size: 14.5px; }
  .selects { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Reduced motion: every state still changes, nothing travels. ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .dim { opacity: 1; }
  .js .dim .dl { stroke-dashoffset: 0; }
}

/* ---------- Print: only the quote sheet ---------- */
@media print {
  html, body { background: #fff; }
  html.print-quote body > *:not(.review) { display: none !important; }
  html.print-quote .review { position: static; display: block; width: auto; max-height: none; box-shadow: none; background: #fff; }
  html.print-quote .review-actions { display: none; }
  html.print-quote .sheet { padding: 0; }
}

/* Elements given a display value above still honour the hidden attribute. */
.parts[hidden], .link-button[hidden], .result-note[hidden] { display: none; }

/* Mid widths (tablet and small laptop): the full table, tightened so it never scrolls sideways. */
@media (min-width: 961px) and (max-width: 1439px) {
  .parts thead th { white-space: normal; vertical-align: bottom; }
  .parts td, .parts tbody th, .parts thead th { padding-inline: 10px; }
  .table-wrap { padding: 0 calc(var(--pad) - 10px); }
  .c-desc { min-width: 140px; }
  .part-toggle { gap: 8px; }
  .part-toggle .part-no { font-size: 17px; }
  .buy { gap: 8px; }
  .step { width: 32px; }
  .qty { width: 38px; }
  .add { min-width: 70px; padding: 0 14px; }
}
@media (min-width: 961px) and (max-width: 1060px) {
  .parts { font-size: 15px; }
  .c-overlay, .c-mount { white-space: normal; }
  .toggle-mark { display: none; }
}
