.preview-mode {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: var(--rule);
  background: var(--paper);
}
.preview-mode button,
.viewer-tools button {
  min-height: 40px;
  border: var(--rule);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: 700 11px var(--font);
  padding: 8px 12px;
  cursor: pointer;
}
.preview-mode button[aria-pressed="true"],
.viewer-tools button[aria-pressed="true"] {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
}
.viewer-tools button:not(:disabled):hover {
  background: var(--mint);
}
.viewer-tools button:disabled {
  opacity: 0.45;
  cursor: default;
}
.stand-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1.16;
  background: var(--lavender);
  overflow: hidden;
}
.stand-stage .live-stand {
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100%;
}
.stand-stage .live-stand svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#stand-3d {
  position: absolute;
  inset: 0;
}
#stand-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#stand-3d canvas:active {
  cursor: grabbing;
}
#stand-3d canvas:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -5px;
}
.viewer-status {
  margin: 0;
  padding: 10px 14px;
  min-height: 42px;
  background: var(--paper);
  border-top: var(--rule);
  font-size: 11px;
  line-height: 1.5;
}
.viewer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 0 14px 14px;
  background: var(--paper);
}
.view-presets,
.view-adjust {
  display: flex;
  gap: 5px;
}
.view-adjust button {
  min-width: 38px;
  font-size: 20px;
  padding: 3px 8px;
}
.preview-bottom {
  gap: 8px;
}
.artwork-adjustments {
  margin-top: 20px;
  padding: 15px;
  background: var(--paper);
  border: var(--rule);
}
.artwork-adjustments summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  min-height: 28px;
}
.artwork-adjustments[open] summary {
  margin-bottom: 16px;
}
.artwork-adjustments .field-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.artwork-adjustments output {
  font-family: var(--mono);
  font-size: 11px;
}
.artwork-adjustments input[type="range"] {
  width: 100%;
  height: 32px;
  margin: 4px 0 14px;
  accent-color: var(--ink);
  cursor: pointer;
}
.artwork-adjustments .text-link {
  font-size: 12px;
  min-height: 38px;
}
.preview-column {
  top: 96px;
}
.preview-disclaimer {
  margin-bottom: 12px;
}
.preview-helper {
  padding-block: 12px;
}
@media (max-width: 760px) {
  .preview-mode {
    padding: 10px;
  }
  .preview-mode button {
    flex: 1;
    min-height: 44px;
  }
  .viewer-status {
    padding: 10px;
    font-size: 10px;
  }
  .viewer-tools {
    gap: 9px 7px;
    padding: 0 10px 12px;
  }
  .viewer-tools button {
    min-height: 44px;
    padding: 8px 10px;
  }
  .view-adjust button {
    min-width: 44px;
  }
  .view-presets {
    flex: 1;
  }
  .view-presets button {
    flex: 1;
  }
  .view-adjust {
    width: 100%;
  }
  #explode-stand,
  #download-preview {
    flex: 1;
  }
  .artwork-adjustments {
    padding: 12px;
  }
}

/* Part editing sits beside the model, with the same controls in 2D fallback. */
.part-editor {
  padding: 14px;
  border-top: var(--rule);
  background: var(--paper);
}
.part-editor-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.part-editor-heading strong {
  font-size: 14px;
}
.part-editor-heading > span {
  font: 10px var(--mono);
  color: var(--muted);
}
.part-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.part-options button,
.studio-action {
  border: var(--rule);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: 700 12px var(--font);
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
}
.part-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.part-options button[aria-pressed="true"] {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink);
}
.part-colour-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.part-selection {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin: 13px 0 8px;
  font-size: 12px;
}
.part-selection > span {
  font-size: 11px;
  color: var(--muted);
}
.part-swatches { display: block; }
.filament-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.part-swatch {
  width: 100%; min-width: 0; min-height: 78px; padding: 8px 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px;
  border: 2px solid transparent; border-radius: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.part-swatch[aria-pressed="true"] { border-color: var(--ink); background: var(--white); }
.part-swatch-chip {
  width: 30px; height: 30px; flex: 0 0 30px; border: 1.5px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; background: var(--swatch); color: var(--ink);
  font-size: 15px; font-weight: 900; text-shadow: 0 0 3px white, 0 0 3px white;
}
.part-swatch-name { font-size: 11px; font-weight: 650; line-height: 1.2; text-align: center; }
.part-swatch.is-delayed { border-style: dashed; }
.colour-delay-notice { margin: 12px 0; padding: 12px; border: 2px solid var(--ink); background: #fff1b8; font-size: 12px; line-height: 1.5; }
.more-filaments { margin-top: 10px; border-top: 1px solid var(--ink); }
.more-filaments summary { min-height: 44px; padding: 12px 2px; font-size: 11px; font-weight: 700; cursor: pointer; }
.more-filaments[open] { padding-bottom: 8px; }
.filament-stock-note { margin: 0 2px 10px; font-size: 11px !important; line-height: 1.5; color: var(--muted); }
.logo-print-options > summary { min-height: 28px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.logo-print-options[open] > summary { margin-bottom: 12px; }
.more-filaments > summary::after,
.logo-print-options > summary::after,
.preset-details > summary::after { content: '+'; font-size: 18px; }
.more-filaments[open] > summary::after,
.logo-print-options[open] > summary::after,
.preset-details[open] > summary::after { content: '−'; }
#logo.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.upload-label:has(+ #logo:focus-visible) { outline: 3px solid var(--ink); outline-offset: 4px; }
#name-style-options { margin-bottom: 16px; }
#retry-3d { margin: 0 20px 12px; width: calc(100% - 40px); }
.part-hint {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin: 10px 0 0;
}
.camera-tools {
  background: var(--paper);
  border-top: var(--rule);
}
.camera-tools summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  min-height: 42px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.camera-tools[open] summary {
  margin-bottom: 4px;
}
.camera-tools .viewer-tools {
  padding-top: 0;
}
.part-editor .artwork-adjustments {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}
.artwork-title {
  font-weight: 800;
  font-size: 12px;
  margin: 0;
}
.part-editor .artwork-adjustments .field-hint {
  font-size: 10px;
  margin: 6px 0;
}
.part-editor .artwork-adjustments .field-label {
  font-size: 11px;
  margin: 8px 0 0;
}
.part-editor .artwork-adjustments input[type="range"] {
  height: 22px;
  margin: 0 0 6px;
}
#artwork-panel .studio-action {
  width: 100%;
}
.studio-action {
  margin: 8px 0;
  box-shadow: 3px 3px 0 var(--ink);
}
.studio-action:hover {
  background: var(--mint);
}
.preset-details {
  border: var(--rule);
  padding: 14px;
  margin: 18px 0;
  background: var(--paper);
}
.preset-details summary {
  min-height: 28px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.preset-details[open] summary {
  margin-bottom: 14px;
}
.preset-details .layout-options {
  margin-top: 12px;
}
.tile-field {
  padding: 18px;
  background: var(--paper);
  border: var(--rule);
  margin: 0 0 18px;
}
.tile-header {
  margin-bottom: 12px;
}
.tile-header > strong {
  font: 700 11px var(--mono);
  letter-spacing: 0.08em;
}
.tile-action-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 7px;
  border: 1px solid var(--ink);
  background: var(--mint);
}
.tile-picker {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
}
.tile-icon-preview {
  border: var(--rule);
  background: var(--white);
  min-height: 78px;
  display: grid;
  place-items: center;
  box-shadow: 3px 3px 0 var(--ink);
}
.tile-picker-controls {
  min-width: 0;
}
.tile-picker-controls label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
  font-weight: 700;
}
.tile-picker-controls select {
  width: 100%;
  min-width: 0;
  padding: 10px 22px 10px 10px;
  font-size: 13px;
  min-height: 44px;
}
.tile-cycle {
  display: grid;
  gap: 4px;
}
.tile-cycle button {
  border: var(--rule);
  background: var(--white);
  border-radius: 0;
  width: 38px;
  min-height: 36px;
  cursor: pointer;
  font-size: 18px;
}
.icon-library {
  margin: 14px 0;
}
.icon-library summary {
  display: flex;
  justify-content: space-between;
  min-height: 30px;
  align-items: center;
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
}
.icon-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.icon-choices button {
  border: var(--rule);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 700 10px var(--font);
  background: var(--white);
  color: var(--ink);
  padding: 9px 4px;
  min-height: 68px;
  cursor: pointer;
}
.icon-choices button[aria-pressed="true"] {
  background: var(--yellow);
}
.logo-palette {
  border: var(--rule);
  background: var(--mint);
  padding: 14px;
  margin-top: 16px;
}
.logo-palette strong {
  font-size: 13px;
}
.logo-palette p {
  font-size: 11px;
  line-height: 1.6;
  margin: 10px 0 0;
}
#logo-palette-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
#logo-palette-swatches > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
}
#logo-palette-swatches i {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--swatch);
  border: 1px solid var(--ink);
}
#part-editor {
  scroll-margin-top: 110px;
}
.preview-helper {
  display: none;
}
@media (min-width: 761px) {
  .stand-stage {
    aspect-ratio: auto;
    height: clamp(400px, 38vw, 510px);
  }
  .preview-column {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .preview-disclaimer {
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .part-editor {
    padding: 12px;
  }
  .part-editor-heading {
    align-items: flex-start;
  }
  .part-editor-heading > span {
    font-size: 9px;
    max-width: 125px;
    text-align: right;
  }
  .part-options button {
    min-height: 44px;
    padding: 8px 5px;
    font-size: 11px;
    gap: 6px;
  }
  .filament-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .part-swatch { min-height: 74px; }
  .stand-stage {
    aspect-ratio: 1.15;
  }
  .tile-field {
    padding: 12px;
  }
  .tile-picker {
    grid-template-columns: 60px minmax(0, 1fr) 44px;
    gap: 8px;
  }
  .tile-icon-preview {
    min-height: 80px;
  }
  .tile-icon-preview svg {
    width: 44px;
  }
  .tile-cycle button {
    width: 44px;
    min-height: 44px;
  }
  .tile-picker-controls select {
    font-size: 12px;
    padding-left: 8px;
  }
  .studio-action {
    min-height: 44px;
  }
  .preview-column {
    position: static;
  }
}
.logo-print-options {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px solid var(--ink, #171717);
  background: #f3efff;
}
.logo-print-options > strong {
  font-size: 1.15rem;
}
.logo-print-options > p {
  margin: 0.75rem 0;
  line-height: 1.55;
}
.logo-print-options select {
  max-width: 100%;
  font-size: 0.9rem;
}
.logo-background-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 1rem 0;
  line-height: 1.45;
  font-size: 0.9rem;
}
.logo-background-option input {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: #171717;
}
.logo-colour-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}
.logo-colour-list > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.logo-colour-list i {
  width: 1.2rem;
  height: 1.2rem;
  background: var(--swatch);
  border: 1px solid #171717;
}
.logo-quote-note {
  padding: 0.85rem;
  background: #fff3a3;
  border: 2px solid #171717;
  font-weight: 600;
}
/* CAD tile artwork controls follow the same compact, mobile-first editor. */
.tile-svg-options { margin: 14px 0; padding: 12px; border: 2px solid var(--ink, #171717); background: #f7f4eb; }
.tile-svg-options summary { cursor: pointer; font-weight: 800; font-size: .85rem; }
.tile-dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.tile-dimension-grid label { font-size: .75rem; font-weight: 700; }
.tile-dimension-grid input { display: block; width: 100%; margin-top: 6px; }
.tile-svg-options input[type=file] { max-width: 100%; font-size: .75rem; }
.design-download { margin: 18px 0; padding: 14px; border: 2px solid var(--ink, #171717); background: #e5edc9; }
.design-download .studio-action { width: 100%; }

/* One page flow: choose a stand, shape it in the studio, then send its details. */
.customiser-section > .section-heading { margin-bottom: 26px; align-items: end; gap: 24px; }
.customiser-section > .section-heading > p { max-width: 390px; margin-bottom: 5px; line-height: 1.65; }
.customiser-grid { column-gap: 28px; row-gap: 26px; }
.stand-choice { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.stand-choice legend { margin-bottom: 12px; font-size: 14px; letter-spacing: 0; }
.stand-choice .board-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stand-choice .board-option { min-height: 68px; padding: 13px 18px; }
.stand-choice .board-option small { font-size: 11px; }
.customiser-fields { min-width: 0; padding: 24px; border: var(--rule); background: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.customiser-fields .form-section { margin-bottom: 22px; padding-bottom: 22px; }
.customiser-fields .form-section legend { margin-bottom: 14px; font-size: 17px; }
.customiser-fields .tile-field { padding: 14px; margin-bottom: 12px; }
.customiser-fields .tile-field:last-child { margin-bottom: 0; }
.customiser-fields .quote-summary { margin: 0; }
.customiser-section .preview-heading { padding: 16px 18px; }
.customiser-section .preview-bottom { padding: 12px 16px; }
@media (max-width: 1000px) and (min-width: 761px) {
  .customiser-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
  .customiser-fields { padding: 16px; }
  .customiser-fields .tile-field { padding: 10px; }
  .customiser-fields .tile-picker { grid-template-columns: 52px minmax(0, 1fr) 34px; gap: 7px; }
  .customiser-fields .tile-cycle button { width: 34px; }
}
@media (max-width: 760px) {
  .customiser-section > .section-heading { margin-bottom: 22px; gap: 14px; }
  .customiser-section > .section-heading > p { max-width: 100%; margin: 0; }
  .customiser-grid { gap: 22px; }
  .stand-choice .board-options { gap: 8px; }
  .stand-choice .board-option { min-height: 100px; padding: 12px; flex-wrap: wrap; gap: 8px; align-content: center; }
  .stand-choice .board-option > span { flex-basis: calc(100% - 24px); }
  .stand-choice .board-option b { margin-left: 23px; font-size: 12px; }
  .stand-choice .board-option small { font-size: 10px; }
  .customiser-section .preview-panel { max-width: none; }
  .stand-stage { aspect-ratio: auto; height: clamp(320px, 95vw, 480px); }
  .customiser-fields { padding: 18px 14px; box-shadow: 4px 4px 0 var(--ink); }
  .customiser-fields .tile-field { padding: 12px; }
}
