/* MIT Stone storefront ---------------------------------------------------- */
:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --surface: #ffffff;
  --ink: #1a1d19;
  --ink-2: #3b3f39;
  --muted: #6d6e66;
  --line: #ddd7ca;
  --line-2: #cfc8b8;
  --brand: #3f5a3b;
  --brand-ink: #2c4229;
  --brand-soft: #e3e9dc;
  --lime: #a8b000;
  --bronze: #9a7b4f;
  --danger: #b2402f;
  --ok: #2f7a4b;
  --night: #121512;
  --night-2: #1c201b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(26, 29, 25, .06), 0 2px 8px rgba(26, 29, 25, .05);
  --shadow: 0 18px 50px -18px rgba(26, 29, 25, .35);
  --shadow-slab: 0 22px 30px -18px rgba(20, 22, 18, .55), 0 2px 4px rgba(20, 22, 18, .18);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1360px;
  /* Theme hooks: static/css/themes.css overrides these per stone (html[data-stone]) */
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --dims-font: var(--sans);
  --eyebrow-font: var(--sans);
  --on-ink: #fff;
  --on-brand: #fff;
  --on-lime: #1a1d19;
  --on-night: #f1efe8;
  --highlight: #e3e9a5;
  --highlight-2: #cfd88a;
  --lime-soft: #eef1c4;
  --lime-ink: #4a4f00;
  --head-weight: 500;
  --head-track: -.02em;
  --head-case: none;
  --h-scale: 1;
  --pill: 999px;
  --r: 1;
  --btn-case: none;
  --btn-track: normal;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }
h1, h2, .display { font-family: var(--display); font-weight: var(--head-weight); letter-spacing: var(--head-track); text-transform: var(--head-case); }
h1 { font-size: calc(clamp(2.3rem, 5.4vw, 4.6rem) * var(--h-scale)); }
h2 { font-size: calc(clamp(1.75rem, 3.4vw, 2.85rem) * var(--h-scale)); }
h3 { font-size: 1.12rem; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: calc(8px * var(--r)); }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section.tight { padding: clamp(36px, 5vw, 64px) 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--eyebrow-font); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--lime); border-radius: 2px; }
.dark .eyebrow, .hero .eyebrow { color: var(--highlight-2); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head > div { display: grid; gap: 12px; max-width: 760px; }
.link-arrow { font-weight: 600; color: var(--brand); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.link-arrow::after { content: "→"; transition: transform .2s; }
.link-arrow:hover::after { transform: translateX(4px); }

/* Buttons & chips */
.btn {
  --b: var(--ink); --f: var(--on-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--pill); border: 1px solid var(--b);
  background: var(--b); color: var(--f); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s; white-space: nowrap;
  text-transform: var(--btn-case); letter-spacing: var(--btn-track);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; }
.btn.brand { --b: var(--brand); --f: var(--on-brand); }
.btn .ic, .chip .ic, .tool-group .ic, .link-arrow .ic { width: 18px; height: 18px; flex: none; }
.ic { width: 20px; height: 20px; }
.was { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: .84rem; margin-left: 6px; }
.btn.lime { --b: var(--lime); --f: var(--on-lime); }
.btn.ghost { background: transparent; color: var(--b); }
.btn.light { --b: #fff; --f: #1a1d19; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.55); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill);
  font-size: .78rem; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap;
}
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.lime { background: var(--lime-soft); color: var(--lime-ink); }
.chip.dark { background: color-mix(in srgb, var(--night) 72%, transparent); color: #fff; backdrop-filter: blur(6px); }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; display: inline-block; }

/* Header -------------------------------------------------------------------- */
.topbar { background: var(--night); color: color-mix(in srgb, var(--on-night) 86%, transparent); font-size: .8rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; min-height: 36px; align-items: center; }
.topbar a:hover { color: #fff; }
.topbar .links { display: flex; gap: 18px; }
.site-header {
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(0,0,0,.06);
}
/* The frosted glass lives on a layer behind the header: a backdrop-filter on the header itself
   would trap the fixed mobile nav inside the header's 74px box. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; flex: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; mix-blend-mode: multiply; }
.brand span { display: grid; line-height: 1.1; }
.brand strong { font-family: var(--display); font-size: 1.28rem; font-weight: 600; text-transform: var(--head-case); }
.brand small { font-size: .7rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a, .nav-item > button {
  padding: 10px 14px; border-radius: var(--pill); font-weight: 550; font-size: .94rem; background: none; border: 0; cursor: pointer;
}
.nav > a:hover, .nav-item > button:hover, .nav a[aria-current="page"] { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.nav .new { position: relative; }
.nav .new::after {
  content: "New"; position: absolute; top: -2px; right: -4px; font-size: .58rem; font-weight: 800; letter-spacing: .06em;
  background: var(--lime); color: var(--on-lime); border-radius: var(--pill); padding: 1px 6px; text-transform: uppercase;
}
.nav-item { position: relative; }
.mega {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px); width: min(760px, 92vw);
  background: var(--surface); border-radius: calc(18px * var(--r)); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav-item.open .mega, .nav-item:focus-within .mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.mega h4 { grid-column: 1 / -1; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 6px; }
.mega a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: calc(10px * var(--r)); }
.mega a:hover { background: var(--bg); }
.mega a img { width: 44px; height: 44px; border-radius: calc(8px * var(--r)); object-fit: cover; }
.mega a span { display: grid; line-height: 1.25; font-weight: 600; font-size: .92rem; }
.mega a small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; border-radius: var(--pill); padding: 0 5px;
  background: var(--brand); color: var(--on-brand); font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}
.icon-btn .count:empty { display: none; }
.menu-btn { display: none; }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; color: #fff; background: var(--night); overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .62; transform: scale(1.04); animation: drift 24s ease-in-out infinite alternate; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 90% at 0% 100%, color-mix(in srgb, var(--night) 92%, transparent) 20%, color-mix(in srgb, var(--night) 35%, transparent) 60%, color-mix(in srgb, var(--night) 15%, transparent));
}
@keyframes drift { to { transform: scale(1.1) translate(-1.5%, -1%); } }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: clamp(28px, 5vw, 72px); align-items: end; padding-top: clamp(56px, 7vw, 104px); padding-bottom: clamp(44px, 5vw, 72px); }
.hero h1 { max-width: 15ch; margin: 18px 0 20px; }
.hero h1 em { font-style: italic; color: var(--highlight); }
.hero .lead { color: rgba(255,255,255,.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: flex; gap: clamp(20px, 4vw, 48px); margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { display: grid; }
.hero-stats strong { font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 500; }
.hero-stats span { font-size: .8rem; color: rgba(255,255,255,.66); letter-spacing: .04em; }

/* Quick-fit widget on the hero */
.quickfit {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: calc(20px * var(--r)); padding: 22px;
  backdrop-filter: blur(16px) saturate(1.2); display: grid; gap: 14px;
}
.quickfit h2 { font-size: 1.45rem; }
.quickfit p { color: rgba(255,255,255,.75); font-size: .92rem; }
.quickfit .dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.quickfit .dims span { color: rgba(255,255,255,.6); font-weight: 600; }
.quickfit input {
  width: 100%; min-height: 50px; border-radius: calc(12px * var(--r)); border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.25);
  color: #fff; padding: 0 14px; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.quickfit input::placeholder { color: rgba(255,255,255,.45); }
.quickfit label { display: grid; gap: 6px; font-size: .74rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.quickfit-result { min-height: 24px; font-size: .92rem; color: var(--highlight); font-weight: 600; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button {
  border: 1px solid rgba(255,255,255,.2); background: transparent; color: rgba(255,255,255,.85); border-radius: var(--pill);
  padding: 5px 11px; font-size: .78rem; cursor: pointer;
}
.presets button:hover { background: rgba(255,255,255,.1); }

/* Page hero (inner pages) */
.page-hero { padding: clamp(48px, 7vw, 92px) 0 clamp(28px, 4vw, 44px); }
.page-hero .wrap { display: grid; gap: 16px; }
.page-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.8rem); max-width: 20ch; }
.page-hero.image { color: #fff; position: relative; isolation: isolate; background: var(--night); }
.page-hero.image::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--night) 88%, transparent), color-mix(in srgb, var(--night) 35%, transparent)), var(--page-bg) center/cover; }
.page-hero.image .lead { color: rgba(255,255,255,.8); }
.crumbs { display: flex; gap: 8px; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs span::before { content: "/"; margin-right: 8px; opacity: .5; }

/* Value strip */
.value-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.value-strip > div { padding: 28px clamp(16px, 2vw, 28px); display: grid; gap: 8px; border-right: 1px solid var(--line); }
.value-strip > div:last-child { border-right: 0; }
.value-strip svg { width: 26px; height: 26px; color: var(--brand); }
.value-strip strong { font-size: 1rem; }
.value-strip p { color: var(--muted); font-size: .9rem; }

/* Material cards ----------------------------------------------------------- */
.grid { display: grid; gap: clamp(14px, 2vw, 24px); }
.grid.materials { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.material-card { display: grid; gap: 14px; position: relative; }
.material-card .media {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
}
.material-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.material-card:hover .media img { transform: scale(1.06); }
.material-card .badges { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.material-card .save {
  position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: #1a1d19; cursor: pointer; transition: transform .15s;
}
.material-card .save:hover { transform: scale(1.08); }
.material-card .save svg { width: 18px; height: 18px; }
.material-card .save[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.material-card .body { display: grid; gap: 4px; }
.material-card .body h3 { font-family: var(--display); font-weight: var(--head-weight); font-size: 1.24rem; }
.material-card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.material-card .stock { font-size: .84rem; font-weight: 600; color: var(--brand); }
.material-card .stock.none { color: var(--muted); font-weight: 500; }

/* Slab rendering ----------------------------------------------------------- */
.slab-svg { width: 100%; height: auto; display: block; overflow: visible; }
.slab-svg .slab-body { filter: drop-shadow(0 10px 10px rgba(20,22,18,.28)) drop-shadow(0 1px 1px rgba(20,22,18,.25)); }
.slab-svg .outline { fill: none; stroke: rgba(26,29,25,.16); stroke-dasharray: 18 14; vector-effect: non-scaling-stroke; }
.slab-svg .r-reserved { fill: url(#hatch-reserved); stroke: #b98a2f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.slab-svg .r-defect { fill: url(#hatch-defect); stroke: var(--danger); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.slab-svg .r-ghost { fill: none; stroke: rgba(26,29,25,.35); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.slab-svg .r-piece { fill: rgba(255, 255, 255, .14); stroke: #e8f05a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.slab-svg .r-piece.bad { fill: rgba(178, 64, 47, .35); stroke: #ff7a63; }
.slab-svg .r-piece.sel { stroke: #fff; stroke-width: 3; }
.slab-svg .r-free { fill: color-mix(in srgb, var(--brand) 10%, transparent); stroke: color-mix(in srgb, var(--brand) 70%, transparent); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.slab-svg text { font-family: var(--sans); font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: .1em; fill: #fff; stroke-linejoin: round; }
.slab-svg .drag { cursor: grab; }
.slab-svg .drag:active { cursor: grabbing; }

.slab-card {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.slab-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.slab-card .stage { display: grid; place-items: center; padding: 10px 6px 18px; min-height: 150px; background: linear-gradient(var(--bg) 0 0) padding-box; border-radius: calc(10px * var(--r)); }
.slab-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.slab-card h3 { font-size: 1rem; }
.slab-card .dims { font-family: var(--dims-font); font-weight: 700; font-variant-numeric: tabular-nums; }
.slab-card .sub { color: var(--muted); font-size: .84rem; }
.slab-card .price { font-weight: 700; color: var(--brand); }

/* Stone wall: every slab at true relative scale */
.wall-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: var(--pill); padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--pill); cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.wall { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 34px 26px; padding: 18px 0 8px; }
.wall-item { display: grid; gap: 10px; justify-items: start; width: calc(var(--w) * var(--scale, .085px)); min-width: 64px; transition: opacity .25s, transform .25s; }
.wall-item[hidden] { display: none; }
.wall-item .caption { font-size: .8rem; line-height: 1.3; }
.wall-item .caption strong { display: block; font-size: .86rem; }
.wall-item .caption span { color: var(--muted); }
.wall-floor { height: 1px; background: var(--line-2); margin-top: -1px; }
.person { flex: none; width: calc(450 * var(--scale, .085px)); color: var(--muted); display: grid; justify-items: center; gap: 6px; font-size: .72rem; }
.person svg { width: 100%; height: calc(1750 * var(--scale, .085px)); }

/* Filters ------------------------------------------------------------------ */
.filterbar {
  position: sticky; top: 74px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); padding: 12px 0;
}
.filterbar .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-field { position: relative; flex: 1 1 240px; max-width: 360px; }
.search-field svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 17px; color: var(--muted); }
.search-field input { width: 100%; min-height: 42px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); padding: 0 16px 0 40px; }
.select {
  min-height: 42px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); padding: 0 34px 0 14px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236d6e66' fill='none' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; font-size: .9rem; cursor: pointer;
}
.swatch-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch-filter button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer;
}
.swatch-filter button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand); }
.result-count { margin-left: auto; color: var(--muted); font-size: .9rem; }
.load-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 36px; }
.load-more[hidden] { display: none; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); grid-column: 1 / -1; }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 5 / 4; color: #fff; isolation: isolate; display: grid; align-content: end; padding: 18px; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--night) 82%, transparent)); }
.tile:hover img { transform: scale(1.06); }
.tile h3 { font-family: var(--display); font-weight: var(--head-weight); font-size: 1.35rem; }
.tile small { color: rgba(255,255,255,.75); }

/* Product detail ----------------------------------------------------------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.gallery { display: grid; gap: 12px; position: sticky; top: 96px; }
.gallery .main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--bg-2); position: relative; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 76px; height: 76px; padding: 0; border-radius: calc(10px * var(--r)); overflow: hidden; border: 2px solid transparent; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); margin: 26px 0; }
.specs div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.specs div:nth-child(odd) { padding-right: 16px; }
.specs span { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.specs strong { font-weight: 600; }
.stock-panel { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; }
.stock-panel .nums { display: flex; gap: 26px; flex-wrap: wrap; }
.stock-panel .nums strong { display: block; font-family: var(--display); font-size: 1.8rem; font-weight: 500; line-height: 1; }
.stock-panel .nums span { font-size: .8rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.note { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-size: .92rem; }

/* Colour signature */
.signature { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; margin-bottom: 16px; }
.sig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sig-head h2 { font-size: 1.35rem; }
.sig-bar { display: flex; gap: 3px; height: 46px; border-radius: calc(12px * var(--r)); overflow: hidden; }
.sig-bar i { display: block; min-width: 8px; }
.sig-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.sig-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.sig-chip { width: 30px; height: 30px; border-radius: calc(8px * var(--r)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.sig-list strong { display: block; font-size: .92rem; line-height: 1.2; }
.sig-list small { color: var(--muted); font-size: .76rem; font-family: ui-monospace, Menlo, monospace; }
.sig-list em { font-style: normal; color: var(--muted); font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums; }
.sig-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.slab-tones { justify-content: flex-start !important; }
.slab-tones .dots { display: flex; gap: 2px; width: 74px; height: 12px; border-radius: var(--pill); overflow: hidden; flex: none; }
.slab-tones .dots i { display: block; min-width: 4px; }
.viewer-side .tones { display: grid; gap: 8px; }
.viewer-side .tones .sig-bar { height: 22px; border-radius: calc(6px * var(--r)); }
.viewer-side .tones ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; color: rgba(255,255,255,.75); }
.viewer-side .tones li { display: inline-flex; gap: 6px; align-items: center; }
.viewer-side .tones li i { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }

/* Slab viewer -------------------------------------------------------------- */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; background: var(--night); color: #fff; border-radius: calc(22px * var(--r)); overflow: hidden; min-height: 560px; }
.viewer-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; display: grid; place-items: center; padding: 40px; background: radial-gradient(80% 80% at 50% 40%, var(--night-2), var(--night) 70%); }
.viewer-stage.panning { cursor: grabbing; }
.viewer-canvas { width: 100%; transform-origin: 0 0; will-change: transform; display: flex; gap: 3px; justify-content: center; align-items: center; }
.viewer-canvas .slab-svg { flex: 1 1 0; max-height: 70vh; }
.viewer-canvas .mirror { transform: scaleX(-1); }
.viewer-tools { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.viewer-tools > * { pointer-events: auto; }
.tool-group { display: flex; gap: 4px; padding: 4px; border-radius: var(--pill); background: rgba(0,0,0,.55); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.12); }
.tool-group button { border: 0; background: transparent; color: rgba(255,255,255,.85); padding: 7px 12px; border-radius: var(--pill); cursor: pointer; font-size: .8rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tool-group button:hover { background: rgba(255,255,255,.1); }
.tool-group button[aria-pressed="true"] { background: #fff; color: #1a1d19; }
.loupe {
  position: absolute; width: 180px; height: 180px; border-radius: 50%; pointer-events: none; border: 3px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); background-repeat: no-repeat; display: none; z-index: 5;
}
.viewer-side { background: var(--night-2); padding: 26px; display: grid; gap: 18px; align-content: start; border-left: 1px solid rgba(255,255,255,.06); }
.viewer-side h1 { font-size: 2rem; }
.viewer-side .kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9rem; }
.viewer-side .kv dt { color: rgba(255,255,255,.55); }
.viewer-side .kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer-side .price { font-family: var(--display); font-size: 1.9rem; }
.viewer-side .price small { font-family: var(--sans); font-size: .85rem; color: rgba(255,255,255,.6); }
.light-daylight .slab-svg image { filter: none; }
.light-warm .slab-svg image { filter: sepia(.18) saturate(1.12) brightness(1.03); }
.light-evening .slab-svg image { filter: brightness(.82) contrast(1.08) sepia(.12); }
.light-showroom .slab-svg image { filter: contrast(1.12) brightness(1.06) saturate(1.06); }

/* Planner (place your pieces) */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.planner-stage { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: clamp(18px, 3vw, 36px); }
.panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; }
.piece-list { display: grid; gap: 8px; }
.piece-row { display: grid; grid-template-columns: 1fr 12px 1fr 54px 26px; gap: 6px; align-items: center; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.piece-row > input:first-child { grid-column: 1 / -1; background: transparent; border-color: transparent; font-weight: 600; padding-left: 2px; }
.piece-row > input:first-child:focus { border-color: var(--line); background: var(--bg); }
.piece-row input { min-height: 38px; border-radius: calc(9px * var(--r)); border: 1px solid var(--line); background: var(--bg); padding: 0 10px; width: 100%; font-size: .9rem; min-width: 0; }
.piece-row input.num { text-align: right; font-variant-numeric: tabular-nums; }
.piece-row span { text-align: center; color: var(--muted); }
.piece-row button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.piece-row button:hover { color: var(--danger); }
.hint { font-size: .84rem; color: var(--muted); }
.status-line { display: flex; gap: 8px; align-items: center; font-size: .9rem; font-weight: 600; }
.status-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.status-line.bad .dot { background: var(--danger); }

/* Finder (Smart Fit) ------------------------------------------------------- */
.finder { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
.finder-form { position: sticky; top: 96px; display: grid; gap: 18px; }
.step { display: grid; gap: 12px; }
.step-title { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.step-title b { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: .8rem; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset {
  border: 1px solid var(--line); background: var(--surface); border-radius: calc(12px * var(--r)); padding: 12px 8px; cursor: pointer;
  display: grid; justify-items: center; gap: 6px; font-size: .78rem; font-weight: 600; text-align: center; transition: border-color .15s, background .15s;
}
.preset svg { width: 46px; height: 30px; color: var(--brand); }
.preset:hover { border-color: var(--line-2); }
.preset[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.material-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow: auto; }
.material-pick label { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .82rem; font-weight: 600; }
.material-pick input { display: none; }
.material-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.switch { display: flex; gap: 10px; align-items: center; font-size: .9rem; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: var(--pill); background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.preview-shapes { background: var(--bg); border-radius: calc(12px * var(--r)); padding: 14px; min-height: 90px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.preview-shapes div { background: repeating-linear-gradient(135deg, var(--line-2) 0 6px, var(--bg-2) 6px 12px); border: 1.5px solid var(--ink-2); border-radius: 3px; position: relative; }
.preview-shapes div span { position: absolute; inset: auto 0 -18px; font-size: .66rem; text-align: center; color: var(--muted); white-space: nowrap; }
.results { display: grid; gap: 30px; }
.tier { display: grid; gap: 16px; }
.tier-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.tier-head h2 { font-size: 1.7rem; }
.tier-head p { color: var(--muted); }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.match {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; display: grid; gap: 12px;
  cursor: pointer; transition: border-color .15s, box-shadow .2s, transform .2s; text-align: left;
}
.match:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.match.best { border-color: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 22%, transparent); }
.match .stage { background: var(--bg); border-radius: calc(10px * var(--r)); padding: 14px 12px 18px; display: grid; place-items: center; }
.meter { height: 6px; border-radius: var(--pill); background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: var(--pill); }
.save-banner {
  display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--night-2), color-mix(in srgb, var(--brand) 70%, var(--night-2))); color: var(--on-night);
}
.save-banner strong { font-family: var(--display); font-size: 1.6rem; font-weight: 500; }
.save-banner svg { width: 36px; height: 36px; color: var(--highlight); flex: none; }
.collapse > summary { cursor: pointer; list-style: none; }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary h2::after { content: "Show ▾"; font: 600 .82rem var(--sans); color: var(--brand); margin-left: 14px; vertical-align: middle; }
.collapse[open] > summary h2::after { content: "Hide ▴"; }
.finder-empty { display: grid; gap: 18px; place-items: center; text-align: center; padding: 60px 20px; color: var(--muted); }
.finder-empty svg { width: 120px; color: var(--line-2); }
.loading { opacity: .5; pointer-events: none; transition: opacity .2s; }

/* Forms ---------------------------------------------------------------------- */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border-radius: calc(12px * var(--r)); border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; font-weight: 400; font-size: 1rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.quote-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.card { background: var(--surface); border-radius: calc(20px * var(--r)); border: 1px solid var(--line); padding: clamp(20px, 3vw, 36px); }

/* Projects ------------------------------------------------------------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.project { display: grid; gap: 14px; }
.project .media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.project .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover .media img { transform: scale(1.05); }
.project h3 { font-family: var(--display); font-weight: var(--head-weight); font-size: 1.4rem; }
.dark { background: var(--night); color: var(--on-night); }
.dark .muted, .dark .lead { color: color-mix(in srgb, var(--on-night) 70%, transparent); }
.dark .link-arrow { color: var(--highlight); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; counter-reset: s; }
.steps li { list-style: none; padding: 26px; background: rgba(255,255,255,.04); display: grid; gap: 10px; counter-increment: s; }
.steps li::before { content: "0" counter(s); font-family: var(--display); font-size: 2.2rem; color: var(--highlight); }
.steps ol { padding: 0; margin: 0; }

/* Drawer, search, toast ------------------------------------------------------- */
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); background: var(--surface); z-index: 80; transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1); display: grid; grid-template-rows: auto 1fr auto; box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer header, .drawer footer { padding: 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer footer { border-top: 1px solid var(--line); border-bottom: 0; display: grid; }
.drawer .items { overflow: auto; padding: 12px 20px; display: grid; gap: 12px; align-content: start; }
.drawer .item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.drawer .item img { width: 64px; height: 64px; border-radius: calc(10px * var(--r)); object-fit: cover; }
.scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--night) 45%, transparent); z-index: 70; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.scrim.open { opacity: 1; visibility: visible; }
.search-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: start center; padding: 10vh 16px; background: color-mix(in srgb, var(--night) 55%, transparent); backdrop-filter: blur(6px); }
.search-overlay.open { display: grid; }
.search-box { width: min(640px, 100%); background: var(--surface); border-radius: calc(18px * var(--r)); box-shadow: var(--shadow); overflow: hidden; }
.search-box input { width: 100%; border: 0; background: transparent; padding: 22px 24px; font-size: 1.15rem; outline: none; border-bottom: 1px solid var(--line); }
.search-results { max-height: 50vh; overflow: auto; padding: 8px; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: calc(10px * var(--r)); }
.search-results a:hover, .search-results a.active { background: var(--bg); }
.search-results small { color: var(--muted); }
.toast-stack { position: fixed; bottom: 20px; left: 50%; translate: -50% 0; z-index: 100; display: grid; gap: 8px; width: min(480px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--on-ink); padding: 14px 18px; border-radius: calc(12px * var(--r)); box-shadow: var(--shadow); font-size: .92rem; animation: toast-in .25s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--brand); color: var(--on-brand); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.modal { border: 0; border-radius: calc(20px * var(--r)); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.modal::backdrop { background: color-mix(in srgb, var(--night) 55%, transparent); backdrop-filter: blur(4px); }
.modal .card { border: 0; }

/* Compare table */
.compare { overflow-x: auto; }
.compare table { border-collapse: collapse; width: 100%; min-width: 640px; }
.compare th, .compare td { padding: 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare th { width: 160px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.compare img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(12px * var(--r)); }

/* Footer --------------------------------------------------------------------- */
.footer { background: var(--night); color: color-mix(in srgb, var(--on-night) 75%, transparent); padding: 72px 0 36px; }
.footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer h4 { color: var(--on-night); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer a { display: block; padding: 4px 0; }
.footer a:hover { color: var(--on-night); }
.footer .brand strong { color: var(--on-night); }
.footer .bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; gap: 16px; font-size: .84rem; flex-wrap: wrap; }
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 30px rgba(37,211,102,.4);
}
.wa-float svg { width: 28px; height: 28px; }


/* Colour Match ----------------------------------------------------------------- */
.colour { display: grid; gap: 22px; }
.cm-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.cm-steps li { display: flex; gap: 8px; align-items: center; padding: 8px 14px 8px 8px; border-radius: var(--pill); background: var(--bg-2); color: var(--muted); font-weight: 600; font-size: .88rem; }
.cm-steps li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: .78rem; }
.cm-steps li.on { background: var(--brand); color: var(--on-brand); }
.cm-steps li.on b { background: var(--lime); color: var(--on-lime); }
.cm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: calc(20px * var(--r)); padding: clamp(18px, 3vw, 32px); display: grid; gap: 18px; scroll-margin-top: 96px; }
.cm-title { font-family: var(--display); font-weight: var(--head-weight); font-size: clamp(1.5rem, 2.6vw, 2rem); }
.dropzone { display: grid; place-items: center; text-align: center; gap: 8px; padding: clamp(28px, 6vw, 64px) 20px; border: 2px dashed var(--line-2); border-radius: calc(16px * var(--r)); background: var(--bg); cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone svg { width: 54px; color: var(--brand); }
.dropzone strong { font-size: 1.1rem; }
.samples { display: grid; gap: 10px; }
.sample-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sample { position: relative; border: 0; padding: 0; border-radius: calc(12px * var(--r)); overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; background: var(--bg-2); }
.sample img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.sample:hover img { transform: scale(1.06); }
.sample span { position: absolute; left: 8px; bottom: 8px; background: color-mix(in srgb, var(--night) 70%, transparent); color: #fff; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: var(--pill); }
.hex-entry { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.hex-entry input[type=color] { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: calc(10px * var(--r)); padding: 3px; background: var(--surface); cursor: pointer; }
.hex-input { width: 120px; min-height: 44px; border-radius: calc(10px * var(--r)); border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.cm-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 26px; align-items: start; }
.photo-stage { position: relative; border-radius: calc(14px * var(--r)); overflow: hidden; background: var(--night); cursor: crosshair; }
.photo-stage img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; translate: -50% -50%; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.4); font-weight: 800; font-size: .8rem; cursor: pointer; pointer-events: auto; transition: transform .15s; }
.marker:hover { transform: scale(1.15); }
.eyedrop { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; translate: -50% -125%; box-shadow: 0 6px 20px rgba(0,0,0,.45); pointer-events: none; }
.cm-side { display: grid; gap: 14px; align-content: start; }
.share-bar { display: flex; gap: 2px; height: 14px; border-radius: var(--pill); overflow: hidden; }
.share-bar i { display: block; }
.swatches { display: grid; gap: 8px; }
.swatch-btn { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: calc(12px * var(--r)); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.swatch-btn:hover { border-color: var(--line-2); }
.swatch-btn[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.swatch-btn .chip-colour { width: 44px; height: 44px; border-radius: calc(9px * var(--r)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.swatch-btn strong { display: block; }
.swatch-btn small { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: .76rem; }
.swatch-btn em { font-style: normal; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.target-chip { width: 150px; min-height: 96px; border-radius: calc(14px * var(--r)); padding: 12px 14px; display: grid; align-content: end; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.target-chip small { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.target-chip span { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; opacity: .85; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.palette-card { border: 1px solid var(--line); background: var(--surface); border-radius: calc(16px * var(--r)); padding: 0; overflow: hidden; cursor: pointer; text-align: left; display: grid; transition: transform .15s, box-shadow .2s, border-color .2s; }
.palette-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.palette-card[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.pchips { display: flex; height: 112px; }
.pchip { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 6px; min-width: 0; }
.pchip:first-child { flex: 1.5; }
.pchip b { font-size: .72rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.pchip small { font-family: ui-monospace, Menlo, monospace; font-size: .62rem; opacity: .8; }
.pmeta { display: grid; grid-template-columns: 1fr 64px; gap: 12px; padding: 14px 16px; align-items: center; }
.pmeta strong { font-size: 1rem; }
.pmeta p { color: var(--muted); font-size: .84rem; line-height: 1.45; margin-top: 2px; }
.wheel { width: 64px; height: 64px; }
.type-row { display: flex; gap: 10px; flex-wrap: wrap; }
.type { min-width: 150px; border: 1px solid var(--line); background: var(--surface); border-radius: calc(14px * var(--r)); padding: 14px 18px; display: grid; gap: 2px; text-align: left; cursor: pointer; }
.type strong { font-family: var(--display); font-size: 1.35rem; font-weight: 500; }
.type span { font-size: .8rem; color: var(--muted); }
.type[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.type[disabled] { opacity: .45; cursor: not-allowed; }
.cm-results { display: grid; gap: 18px; scroll-margin-top: 96px; }
.cm-studio-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.cm-results .stone-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }
.cm-why { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cm-why summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.cm-why summary::-webkit-details-marker { display: none; }
.cm-why summary > span:first-child { display: grid; gap: 2px; }
.cm-why summary .muted { font-size: .86rem; }
.cm-why-caret { color: var(--muted); transition: transform .2s; }
.cm-why[open] .cm-why-caret { transform: rotate(180deg); }
.cm-why .stone-grid { padding: 0 14px 14px; }
.moodboard-wrap { position: sticky; top: 96px; display: grid; gap: 12px; }
.moodboard { border-radius: calc(18px * var(--r)); overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); }
.moodboard svg { display: block; width: 100%; height: auto; transition: filter .4s; }
.moodboard.light-sun svg { filter: brightness(1.04) saturate(1.04); }
.moodboard.light-white svg { filter: brightness(1.02) saturate(.9) hue-rotate(-6deg); }
.moodboard.light-white .sunfall, .moodboard.light-warm .sunfall { display: none; }
.moodboard.light-warm svg { filter: sepia(.22) saturate(1.12) brightness(.96); }
.mood-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.stone-grid { display: grid; gap: 12px; }
.stone-card { display: grid; grid-template-columns: 150px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(16px * var(--r)); padding: 12px; cursor: pointer; transition: border-color .15s, box-shadow .2s; }
.stone-card:hover { border-color: var(--line-2); }
.stone-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.stone-media { position: relative; border-radius: calc(10px * var(--r)); overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.stone-media img { width: 100%; height: 100%; object-fit: cover; }
.ring { position: absolute; right: 8px; bottom: 8px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255,255,255,.35) 0); }
.ring b { width: 44px; height: 44px; border-radius: 50%; background: var(--night); color: var(--on-night); display: grid; place-items: center; font-size: .82rem; }
.stone-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.stone-body .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stone-body h3 { font-family: var(--display); font-weight: var(--head-weight); font-size: 1.3rem; }
.profile { display: flex; gap: 10px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); font-weight: 600; }
.profile span { display: inline-flex; gap: 5px; align-items: center; }
.profile i { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.reasons { margin: 0; padding-left: 18px; font-size: .86rem; color: var(--ink-2); display: grid; gap: 2px; }
.fit-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }
.stone-card .stock { font-size: .84rem; font-weight: 600; color: var(--brand); }
@media (max-width: 1000px) {
  .cm-split, .cm-results { grid-template-columns: 1fr; }
  .moodboard-wrap { position: static; }
}
@media (max-width: 560px) {
  .stone-card { grid-template-columns: 96px 1fr; }
  .pchip b { font-size: .64rem; }
}

.colour-teaser { display: grid; grid-template-columns: 220px 1fr auto; gap: clamp(18px, 3vw, 40px); align-items: center; transition: box-shadow .2s, transform .2s; }
.colour-teaser:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.teaser-swatches { display: grid; grid-template-columns: repeat(5, 1fr); height: 150px; border-radius: calc(14px * var(--r)); overflow: hidden; }
.teaser-swatches i:first-child { grid-column: span 2; }
@media (max-width: 860px) { .colour-teaser { grid-template-columns: 1fr; } .teaser-swatches { height: 90px; } }


/* Scene Studio ---------------------------------------------------------------- */
.ss { display: grid; gap: 14px; }
.ss-scenes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ss-scene { flex: none; display: inline-flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.ss-scene svg { width: 20px; height: 20px; color: var(--brand); }
.ss-scene[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ss-scene[aria-selected="true"] svg { color: var(--lime); }
.ss-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ss-stage { display: grid; gap: 8px; position: sticky; top: 90px; }
.ss-canvas { border-radius: 18px; overflow: hidden; background: #e9e6df; box-shadow: var(--shadow); touch-action: none; user-select: none; }
.ss-svg { display: block; width: 100%; height: auto; }
.ss-svg [data-target] { cursor: pointer; }
.ss-svg .ss-item { cursor: grab; }
.ss-svg .ss-item:hover { filter: brightness(1.06); }
.ss-svg .ss-selected { filter: drop-shadow(0 0 3px #e8f05a) drop-shadow(0 0 2px #e8f05a); }
.ss-hint { font-size: .82rem; color: var(--muted); }
.ss-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; max-height: calc(100vh - 120px); grid-template-rows: auto 1fr; }
.ss-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ss-tabs button { flex: 1; border: 0; background: none; padding: 12px 8px; font-weight: 650; font-size: .82rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ss-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.ss-body { overflow-y: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.ss-row { border: 1px solid var(--line); border-radius: 12px; }
.ss-row.open { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63,90,59,.12); }
.ss-rowbtn { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; cursor: pointer; text-align: left; }
.ss-sw { width: 34px; height: 34px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); background-size: cover; }
.ss-rl strong { display: block; font-size: .9rem; }
.ss-rl small { color: var(--muted); font-size: .78rem; }
.ss-caret { color: var(--muted); }
.ss-picker { padding: 4px 10px 12px; display: grid; gap: 10px; }
.ss-pgroup { display: grid; gap: 5px; }
.ss-pgroup > span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ss-pgroup > div, .ss-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ss-chip { width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; background-size: cover !important; }
.ss-chip.on { box-shadow: 0 0 0 2px var(--brand); }
.ss-custom { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ss-custom input { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.ss-switch { padding: 0 10px 12px; font-size: .84rem; }
.ss-note { font-size: .8rem; color: var(--muted); }
.ss-field { display: grid; gap: 6px; }
.ss-field > span { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ss-seg { flex-wrap: wrap; }
.ss-seg button { padding: 6px 11px; font-size: .8rem; }
.ss-patterns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ss-pattern { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 4px; display: grid; justify-items: center; gap: 4px; font-size: .72rem; font-weight: 650; cursor: pointer; }
.ss-pattern svg { width: 28px; height: 28px; color: var(--ink-2); }
.ss-pattern[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.ss-item-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.ss-item-card.on { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(168,176,0,.2); }
.ss-item-head { display: flex; justify-content: space-between; align-items: center; }
.ss-toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: .9rem; }
.ss-toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.ss-x { border: 0; background: none; font-size: 1.2rem; color: var(--muted); cursor: pointer; }
.ss-x:hover { color: var(--danger); }
.ss-variant { min-height: 36px; border-radius: 9px; font-size: .84rem; width: 100%; }
.ss-item-card .ss-row { border-style: dashed; }
.ss-item-card .ss-rowbtn { padding: 5px 8px; grid-template-columns: 26px 1fr auto; }
.ss-item-card .ss-sw { width: 26px; height: 26px; }
.ss-add .select { width: 100%; }
.ss-bar { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.ss-stones { display: flex; gap: 10px; flex-wrap: wrap; }
.ss-stone { display: flex; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; }
.ss-stone-sw { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-2); flex: none; }
.ss-stone small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ss-stone-select { border: 0; background: none; font-weight: 650; font-size: .9rem; max-width: 220px; cursor: pointer; padding: 0; }
.ss-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ss-estimate { grid-column: 1 / -1; display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: .88rem; padding-top: 10px; border-top: 1px solid var(--line); }
.ss-est-title { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.ss-estimate .btn { margin-left: auto; }

/* Stone rail: the matching stones live beside the room, so trying one never means scrolling away */
.ss--rail .ss-main { grid-template-columns: 172px minmax(0, 1fr) 300px; }
.ss--rail .ss-stones { display: none; }
.ss--rail .ss-bar { grid-template-columns: 1fr; }
.ss--rail .ss-actions { justify-content: flex-start; }
.ss-rail { position: sticky; top: 90px; height: min(var(--ss-canvas-h, calc(100vh - 120px)), calc(100vh - 120px)); min-height: 420px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.ss-brush { position: relative; display: grid; gap: 4px; }
.ss-slot { position: relative; }
.ss-slot-btn { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s; }
.ss-slot.on .ss-slot-btn { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
.ss-slot-sw { position: relative; width: 30px; height: 30px; border-radius: 8px; background: var(--bg-2) center/cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.ss-slot-sw b { position: absolute; left: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: .64rem; background: var(--ink); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.ss-slot[data-brush="B"] .ss-slot-sw b { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 3px var(--surface); }
.ss-slot-tx { min-width: 0; display: grid; }
.ss-slot-tx small { font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ss-slot-tx strong { font-size: .8rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-slot-clear { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; opacity: 0; transition: opacity .15s; }
.ss-slot:hover .ss-slot-clear, .ss-slot-clear:focus-visible { opacity: 1; }
.ss-slot-clear:hover { color: var(--danger); }
.ss-swap { position: absolute; right: 8px; top: 50%; z-index: 1; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: transform .25s, border-color .15s; }
.ss-swap svg { width: 13px; height: 13px; }
.ss-swap:hover { transform: rotate(180deg); border-color: var(--brand); color: var(--brand); }
.ss-rail-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.ss-rail-tools[hidden] { display: none; }
.ss-rail-search, .ss-rail-type { width: 100%; min-width: 0; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 7px; font: inherit; font-size: .8rem; background: var(--surface); color: var(--ink); }
.ss-rail-list { display: grid; gap: 4px; align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 -4px; padding: 4px; position: relative; scroll-snap-type: y proximity; }
.ss-card { display: grid; gap: 1px; padding: 4px 4px 6px; border-radius: 12px; cursor: pointer; scroll-snap-align: start; outline: none; transition: background .15s, box-shadow .15s, transform .15s; }
.ss-card:hover { background: var(--bg-2); }
.ss-card:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.ss-card:active { cursor: grabbing; transform: scale(.98); }
.ss-card.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.ss-card[hidden] { display: none; }
.ss-card-img { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--bg-2); margin-bottom: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ss-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ss-card:hover .ss-card-img img { transform: scale(1.12); }
.ss-tag { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .66rem; font-weight: 700; background: var(--ink); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ss-tag-B { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink), 0 1px 4px rgba(0,0,0,.25); }
.ss-tag[hidden] { display: none; }
.ss-card strong { font-family: var(--display); font-weight: var(--head-weight); font-size: .9rem; line-height: 1.2; overflow-wrap: anywhere; }
.ss-card small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.ss-rail-empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 12px 0; }
.ss-peek { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); max-width: calc(100% - 24px); z-index: 2; pointer-events: none;
  padding: 7px 14px; border-radius: 999px; background: rgba(20, 22, 19, .78); color: #fff; font-size: .8rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0,0,0,.18); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: ss-peek-in .18s ease-out; }
.ss-peek b { font-weight: 700; }
.ss-canvas { position: relative; }
.ss-catch { display: none; position: absolute; inset: 0; z-index: 1; }
.ss-dragging .ss-catch { display: block; }
.ss-peek span { opacity: .75; }
@keyframes ss-peek-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.ss-canvas.ss-settle svg { animation: ss-settle .6s cubic-bezier(.2,.7,.2,1); }
@keyframes ss-settle { from { filter: brightness(1.12) saturate(.75); transform: scale(1.012); } }
.ss-dragging .ss-canvas { box-shadow: 0 0 0 3px var(--lime), var(--shadow); }
.ss-svg .ss-drop { filter: brightness(1.08) drop-shadow(0 0 3px #e8f05a) drop-shadow(0 0 1px #e8f05a); }
@media (prefers-reduced-motion: reduce) {
  .ss-canvas.ss-settle svg, .ss-peek { animation: none; }
  .ss-card-img img, .ss-swap { transition: none; }
}
@media (max-width: 1280px) {
  .ss--rail .ss-main { grid-template-columns: 150px minmax(0, 1fr) 280px; }
}
@media (max-width: 1080px) {
  .ss-main, .ss--rail .ss-main { grid-template-columns: 1fr; }
  .ss-stage { position: relative; top: auto; }
  .ss-panel { max-height: none; }
  .ss-bar { grid-template-columns: 1fr; }
  .ss-actions { justify-content: flex-start; }
  /* the rail turns into a film strip under the room, within thumb reach */
  .ss--rail .ss-stage { order: 1; }
  .ss-rail { order: 2; position: static; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .ss--rail .ss-panel { order: 3; }
  .ss-brush { grid-template-columns: 1fr 1fr; }
  .ss-swap { right: auto; left: 50%; margin: -12px 0 0 -12px; }
  .ss-rail-list { grid-auto-flow: column; grid-auto-columns: 124px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
}
@media (max-width: 560px) {
  .ss-rail-list { grid-auto-columns: 108px; }
  .ss-peek { white-space: normal; text-align: center; border-radius: 14px; }
}

/* Responsive ------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .finder, .planner { grid-template-columns: 1fr; }
  .finder-form { position: static; }
  .viewer { grid-template-columns: 1fr; }
  .viewer-side { border-left: 0; }
}
@media (max-width: 960px) {
  .hero .wrap, .detail, .quote-layout { grid-template-columns: 1fr; }
  .gallery { position: static; }
  .value-strip, .steps { grid-template-columns: 1fr 1fr; }
  .value-strip > div:nth-child(2) { border-right: 0; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: grid; }
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); background: var(--surface); flex-direction: column; align-items: stretch;
    padding: 90px 20px 20px; gap: 2px; transform: translateX(100%); transition: transform .3s; z-index: 75; overflow: auto; box-shadow: var(--shadow);
  }
  .nav.open { transform: none; }
  /* Lift the header over the scrim while the nav is open; the toggle moves into the panel's corner as a close button */
  .site-header:has(.nav.open) { z-index: 80; }
  .site-header:has(.nav.open) .menu-btn { position: fixed; top: 22px; right: var(--gutter); z-index: 76; }
  .site-header:has(.nav.open) .menu-btn svg { display: none; }
  .site-header:has(.nav.open) .menu-btn::before,
  .site-header:has(.nav.open) .menu-btn::after { content: ""; grid-area: 1 / 1; width: 18px; height: 1.7px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
  .site-header:has(.nav.open) .menu-btn::after { transform: rotate(-45deg); }
  .nav > a, .nav-item > button { width: 100%; text-align: left; padding: 14px; border-radius: calc(12px * var(--r)); }
  .mega { position: static; transform: none; width: 100%; box-shadow: none; border: 0; padding: 0 0 0 8px; grid-template-columns: 1fr; display: none; opacity: 1; visibility: visible; }
  .nav-item.open .mega { display: grid; transform: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .topbar .tag { display: none; }
  .brand small { display: none; }
  .form-grid, .specs, .value-strip, .steps, .footer .cols { grid-template-columns: 1fr; }
  .value-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .section-head { flex-direction: column; align-items: start; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .viewer-stage { padding: 24px 12px 12px; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
  .viewer-tools { position: static; justify-content: flex-start; }
  .icon-btn.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
