/* Interaction finish. Page and product motion are orchestrated in app.js. */
@media(max-width:720px){
  .composition > .label-row { display:flex; grid-column:1 / -1; padding-bottom:3px; }
}
:root {
  --ease-settle: cubic-bezier(.2,.7,.2,1);
  --ease-press: cubic-bezier(.2,.6,.3,1);
  --control-wash: rgba(165,9,35,.045);
}

html { scrollbar-gutter: stable; }
body { text-rendering: optimizeLegibility; }
.frame { background-color: var(--cream, #faf8ec); }
button { touch-action: manipulation; }
button:disabled { pointer-events: none; }
button, a, summary { -webkit-tap-highlight-color: transparent; }

/* Vector icons keep the same thin brand strokes on iPad and desktop. */
.ui-icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -.2em; pointer-events: none; }
.primary .ui-icon.arrow, .secondary .ui-icon.arrow { width: 20px; height: 20px; }
.category-arrow.ui-icon { width: 16px; height: 16px; }
.text-btn .ui-icon, .mini-btn .ui-icon { width: 13px; height: 13px; }
.rotation-symbol.ui-icon { width: 30px; height: 30px; }

.primary, .secondary, .text-btn, .prototype-btn, .icon-btn,
.mini-btn, .browse-arrow, .add-part, .all-colours, .reset-view, .step,
.category, .shape-option, .toggle button, .body-select {
  transition: background-color 180ms var(--ease-settle),
    border-color 180ms var(--ease-settle), color 180ms var(--ease-settle),
    transform 160ms var(--ease-press), opacity 180ms var(--ease-settle),
    box-shadow 180ms var(--ease-settle);
}

.primary, .secondary { font-weight: 500; }
.primary .arrow, .secondary .arrow, .category-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-settle);
}
.primary:active, .secondary:active { transform: translateY(1px); }
.icon-btn:active, .mini-btn:active,
.browse-arrow:not([aria-disabled="true"]):active { transform: scale(.96); }
.category:active, .shape-option:active, .pick:active .pick-art {
  transform: scale(.985);
}
.step-dot {
  transition: background-color 220ms var(--ease-settle),
    color 220ms var(--ease-settle), border-color 220ms var(--ease-settle);
}
.category.active { background: var(--control-wash); }
.category-name { transition: color 180ms var(--ease-settle); }
.body-row {
  transition: border-color 180ms var(--ease-settle),
    background-color 180ms var(--ease-settle);
}
.body-row.active { background: var(--control-wash); }
.mini-btn { border-radius: 3px; }
.body-select { border-radius: 3px; }
.pick-art {
  transition: transform 220ms var(--ease-settle),
    border-color 180ms var(--ease-settle), background-color 180ms var(--ease-settle);
}
.pick-art svg {
  transition: transform 240ms var(--ease-settle);
}
.pick-name { transition: color 180ms var(--ease-settle); }
.shape-option.selected { background: rgba(250,248,236,.8); }
.shape-option svg { transition: transform 220ms var(--ease-settle); }
.shape-options {
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 3px;
}

/* Both catalogues use the same visible, mouse-friendly browse controls. */
.option-browser, .browse-viewport { min-width: 0; max-width: 100%; }
.browse-heading { gap: 6px; }
.field-label.browse-heading { margin-bottom: 5px; }
.label-row.browse-heading { padding-bottom: 0; }
.browse-meta { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.browse-count {
  color: var(--red);
  opacity: .64;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .1px;
  text-transform: none;
  white-space: nowrap;
}
.browse-controls { display: none; align-items: center; gap: 4px; }
.option-browser.is-scrollable .browse-controls { display: flex; }
.browse-arrow {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}
.browse-arrow::before {
  position: absolute;
  inset: 2px;
  content: '';
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  transition: background-color 160ms var(--ease-settle), border-color 160ms var(--ease-settle);
}
.browse-arrow > span, .browse-arrow svg { position: relative; z-index: 1; }
.browse-arrow:disabled, .browse-arrow[aria-disabled="true"] {
  opacity: 1;
  color: rgba(165,9,35,.3);
  cursor: default;
}
.browse-arrow svg { width: 13px; height: 13px; }
.browse-viewport { position: relative; isolation: isolate; }
.browse-viewport::before, .browse-viewport::after {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  z-index: 2;
  width: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-settle);
}
.browse-viewport::before {
  left: 0;
  background: linear-gradient(to right,var(--cream),rgba(250,248,236,0));
}
.browse-viewport::after {
  right: 0;
  background: linear-gradient(to left,var(--cream),rgba(250,248,236,0));
}
.option-browser.is-scrollable.has-previous > .browse-viewport::before,
.option-browser.is-scrollable.has-next > .browse-viewport::after { opacity: 1; }
.option-browser .shape-options, .option-browser .picks {
  display: flex;
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 6px;
  scrollbar-width: none;
}
.option-browser .shape-options::-webkit-scrollbar,
.option-browser .picks::-webkit-scrollbar { display: none; }
.option-browser .shape-options { gap: 8px; }
.option-browser .shape-option {
  flex: 1 0 max(78px,calc((100% - 20px) / 3.4));
  min-width: 78px;
}
.option-browser .picks { gap: 7px; }
.option-browser .pick {
  flex: 0 0 calc((100% - 14px) / 3);
  min-width: 80px;
}
.studio-picks .option-browser.is-scrollable .browse-heading h3 {
  font-size: 18px;
  letter-spacing: -.5px;
  line-height: 1.15;
}
.browse-hint {
  display: none;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
  margin: 3px 6px 0;
}
.option-browser.is-scrollable .browse-hint { display: block; }
.option-browser .browse-controls[hidden],
.option-browser .browse-hint[hidden] { display: none; }

/* Each stage keeps its next action beside the composition being reviewed. */
.workflow-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 22px;
}
.workflow-column > .editor,
.workflow-column > .summary-panel,
.workflow-column > .design-card {
  width: 100%;
  align-self: stretch;
}
.workflow-column > .design-card { max-width: none; margin-left: 0; }
.card-by { margin: 5px 0 10px; font-size: 13px; line-height: 1.45; color: var(--red); overflow-wrap: anywhere; }
.design-signature { border-top: 1px solid var(--line); padding: 14px 0 0; margin: 16px 0 12px; text-align: left; }
.design-signature label { display: block; color: var(--red); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.design-signature input { width: 100%; min-width: 0; min-height: 43px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--red); padding: 10px 12px; font: inherit; font-size: 16px; }
.design-signature input::placeholder { color: var(--muted); font-size: 13px; }
.design-signature input:focus { outline: 1px solid var(--red); outline-offset: 2px; }
.design-signature p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.order-customer { color: var(--red); font-size: 14px; margin: 15px 0 18px; overflow-wrap: anywhere; }
.order-customer span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workflow-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.workflow-actions > .primary, .workflow-actions > .secondary {
  width: 100%;
  min-width: 0;
  min-height: 47px;
}
.workflow-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.workflow-links > .text-btn { font-size: 10px; min-height: 32px; }

/* A live parts total sits directly above each stage's next action. */
.price-panel { border-top: 1px solid var(--red); color: var(--red); margin-bottom: 5px; }
.price-panel > summary {
  display: grid; grid-template-columns: 1fr auto; gap: 7px 10px;
  align-items: center; padding: 17px 0 14px; min-height: 74px;
  list-style: none; cursor: pointer;
}
.price-panel > summary::-webkit-details-marker { display: none; }
.price-total-label { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; }
.price-total { font-size: 23px; font-weight: 500; white-space: nowrap; letter-spacing: -.4px; }
.price-disclosure { font-size: 10px; color: var(--muted); }
.price-panel > summary::after { content: '+'; justify-self: end; font-size: 16px; line-height: 1; }
.price-panel[open] > summary::after { content: '−'; }
.price-breakdown { padding: 0 0 13px; }
.price-breakdown ul { list-style: none; padding: 0; margin: 0; max-height: 270px; overflow-y: auto; overscroll-behavior: contain; }
.price-breakdown li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.price-item { min-width: 0; font-size: 11px; line-height: 1.5; }
.price-item small { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; margin-top: 2px; }
.price-item-amount { flex-shrink: 0; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.price-breakdown p { font-size: 10px; color: var(--muted); line-height: 1.5; margin: 11px 0 0; }
.price-pending { display: flex; justify-content: space-between; padding: 17px 0; font-size: 11px; }

/* Dedicated order summary; social PNGs retain their established layout. */
.contact-price-total { display: block; margin-top: 7px; color: var(--red); font-size: 17px; }
.sad-price-export { margin: 0 0 20px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sad-price-export .small-label { margin: 0 0 10px; }
.sad-price-export details > summary { font-size: 11px; cursor: pointer; padding: 7px 0; min-height: 32px; }
#sad-priced-image { display: block; width: 100%; max-height: 420px; object-fit: contain; margin-top: 10px; background: var(--cream); border: 1px solid var(--line); }
#sad-priced-status { font-size: 10px; color: var(--muted); line-height: 1.5; margin: 10px 0; }
#sad-priced-link { width: 100%; gap: 10px; min-height: 44px; font-size: 10px; padding: 10px 13px; }
#sad-priced-link[aria-disabled="true"] { opacity: .42; pointer-events: none; cursor: default; }
#sad-priced-retry { min-height: 44px; }
.sad-price-export [hidden] { display: none !important; }
.order-item-list { list-style: none; padding: 0; margin: 0 0 12px; }
.order-item-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.order-item-list li div { min-width: 0; }
.order-item-list strong { display: block; font-weight: 500; }
.order-item-list li div span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.order-item-list li > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-total { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0; color: var(--red); }
.order-total strong { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.order-pricing-pending { color: var(--muted); }
dialog label.order-confirmation { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.order-confirmation input { display: inline-block; flex: 0 0 18px; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--red); }
.order-confirmation span { min-width: 0; }
.test-email-note { margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--red); overflow-wrap: anywhere; }
.site-footer { min-height: 58px; padding: 10px 0; justify-content: flex-start; }

.editor.is-building .editor-heading { display: block; padding-bottom: 12px; margin-bottom: 12px; }
.build-heading-copy { width: 100%; min-width: 0; }
.build-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.build-topline .eyebrow { margin: 0; font-size: 9px; letter-spacing: 1.1px; }
.editor.is-building .editor-heading h2 {
  margin: 0;
  max-width: 100%;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -.7px;
  text-wrap: balance;
}
.build-part-label { margin: 5px 0 0; font-size: 10px; line-height: 1.5; color: var(--muted); letter-spacing: .3px; }
.build-steps { display: flex; gap: 6px; max-width: 100%; margin: 0 0 13px; padding: 0; }
.build-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-settle),
    border-color 160ms var(--ease-settle), color 160ms var(--ease-settle);
}
.build-step.is-current {
  border-color: var(--red);
  background: var(--control-wash);
  color: var(--red);
  font-weight: 600;
}
.build-empty { margin: 0 0 14px; color: var(--ink); font-size: 11px; line-height: 1.6; }
.editor.is-building .build-empty + .secondary { width: 100%; min-height: 44px; }
.build-mobile-intro { display: none; }
.swatch {
  transition: transform 160ms var(--ease-press),
    box-shadow 180ms var(--ease-settle), border-color 180ms var(--ease-settle);
}
.swatch::after {
  position: absolute;
  inset: -5px;
  content: '';
  border: 1px solid var(--red);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.95);
  pointer-events: none;
  transition: opacity 180ms var(--ease-settle), transform 200ms var(--ease-settle);
}
.swatch.selected::after { opacity: 1; transform: scale(1); }
.swatch:active { transform: scale(.97); }
.swatch-tooltip {
  position: absolute;
  bottom: calc(100% + 13px);
  left: 50%;
  z-index: 8;
  width: max-content;
  max-width: 150px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--cream);
  color: var(--ink);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  opacity: 0;
  transform: translate(-50%,3px);
  pointer-events: none;
  transition: opacity 140ms var(--ease-settle), transform 140ms var(--ease-settle);
}
.swatch:focus-visible .swatch-tooltip { opacity: 1; transform: translate(-50%,0); }
.swatch:nth-child(6n + 1) .swatch-tooltip { left: 0; transform: translate(0,3px); }
.swatch:nth-child(6n) .swatch-tooltip { left: auto; right: 0; transform: translate(0,3px); }
.swatch:nth-child(6n + 1):focus-visible .swatch-tooltip,
.swatch:nth-child(6n):focus-visible .swatch-tooltip { transform: translate(0,0); }
.drawing g[data-part-id] { transition: filter 180ms var(--ease-settle); }
.drawing g[data-part-id]:focus-visible { filter: none; }
.part-focus-ring { transition: opacity 140ms var(--ease-settle); }
.part-selection-ring { transition: opacity 180ms var(--ease-settle); }
.drawing [data-part-id] [fill]:not([fill="none"]) {
  transition: fill 190ms var(--ease-settle);
}
.editor { scroll-margin-top: 18px; }
.body-list {
  overflow: clip;
  width: calc(100% + 12px);
  margin-inline: -6px;
  padding: 6px;
}

/* Selected body controls are positioned by body-interactions.js. */
.drawing { position: relative; overflow: visible; isolation: isolate; }
.drawing > svg { position: relative; z-index: 2; }
.body-interaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.body-edge-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.body-edge-add {
  position: absolute;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--red);
  border-radius: 50%;
  background: var(--cream);
  color: var(--red);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  transform: translate(-50%,-50%);
  pointer-events: auto;
  transition: background-color 160ms var(--ease-settle),
    border-color 160ms var(--ease-settle), transform 140ms var(--ease-press);
}
.body-edge-add svg { width: 16px; height: 16px; }
.body-edge-add:active { transform: translate(-50%,-50%) scale(.96); }
.body-edge-delete {
  border: 0;
  background: transparent;
  font-size: 16px;
  isolation: isolate;
}
.body-edge-delete::before {
  position: absolute;
  inset: 4px;
  z-index: -1;
  content: '';
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--cream);
  pointer-events: none;
  transition: background-color 160ms var(--ease-settle), border-color 160ms var(--ease-settle);
}
.body-edge-delete svg { width: 13px; height: 13px; }
.body-interaction-layer [hidden] { display: none !important; }
.body-controls-hint {
  max-width: 310px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
}
.title-block h1[tabindex="-1"]:focus { outline: none; }
.render-area canvas { cursor: grab; }
.render-area canvas:active { cursor: grabbing; }

/* Feather closeups into the page while keeping the centre fully sharp. */
.preview-workspace .render-area { overflow: hidden; isolation: isolate; }
.preview-workspace .render-area > canvas,
.preview-workspace .render-fallback {
  --viewer-edge-x: clamp(18px, 8%, 42px);
  --viewer-edge-y: clamp(24px, 7%, 48px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--viewer-edge-x), #000 calc(100% - var(--viewer-edge-x)), transparent), linear-gradient(to bottom, transparent, #000 var(--viewer-edge-y), #000 calc(100% - var(--viewer-edge-y)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--viewer-edge-x), #000 calc(100% - var(--viewer-edge-x)), transparent), linear-gradient(to bottom, transparent, #000 var(--viewer-edge-y), #000 calc(100% - var(--viewer-edge-y)), transparent);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.preview-workspace .render-area[data-view="2d"] > canvas { visibility: hidden; pointer-events: none; }
.preview-workspace .render-area:focus-within { outline: 1px solid var(--red); outline-offset: 4px; border-radius: 5px; }
.render-fallback:has(> .render-status.is-loading) > svg { opacity: .3; }
.render-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: max-content; max-width: calc(100% - 32px); padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--ui-panel-radius);
  background: var(--cream); color: var(--red); text-align: center;
  box-shadow: 0 4px 24px #282b3310;
}
.render-status .loading-message { font-size: var(--ui-body); font-weight: 500; line-height: 1.45; }
.render-loading-ring {
  width: 16px; height: 16px; flex: 0 0 16px; border: 1.5px solid var(--line);
  border-top-color: currentColor; border-radius: 50%;
  animation: render-loading-turn .9s linear infinite;
}
.render-status.is-error { flex-direction: column; }
@keyframes render-loading-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .render-loading-ring { animation: none; } }

.preview-workspace .render-area[data-view="2d"] .render-fallback { cursor: grab; touch-action: none; overflow: hidden; }
.preview-workspace .render-area[data-view="2d"] .render-fallback:active { cursor: grabbing; }
.preview-workspace .render-fallback > svg { flex-shrink: 0; }
.rotation-help.is-2d .rotation-symbol { display: none; }

/* The Finalize viewport shares the exported hero's framing ratio. */
.final-stage { gap: 12px; }
.final-stage .render-area {
  width: min(100%,365px,38svh);
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 568 / 982;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  background: var(--cream,#faf8ec);
}
.final-stage[data-light-state="on"] .render-area { background: #211d1c; }
.final-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 15px;
  width: 100%;
  max-width: 365px;
}
.final-controls .zoom-controls { gap: 9px; }
.final-controls .icon-btn { min-width: 36px; min-height: 36px; }
.final-controls .final-bulb-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  color: var(--red);
  background: transparent;
  border-color: var(--line);
}
.final-bulb-toggle .ui-icon { width: 20px; height: 20px; }
.final-bulb-toggle .ui-icon path { transition: fill 180ms var(--ease-settle); }
.final-controls .final-bulb-toggle.is-on {
  color: #956519;
  border-color: rgba(149,101,25,.48);
  background: rgba(240,190,83,.13);
  box-shadow: 0 0 14px rgba(240,190,83,.14);
}
.final-bulb-toggle.is-on .ui-icon path { fill: rgba(240,190,83,.25); }
@media (hover: hover) and (pointer: fine) {
  .final-controls .final-bulb-toggle:hover { border-color: currentColor; }
  .final-controls .final-bulb-toggle.is-on:hover { background: rgba(240,190,83,.21); }
}
.final-controls .reset-view { font-size: 10px; white-space: nowrap; }
.final-image-hint { flex: 0 0 100%; text-align: center; font-size: 10px; line-height: 1.5; color: var(--muted); margin: 0; }
@media (max-width:720px) {
  .final-stage .render-area { width: min(100%,365px,38svh); height: auto; min-height: 0; max-height: none; }
  .final-stage { min-height: 0; padding-top: 12px; }
  .final-controls .icon-btn { width: 44px; height: 44px; }
  .final-controls .reset-view { min-height: 44px; }
}
.details summary { align-items: center; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { margin-left: 10px; }
.detail-row { line-height: 1.5; }
.detail-colour { text-align: right; }
.detail-swatch { flex-shrink: 0; }
.reset-view, .all-colours { text-underline-offset: 4px; }
.stage-note { text-wrap: balance; }
.summary-caption, .final-copy { text-wrap: pretty; }

input, textarea, select {
  transition: border-color 180ms var(--ease-settle),
    background-color 180ms var(--ease-settle), box-shadow 180ms var(--ease-settle);
}
input::placeholder, textarea::placeholder { color: #85857d; opacity: 1; }
input:focus, textarea:focus, select:focus {
  background: #fdfbf1;
  border-color: var(--red);
}
input:user-invalid, textarea:user-invalid { border-color: var(--red); }
dialog { box-shadow: 0 22px 70px rgba(40,32,26,.16); }
dialog .close { background: transparent; }
#toast { line-height: 1.5; }
#toast button { white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: #8d071d; }
  .secondary:hover, .icon-btn:hover, .mini-btn:hover,
  .toggle button:not(.active):hover, .body-select:hover {
    background: var(--control-wash);
  }
  .browse-arrow:not(:disabled):not([aria-disabled="true"]):hover::before { background: var(--control-wash); }
  .primary:hover .arrow, .secondary:hover .arrow { transform: translateX(3px); }
  .text-btn:not(:disabled):hover, .reset-view:hover, .all-colours:hover,
  .prototype-btn:hover { color: var(--red); }
  .text-btn:hover { opacity: .72; }
  .category:not(.active):hover { border-color: rgba(165,9,35,.4); background: rgba(165,9,35,.018); }
  .category:hover .category-arrow { transform: translate(1px,-1px); }
  .shape-option:hover { border-color: var(--line); }
  .shape-option.selected:hover { border-color: var(--red); }
  .shape-option:hover svg { transform: translateY(-1px); }
  .add-part:not(:disabled):hover { border-color: var(--red); background: var(--control-wash); }
  .pick:hover .pick-art { border-color: var(--line); transform: translateY(-2px); }
  .pick.active:hover .pick-art { border-color: var(--red); }
  .pick:hover .pick-art svg { transform: scale(1.02); }
  .swatch:hover { transform: scale(1.03); border-color: var(--red); }
  .swatch:hover .swatch-tooltip { opacity: 1; transform: translate(-50%,0); }
  .swatch:nth-child(6n + 1):hover .swatch-tooltip,
  .swatch:nth-child(6n):hover .swatch-tooltip { transform: translate(0,0); }
  .step:not(:disabled):not(.current):hover .step-dot { background: var(--control-wash); }
  .details summary:hover { color: #8d071d; }
  .body-edge-add:not(.body-edge-delete):hover { background: #f1ecdf; }
  .body-edge-delete:hover::before { background: #f1ecdf; }
  .build-step:not(.is-current):hover { border-color: var(--red); background: var(--control-wash); color: var(--red); }
}

@media (pointer: coarse) {
  .body-edge-add { width: 44px; height: 44px; }
  .body-edge-delete::before { inset: 10px; }
}

@media (min-width: 721px) {
  .workflow-column .editor { padding: 18px; }
  .workflow-column .editor .editor-heading { padding-bottom: 16px; margin-bottom: 16px; }
  .workflow-column .editor .shape-option svg { height: 44px; }
  .workflow-column .editor .shape-note { margin-bottom: 20px; }
  .workflow-column .editor .colour-title { margin-bottom: 14px; }
  .workflow-column .editor .colour-grid { row-gap: 10px; }
  .workflow-column .editor .all-colours { margin-top: 14px; }
  .workflow-column .editor .selected-colour-caption { margin-top: 12px; }
  .workflow-column .editor .editor-footer { margin-top: 18px; padding-top: 12px; }
  .workflow-column .editor.is-building .editor-heading { padding-bottom: 12px; margin-bottom: 12px; }
}

@media (min-width: 721px) and (max-width: 850px) {
  .studio-picks .option-browser.is-scrollable .browse-meta {
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
  }
  .studio-picks .option-browser.is-scrollable .browse-heading h3 { max-width: 75px; }
}

@media (max-width: 720px) {
  .editor.is-building .editor-heading { padding-bottom: 0; margin-bottom: 14px; }
  .editor.is-building .editor-heading h2 { font-size: 22px; }
  .build-step { min-height: 44px; }
  .build-steps { margin-bottom: 14px; }
  .build-mobile-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin: -5px 0 8px;
    color: var(--red);
    font-size: 10px;
    line-height: 1.5;
  }
  .build-mobile-intro > span { flex: 1; min-width: 0; text-wrap: balance; }
  .workflow-column { gap: 18px; }
  .build-workspace .workflow-column { grid-row: 4; margin-top: 17px; }
  .preview-workspace .workflow-column { grid-row: 4; }
  .final-workspace .workflow-column { grid-row: 3; margin-top: 24px; }
  .workflow-column > .editor { margin-top: 0; }
  .workflow-column > .design-card { margin: 0; }
  .workflow-actions { margin-top: 0; }
  .workflow-links > .text-btn { min-height: 44px; }
  .step { min-height: 44px; }
  .category { min-height: 52px; }
  .body-row { min-height: 49px; }
  .body-select { min-height: 44px; padding-inline: 8px; }
  .body-controls .mini-btn { width: 44px; height: 44px; }
  .add-part { min-height: 44px; padding: 12px; }
  .shape-options { padding-top: 4px; padding-bottom: 7px; }
  .shape-option { flex-basis: 86px; }
  .body-edge-add { width: 44px; height: 44px; }
  .body-edge-delete::before { inset: 10px; }
  .body-controls-hint { font-size: 9px; max-width: 280px; }
  .browse-arrow { width: 44px; height: 44px; flex-basis: 44px; }
  .browse-arrow::before { inset: 10px; }
  .option-browser .shape-option { flex: 0 0 86px; min-width: 86px; }
  .option-browser .shape-options::after { content: none; }
  .option-browser .picks { gap: 5px; }
  .option-browser .pick { flex-basis: calc((100% - 10px) / 3); min-width: 86px; }
  .colour-grid {
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 16px 8px;
    padding: 6px 0;
  }
  .swatch { width: 34px; max-width: 100%; }
  .swatch::before {
    position: absolute;
    content: '';
    width: 44px;
    height: 44px;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
  }
  .all-colours { min-height: 44px; padding: 10px 0 7px; margin-top: 6px; }
  .selected-colour-caption { margin-top: 8px; }
  .toggle { width: 128px; }
  .toggle button { min-height: 40px; padding-block: 9px; }
  .icon-btn { width: 44px; height: 44px; }
  .zoom-controls { gap: 10px; }
  .reset-view { min-height: 44px; padding-block: 8px; display: inline-flex; align-items: center; }
  .details summary { min-height: 44px; padding: 12px 0 7px; }
  .detail-row { gap: 10px; }
  .detail-row .detail-name { font-size: 11px; }
  .detail-row .detail-colour { font-size: 10px; }
  .site-footer {
    position: static;
    bottom: auto;
    z-index: auto;
    min-height: 54px;
    gap: 8px;
    padding-top: 9px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom,0px));
    box-shadow: none;
    isolation: auto;
    background: transparent;
  }
  .site-footer::before { content: none; }
  .footer-actions .primary, .footer-actions .secondary { min-height: 48px; }
  .footer-actions .text-btn, .footer-meta .text-btn { min-height: 44px; }
  .prototype-btn { min-height: 44px; }
  .footer-meta { min-height: 32px; }
  .final-footer .footer-meta { gap: 12px; }
  #toast {
    bottom: calc(18px + env(safe-area-inset-bottom,0px));
    width: max-content;
    max-width: calc(100vw - 38px);
    padding: 12px 15px;
    gap: 14px;
  }
  #toast button { min-height: 44px; }
  dialog { padding-top: 33px; }
  dialog .close { top: 10px; right: 10px; }
  input, textarea, select { font-size: 16px; min-height: 46px; }
  .contact-row { gap: 3px; }
  .dialog-actions .primary, .dialog-actions .secondary { min-height: 47px; }
}

@media (max-width: 360px) {
  .colour-grid { grid-template-columns:repeat(6,minmax(0,1fr)); gap:16px 7px; }
  .swatch { width: 32px; }
  .body-select { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .primary:active, .secondary:active, .icon-btn:active, .mini-btn:active, .browse-arrow:active,
  .category:active, .shape-option:active, .pick:active .pick-art,
  .pick:hover .pick-art, .pick:hover .pick-art svg, .shape-option:hover svg,
  .swatch:hover, .swatch:active, .primary:hover .arrow,
  .secondary:hover .arrow, .category:hover .category-arrow { transform: none; }
  .body-edge-add:active { transform: translate(-50%,-50%); }
}

.editor h2[tabindex="-1"]:focus{outline:none}

/* Save-image preparation and sharing stay inside the existing export modal. */
#export-dialog .export-status {
  min-height: 17px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
#export-dialog .export-actions { display: flex; flex-direction: column; gap: 10px; }
#export-dialog .export-actions > .primary,
#export-dialog .export-actions > .secondary { width: 100%; min-height: 47px; }
#export-dialog #export-link[aria-disabled="true"] { opacity: .42; pointer-events: none; cursor: default; }
#export-dialog #export-retry { min-height: 44px; margin-top: 6px; }
#export-dialog [hidden] { display: none !important; }

/* Light on gives Finalize a complete night palette, including its panels. */
body[data-final-theme="dark"] {
  /* The original --red token supplies interface ink as well as accent fills. */
  --cream: #211d1c;
  --red: #faf0d5;
  --ink: #faf0d5;
  --muted: #c4b7a8;
  --line: rgba(250,240,213,.27);
  --border: rgba(250,240,213,.35);
  --wash: #2b2523;
  --control-wash: rgba(250,240,213,.07);
  --final-accent: #a50923;
  --final-on-accent: #faf0d5;
  color-scheme: dark;
  background: var(--cream);
  color: var(--ink);
}
body[data-final-theme="dark"] ::selection {
  background: #a50923;
  color: var(--final-on-accent);
}
body[data-final-theme="dark"] .frame,
body[data-final-theme="dark"] .design-card,
body[data-final-theme="dark"] .site-footer,
body[data-final-theme="dark"] .price-panel {
  border-color: var(--border);
}
body[data-final-theme="dark"] .design-card {
  background: var(--wash);
}
body[data-final-theme="dark"] .primary,
body[data-final-theme="dark"] .toggle button.active,
body[data-final-theme="dark"] .step.current .step-dot {
  background: var(--final-accent);
  color: var(--final-on-accent);
}
body[data-final-theme="dark"] .primary {
  border-color: var(--final-accent);
}
body[data-final-theme="dark"] .prototype-btn::before {
  background: var(--final-accent);
}
body[data-final-theme="dark"] .final-stage .render-area,
body[data-final-theme="dark"] .final-stage .render-fallback {
  background: var(--cream);
}
body[data-final-theme="dark"] input,
body[data-final-theme="dark"] textarea,
body[data-final-theme="dark"] select {
  background: var(--wash);
  color: var(--ink);
  border-color: var(--border);
  caret-color: var(--ink);
}
body[data-final-theme="dark"] input::placeholder,
body[data-final-theme="dark"] textarea::placeholder {
  color: var(--muted);
}
body[data-final-theme="dark"] input:focus,
body[data-final-theme="dark"] textarea:focus,
body[data-final-theme="dark"] select:focus {
  background: #322b28;
  border-color: var(--ink);
}
body[data-final-theme="dark"] input:autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--wash);
}
body[data-final-theme="dark"] select option {
  background: var(--wash);
  color: var(--ink);
}
body[data-final-theme="dark"] .order-confirmation input {
  accent-color: var(--final-accent);
}
body[data-final-theme="dark"] input:user-invalid,
body[data-final-theme="dark"] textarea:user-invalid {
  border-color: #f19291;
}
body[data-final-theme="dark"] .send-status.error {
  color: #f19291;
}
body[data-final-theme="dark"] dialog {
  background: var(--wash);
  border-color: var(--border);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}
body[data-final-theme="dark"] dialog::backdrop {
  background: rgba(8,6,7,.7);
}
body[data-final-theme="dark"] #toast {
  background: var(--wash);
  border-color: var(--border);
  box-shadow: 0 6px 25px rgba(0,0,0,.35);
}
@media (hover: hover) and (pointer: fine) {
  body[data-final-theme="dark"] .primary:hover {
    background: #8d071d;
  }
  body[data-final-theme="dark"] .details summary:hover {
    color: var(--ink);
    background: var(--control-wash);
  }
}
@media (min-width: 961px) and (max-height: 950px) {
  body { padding: 10px; }
  .frame { padding: 10px 24px 0; min-height: calc(100svh - 20px); }
  .site-header { min-height: 42px; gap: 24px; }
  .brand img, .brand-logo { width: 124px; max-height: 44px; }
  main { min-height: 0; }
  .workspace {
    grid-template-columns: minmax(180px,.8fr) minmax(290px,1.45fr) minmax(294px,1fr);
    gap: 20px;
    padding: 10px 0;
    align-items: start;
  }
  .title-block > .eyebrow { margin-bottom: 8px; }
  .title-block h1 { font-size: clamp(38px,3.6vw,52px); margin-bottom: 20px; letter-spacing: -2px; }
  .left-column { align-self: stretch; }
  .composition { margin-bottom: 16px; }
  .composition .label-row { padding-bottom: 9px; }
  .category { min-height: 48px; margin-bottom: 6px; padding: 5px 11px; gap: 9px; }
  .category-icon { width: 48px; height: 36px; }
  .category-icon svg { max-height: 34px; }
  .studio-picks { padding-top: 14px; }
  .studio-picks h3 { font-size: 20px; }
  .studio-picks .micro-copy { margin: 6px 0 8px; }
  .pick-art { height: 90px; padding: 7px; }
  .pick-name { margin-top: 6px; font-size: 10px; }
  .product-stage { align-self: start; }
  .drawing { height: clamp(365px,calc(100svh - 190px),600px); min-height: 0; max-height: none; padding: 3px 12px 10px; }
  .drawing > svg { max-height: 100%; }
  .stage-note { margin-top: 7px; }
  .workflow-column { gap: 8px; }
  .workflow-column .editor { padding: 12px; }
  .workflow-column .editor .editor-heading,
  .workflow-column .editor.is-building .editor-heading { padding-bottom: 7px; margin-bottom: 7px; }
  .editor.is-building .editor-heading h2 { font-size: 22px; }
  .build-topline { margin-bottom: 3px; }
  .build-topline .eyebrow { line-height: 1.4; }
  .build-part-label { margin-top: 3px; }
  .build-steps { margin-bottom: 7px; }
  .browse-arrow { width: 24px; height: 24px; flex-basis: 24px; }
  .option-browser .shape-options { padding: 4px; }
  .workflow-column .editor .shape-option { padding: 9px 6px 7px; gap: 6px; font-size: 10px; }
  .workflow-column .editor .shape-option svg { width: 49px; height: 32px; }
  .workflow-column .editor .colour-title { margin-top: 8px; margin-bottom: 8px; }
  .workflow-column .editor .colour-grid { row-gap: 8px; column-gap: 8px; }
  .workflow-column .editor .swatch { width: 32px; max-width: 32px; }
  .workflow-column .editor .all-colours { margin-top: 6px; min-height: 24px; padding-bottom: 4px; }
  .workflow-column .editor.is-building .shape-note,
  .workflow-column .editor.is-building .selected-colour-caption,
  .workflow-column .editor.is-building .browse-hint { display: none; }
  .workflow-column .editor:not(.is-building) .shape-note { margin: 6px 0 12px; }
  .workflow-column .editor:not(.is-building) .selected-colour-caption { margin-top: 8px; }
  .workflow-column .editor .editor-footer { margin-top: 12px; padding-top: 10px; }
  .workflow-actions { margin-top: 0; gap: 6px; }
  .workflow-actions > .primary, .workflow-actions > .secondary { min-height: 44px; padding: 11px 16px; }
  .price-panel { margin-bottom: 2px; }
  .price-panel > summary { min-height: 54px; padding: 7px 0; gap: 4px 10px; }
  .price-total { font-size: 21px; }
  .workflow-links { gap: 10px; }
  .workflow-links > .text-btn { min-height: 28px; }
  .site-footer { min-height: 40px; padding: 4px 0; }
  .summary-panel { padding: 17px; }
  .summary-panel .summary-title { margin-bottom: 12px; }
  .summary-panel .summary-art { height: 145px; padding-block: 5px 10px; }
  .summary-caption { margin: 6px 0 12px; }
  .summary-swatches { margin-bottom: 14px; }
  .summary-base { margin-top: 14px; padding-top: 12px; }
  .view-controls { gap: 18px; padding-bottom: 18px; }
  .preview-workspace .render-area { height: clamp(375px,calc(100svh - 185px),640px); min-height: 0; max-height: none; }
  .final-workspace { grid-template-columns: minmax(180px,.8fr) minmax(290px,1.45fr) minmax(294px,1fr); }
  .final-title { justify-content: flex-start; padding-top: 12px; }
  .final-title h1 { font-size: clamp(44px,4.5vw,65px); letter-spacing: -3px; }
  .final-title .design-stamp { margin-top: 18px; }
  .final-stage { gap: 10px; }
  .final-stage .render-area { width: min(100%,315px,32svh); height: auto; min-height: 0; }
  .final-controls { gap: 8px 12px; }
  .design-card { padding: 14px; }
  .card-brand { margin-bottom: 8px; }
  .design-card .summary-art { height: 90px; padding: 3px 0 6px; }
  .design-card .card-name { margin-top: 6px; padding-top: 8px; font-size: 17px; }
  .design-card .card-id { margin-top: 5px; }
  .design-card .card-by { margin: 3px 0 7px; font-size: 12px; line-height: 1.4; }
  .design-card .summary-swatches { margin-top: 6px; }
  .design-signature { margin: 8px 0 6px; padding-top: 8px; }
  .design-signature label { margin-bottom: 4px; }
  .design-signature input { min-height: 44px; padding: 9px 11px; }
  .design-signature p { display: none; }
}

@media (min-width: 961px) and (max-height: 950px) and (pointer: coarse) {
  .workflow-column .editor .all-colours { min-height: 44px; }
  .browse-arrow { width: 44px; height: 44px; flex-basis: 44px; }
  .browse-arrow::before { inset: 10px; }
  .workflow-column .editor .colour-grid { row-gap: 12px; }
  .workflow-column .editor .swatch::before {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
  }
  .icon-btn { width: 44px; height: 44px; }
  .toggle button { min-height: 44px; }
  .body-select { min-height: 44px; }
  .mini-btn { width: 44px; height: 44px; }
  .add-part { min-height: 44px; }
}

/* The outlined header logo is present before scripts and fonts load. */
body[data-final-theme="dark"] .brand-logo path { fill: #faf0d5; }

/* Disclosures grow the order column without recentering the desktop lamp. */
@media (min-width: 961px) and (pointer: fine) {
  .final-workspace > .final-title,
  .final-workspace > .final-stage { align-self: start; }
}
