@font-face {
  font-family: CapMontserrat;
  src: url("type/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
}
@font-face {
  font-family: CapMontserrat;
  src: url("type/montserrat-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
}
@font-face {
  font-family: CapPlayfair;
  src: url("type/playfair-display-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
}
@font-face {
  font-family: CapPlayfair;
  src: url("type/playfair-display-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
}
@font-face {
  font-family: Inter;
  src: url("type/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #fff;
  --soft: #f5f5f7;
  --pearl: #fafafc;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --divider: #e6e6ea;
  --accent: #0066cc;
  --focus: #0071e3;
  --on-accent: #fff;
  --tint: #eaf3ff;
  --night: #0b0f17;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --gutter: clamp(16px, 3.5vw, 24px);
  --frame: min(1192px, calc(100% - 2 * var(--gutter)));
  --card: 18px;
  --control: 11px;
  --pill: 9999px;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --bar-height: calc(var(--nav-h) + var(--subnav-h));
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 1.0625rem/1.47 var(--sans);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  background: var(--page);
  color: var(--ink);
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
:where(#app) section { padding: 0; }
h1, h2, h3 { font-weight: 600; }
h1 { font-size: clamp(2.5rem, 4.4vw, 4rem); letter-spacing: -.022em; line-height: 1.06; }
h2 { font-size: clamp(1.75rem, 2.8vw, 2.5rem); letter-spacing: -.019em; line-height: 1.12; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible, .drop-area:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent); color: white; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 110; top: 8px; left: 8px; padding: 12px; border-radius: 8px; background: white; color: var(--ink); transform: translateY(-160%); }
.skip:focus { transform: none; }
.frame { width: var(--frame); margin-inline: auto; }
.proposal-bar .prod, .proposal-bar li a { display: inline-flex; align-items: center; min-height: 44px; }
.proposal-bar li a[aria-current] { color: var(--ink); font-weight: 600; }
.proposal-bar .btn { min-height: 44px; white-space: nowrap; }
.proposal-bar ul { display: flex; }
@media (max-width: 760px) {
  :root { --subnav-h: 90px; }
  .proposal-bar .inner { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 1fr 34px; gap: 0 12px; }
  .proposal-bar .prod, .proposal-bar .btn { grid-row: 1; }
  .proposal-bar .prod { font-size: clamp(1rem, 4.5vw, 1.3125rem); line-height: 1.15; white-space: normal; }
  .proposal-bar .btn { grid-column: 2; }
  .proposal-bar ul { grid-area: 2 / 1 / 3 / -1; margin: 0; gap: clamp(12px,4vw,24px); }
  .proposal-bar li a { min-height: 32px; }
}
.foot-top .cap-guide { color: var(--foot-ink); font-size: 13px; }
.foot-top .cap-guide:hover { color: white; text-decoration: underline; }
.foot-top nav :is(a, button) { min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; }
.globalnav li :is(a, button) { min-width: 24px; }
@media (max-width: 400px) {
  .globalnav .nav-storefronts { display: none; }
}
main:focus { outline: 0; }
#workspace, #controls, #ficha { scroll-margin-top: calc(var(--bar-height) + 16px); }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-block: clamp(32px, 4.5vw, 64px) clamp(24px, 3vw, 40px); }
.intro-copy { margin-top: 12px; max-width: 50ch; font-size: clamp(1.0625rem, 1.55vw, 1.3125rem); color: var(--muted); line-height: 1.38; text-wrap: pretty; }
.head-actions, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-actions { flex-shrink: 0; }
.primary, .secondary, .text-button, .orbit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; font-size: 1rem; line-height: 1.25;
}
.primary, .secondary {
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--pill);
  transition: background .2s var(--ease), transform .18s var(--ease);
}
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--focus); }
.secondary { border-color: var(--accent); color: var(--accent); }
.secondary:hover { background: rgb(0 102 204 / 6%); }
.primary:active, .secondary:active { transform: scale(.95); }
.text-button { color: var(--accent); font-size: .9375rem; }
.text-button:hover { text-decoration: underline; }
.full { width: 100%; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(360px, 1fr); align-items: start; gap: clamp(16px, 2.5vw, 32px); padding-bottom: clamp(32px, 5vw, 72px); }
[data-proposal=tech] .work-grid { grid-template-columns: minmax(360px, 1fr) minmax(0, 1.65fr); }
.preview, .controls { min-width: 0; background: var(--surface); border-radius: var(--card); }
.preview { position: sticky; top: calc(var(--bar-height) + 16px); }
.stage {
  position: relative; isolation: isolate; overflow: hidden; width: 100%; aspect-ratio: 1.58;
  border-radius: var(--card) var(--card) 0 0;
  background: linear-gradient(#f4f5f6, #fff 74%, #fbfbfc); color: var(--ink);
}
.stage #cap, #safe-area { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage #cap { cursor: grab; touch-action: none; }
.stage #cap:active { cursor: grabbing; }
#safe-area { pointer-events: none; }
#safe-area polygon { fill: #fff1; stroke: white; stroke-width: 1.5px; stroke-dasharray: 5 4; filter: drop-shadow(0 1px 1px #242427); }
.stage-head, .stage-tools { position: absolute; inset-inline: 16px; display: flex; justify-content: space-between; align-items: center; z-index: 2; pointer-events: none; }
.stage-head { top: 16px; }
.stage-actions { display: flex; align-items: center; gap: 6px; }
.stage-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding-inline: 12px; font-size: .875rem; }
.stage-tools { bottom: 16px; }
.stage-head button, .stage-tools button { pointer-events: auto; }
.glass, #view-label {
  border-radius: var(--pill); background: rgb(255 255 255 / 82%); color: #242427;
  box-shadow: inset 0 0 0 1px rgb(29 29 31 / 10%), 0 1px 4px rgb(29 29 31 / 4%);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
#view-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: .8125rem; font-weight: 500; }
.icon-only, .zoom button { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; padding: 0; flex: none; }
.orbit { font-size: .875rem; padding-inline: 14px; }
.zoom { position: relative; display: flex; pointer-events: auto; align-items: center; }
.zoom::before { content: ""; position: absolute; left: 50%; height: 18px; border-left: 1px solid var(--line); pointer-events: none; }
.glass button:hover, button.glass:hover { background: white; }
.toggle-controls, .panel-handle { display: none; }
.view-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 20px; }
.view-row > span, .eyebrow, .model-caption p, .caption-chip { font-size: .875rem; color: var(--muted); }
#views { display: flex; justify-content: end; flex-wrap: wrap; gap: 2px; }
#views button { min-height: 44px; padding-inline: 10px; font-size: .875rem; border-radius: var(--pill); color: var(--muted); }
#views button:hover, #views button[aria-pressed=true] { color: var(--accent); }
#views button[aria-pressed=true] { background: var(--tint); font-weight: 600; }
.model-caption { border-top: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px 20px; }
.eyebrow { font-weight: 600; }
.model-caption h2 { font-size: clamp(1.625rem, 2.4vw, 2.125rem); margin: 2px 0 4px; }
.caption-chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.caption-chip i, .part-list i { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--sw); border: 1px solid rgb(0 0 0 / 12%); }

.controls { padding: 0 clamp(16px, 2vw, 28px) 24px; }
.stage-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--divider); }
.stage-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; padding: 4px 0; color: var(--muted); font-size: .875rem; }
.stage-tabs button:hover, .stage-tabs button[aria-pressed=true] { color: var(--accent); }
.stage-tabs button[aria-pressed=true] { font-weight: 600; }
.stage-tabs button[aria-pressed=true]::after { content: ""; position: absolute; bottom: -1px; inset-inline: 4px; height: 2px; background: var(--accent); }
.editor-fields { padding-block: 24px 20px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.5rem, 2vw, 1.75rem); letter-spacing: -.019em; }
.section-head p, .dialog-intro, .help, .guide p, .fixed-fabric p { margin-top: 6px; color: var(--muted); }
.section-head p, .help, .fixed-fabric p { font-size: .9375rem; }
.segmented { display: flex; border-radius: var(--pill); gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--soft); }
.segmented button { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: inherit; color: var(--muted); font-size: .875rem; }
.segmented button[aria-pressed=true] { color: var(--ink); background: white; box-shadow: 0 1px 4px rgb(0 0 0 / 12%); font-weight: 600; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preset, .fabric-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--control); background: var(--surface); text-align: left; }
.preset { display: flex; flex-direction: column; padding-bottom: 10px; }
.preset:hover, .fabric-card:hover, .part-list button:hover, .record:hover { border-color: var(--accent); }
.preset[aria-pressed=true], .fabric-card[aria-pressed=true], .part-list button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.preset-image { display: block; width: 100%; aspect-ratio: 1.6; background: #ebebef; }
.preset-image img, .preset-image canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.preset > b, .preset > small { display: block; margin-inline: 8px; }
.preset > b, .fabric-card b, .label-row strong, .field, .color-input { font-size: .9375rem; font-weight: 600; }
.preset > b { margin-top: 8px; }
.preset > small, .fabric-card small, .model-use, .proof figcaption, .drop-area small { font-size: .8125rem; color: var(--muted); }
.preset i, .fabric-card i { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: white; display: grid; place-items: center; }
.preset[aria-pressed=false] i { display: none; }
.shape-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.shape-picker legend { padding: 0; margin-bottom: 8px; font-size: .9375rem; font-weight: 600; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr)); gap: 8px; }
.shape-card {
  display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--control); cursor: pointer;
}
.shape-card img { display: block; width: 100%; height: auto; }
.shape-card span { display: flex; align-items: center; gap: 6px; padding: 8px; font-size: .8125rem; font-weight: 600; line-height: 1.25; }
.shape-card input { flex: none; margin: 0; accent-color: var(--accent); }
.shape-card:hover { border-color: var(--accent); }
.shape-card:has(:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--tint); }
.shape-card:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.shape-card input:focus-visible { outline: 0; }
.model-use { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.control-rule { border-top: 1px solid var(--divider); padding-top: 16px; margin-top: 18px; }
.label-row, .live-estimate { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label-row span { font-size: .875rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; margin-top: 4px; }
.color-dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--tick); }
.color-dot::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
.color-dot[aria-pressed=true]::after { content: ""; position: absolute; inset: 3px; border: 2px solid var(--accent); border-radius: 50%; }
.color-dot svg { position: relative; }
.live-estimate { width: 100%; border-top: 1px solid var(--divider); padding-block: 14px; color: var(--muted); font-size: .875rem; text-align: left; }
.live-estimate b { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.live-estimate:hover b { color: var(--accent); }
.inspect { display: none; }

.material-shelf, .spec-block { background: var(--surface); padding-block: clamp(32px, 5vw, 72px); }
.shelf-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.shelf-heading h2 { text-wrap: balance; }
#fabric-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fabric-card { display: flex; flex-direction: column; }
.fabric-card img { display: block; width: 100%; aspect-ratio: 2.15; object-fit: cover; }
.fabric-card span { padding: 12px 16px; display: grid; gap: 2px; }
[data-proposal=library] .material-shelf { padding: 0 0 24px; background: var(--page); }
[data-proposal=library] #fabric-shelf { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
[data-proposal=library] #fabric-shelf img { aspect-ratio: 1.7; }
[data-proposal=library] #fabric-shelf span { padding: 10px; }
[data-proposal=library] #fabric-shelf small { display: none; }
.spec-block { background: var(--night); color: var(--pearl); }
.spec-block .secondary { border-color: #8fcaff; color: #8fcaff; }
.spec-block .secondary:hover { background: rgb(143 202 255 / 12%); }
#specs .spec-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
#specs .spec-list div { flex-direction: column; gap: 4px; padding: 14px 0; border-color: rgb(245 245 247 / 18%); }
#specs .spec-list dt { color: #b9bcc3; }
#specs .spec-list dd { text-align: left; max-width: 100%; font-size: 1.0625rem; }

.fields, .part-list, .fabric-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field select, .field input:not([type=color]) {
  width: 100%; min-height: 44px; border-radius: var(--control); border: 1px solid var(--line); padding: 9px 12px;
  background-color: var(--surface); color: var(--ink); font-size: 1rem; font-weight: 400;
}
.field select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236e6e73' stroke-width='1.6'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.construction, .editor-fields > .field + .field { margin-top: 12px; }
.stitch-controls { margin-top: 12px; }
.stitch-height { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; margin-top: 14px; font-size: .9375rem; font-weight: 600; }
.stitch-height output { color: var(--accent); font-variant-numeric: tabular-nums; }
.stitch-height input, #height-scale { grid-column: 1 / -1; }
.stitch-height input { width: 100%; min-height: 24px; margin: 0; accent-color: var(--accent); }
#height-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; font-weight: 400; }
.fixed-fabric { display: flex; align-items: center; gap: 16px; margin-block: 16px; }
.fixed-fabric img { width: 88px; height: 76px; border-radius: var(--control); object-fit: cover; }
.fabric-options { gap: 8px; }
.fabric-options .fabric-card { flex-direction: row; align-items: center; }
.fabric-options .fabric-card img { width: 30%; min-height: 64px; align-self: stretch; aspect-ratio: auto; object-fit: cover; }
.fabric-options .fabric-card span { padding: 8px; }
.fabric-options .fabric-card i { left: 4px; top: 4px; }
.part-list button { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--control); font-size: .9375rem; text-align: left; }
.part-list button[aria-pressed=true] { background: var(--tint); }
.color-input { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.color-input input { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--surface); }
.color-input span { margin-left: auto; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.drop-area { position: relative; display: grid; place-items: center; gap: 4px; border: 1px dashed #8e8e93; border-radius: var(--control); background: var(--pearl); padding: 20px; margin: 16px 0; cursor: pointer; color: var(--accent); }
.drop-area strong { font-size: 1rem; font-weight: 600; }
.drop-area input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-area.over { background: var(--tint); border-color: var(--accent); }
.font-picker { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.font-picker .field { flex: 1 1 10rem; }
.font-upload { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.font-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.font-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.font-help { margin: 6px 0 14px; }
.lettering-fonts { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.lettering-fonts legend { padding: 0; margin-bottom: 6px; font-size: .9375rem; font-weight: 600; }
.lettering-fonts > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lettering-fonts label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--control); cursor: pointer; }
.lettering-fonts label:has(:checked) { border-color: var(--accent); background: var(--tint); }
.lettering-fonts input { margin: 0; accent-color: var(--accent); }
.text-entry { display: flex; align-items: end; gap: 8px; }
.text-entry .field { flex: 1; }
.range { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 8px; font-size: .875rem; margin-top: 8px; }
.range input { width: 100%; height: 32px; accent-color: var(--accent); }
.remove { margin-top: 4px; }

dialog { margin: auto; background: var(--surface); color: var(--ink); border: 0; border-radius: var(--card); padding: 0; width: min(580px, calc(100% - 24px)); max-height: 90dvh; box-shadow: 0 18px 85px #0003; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(29 29 31 / 44%); backdrop-filter: blur(3px); }
dialog:has(.compare-grid) { width: min(1160px, calc(100% - 24px)); }
.compare-modes { margin-block: 16px; display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--pill); background: var(--soft); }
.compare-modes button { min-height: 36px; padding-inline: 12px; border-radius: var(--pill); font-size: .875rem; }
.compare-modes button[aria-pressed=true] { background: var(--surface); box-shadow: 0 1px 4px #0002; }
.compare-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(6px,1.5vw,16px); }
.compare-grid figcaption { margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
.compare-image { overflow: hidden; aspect-ratio: 3 / 2; border-radius: var(--control); background: var(--soft); }
.compare-image img { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 46% 42%; }
.compare-grid.detail img { transform: scale(2.45); }
@media (max-width: 560px) {
  dialog:has(.compare-grid) { width: calc(100% - 12px); max-width: calc(100% - 12px); }
  dialog:has(.compare-grid) #dialog-body { padding: 16px 12px; }
  .compare-grid.detail .compare-image { aspect-ratio: 1; }
}
#dialog-body { padding: clamp(20px, 3vw, 32px); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-head h2 { font-size: clamp(1.625rem, 3.5vw, 2.125rem); }
.dialog-head .icon-only { color: var(--ink); background: var(--soft); border-color: transparent; }
.dialog-intro { font-size: 1rem; margin-block: 12px; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }
.dialog-status:not(:empty) { margin-top: 12px; font-size: .875rem; color: var(--accent); }
.quote-piece { margin-block: 16px 12px; }
.quote-piece h3 { font-size: 1rem; }
.quote-piece p { font-size: .875rem; color: var(--muted); }
dialog:has(.quote-review) { width: min(1024px, calc(100% - 24px)); }
.quote-review { display: grid; gap: clamp(16px, 3vw, 32px); margin-bottom: 12px; }
.quote-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 12px; }
.quote-gallery :is(img, canvas) { display: block; width: 100%; height: auto; aspect-ratio: 16 / 11; object-fit: contain; background: #fbfbfc; border-radius: var(--control); }
.quote-gallery figcaption { margin: 4px 0 0; font-size: .8125rem; font-weight: 600; }
.quote-pricing .help { margin-top: 0; }
@media screen and (min-width: 800px) {
  .quote-review { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .quote-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-pricing .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-pricing .dialog-actions .primary { grid-column: 1 / -1; }
}
@media screen and (max-width: 520px) {
  .quote-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.quote-fields, .prices { margin-block: 16px; }
.prices > div, .spec-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.prices > div { padding-block: 4px; font-size: .9375rem; }
dd { text-align: right; }
.prices dd { font-variant-numeric: tabular-nums; }
.prices .total { padding: 16px; margin-top: 12px; align-items: center; background: var(--soft); border-radius: var(--control); font-weight: 600; line-height: 1.25; }
.total dd { font-size: clamp(1.125rem, 4vw, 1.5rem); }
.total small { font-size: .8125rem; font-weight: 400; color: var(--muted); }
summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-size: .9375rem; font-weight: 600; }
.spec-list > div { border-bottom: 1px solid var(--divider); padding-block: 8px; font-size: .875rem; }
.spec-list dt { color: var(--muted); }
.spec-list dd { max-width: 65%; overflow-wrap: anywhere; }
.quote-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-bottom: 16px; }
.proof { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.proof img { width: 100%; height: 72px; padding: 6px; object-fit: contain; border: 1px solid var(--divider); border-radius: var(--control);
  background: repeating-conic-gradient(#f4f4f5 0 25%, #ced1d5 0 50%) 0 0 / 16px 16px; print-color-adjust: exact; }
.proof figcaption { overflow-wrap: anywhere; }
.proof figcaption strong { display: block; color: var(--ink); }
.records { display: grid; gap: 8px; }
.record, .empty { padding: 16px; border-radius: var(--control); background: var(--soft); }
.record { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid transparent; text-align: left; }
.record span { display: grid; }
.record small, .empty { color: var(--muted); }
.guide h3 { margin-top: 16px; font-size: 1.125rem; }
.guide p { font-size: 1rem; }
#notice { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: 10px 16px; border-radius: var(--control); z-index: 30; opacity: 0; pointer-events: none; text-align: center; font-size: .875rem; max-width: 92vw; }
#notice.visible { opacity: 1; }

@media (max-width: 980px) {
  .work-grid, [data-proposal=tech] .work-grid { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(330px, .96fr); }
  [data-proposal=tech] .work-grid { grid-template-columns: minmax(330px, .96fr) minmax(0, 1fr); }
  .head-actions { flex-shrink: 1; }
  .stage-tabs button { flex-direction: column; gap: 2px; }
  .stage { aspect-ratio: 1.3; }
  .view-row { padding: 8px; }
  .view-row > span { display: none; }
  #views { width: 100%; justify-content: center; }
  #views button { padding-inline: 6px; }
  .model-caption { padding: 12px 16px 16px; }
  [data-proposal=library] #fabric-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [data-proposal=library] #fabric-shelf img { aspect-ratio: 3; }
}
@media (max-width: 740px) {
  .intro { display: block; padding-block: 28px 24px; }
  .intro-copy { margin-top: 8px; }
  .head-actions { margin-top: 16px; }
  .head-actions button { font-size: .9375rem; padding-inline: 15px; }
  .work-grid, [data-proposal=tech] .work-grid { display: flex; flex-direction: column; gap: 16px; }
  .work-grid > * { width: 100%; }
  .preview { position: static; }
  [data-proposal=tech] .preview { order: -1; }
  .stage { aspect-ratio: 1.53; }
  .stage-head, .stage-tools { inset-inline: 10px; }
  .stage-head { top: 10px; }
  .stage-tools { bottom: 10px; }
  .stage-tabs button { flex-direction: row; gap: 4px; }
  .inspect { display: flex; width: 100%; margin-bottom: 8px; }
  .shelf-heading { align-items: start; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  #fabric-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fabric-card span { padding: 10px; }
  /* The next swatch peeks into view, as in the Kits product gallery. */
  [data-proposal=library] .material-shelf { padding-bottom: 16px; }
  [data-proposal=library] #fabric-shelf {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: clamp(120px, 35vw, 165px);
    gap: 10px; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
    scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  }
  [data-proposal=library] #fabric-shelf img { aspect-ratio: 2; }
  [data-proposal=library] #fabric-shelf button { scroll-snap-align: start; }
  #specs .spec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
}
@media (max-width: 450px) {
  .stage { box-sizing: content-box; padding-bottom: 36px; background: #fbfbfc; }
  .stage :is(#cap, #safe-area) { height: calc(100% - 36px); }
  .stage-tabs button { flex-direction: column; gap: 2px; }
  #views { display: grid; grid-template-columns: 1.25fr .8fr 1fr 1fr 1fr; gap: 0; }
  #views button { font-size: .8125rem; padding-inline: 2px; }
  .fabric-options .fabric-card { flex-direction: column; align-items: stretch; }
  .fabric-options .fabric-card img { width: 100%; height: 56px; min-height: 0; }
  .dialog-actions { justify-content: start; }
  .quote-fields { grid-template-columns: 1fr; }
  .prices .total { flex-direction: column; align-items: start; gap: 8px; }
  .prices .total dd { font-size: 1.5rem; }
  .record { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .controls { padding-inline: 12px; }
  .preset > b { margin-inline: 5px; font-size: .8125rem; }
  .model-caption { align-items: start; }
}
/* Keep the live canvas centered in the space beside the floating editor. */
:root:has(#inspection[open]) { overflow: hidden; }
#inspection {
  --panel-gap: clamp(10px, 1.6vw, 24px);
  inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; border-radius: 0; overflow: hidden;
  background: linear-gradient(#f3f4f6, #fff 74%, #fbfbfc);
}
#inspection .work-grid {
  --panel-axis: x;
  --panel-width: clamp(320px, 33vw, 450px);
  display: grid; grid-template: "scene panel" minmax(0, 1fr) / minmax(0, 1fr) var(--panel-width);
  gap: 0; width: 100%; height: 100%; margin: 0; padding: 0;
}
#inspection .work-grid[data-panel-first] { grid-template: "panel scene" minmax(0, 1fr) / var(--panel-width) minmax(0, 1fr); }
#inspection [data-panel-first] .controls { margin-inline: var(--panel-gap) 0; }
#inspection .preview {
  grid-area: scene; position: relative; top: auto; align-self: stretch; min-height: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 0; background: transparent; border-radius: 0;
}
#inspection .stage { height: 100%; box-sizing: border-box; padding: 0; aspect-ratio: auto; border-radius: 0; }
#inspection .stage :is(#cap, #safe-area) { height: 100%; }
#inspection .view-row { justify-content: center; padding: 4px 8px 10px; }
#inspection .view-row > span, #inspection .inspect, #inspection .model-caption { display: none; }
#inspection #views {
  justify-content: center; width: auto; max-width: 100%; padding: 3px;
  border: 1px solid var(--divider); border-radius: var(--pill); background: var(--surface);
}
#inspection .toggle-controls { display: inline-flex; }
#inspection .toggle-controls[aria-expanded=true] { color: var(--accent); background: var(--tint); }
#inspection .controls {
  grid-area: panel; display: flex; flex-direction: column; min-height: 0; width: auto;
  max-height: calc(100% - 2 * var(--panel-gap)); margin: var(--panel-gap) var(--panel-gap) var(--panel-gap) 0;
  padding: 0; overflow: hidden; border: 1px solid var(--divider);
  box-shadow: 0 12px 40px rgb(29 29 31 / 10%), 0 2px 6px rgb(29 29 31 / 5%);
}
#inspection .stage-tabs { flex: none; padding-inline: 8px; }
#inspection .panel-handle {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; min-height: 36px; background: var(--pearl); color: var(--muted);
  border-bottom: 1px solid var(--divider); font-size: .875rem; cursor: grab; touch-action: none; user-select: none;
}
#inspection .panel-handle:hover { color: var(--ink); background: var(--soft); }
#inspection .panel-handle:focus-visible { outline-offset: -3px; }
#inspection .controls.dragging { z-index: 3; box-shadow: 0 16px 48px rgb(29 29 31 / 18%); }
#inspection .controls.dragging .panel-handle { cursor: grabbing; }
#inspection .stage-tabs button { flex-direction: column; gap: 2px; }
#inspection #editor { padding: 0 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 900px) {
  #inspection .compare-button { width: 44px; height: 44px; padding: 0; }
  #inspection .compare-button span { display: none; }
  #inspection #view-label { padding-inline: 8px; }
  #inspection .stage-head { gap: 4px; }
}
@media (max-width: 740px) and (orientation: portrait), (max-width: 620px) {
  #inspection .work-grid {
    --panel-axis: y;
    grid-template: "scene" minmax(0, 1fr) "panel" minmax(0, 44%) / minmax(0, 1fr);
  }
  #inspection .work-grid[data-panel-first] { grid-template: "panel" minmax(0, 44%) "scene" minmax(0, 1fr) / minmax(0, 1fr); }
  #inspection [data-panel-first] .controls { margin: max(8px, env(safe-area-inset-top)) 8px 0; }
  #inspection .controls { align-self: stretch; max-height: none; margin: 0 8px max(8px, env(safe-area-inset-bottom)); }
  #inspection .view-row { padding-bottom: 6px; }
  #inspection .stage-tabs button { min-height: 48px; }
}
#inspection .work-grid:has(.controls[hidden]) { grid-template: "scene" minmax(0, 1fr) / minmax(0, 1fr); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  @page { margin: 12mm; }
  body { background: white; }
  body > nav, body > footer, body > .vnc-card, #app > *, .skip, #notice { display: none !important; }
  #app #dialog[open] { position: static; display: block !important; width: 100%; max-width: none; max-height: none; margin: 0; overflow: visible; border: 0; box-shadow: none; }
  #dialog::backdrop, .dialog-head button, .dialog-actions { display: none; }
  #dialog-body { padding: 0; }
  .quote-gallery { break-inside: avoid; gap: 2mm; }
  .quote-gallery :is(img, canvas) { height: 24mm; }
  details > .quote-spec { display: block !important; }
  .dialog-head::before { content: ""; width: 31mm; height: 10.5mm; background: url("../img/brand/vincitore.webp") left center / contain no-repeat; print-color-adjust: exact; }
  .dialog-head { flex-direction: column; align-items: start; }
  .dialog-head h2 { font-size: 24pt; }
  .spec-list > div, .proof { break-inside: avoid; }
  .field input, .field select { appearance: none; background: white !important; color: var(--ink) !important; }
}
