/* Hoften Design Lab — phone-first studio. Black and white. Green confirm, red delete. No tan. */
:root {
  --black: #000;
  --white: #fff;
  --panel: #1C1C1E;
  --panel-2: rgba(28, 28, 30, 0.82);
  --line: rgba(255,255,255,0.12);
  --muted: #8e8e93;
  --green: #34C759;
  --red: #FF3B30;
  --canvas: #1C1C1E;
  --radius: 24px;
  --radius-sm: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-tight: "Inter Tight", var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #000; color: #fff; font-family: var(--font); }
body.lab-app-page { min-height: 100dvh; background: #000; }
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; z-index: 99; background: #fff; color: #000; padding: 6px 10px; }

.desk-brand { display: none; }
.device-wrap { min-height: 100dvh; }
.device, .app {
  min-height: 100dvh;
  min-height: 100svh;
  background: #000;
}
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  background: var(--app-bg, #1C1C1E);
  color: #fff;
  transition: background 0.35s ease;
}
.app.is-light { color: #111; }
.app.is-light .icon-btn,
.app.is-light .pill,
.app.is-light .tool-btn,
.app.is-light .tab-bar,
.app.is-light .float-panel,
.app.is-light .pop-menu,
.app.is-light .tips-card { color: #fff; }
.app.is-light .pill-quote { color: #fff; }

/* Header */
.app-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 10px 0;
  pointer-events: none;
}
.app-header > * , .side-stack, .header-pills { pointer-events: auto; }
.header-pills { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: rgba(28,28,30,0.72);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
#btn-text { font-family: var(--font-tight); font-weight: 600; font-size: 15px; }
.pill {
  height: 32px;
  padding: 0 12px;
  border: 0; border-radius: 999px;
  background: rgba(28,28,30,0.82);
  color: #fff;
  font: 500 12px/1 var(--font);
  display: inline-flex; align-items: center; gap: 6px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill-quote { background: #fff; color: #000; font-weight: 600; }
.side-stack {
  position: absolute;
  top: calc(54px + var(--safe-t));
  right: 10px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Stage */
.stage {
  flex: 1;
  position: relative;
  min-height: 0;
}
.lab-3d-host, .lab-3d-canvas, .lab-photo-host, .lab-photo-canvas, .svg-host {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.lab-photo-canvas, .lab-3d-canvas { display: block; touch-action: none; }
.lab-photo-host img, .lab-3d-host img, .lab-photo-host picture, .stage img {
  pointer-events: none;
}
.lab-3d-host[hidden], .lab-photo-host[hidden], .svg-host[hidden], [hidden] { display: none !important; }
.svg-host { display: flex; align-items: center; justify-content: center; padding: 4.5rem 1.5rem 10rem; }
.svg-host svg { width: min(100%, 22rem); height: auto; filter: drop-shadow(0 18px 28px rgba(0,0,0,0.45)); }

.edit-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; touch-action: none; }
.edit-overlay .bbox, .edit-overlay .h { pointer-events: auto; touch-action: none; }
.bbox {
  position: absolute;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
  pointer-events: auto;
  touch-action: none;
}
.bbox .h {
  position: absolute; width: 18px; height: 18px;
  background: #fff center / 11px 11px no-repeat;
  border: 1px solid #111; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.bbox .h.tl { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 2 V14 M2 8 H14' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round'/><path d='M8 2 L6 4 M8 2 L10 4 M8 14 L6 12 M8 14 L10 12 M2 8 L4 6 M2 8 L4 10 M14 8 L12 6 M14 8 L12 10' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>"); }
.bbox .h.tr { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M12 6 A5 5 0 1 0 13 10' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round'/><path d='M12 3.5 L12 6.5 L15 6.5' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.bbox .h.bl { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='3' y='3' width='7' height='7' rx='1.2' fill='none' stroke='%23111' stroke-width='1.5'/><rect x='6' y='6' width='7' height='7' rx='1.2' fill='%23fff' stroke='%23111' stroke-width='1.5'/></svg>"); }
.bbox .h.br { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 12 L12 4 M12 4 H8 M12 4 V8' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.bbox .h.tl { left: -8px; top: -8px; cursor: move; }
.bbox .h.tr { right: -8px; top: -8px; cursor: alias; }
.bbox .h.bl { left: -8px; bottom: -8px; cursor: copy; }
.bbox .h.br { right: -8px; bottom: -8px; cursor: nwse-resize; }
.bbox .h.tl, .bbox .h.tr, .bbox .h.bl, .bbox .h.br { cursor: nwse-resize; }
.bbox .h.rot {
  left: 50%; top: -30px; margin-left: -9px;
  cursor: grab;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M12 6 A5 5 0 1 0 13 10' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round'/><path d='M12 3.5 L12 6.5 L15 6.5' stroke='%23111' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.bbox .h.ml, .bbox .h.mr, .bbox .h.mt, .bbox .h.mb {
  width: 12px; height: 12px;
}
.bbox .h.ml { left: -6px; top: 50%; margin-top: -6px; }
.bbox .h.mr { right: -6px; top: 50%; margin-top: -6px; }
.bbox .h.mt { top: -6px; left: 50%; margin-left: -6px; }
.bbox .h.mb { bottom: -6px; left: 50%; margin-left: -6px; }

/* Floating panels */
.float-panel {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(168px + var(--safe-b));
  z-index: 7;
  background: var(--panel-2);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  color: #fff;
}
.float-panel h2 {
  margin: 0 0 12px;
  text-align: center;
  font: 600 15px/1.2 var(--font-tight);
}
.panel-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
.part-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.part-tab {
  flex: 1;
  background: #2c2c2e;
  color: #fff;
  border: 0; border-radius: 12px;
  padding: 8px 6px 7px;
  font: 500 10px/1.1 var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
}
.part-tab.is-on { background: #fff; color: #000; }
.part-dot, .part-rainbow {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  background: #f4f4f4;
}
.part-tab.is-on .part-dot { border-color: #000; }
.part-rainbow {
  background: conic-gradient(#ff3b30, #ffd60a, #34c759, #0a84ff, #bf5af2, #ff3b30);
}
.swatch-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px; }
.swatch {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  position: relative;
  padding: 0;
}
.swatch.is-on { box-shadow: 0 0 0 2px #fff; }
.swatch .lbl {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 7px; letter-spacing: 0.04em; color: #fff; text-transform: uppercase;
  pointer-events: none;
}
.more-colors {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; color: #fff;
  font: 500 14px/1 var(--font);
  padding: 4px 0 0;
  cursor: pointer;
}
.rainbow-ring {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(#ff3b30, #ffd60a, #34c759, #0a84ff, #bf5af2, #ff3b30);
}
.panel-rotate {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
  bottom: calc(168px + var(--safe-b));
}
.angle-row { display: flex; gap: 6px; justify-content: center; margin: 0 0 10px; }
.angle-row button, .zoom-row button {
  /* noop placeholder to keep specificity if needed */
}
.angle-row button {
  background: rgba(44,44,46,0.9); color: #fff; border: 0; border-radius: 999px;
  padding: 8px 14px; font: 500 12px/1 var(--font); cursor: pointer;
}
.angle-row button.is-on { background: #fff; color: #000; }
.zoom-row {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  background: var(--panel-2);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-radius: 999px;
  padding: 6px 8px;
}
.zoom-row button {
  background: transparent; border: 0; color: #fff;
  font: 500 13px/1 var(--font);
  padding: 8px 10px; border-radius: 999px;
  cursor: pointer;
}
.zoom-row button.is-on { background: #fff; color: #000; }
.zoom-close { font-size: 16px !important; width: 32px; }

/* Docks */
.tool-dock, .edit-dock {
  position: absolute;
  left: 10px; right: 10px;
  bottom: calc(78px + var(--safe-b));
  z-index: 6;
}
.tool-dock {
  display: flex; justify-content: space-between; gap: 6px;
}
.tool-btn {
  flex: 1;
  background: rgba(28,28,30,0.82);
  color: #fff;
  border: 0; border-radius: 16px;
  padding: 10px 4px 8px;
  font: 500 10px/1 var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  min-width: 0;
}
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn.is-on { background: #fff; color: #000; }
.tool-btn.wide { flex: 1.4; flex-direction: row; gap: 6px; font-size: 13px; padding: 10px; }
.edit-actions, .nudge-row { display: flex; gap: 8px; justify-content: center; }
.edit-actions { margin-bottom: 8px; }
.nudge-row button, .sq-btn {
  background: rgba(28,28,30,0.88);
  color: #fff; border: 0; border-radius: 14px;
  min-width: 48px; height: 52px;
  font: 500 10px/1 var(--font);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  backdrop-filter: blur(18px);
  cursor: pointer;
  padding: 6px 8px;
}
.nudge-row button svg { width: 16px; height: 16px; }
.nudge-row span { font-size: 9px; color: #c7c7cc; }
.sq-btn { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
.sq-btn svg { width: 20px; height: 20px; }
.sq-btn.danger { background: #FF3B30; color: #fff; }
.sq-btn.confirm { background: #34C759; color: #fff; }

.place-panel { display: grid; gap: 8px; margin-top: 10px; }
.place-panel-mobile { margin-top: 10px; padding: 0 4px 4px; }
.place-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: 8px;
  color: #c7c7cc;
  font: 500 11px/1 var(--font);
  letter-spacing: 0.04em;
}
.place-row input[type="range"] { width: 100%; accent-color: #fff; }
.place-size-val { min-width: 2.6rem; text-align: right; font-size: 11px; color: #fff; }

.tab-bar {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(12px + var(--safe-b));
  z-index: 6;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(28,28,30,0.78);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-radius: 999px;
  padding: 6px 8px;
  height: 58px;
}
.tab {
  flex: 1;
  background: transparent; border: 0; color: #c7c7cc;
  font: 500 10px/1 var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.tab svg { width: 20px; height: 20px; }
.tab.is-on { color: #000; background: #fff; }

/* Sheets & modals */
.sheet, .modal {
  position: absolute; inset: 0;
  z-index: 20;
  background: #0b0b0d;
  display: flex; flex-direction: column;
  animation: up 0.32s ease;
  color: #fff;
}
.sheet { top: 0; border-radius: 0; overflow: hidden; }
.sheet-tall { top: 0; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head, .modal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-head > div, .modal-head > div, .modal-head-copy { flex: 1; min-width: 0; }

.sheet-head h2, .modal-head h2 { margin: 0; font: 600 17px/1.2 var(--font-tight); }
.sheet-head p, .modal-head p, #layout-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.sheet-body { flex: 1; overflow: auto; padding: 16px 16px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.icon-btn[data-close-sheet], #layout-x, #picker-x { font-size: 22px; background: transparent; }

.mock-grid, #mockup-grid, #saved-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.mock-card, .saved-card {
  background: #1c1c1e; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 10px 10px; color: #fff; text-align: left; cursor: pointer;
}
.mock-card.is-on { outline: 2px solid #fff; }
.mock-card svg { width: 100%; height: 64px; display: block; margin-bottom: 8px; }
.mock-card strong, .saved-card strong { display: block; font: 600 13px/1.2 var(--font-tight); }
.mock-card span, .saved-card span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.saved-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: #111; margin-bottom: 8px; }
.saved-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 2rem 1rem; }

/* Brain */
.brain-thread { max-height: 36vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.msg { background: #1c1c1e; border-radius: 14px; padding: 10px 12px; font-size: 13px; max-width: 92%; }
.msg.user { align-self: flex-end; background: #2c2c2e; }
.msg .who { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.brain-refs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.brain-refs figure { margin: 0; position: relative; }
.brain-refs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #fff; }
.brain-refs button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: #111; color: #fff; font-size: 11px; cursor: pointer; }
.prompt-label, .control-kicker { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"] {
  width: 100%; background: #1c1c1e; color: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font: 400 14px/1.4 var(--font);
}
textarea { resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button, .tiny-btn {
  background: #1c1c1e; color: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 10px; font: 500 11px/1 var(--font); cursor: pointer;
}
.chips button.is-on { background: #fff; color: #000; border-color: #fff; }
.brain-compose-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.brain-attach { position: relative; overflow: hidden; cursor: pointer; }
.brain-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-solid {
  background: #fff; color: #000; border: 0; border-radius: 999px;
  padding: 10px 16px; font: 600 13px/1 var(--font); cursor: pointer;
}
.btn-solid:hover, .btn-solid:focus-visible { background: #000; color: #fff; box-shadow: inset 0 0 0 1px #fff; }
.gen-status { min-height: 1.2em; color: var(--muted); font-size: 12px; }
.brain-suggest { background: #1c1c1e; border-radius: 14px; padding: 12px; margin: 12px 0; }
.brain-suggest p { margin: 0 0 8px; font-size: 13px; color: #c7c7cc; }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.design-option { background: #1c1c1e; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; }
.design-option svg, .design-option img { width: 100%; aspect-ratio: 1; background: #0b0b0d; border-radius: 10px; }
.design-option .meta { font-size: 10px; color: var(--muted); margin: 6px 0 4px; letter-spacing: 0.08em; text-transform: uppercase; }
.design-pick { background: none; border: 0; color: inherit; padding: 0; text-align: left; width: 100%; cursor: pointer; }
.add-layer { width: 100%; background: #fff; color: #000; border: 0; border-radius: 999px; padding: 7px; font: 600 11px/1 var(--font); cursor: pointer; }

/* Checkout */
.path-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
.path-card {
  background: #1c1c1e; border: 1px solid var(--line); border-radius: 16px;
  color: #fff; text-align: left; padding: 14px; cursor: pointer;
}
.path-card[aria-pressed="true"] { outline: 2px solid #fff; }
.path-card strong { display: block; font: 600 15px/1.2 var(--font-tight); margin-bottom: 4px; }
.path-card span { color: var(--muted); font-size: 13px; }
.review-mock { background: #1c1c1e; border-radius: 16px; overflow: hidden; }
.review-mock img, .review-mock canvas, .review-mock svg { width: 100%; max-height: 280px; object-fit: contain; border-radius: 16px; background: #1c1c1e; display: block; }
.quote-summary { font-size: 13px; color: #c7c7cc; margin: 10px 0; }
.quote-summary dt { color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 8px; }
.quote-summary dd { margin: 2px 0 0; }

.return-banner { display: none; }
.return-banner.is-on,
body.is-returning .return-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  background: #000;
  border-bottom: 1px solid #1c1c1e;
  color: #fff;
}
.return-banner p { margin: 0; font-size: 13px; color: #c7c7cc; }
body.is-returning .device, body.is-returning .app {
  min-height: calc(100dvh - 48px);
  height: calc(100dvh - 48px);
}
@media (min-width: 800px) {
  body.is-returning .device, body.is-returning .app {
    min-height: 0; height: 100%;
  }
}

.quote-attach-lab {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
  color: #fff;
}
.quote-attach-lab .attach-kicker {
  margin: 0;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.quote-attach-lab .attach-lead { margin: 0; font-size: 13px; color: #c7c7cc; }
.quote-attach-lab .attach-empty { margin: 0; font-size: 13px; color: var(--muted); }
.quote-attach-lab .attach-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quote-attach-lab .attach-thumb { margin: 0; }
.quote-attach-lab .attach-thumb img {
  width: 100%; aspect-ratio: 4/5; object-fit: contain;
  background: #111; border-radius: 12px; display: block;
}
.quote-attach-lab .attach-thumb figcaption {
  margin-top: 4px;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.quote-attach-lab .attach-specs { margin: 0; }
.quote-attach-lab .attach-specs dt {
  color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 8px;
}
.quote-attach-lab .attach-specs dd { margin: 2px 0 0; font-size: 13px; color: #c7c7cc; }
.quote-attach-lab .attach-file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quote-attach-lab .attach-file-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #111;
  border-radius: 12px;
}
.quote-attach-lab .attach-file-preview {
  width: 48px; height: 48px; border-radius: 8px; overflow: hidden;
  background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.quote-attach-lab .attach-file-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quote-attach-lab .attach-file-icon { font-size: 8px; letter-spacing: 0.12em; }
.quote-attach-lab .attach-file-meta strong { display: block; font-size: 13px; }
.quote-attach-lab .attach-file-meta span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.quote-attach-lab .attach-remove {
  background: none; border: 0; color: #c7c7cc;
  font: 500 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.quote-attach-lab .attach-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Review already shows front/back mockups — don't repeat them in the attach card. */
.quote-attach-lab .attach-thumbs { display: none; }
.quote-attach-lab .attach-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 12px;
  border: 1px solid #fff; border-radius: 999px;
  background: transparent; color: #fff;
  font: 500 11px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
}
.quote-attach-lab .attach-btn:hover, .quote-attach-lab .attach-btn:focus-visible { background: #fff; color: #000; }
.quote-attach-lab .attach-btn input[type="file"] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.quote-attach-lab label.attach-btn { position: relative; }
.review-mock.review-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: transparent;
}
.review-mock.review-pair figure { margin: 0; }
.review-mock.review-pair img { max-height: 220px; border-radius: 16px; }
.review-mock.review-pair figcaption {
  margin-top: 4px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.field { margin: 0 0 10px; }
.field label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.size-grid label { background: #1c1c1e; border-radius: 10px; padding: 8px; font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.size-total { color: var(--muted); font-size: 13px; }
.designer-note { color: var(--muted); font-size: 12px; }
.form-status { color: #fff; font-size: 13px; margin-top: 10px; }
.form-status:empty { display: none; }
.form-status.is-err { color: #ffdad3; background: #3a1510; padding: 8px 10px; border-radius: 8px; }
.form-status.is-ok { color: #d4f0e0; background: #123024; padding: 8px 10px; border-radius: 8px; }
.addon-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.extras-block { margin: 8px 0 16px; }

/* Layout modal */
#modal-layout { background: #000; }
.pattern-wrap {
  flex: 1; position: relative; margin: 8px 12px;
  background: #f3f3f5; border-radius: 8px; overflow: hidden;
  touch-action: none;
}
.pattern-svg { width: 100%; height: 100%; display: block; }
.pattern-layers { position: absolute; inset: 0; }
.pat-layer {
  position: absolute; transform-origin: center center;
  touch-action: none; cursor: grab;
}
.pat-layer img, .pat-layer svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pat-layer.is-on { outline: 1.5px solid #0a84ff; }
.pat-layer .bbox { inset: 0; width: 100%; height: 100%; box-sizing: border-box; }
.layout-dock {
  flex: 0 0 auto;
  padding: 8px 16px calc(16px + var(--safe-b));
  background: #000;
}
.opacity-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.opacity-row .eye { width: 22px; color: #5ac8fa; display: flex; }
.opacity-row .eye svg { width: 22px; height: 22px; }
.opacity-row input[type="range"] { flex: 1; accent-color: #fff; }
#layout-slider-val { font-size: 11px; color: #5ac8fa; min-width: 3.5rem; text-align: right; }
.layout-actions { display: flex; gap: 8px; align-items: center; }
.layout-spacer { flex: 1; }

/* Picker */
.picker-modal { background: rgba(0,0,0,0.72); }
.app:has(#modal-picker:not([hidden])) .float-panel { visibility: hidden; }
.picker-modal .picker-head, .picker-modal .picker-body {
  background: #1C1C1E;
  backdrop-filter: blur(24px);
}
.picker-head {
  display: flex; align-items: center; gap: 8px;
  margin: 18vh 12px 0; border-radius: 20px 20px 0 0;
  padding: 10px 10px 8px; border-bottom: 1px solid var(--line);
}
.picker-tabs { display: flex; flex: 1; justify-content: center; gap: 4px; background: #2c2c2e; border-radius: 999px; padding: 3px; }
.picker-tabs button {
  flex: 1; border: 0; background: transparent; color: #c7c7cc;
  border-radius: 999px; padding: 6px 8px; font: 500 12px/1 var(--font); cursor: pointer;
}
.picker-tabs button.is-on { background: #3a3a3c; color: #fff; }
.picker-body { margin: 0 12px; border-radius: 0 0 20px 20px; padding: 12px 12px 18px; }
.spectrum-box {
  position: relative; width: 100%; aspect-ratio: 1.35;
  border-radius: 8px; overflow: hidden;
  background: linear-gradient(to right, #fff, hsl(20,100%,50%)),
              linear-gradient(to top, #000, transparent);
  background-blend-mode: multiply;
  cursor: crosshair;
}
.spectrum-knob {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #000; pointer-events: none;
  transform: translate(-50%, -50%);
}
.hue-row input, #picker-sliders input, .checker input { width: 100%; accent-color: #fff; }
.hue-row { margin: 10px 0; }
.hue-row input {
  background: linear-gradient(to right, #ff0000, #ff0, #0f0, #0ff, #00f, #f0f, #ff0000);
  border-radius: 99px; height: 14px; appearance: none;
}
.hue-row input::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid #000; }
#picker-sliders label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0; }
.picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.picker-grid button { aspect-ratio: 1; border: 0; border-radius: 6px; cursor: pointer; padding: 0; }
.picker-op { margin-top: 12px; font-size: 10px; letter-spacing: 0.12em; }
.checker { flex: 1; background-image: linear-gradient(45deg, #777 25%, transparent 25%), linear-gradient(-45deg, #777 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #777 75%), linear-gradient(-45deg, transparent 75%, #777 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; border-radius: 99px; padding: 0 4px; }
.recent-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.current-swatch { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.recent-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.recent-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; }

/* Menus, tips, clear-display */
.pop-menu {
  position: absolute;
  top: calc(54px + var(--safe-t));
  right: 12px;
  z-index: 30;
  background: var(--panel-2);
  backdrop-filter: blur(22px);
  border-radius: 16px;
  padding: 6px;
  min-width: 220px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.pop-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: 0; color: #fff;
  text-align: left; padding: 11px 12px; border-radius: 12px;
  font: 500 14px/1 var(--font); cursor: pointer;
}
.pop-menu button:hover, .pop-menu button:focus { background: rgba(255,255,255,0.08); }
.pop-menu svg { width: 18px; height: 18px; flex: 0 0 auto; }
.tips-card {
  position: absolute; left: 16px; right: 16px; top: 22%;
  z-index: 28;
  background: var(--panel-2);
  backdrop-filter: blur(22px);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.45);
}
.tips-card h3 { margin: 0 0 8px; font: 600 16px var(--font-tight); }
.tips-card ul { margin: 0 0 14px; padding-left: 1.1rem; color: #c7c7cc; font-size: 13px; }
.tips-card li { margin: 0 0 6px; }
.app.clear-ui .app-header .header-pills,
.app.clear-ui .side-stack,
.app.clear-ui .tool-dock,
.app.clear-ui .edit-dock,
.app.clear-ui .float-panel,
.app.clear-ui .tab-bar { display: none !important; }

/* Shared chrome for tablet + desktop (no phone frame at >=800) */
.desk-wide-only { display: none !important; }
.desk-nav { display: none; }
#btn-desk-quote { display: none; }
.desk-rail-left, .desk-rail-right { display: contents; }

@media (min-width: 800px) {
  body.lab-app-page {
    display: flex; flex-direction: column;
    height: 100dvh; min-height: 100dvh;
    overflow: hidden;
    background: #000;
  }
  .desk-brand {
    display: flex; flex-direction: row; align-items: center;
    gap: 18px;
    width: 100%;
    height: 48px;
    padding: 0 18px;
    flex: 0 0 auto;
    border-bottom: 1px solid #1c1c1e;
    background: #000;
  }
  .desk-wordmark {
    color: #fff; text-decoration: none;
    font: 500 13px/1 var(--font-tight);
    letter-spacing: 0.22em; text-transform: uppercase;
    white-space: nowrap;
  }
  .desk-wordmark span { font-weight: inherit; letter-spacing: inherit; color: inherit; }
  .desk-nav { display: flex; align-items: center; gap: 16px; }
  .desk-nav a {
    color: #c7c7cc; text-decoration: none;
    font: 500 12px/1 var(--font);
    letter-spacing: 0.04em;
  }
  .desk-nav a:hover, .desk-nav a:focus { color: #fff; }
  .desk-note { margin: 0 0 0 auto; color: #5a5a5a; font-size: 11px; }
  #btn-desk-quote {
    display: inline-flex;
    height: 32px;
    flex: 0 0 auto;
  }
  .device-wrap {
    display: flex; align-items: stretch; justify-content: stretch;
    flex: 1 1 auto; min-height: 0; width: 100%;
    padding: 0;
  }
  .device {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    border-radius: 0;
    overflow: hidden;
    border: 0;
    box-shadow: none;
    background: #000;
    transform: none;
  }
  .device .app { min-height: 0; height: 100%; width: 100%; }
}

/* Tablet 800–1023: full viewport, compact phone chrome, no device bezel */
@media (min-width: 800px) and (max-width: 1023.98px) {
  .svg-host { padding: 4.5rem 2rem 9rem; }
}

/* Design Lab desktop layout >=1024 */
@media (min-width: 1024px) {
  .desk-wide-only { display: flex !important; }
  .desk-brand { height: 56px; padding: 0 24px; }
  .desk-wordmark { font-size: 14px; letter-spacing: 0.24em; }
  body.lab-app-page.is-desk .device,
  .device { border: 0; box-shadow: none; transform: none; }

  .app {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "left canvas right";
    background: #000;
    color: #fff;
  }

  .desk-rail-left,
  .desk-rail-right { display: flex; }

  .desk-rail-left {
    grid-area: left;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: auto;
    padding: 20px 16px 24px;
    background: #000;
    border-right: 1px solid #1c1c1e;
    z-index: 8;
  }
  .desk-rail-right {
    grid-area: right;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: auto;
    padding: 20px 16px 16px;
    background: #000;
    border-left: 1px solid #1c1c1e;
    z-index: 4;
  }
  .desk-rail-left { z-index: 4; }

  .rail-kicker {
    margin: 0 0 10px;
    color: #8e8e93;
    font: 500 11px/1 var(--font);
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .rail-actions {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
  }
  .rail-btn {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    background: #111;
    color: #fff;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 10px 12px;
    font: 500 13px/1 var(--font);
    cursor: pointer;
    text-align: left;
  }
  .rail-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
  .rail-letter {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font: 600 14px/1 var(--font-tight);
  }
  .rail-btn:hover, .rail-btn:focus { background: #1c1c1e; border-color: #333; }
  .rail-card {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
    padding: 14px;
    background: #111;
    border: 1px solid #222;
    border-radius: 16px;
    color: #fff;
  }
  .rail-card h2 {
    margin: 0;
    text-align: left;
    font: 600 15px/1.2 var(--font-tight);
  }
  .rail-card .panel-hint { text-align: left; margin: 0; }
  .rail-quote {
    display: inline-flex !important;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 8px;
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    font-size: 13px;
    z-index: 2;
    box-shadow: 0 -12px 16px #000;
  }

  .app-header {
    grid-area: canvas;
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 12px 12px 0;
    pointer-events: none;
  }
  .app-header #btn-back,
  .app-header #btn-quote,
  .app-header #btn-studio-top { display: none !important; }

  .stage {
    grid-area: canvas;
    background: var(--app-bg, #EDEDED);
    min-height: 0;
  }
  .svg-host { padding: 4rem 2.5rem 5rem; }

  .side-stack {
    grid-area: canvas;
    top: 64px;
    right: 16px;
    z-index: 6;
  }
  .side-stack #btn-text,
  .side-stack #btn-layers { display: none; }

  .tab-bar { display: none !important; }

  /* Tool dock lives in the left rail */
  .tool-dock, #tool-dock[hidden] {
    position: static;
    display: flex !important;
    flex-direction: column;
    left: auto; right: auto; bottom: auto;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #1c1c1e;
    z-index: auto;
  }
  .tool-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 12px;
    background: #111;
    backdrop-filter: none;
  }
  .tool-btn svg { width: 18px; height: 18px; }
  .tool-btn.wide { flex: 0 0 auto; }

  .edit-dock, #edit-dock:not([hidden]) {
    grid-area: canvas;
    position: absolute;
    left: 16px; right: 16px;
    bottom: 16px;
    z-index: 9;
  }

  /* Always-visible color + view docks in the right rail */
  #panel-color,
  #panel-rotate,
  #panel-paint:not([hidden]),
  #panel-bg:not([hidden]),
  #panel-color[hidden],
  #panel-rotate[hidden] {
    position: static;
    left: auto; right: auto; bottom: auto;
    display: block !important;
    margin: 0 0 14px;
    padding: 14px;
    background: #111;
    border: 1px solid #222;
    border-radius: 16px;
    box-shadow: none;
    backdrop-filter: none;
    z-index: auto;
  }
  #panel-paint[hidden],
  #panel-bg[hidden] { display: none !important; }
  .float-panel h2 { text-align: left; margin-bottom: 10px; }
  .panel-hint { text-align: left; }
  #zoom-close { display: none !important; }

  /* Garment list is a dock, not a full-screen sheet */
  #sheet-mockups,
  #sheet-mockups[hidden] {
    position: static;
    inset: auto;
    display: flex !important;
    flex-direction: column;
    background: transparent;
    animation: none;
    overflow: visible;
    border-radius: 0;
    margin: 0 0 12px;
    z-index: auto;
    color: #fff;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
  }
  #sheet-mockups .sheet-head {
    padding: 0 0 8px;
    border-bottom: 0;
  }
  #sheet-mockups .sheet-head [data-close-sheet] { display: none !important; }
  #sheet-mockups .sheet-head h2 {
    font: 500 11px/1 var(--font);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8e8e93;
  }
  #sheet-mockups .sheet-head p { display: none; }
  #sheet-mockups .sheet-body,
  #mockup-grid {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow: visible;
    flex: 0 0 auto;
    min-height: 0;
  }
  .mock-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 8px 8px;
    border-radius: 12px;
    background: #111;
  }
  .mock-card svg {
    width: 100%; height: 44px; margin: 0 0 6px;
    grid-row: auto;
  }
  .mock-card strong { font-size: 13px; }
  .mock-card span { font-size: 10px; }
  /* Edit sliders, nudge pad, and the leftover Rotate tool are on the canvas or in layer properties. */
  .edit-dock, #edit-dock:not([hidden]) { display: none !important; }
  #btn-dock-layers { display: none !important; }

  /* Studio, saved, checkout: centered desktop modals */
  #sheet-studio,
  #sheet-saved,
  #sheet-checkout,
  .modal {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    position: absolute;
    inset: 0;
    z-index: 50;
    width: auto;
    height: auto;
  }
  #sheet-studio,
  #sheet-saved,
  #sheet-checkout {
    background: rgba(0,0,0,0.72);
    display: flex;
    flex-direction: column;
    padding: 4vh 6vw;
    border-radius: 0;
    animation: none;
  }
  #sheet-studio > .sheet-head,
  #sheet-saved > .sheet-head,
  #sheet-checkout > .sheet-head {
    width: min(720px, 100%);
    margin: 0 auto;
    background: #0b0b0d;
    border-radius: 20px 20px 0 0;
    border: 1px solid #222;
    border-bottom: 1px solid #222;
  }
  #sheet-studio > .sheet-body,
  #sheet-saved > .sheet-body,
  #sheet-checkout > .sheet-body,
  #sheet-checkout > form,
  #sheet-checkout > #lab-forms,
  #sheet-checkout > #lab-done {
    width: min(720px, 100%);
    margin: 0 auto;
    background: #0b0b0d;
    border-left: 1px solid #222;
    border-right: 1px solid #222;
  }
  #sheet-studio > :last-child,
  #sheet-saved > :last-child,
  #sheet-checkout > :last-child {
    border-radius: 0 0 20px 20px;
    border-bottom: 1px solid #222;
  }

  .pop-menu { top: 56px; }
  .app.clear-ui .desk-rail-left,
  .app.clear-ui .desk-rail-right,
  .app.clear-ui .rail-actions { display: none !important; }
  .app:has(#sheet-checkout:not([hidden])) .app-header,
  .app:has(#sheet-studio:not([hidden])) .app-header,
  .app:has(#sheet-saved:not([hidden])) .app-header,
  .app:has(#sheet-checkout:not([hidden])) .side-stack,
  .app:has(#sheet-studio:not([hidden])) .side-stack,
  .app:has(#sheet-saved:not([hidden])) .side-stack { z-index: 1; }
}


/* ——— Layer properties / typography ——— */
.layer-props {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 16;
  max-height: 52vh;
  overflow: auto;
  padding: 14px 16px 18px;
  background: #0d0d0f;
  border-top: 1px solid #2a2a2e;
  border-radius: 20px 20px 0 0;
  color: #fff;
  -webkit-overflow-scrolling: touch;
}
.layer-props[hidden] { display: none !important; }
.layer-props-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.layer-props-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.layer-props-tools { display: flex; align-items: center; gap: 6px; }
.layer-props-tools button {
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.layers-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.layers-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid #2a2a2e;
  border-radius: 10px;
  background: #141416;
}
.layers-item.is-on { border-color: #fff; }
.layers-item.is-hidden > [data-layer-act="select"] { opacity: 0.4; text-decoration: line-through; }
.layers-item button {
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
}
.layers-item [data-layer-act="select"] {
  text-align: left;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layers-item button[disabled] { opacity: 0.3; cursor: default; }
.prop-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9e;
}
#layer-text, #layer-font {
  width: 100%;
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  margin-bottom: 8px;
}
.prop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.prop-row button {
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}
.prop-row button.is-on, .prop-row button[aria-pressed="true"] {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.prop-row button.is-danger { border-color: #FF3B30; color: #FF3B30; }
#text-color-swatches, #art-tint-swatches { margin-bottom: 8px; }

@media (min-width: 1024px) {
  .layer-props {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 14px 12px;
    margin: 0 0 14px;
    border: 1px solid #2a2a2e;
    border-radius: 16px;
    background: #111113;
  }
  #btn-layer-props-x { display: none; }
  .desk-rail-right .layer-props { order: 6; }
}

@media (max-width: 1023px) {
  .app:has(#layer-props:not([hidden])) .edit-dock { bottom: 52vh; }
}


/* ——— Competitor-inspired lab tools (Yeezy-minimal) ——— */
.lab-steps {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 8px 16px 0;
  gap: 8px;
  justify-content: center;
  background: #000;
  color: #fff;
}
.lab-steps button {
  background: transparent;
  color: #8e8e93;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 6px 4px 8px;
  font: 500 11px/1.2 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.lab-steps button.is-on { color: #fff; border-bottom-color: #fff; }
.lab-steps li { display: flex; }

.start-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.start-screen[hidden] { display: none !important; }
.start-card { width: min(520px, 100%); }
.start-kicker { margin: 0 0 8px; letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; color: #8e8e93; }
.start-card h2 { margin: 0 0 22px; font: 500 28px/1.1 var(--font-tight); }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.start-grid button, .start-skip {
  text-align: left;
  background: #111;
  color: #fff;
  border: 1px solid #2a2a2e;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
}
.start-grid strong { display: block; font-size: 15px; margin-bottom: 6px; }
.start-grid span { display: block; font-size: 12px; color: #8e8e93; line-height: 1.4; }
.start-skip { width: 100%; margin-top: 12px; text-align: center; background: transparent; }

.canvas-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 46%;
}
.canvas-hud button, .save-indicator, .price-est { pointer-events: auto; }
.hud-pills, .hud-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.hud-pills button, .hud-meta button, .save-indicator {
  background: rgba(0,0,0,0.78);
  color: #fff;
  border: 1px solid #333;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}
.save-indicator { opacity: 0.55; cursor: default; }
.save-indicator.is-on { opacity: 1; }
.price-est {
  margin: 0;
  font-size: 11px;
  color: #111;
  background: rgba(255,255,255,0.86);
  border-radius: 8px;
  padding: 6px 8px;
  max-width: 240px;
  line-height: 1.35;
}

.print-guide {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.print-guide[hidden] { display: none !important; }
.print-guide-max, .print-guide-safe {
  position: absolute;
  box-sizing: border-box;
}
.print-guide-max { border: 1px dashed rgba(0,0,0,0.55); }
.print-guide-safe { border: 1px solid rgba(0,0,0,0.28); }
.print-guide-label, .print-guide-art, .print-guide-warn {
  position: absolute;
  z-index: 6;
  font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.94);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.print-guide-label { font-weight: 600; }
.print-guide-art.is-warn, .art-inch-readout.is-warn { color: #000; background: #fff; box-shadow: inset 0 0 0 1px #000; }
.print-guide-warn {
  pointer-events: auto;
  background: #000;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 8px;
}
.print-guide-warn[hidden] { display: none !important; }
.print-guide-max.is-warn { border-color: #000; border-width: 1px; border-style: dashed; }

.place-strip {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: calc(100% - 20px);
  padding: 4px;
  background: rgba(0,0,0,0.72);
  border-radius: 12px;
}
.place-strip button {
  flex: 0 0 auto;
  min-width: 64px;
  background: transparent;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.place-strip button:disabled{opacity:.35;cursor:not-allowed}
.place-strip button.is-on { border-color: #fff; }

.ctx-toolbar {
  position: absolute;
  z-index: 9;
  display: flex;
  gap: 2px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.ctx-toolbar[hidden] { display: none !important; }
.ctx-toolbar button {
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.ctx-toolbar button:hover { background: #222; }
.bbox .h.del {
  top: -8px;
  right: -28px;
  left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-style: normal;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.preset-row button {
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 10px 8px;
  min-width: 72px;
  cursor: pointer;
}
.preset-row button small { display: block; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: #8e8e93; margin-top: 4px; }
.preset-row button.is-on { border-color: #fff; }
.rotate-num {
  width: 64px;
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
}
.art-inch-readout { margin: 6px 0 8px; font-size: 12px; color: #c7c7cc; }

.font-modal .modal-card {
  background: #0d0d0f;
  color: #fff;
  width: min(420px, 92vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: 16px;
  padding: 16px;
}
#font-search {
  width: 100%;
  background: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}
.font-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.font-tabs button {
  background: transparent; color: #8e8e93; border: 0; border-bottom: 1px solid transparent;
  padding: 6px 2px; cursor: pointer; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px;
}
.font-tabs button.is-on { color: #fff; border-bottom-color: #fff; }
.font-list { display: flex; flex-direction: column; gap: 4px; }
.font-list button {
  text-align: left;
  background: #151517;
  color: #fff;
  border: 1px solid #2a2a2e;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1.2;
}
.font-list button small { display: block; font-size: 11px; color: #8e8e93; font-family: var(--font); margin-top: 4px; }
.font-list button.is-on { border-color: #fff; }

.qty-step { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #222; }
.qty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin: 0 0 14px; }
.qty-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #8e8e93;
}
.qty-grid input {
  background: #111; color: #fff; border: 1px solid #333; border-radius: 8px; padding: 8px; font-size: 14px;
}
.price-est-sheet { background: #111; color: #fff; max-width: none; }

.template-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: #111; color: #fff; border: 1px solid #2a2a2e; border-radius: 12px;
  padding: 12px; cursor: pointer; width: 100%;
}
.template-card svg { width: 100%; height: 72px; background: #fff; border-radius: 8px; }
#template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.names-body input {
  width: 100%; background: #1c1c1e; color: #fff; border: 1px solid #333;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 16px;
}

@media (min-width: 1024px) {
  .lab-steps {
    padding: 0 24px 10px;
    justify-content: flex-start;
  }
  .canvas-hud { top: 12px; left: 12px; }
  .start-screen { position: fixed; }
  .place-strip { bottom: 16px; }
}

@media (max-width: 1023px) {
  .canvas-hud { top: 8px; bottom: auto; left: 8px; max-width: 62%; }
  .tab-bar { bottom: calc(10px + var(--safe-b)); }
  .tool-dock, .edit-dock {
    bottom: calc(76px + var(--safe-b));
  }
  .place-strip {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    max-width: none;
    bottom: calc(140px + var(--safe-b));
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .stage, .lab-photo-host, .lab-3d-host, .svg-host {
    padding-bottom: calc(200px + var(--safe-b));
    box-sizing: border-box;
  }
  .edit-dock .place-panel-mobile { display: none; }
  .lab-steps { padding: 4px 8px 6px; }
  .lab-steps button { font-size: 9px; }
  .start-grid { grid-template-columns: 1fr; }
  /* Keep the contextual toolbar from covering the print-area label */
  .print-guide-label { z-index: 8; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .modal { animation: none; }
}

/* Restore notice + color panel label (fixes round 2) */
.restore-note {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: #000; border: 1px solid #000; border-radius: 999px;
  padding: 6px 6px 6px 12px; font-size: 12px; margin-bottom: 6px; align-self: flex-start;
}
.restore-note button { background: #000; color: #fff; border: 0; border-radius: 999px; padding: 5px 10px; font-size: 11px; cursor: pointer; }
.restore-note .restore-x { background: transparent; color: #000; padding: 2px 6px; font-size: 14px; }
.color-current { font-weight: 400; opacity: 0.6; font-size: 0.85em; margin-left: 6px; }
.prop-hint { display: block; font-weight: 400; opacity: 0.6; font-size: 11px; text-transform: none; letter-spacing: 0; }
#color-swatches { flex-wrap: wrap; overflow-x: visible; gap: 8px; }
#color-swatches .swatch { width: 32px; height: 32px; }
@media (min-width: 1024px) {
  /* Desktop: shirt color sits at the top of the right rail so it's found without scrolling. */
  .desk-rail-right > .rail-kicker { order: -2; }
  .desk-rail-right > #panel-color { order: -1; margin-bottom: 14px; }
}

/* Phone + tablet: keep the HUD pills below the header buttons (back / AI Studio / Quote / menu). */
@media (max-width: 1023.98px) {
  .canvas-hud { top: calc(56px + var(--safe-t)); }
}

/* Finish step */
.finish-grid,
#finish-grid-rail.finish-grid,
#panel-finish .finish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#finish-grid-rail .finish-btn[data-finish="none"] {
  grid-column: 1 / -1;
}
.finish-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  background: #0d0d0d;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.finish-btn:hover, .finish-btn:focus-visible { border-color: #fff; }
.finish-btn.is-on { border-color: #fff; background: #161616; }
.finish-swatch {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.finish-swatch span {
  font-family: "Inter Tight", "Helvetica Neue", sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #f2f2f2;
}
.finish-swatch-none { background: #111; }
.finish-swatch-distressed span {
  filter: contrast(1.35);
  opacity: 0.9;
  mask-image: radial-gradient(circle at 30% 30%, #000 40%, transparent 41%),
    radial-gradient(circle at 70% 62%, #000 18%, transparent 19%),
    linear-gradient(115deg, #000 40%, transparent 41%, #000 55%, transparent 56%, #000 100%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 40%, transparent 41%),
    radial-gradient(circle at 70% 62%, #000 18%, transparent 19%),
    linear-gradient(115deg, #000 40%, transparent 41%, #000 55%, transparent 56%, #000 100%);
}
.finish-swatch-embroidery span {
  background: repeating-linear-gradient(180deg, #fff 0 2px, #bdbdbd 2px 3px);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 rgba(255,255,255,0.35));
}
.finish-swatch-puff span {
  color: #fff;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.65)) drop-shadow(0 -1px 0 rgba(255,255,255,0.5));
  transform: scale(1.08);
}
.finish-swatch-halftone {
  background:
    radial-gradient(circle, #fff 1.1px, transparent 1.25px) 0 0 / 6px 6px,
    radial-gradient(circle, #fff 0.8px, transparent 1px) 3px 3px / 6px 6px,
    #111;
}
.finish-swatch-halftone span {
  color: transparent;
  background: #fff;
  -webkit-background-clip: text;
  background-clip: text;
  filter: contrast(2);
  mix-blend-mode: destination-in;
}
.finish-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.finish-copy strong {
  font: 600 13px/1.2 var(--font-tight, inherit);
}
.finish-copy em {
  font-style: normal;
  font-size: 11px;
  color: #9a9a9a;
}
#panel-finish .finish-grid {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 420px) {
  .tool-btn { font-size: 9px; padding: 8px 2px 7px; gap: 3px; }
  .tool-btn svg { width: 18px; height: 18px; }
}

/* All-over print mode */
.print-guide.is-aop .print-guide-max, .print-guide.is-aop .print-guide-safe, .print-guide.is-aop .print-guide-warn { display: none !important; }
.print-guide-warn .aop-switch { margin-left: 6px; font: inherit; font-weight: 700; color: #000; background: #fff; border: 0; border-radius: 3px; padding: 1px 6px; cursor: pointer; }
.print-guide-warn .aop-switch:hover { text-decoration: underline; }
