/* House of 3D - custom quotation. Same tokens as houseof3d.store (Hermes treatment: navy canvas,
   #0000f2 blocks, lavender text accents, Bricolage display / Inter text). Fonts are self-hosted so the
   page keeps its no-third-party CSP. Every selector app.mjs toggles is preserved. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2"); }

body::after { content: ""; position: fixed; inset: 0; border: 5px solid #0000f2; pointer-events: none; z-index: 2147483000; }
:root {
  color-scheme: dark;
  --canvas: #0d0d24; --surface: #19192f; --surface-2: #22223d; --ink: #f2f2f2; --ink-soft: #e6e6ef;
  --ink-mute: #9d9dc4; --accent: #0000f2; --accent-text: #8585f9; --accent-ink: #ffffff; --error: #f0a39b;
  --hair: color-mix(in oklab, var(--ink) 12%, transparent); --hair-strong: color-mix(in oklab, var(--ink) 22%, transparent);
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px -16px rgba(0,0,0,.6);
  font-family: var(--font-text); color: var(--ink); background: var(--canvas); font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.6; background:
  radial-gradient(1200px 600px at 85% -10%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 60%), var(--canvas); }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(2.6rem, 1.6rem + 4.2vw, 4.75rem); }
h2 { font-size: 1.35rem; letter-spacing: -0.02em; }
p { margin: 0 0 .75rem; }
label, legend { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
legend { padding: 0; }
small, .small { font-size: .82rem; line-height: 1.5; }
.muted { color: var(--ink-mute); }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 .6rem; }

button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary { min-height: 46px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--hair-strong); border-radius: var(--r-md); padding: 10px 12px; background: var(--canvas); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: var(--ink-mute); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, var(--ink) 35%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23c2c9bc' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
select option { background: var(--surface); color: var(--ink); }
textarea { resize: vertical; }
input[type=file] { font-size: 13px; padding: 10px; max-width: 100%; border: 0; background: transparent; color: var(--ink-soft); }
input::file-selector-button { min-height: 44px; border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); padding: 8px 16px; margin-right: 12px; cursor: pointer; font-weight: 600; }
input[type=number] { font-variant-numeric: tabular-nums; }
button { cursor: pointer; border: 1px solid var(--hair-strong); border-radius: var(--r-md); padding: 10px 18px; background: var(--surface-2); color: var(--ink); font-weight: 600; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
button:hover:not(:disabled) { background: color-mix(in oklab, var(--surface-2) 70%, var(--ink) 8%); border-color: color-mix(in oklab, var(--ink) 35%, transparent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; background: var(--surface); color: var(--ink-mute); border-color: var(--hair); }
.primary, .quote-summary .primary, input::file-selector-button { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-text); }
.primary:hover:not(:disabled), .quote-summary .primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 88%, white); border-color: color-mix(in oklab, var(--accent) 88%, white); }
.text-button { background: transparent; border-color: transparent; color: var(--accent-text); padding-left: 0; padding-right: 0; min-height: 36px; }
.text-button:hover:not(:disabled) { background: transparent; border-color: transparent; text-decoration: underline; }
a { color: inherit; }
a, button, input, select, textarea, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip { position: absolute; top: -100px; left: 12px; padding: 12px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r-md); z-index: 5; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }

.preview-banner { background: var(--surface); color: var(--ink-soft); padding: 9px clamp(1.25rem, 5vw, 5.5rem); display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; font-size: .78rem; letter-spacing: .01em; border-bottom: 1px solid var(--hair); }
.preview-banner strong { color: var(--accent-text); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; }

.masthead { max-width: 82rem; margin: auto; padding: 22px clamp(1.25rem, 5vw, 5.5rem); display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--hair); }
.wordmark { text-decoration: none; font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.035em; display: inline-flex; align-items: center; }
.wordmark img { width: 28px; height: 24px; display: block; margin-right: 10px; }
.wordmark > span:not(.wordmark-dot) { font-size: .7rem; letter-spacing: .08em; vertical-align: middle; color: var(--ink-soft); font-family: var(--font-text); font-weight: 500; margin: 0 7px; }
.wordmark-dot { color: var(--accent-text); }
.studio-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.studio-label a { text-decoration: none; color: var(--ink-soft); border-bottom: 1px solid var(--hair-strong); padding-bottom: 2px; }
.studio-label a:hover { color: var(--accent-text); border-color: var(--accent-text); }

main { max-width: 82rem; margin: auto; padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 5.5rem) 4rem; }
.intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; margin-bottom: 2rem; }
.intro h1 { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 3.9rem); }
.intro > div > p:last-child { color: var(--ink-soft); font-size: 1.05rem; max-width: 50ch; margin: .9rem 0 0; }
.process-note { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; justify-self: end; font-size: .82rem; color: var(--ink-mute); }
.process-note li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.process-note li span { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-mute); }
.process-note li.current { color: var(--ink); border-color: color-mix(in oklab, var(--accent) 50%, transparent); font-weight: 600; }
.process-note li.current span { color: var(--accent-text); }

#quote-form { display: grid; gap: 1.5rem; }
.card { scroll-margin-top: 1rem; }
.source-switch { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.source-switch label { margin: 0; white-space: nowrap; font-size: .78rem; }
.source-switch select { width: auto; min-height: 40px; padding: 6px 36px 6px 12px; font-size: .9rem; }
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr); gap: 1.5rem 2rem; align-items: start; margin-top: 6px; }
.upload-side { border-left: 1px solid var(--hair); padding-left: 2rem; min-width: 0; }
.upload-side h3 { margin-top: 10px; }
.upload-side label { margin-top: 10px; }
.item-row { display: grid; grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 3.4fr) minmax(9rem, .9fr); gap: 1rem 1.5rem; align-items: start; margin-top: 10px; padding: 16px 18px; border: 1px solid var(--hair); border-radius: var(--r-md); background: color-mix(in oklab, var(--canvas) 60%, var(--surface)); }
.item-name, .item-price { display: grid; gap: 2px; align-content: start; min-width: 0; }
.item-name strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.item-name small, .item-price small { font-size: .78rem; }
.item-price { text-align: right; border-left: 1px solid var(--hair); padding-left: 1.25rem; align-self: stretch; }
.item-price strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.item-price strong.estimate::before { content: "≈ "; color: var(--ink-mute); font-weight: 400; }
.item-fields { display: grid; grid-template-columns: 1.3fr 1.2fr 1.1fr 1.25fr .7fr; gap: 0 12px; min-width: 0; }
/* Colour (milestone 14): a native select like Finish / Infill, with a dot showing the chosen filament. */
.colour-field { position: relative; display: block; }
.colour-field select { padding-left: 36px; }
.colour-dot { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); pointer-events: none; }
.colour-dot.any { background: conic-gradient(#f06, #fc0, #3c3, #3cf, #c3f, #f06); }
.item-fields label { margin-top: 0; }
.item-fields select, .item-fields input { min-height: 44px; }
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.section-heading h2 { flex: 1; }
.step { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-text); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.local-tag { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); border-radius: 999px; padding: 3px 9px; }

.file-picker { position: relative; border: 1px dashed var(--hair-strong); border-radius: var(--r-md); padding: 24px 18px 18px; text-align: center; margin-top: 10px; background: color-mix(in oklab, var(--canvas) 60%, var(--surface)); transition: border-color .15s ease, background .15s ease; }
.file-picker:hover, .file-picker:focus-within, .file-picker.is-over { border-color: var(--accent-text); background: color-mix(in oklab, var(--accent) 5%, var(--surface)); }
.file-picker.is-over { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.file-picker { padding: 30px 18px 22px; }
.file-symbol { display: block; font-size: 1.5rem; color: var(--accent-text); line-height: 1; }
.file-picker label { margin: 8px 0 2px; font-size: 1.05rem; color: var(--ink); font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.file-picker p { font-size: .82rem; color: var(--ink-mute); margin: 0 0 10px; }
.file-picker small { display: block; color: var(--ink-mute); margin-top: 6px; }
#file-status { font-size: .85rem; color: var(--ink-soft); margin: 10px 0 0; }
#file-status.error, #review-status.error, .error { color: var(--error); }

.mesh-stage { position: relative; margin-top: 14px; border-radius: var(--r-md); overflow: hidden; background: #ffffff; color: #ffffff; border: 1px solid var(--hair); min-height: 260px; aspect-ratio: 12 / 7;
  /* White stage so the filament colour reads true (a dark stage dulled every colour). */
  background-image: linear-gradient(to right, rgba(20, 32, 22, .08) 1px, transparent 1px), linear-gradient(to bottom, rgba(20, 32, 22, .08) 1px, transparent 1px); background-size: 36px 36px; background-position: 50% 50%; }
.mesh-stage .eyebrow { color: #5c6b5e; }
.mesh-stage > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1.5rem; }
.mesh-stage p { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.mesh-stage small { color: #5c6b5e; }
.mesh-stage canvas { display: block; width: 100%; height: 100%; }
.viewer-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; font-size: .82rem; color: var(--ink-mute); letter-spacing: .06em; text-transform: uppercase; }
.viewer-controls button { min-height: 40px; min-width: 40px; padding: 6px 12px; border-radius: 999px; }
#mesh-bounds { font-size: .85rem; color: var(--ink-soft); margin: 12px 0 4px; font-variant-numeric: tabular-nums; }

.two-fields, .dimensions { display: grid; gap: 0 16px; }
.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
fieldset label { margin-top: 10px; }
details { margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 4px; }
summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); list-style: none; display: flex; align-items: center; gap: 10px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); transform: rotate(-45deg); transition: transform .15s ease; }
details[open] summary::before { transform: rotate(45deg); }
.reference-note { font-size: .82rem; color: var(--ink-soft); background: color-mix(in oklab, var(--accent) 8%, var(--surface)); border-left: 2px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 14px; margin: 12px 0 6px; }

.quote-summary { background: var(--canvas); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); box-shadow: var(--shadow), inset 0 1px 0 color-mix(in oklab, var(--accent) 20%, transparent); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: start; margin-top: 10px; }
.checkout-right { border-left: 1px solid var(--hair); padding-left: 3rem; min-width: 0; }
.checkout-right #identity-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.button-link.ghost { width: 100%; margin-top: 12px; border: 1px solid var(--hair-strong); background: transparent; color: var(--ink); }
.button-link.ghost:hover { border-color: var(--accent-text); color: var(--accent-text); }
.faq { margin-top: 3rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.5rem 3rem; align-items: start; }
.faq-intro h2 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); margin-bottom: 1rem; }
.faq-intro .button-link { width: auto; }
.faq-list details { margin: 0; border-top: 1px solid var(--hair); padding: 4px 0; }
.faq-list details:last-child { border-bottom: 1px solid var(--hair); }
.faq-list summary { padding: 10px 0; }
.faq-list p { color: var(--ink-soft); margin: 0 0 12px; max-width: 70ch; }
.quote-summary dl { margin: 0 0 1rem; display: grid; gap: 0; border-top: 1px solid var(--hair); }
.quote-summary dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.quote-summary dt { color: var(--ink-mute); font-size: .85rem; }
.quote-summary dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.price-state { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 1rem; border: 1px solid var(--hair); }
.price-state > span { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.price-state p { margin: 6px 0 0; font-size: .82rem; color: var(--ink-soft); }
.quote-summary button, .quote-summary .button-link { width: 100%; margin-top: 12px; }
.quote-summary .small { color: var(--ink-mute); }
#identity-panel, #payment-panel, #accepted-panel { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--hair); }
#identity-panel label { margin-top: 12px; }
#review-status { font-size: .9rem; color: var(--ink-soft); margin-top: 12px; }
#progress { margin-top: 14px; }
.breakdown { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--hair); display: grid; gap: 0; }
.breakdown > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .85rem; color: var(--ink-soft); }
.breakdown dt { color: var(--ink-mute); } .breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.breakdown .total { border-top: 1px solid var(--hair); margin-top: 4px; padding-top: 8px; font-weight: 700; color: var(--ink); font-size: .95rem; }
.breakdown .total dt { color: var(--ink); }
.price-state > span.estimate::before { content: "≈ "; color: var(--ink-mute); font-weight: 400; }
.delivery { margin: 0 0 1rem; } .delivery legend { margin: 0 0 6px; }
.choice-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) { .choice-row-2 { grid-template-columns: 1fr; } }
.progress-track { height: 6px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 10%, transparent); overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
#progress-bar.indeterminate { width: 100%; background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%); background-size: 50% 100%; animation: slide 1.2s linear infinite; }
@keyframes slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
#progress-label { margin: 8px 0 0; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mode-switch { margin-left: auto; display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 999px; padding: 3px; background: var(--canvas); }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; min-height: 0; }
.mode-switch label { margin: 0; padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink-mute); cursor: pointer; line-height: 1.4; }
.mode-switch input:checked + label { background: var(--accent); color: var(--accent-ink); }
.mode-switch input:focus-visible + label { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
#mode-note { margin: 8px 0 0; }
#expert-settings { margin-top: 10px; border-top: 1px solid var(--hair); }
#expert-settings a { color: var(--accent-text); }
/* ---- Expert (milestone 15). Phone: tabbed Process panel. Desktop: Bambu Studio Prepare window. ---- */
.bs-bar { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 12px; border: 1px solid var(--hair-strong); border-radius: var(--r-md); background: var(--canvas); font-size: .9rem; min-width: 0; }
.bs-bar__kind { color: var(--ink-mute); }
.bs-bar__preset { font-size: .9rem; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.bs-reset-all { flex: 0 0 auto; min-height: 28px; min-width: 28px; padding: 0 6px; font-size: .95rem; border-radius: 50%; border: 1px solid var(--hair-strong); background: transparent; color: #ff8a1f; }
.bs-tabs { display: flex; gap: 0; margin-top: 10px; border-bottom: 1px solid var(--hair-strong); }
.bs-tabs [role="tab"] { flex: 1 1 0; min-height: 42px; padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: .9rem; cursor: pointer; }
.bs-tabs [role="tab"][aria-selected="true"] { color: #ff8a1f; border-bottom-color: #ff8a1f; font-weight: 600; }
.bs-tabs [role="tab"][disabled] { color: var(--ink-mute); opacity: .55; cursor: not-allowed; }
.bs-pane { padding: 4px 0 8px; }
.bs-group { display: flex; align-items: center; gap: 8px; margin: 16px 0 4px; font-family: var(--font-display); font-size: .95rem; color: var(--ink); }
.bs-group::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.bs-gi { color: var(--ink-mute); font-size: .85rem; }
.bs-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 6px 0 6px 12px; }
.bs-row label, .bs-lab { margin: 0; font-weight: 500; color: var(--ink-soft); position: relative; font-size: .9rem; }
.bs-row.modified label { color: #ff8a1f; }
.bs-ctl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bs-ctl select { width: 9.5rem; max-width: 100%; padding: 6px 28px 6px 10px; font-size: .9rem; }
.bs-box { display: inline-flex; align-items: center; border: 1px solid var(--hair-strong); border-radius: var(--r-md); background: var(--canvas); overflow: hidden; }
.bs-box select, .bs-box .bs-ro { border: 0; border-radius: 0; background: transparent; width: 7rem; }
.bs-box .bs-ro { padding: 6px 4px 6px 10px; }
.bs-unit { color: var(--ink-mute); font-size: .8rem; padding: 0 10px 0 2px; }
.bs-ro { display: inline-block; color: var(--ink-mute); font-size: .9rem; }
.bs-undo { min-height: 28px; min-width: 28px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: #ff8a1f; font-size: 1rem; }
.bs-pane > .small { margin: 10px 0 0 12px; }
.bsw-note { margin-top: 12px; }
/* Desktop-only chrome is hidden on phones; the phone Printer row is hidden on desktop. */
.bsw-top, .bsw-view, .bsw-cards, .bsw-nozzle, .bsw-filrow, .bsw-h, .bsw-adv { display: none; }
@media (min-width: 1024px) {
  .bs-row--phone { display: none; }
  .bsw { --bb-bg: #1f1f1f; --bb-side: #262626; --bb-panel: #2e2e2e; --bb-line: #3a3a3a; --bb-ink: #d6d6d6; --bb-mute: #8c8c8c; --bb-green: #00ae42; --bb-orange: #ff7a2a; --bb-input: #353535;
    background: var(--bb-bg); color: var(--bb-ink); font-size: .86rem; }
  /* Desktop Expert: the Bambu UI is the top of the page, edge to edge — no window frame. */
  #expert-settings.bs--top { margin: 0; border: 0; }
  body.bs-top-mode > .preview-banner, body.bs-top-mode > header.masthead { display: none; }
  #expert-settings.bs--top .bsw-body { min-height: calc(100vh - 44px); }
  #expert-settings.bs--top .bsw-side { max-height: calc(100vh - 44px); }
  .bsw-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; background: #1a1a1a; border-bottom: 1px solid #0f0f0f; font-size: .86rem; }
  .bsw-home { width: 34px; text-align: center; color: var(--bb-mute); font-size: 1.1rem; text-decoration: none; }
  .bsw-home:hover { color: #fff; }
  .bsw-tab { height: 44px; padding: 0 18px; border: 0; border-radius: 0; background: transparent; color: #bdbdbd; font: inherit; font-size: .86rem; cursor: pointer; }
  .bsw-tab:hover { background: #2a2a2a; color: #fff; }
  .bsw-tab--on, .bsw-tab--on:hover { background: var(--bb-green); color: #fff; font-weight: 600; cursor: default; }
  .bsw-title { flex: 1; text-align: center; font-weight: 700; color: #f2f2f2; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .bsw-slice { min-height: 30px; padding: 0 16px; border: 0; border-radius: 4px; background: var(--bb-green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
  .bsw-print { margin-left: 6px; padding: 6px 16px; border-radius: 4px; background: #3a3a3a; color: #7a7a7a; }
  .bsw-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 640px; }
  .bsw-side { background: var(--bb-side); border-right: 1px solid #141414; padding: 6px 12px 12px; max-height: 720px; overflow-y: scroll; scrollbar-width: thin; scrollbar-color: #5a5a5a #1f1f1f; }
  .bsw-h { display: flex; align-items: center; gap: 8px; margin: 8px -12px 8px; padding: 8px 12px; border-bottom: 1px solid var(--bb-line); font-weight: 600; color: #e8e8e8; font-size: .9rem; }
  .bsw-ico { width: 18px; text-align: center; color: var(--bb-mute); font-size: .9rem; }
  .bsw-gear { margin-left: auto; color: var(--bb-mute); }
  .bsw-cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .bsw-card { display: grid; justify-items: center; align-content: end; gap: 6px; min-height: 108px; padding: 10px 8px; border: 1px solid var(--bb-line); border-radius: 6px; background: var(--bb-panel); font-size: .82rem; color: #e0e0e0; }
  .bsw-card--sync { border-color: var(--bb-green); color: #e0e0e0; }
  .bsw-sync { font-size: 1.6rem; color: var(--bb-green); }
  .bsw-cap { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .bsw-card { min-width: 0; }
  .bsw-thumb { width: 44px; height: 44px; border-radius: 4px; }
  .bsw-thumb--printer { background: linear-gradient(#4b4b4b, #333); border: 1px solid #5a5a5a; box-shadow: inset 0 10px 0 -8px #666, inset 0 -8px 0 -6px #222; position: relative; }
  .bsw-thumb--printer::after { content: ""; position: absolute; left: 10px; right: 10px; top: 14px; bottom: 8px; background: #1b1b1b; border: 1px solid #5a5a5a; border-radius: 2px; }
  .bsw-thumb--plate { width: 46px; height: 40px; background: repeating-linear-gradient(45deg, #5a4a35 0 2px, #3f3528 2px 5px); border: 1px solid #6a5a44; border-radius: 3px; }
  .bsw-sel { width: 100%; min-width: 0; }
  .bsw-sel select { width: 100%; padding: 4px 4px 4px 14px; border: 0; background: transparent; color: #e8e8e8; font: inherit; font-size: .8rem; text-align: center; text-overflow: ellipsis; background-image: linear-gradient(45deg, transparent 50%, #bbb 50%), linear-gradient(135deg, #bbb 50%, transparent 50%); background-position: 4px 55%, 8px 55%; background-size: 4px 4px; background-repeat: no-repeat; }
  .bsw-sel select:focus { outline: 1px solid var(--bb-green); }
  .bsw-nozzle { display: flex; flex-wrap: wrap; gap: 6px 12px; white-space: nowrap; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--bb-line); border-radius: 6px; background: var(--bb-panel); color: #cfcfcf; }
  .bsw-nz-t { width: 100%; color: var(--bb-mute); }
  .bsw-val { display: inline-block; margin-left: 4px; padding: 3px 8px; border: 1px solid #4a4a4a; border-radius: 4px; background: var(--bb-input); color: #e8e8e8; }
  .bsw-filrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--bb-line); border-radius: 6px; background: var(--bb-panel); min-width: 0; }
  .bsw-n { display: inline-grid; place-items: center; width: 20px; height: 20px; background: #fff; color: #111; border-radius: 3px; font-weight: 700; font-size: .78rem; }
  .bsw-filrow .colour-dot { position: static; margin: 0; width: 16px; height: 16px; border-radius: 3px; }
  .bsw-filsel { flex: 1; min-width: 0; padding: 4px 24px 4px 6px; border: 0; background: transparent; color: #e8e8e8; font: inherit; font-size: .86rem; text-overflow: ellipsis; }
  .bsw-filsel:focus { outline: 1px solid var(--bb-green); }
  .bsw-filrow--colour { margin-top: 6px; }
  .bsw-dots { color: var(--bb-mute); }
  .bsw-pill { padding: 2px 10px; border-radius: 999px; background: var(--bb-green); color: #fff; font-size: .74rem; font-weight: 600; }
  .bsw-pill--off { background: #3a3a3a; color: #9a9a9a; margin-left: -4px; }
  .bsw-adv { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #cfcfcf; font-weight: 400; font-size: .82rem; }
  .bsw-adv i { width: 30px; height: 16px; border-radius: 999px; background: #4a4a4a; position: relative; }
  .bsw-adv i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #ddd; }
  /* Process preset bar, tabs and rows in Bambu colours */
  .bsw .bs-bar { margin-top: 8px; padding: 5px 8px; border-color: #4a4a4a; background: var(--bb-input); color: #e8e8e8; border-radius: 4px; }
  .bsw .bs-bar__preset { color: #e8e8e8; }
  .bsw .bs-tabs { margin-top: 8px; border-bottom-color: var(--bb-line); }
  .bsw .bs-tabs [role="tab"] { min-height: 36px; color: #bdbdbd; font-size: .86rem; }
  .bsw .bs-tabs [role="tab"][aria-selected="true"] { color: var(--bb-orange); border-bottom-color: var(--bb-orange); }
  .bsw .bs-tabs [role="tab"].has-mod { color: var(--bb-orange); }
  .bsw .bs-group { color: #f0f0f0; font-family: inherit; font-weight: 700; font-size: .88rem; }
  .bsw .bs-group::after { background: var(--bb-line); }
  .bsw .bs-row { padding: 4px 0 4px 20px; }
  .bsw .bs-row label, .bsw .bs-lab { color: #d0d0d0; font-weight: 400; font-size: .86rem; }
  .bsw .bs-row.modified label { color: var(--bb-orange); }
  .bsw .bs-ctl select { width: 8.6rem; padding: 4px 24px 4px 8px; border: 1px solid #4a4a4a; border-radius: 4px; background: var(--bb-input); color: #e8e8e8; font-size: .86rem; }
  .bsw .bs-box { border-color: #4a4a4a; border-radius: 4px; background: var(--bb-input); }
  .bsw .bs-box select, .bsw .bs-box .bs-ro { width: 5.6rem; border: 0; border-radius: 0; background: transparent; }
  .bsw .bs-ro { color: #9a9a9a; font-size: .86rem; padding: 4px 4px 4px 8px; }
  .bsw .bs-unit { color: var(--bb-mute); }
  .bsw .bs-undo { color: var(--bb-orange); }
  .bsw .small.muted, .bsw .bsw-note { color: var(--bb-mute); }
  .bsw .bsw-note a { color: var(--bb-green); }
  /* Viewport: Bambu dark stage, perspective plate, the live canvas on top. */
  .bsw-view { position: sticky; top: 44px; align-self: start; height: calc(100vh - 44px); display: block; overflow: hidden; background: radial-gradient(120% 80% at 50% 30%, #4a4a4a, #2a2a2a 70%); min-height: 640px; }
  .bsw-tools { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; padding: 6px 14px; border-radius: 6px; background: rgba(20,20,20,.55); color: #6f6f6f; font-size: 1.1rem; }
  .bsw-sep { width: 1px; background: #555; }
  .bsw-axes { position: absolute; left: 20px; bottom: 130px; width: 54px; height: 54px; }
  .bsw-axes::before { content: ""; position: absolute; left: 0; bottom: 0; width: 54px; height: 3px; background: #e0202b; }
  .bsw-axes::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3px; height: 54px; background: #1f3fe0; }
  .bsw-axes .y { position: absolute; left: 0; bottom: 0; width: 3px; height: 40px; background: #1fb84a; transform: rotate(-45deg); transform-origin: bottom left; font-size: 0; }
  .bsw-axes .x, .bsw-axes .z { font-size: 0; }
  .bsw-cube { position: absolute; left: 20px; bottom: 24px; width: 76px; height: 76px; display: grid; align-content: space-between; justify-items: center; padding: 8px 0; background: #2a2a2a; border: 1px solid #444; color: #bbb; font-size: .74rem; }
  .bsw-plateno { position: absolute; right: 26px; bottom: 70px; color: var(--bb-green); font-weight: 800; font-size: 2.2rem; letter-spacing: -.04em; }
  .bsw-fit { position: absolute; right: 26px; bottom: 30px; color: #bdbdbd; font-size: .8rem; }
  .bsw-fit.nofit { color: var(--bb-orange); }
  .bsw-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); color: #777; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
  .bsw-view .viewer-dock { position: absolute; inset: 0; }
  .bsw-view .mesh-stage { position: absolute; inset: 0; margin: 0; border: 0; border-radius: 0; background: transparent; background-image: none; min-height: 0; aspect-ratio: auto; }
  .bsw-view .mesh-stage canvas { position: absolute; left: 50%; top: 50%; width: 100%; height: auto; max-height: 100%; transform: translate(-50%, -50%); }
  .bsw-view #mesh-empty { color: #bdbdbd; } .bsw-view #mesh-empty .eyebrow, .bsw-view #mesh-empty small { color: #8c8c8c; }
  .bsw-view #viewer-controls, .bsw-view #mesh-bounds { display: none; }
}

.mesh-stage canvas { touch-action: none; cursor: grab; }
.mesh-stage canvas:active { cursor: grabbing; }
.button-link { display: inline-block; text-align: center; text-decoration: none; padding: 12px 18px; border-radius: var(--r-md); font-weight: 600; min-height: 46px; }
.inbound-code { font-family: var(--font-mono); font-size: 1.7rem; letter-spacing: .25em; margin: .25rem 0 .5rem; user-select: all; color: var(--accent-text); }
.choice-row { display: grid; gap: 8px; margin: 8px 0; }
.choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--hair-strong); border-radius: var(--r-md); font-weight: 500; color: var(--ink); cursor: pointer; min-height: 46px; }
.choice:has(input:checked) { border-color: var(--accent-text); background: color-mix(in oklab, var(--accent) 8%, transparent); }
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent-text); }
#accepted-panel { color: var(--ink-soft); }
#accepted-panel strong { color: var(--accent-text); font-family: var(--font-mono); letter-spacing: .04em; }

.next-step { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hair); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem 3rem; }
.next-step > p:last-child { color: var(--ink-soft); max-width: 60ch; margin: 0; }
footer { max-width: 82rem; margin: auto; padding: 1.5rem clamp(1.25rem, 5vw, 5.5rem) 2.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); border-top: 1px solid var(--hair); }
footer a { text-decoration: none; color: var(--ink-mute); }
footer a:hover { color: var(--accent-text); }

@media (max-width: 960px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .process-note { justify-self: start; flex-wrap: wrap; }
  .upload-grid, .checkout-grid, .faq { grid-template-columns: 1fr; }
  .upload-side, .checkout-right { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 1rem; }
  .item-row { grid-template-columns: 1fr; }
  .item-price { text-align: left; border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 10px; }
  .item-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-switch { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .studio-label { display: none; }
  .two-fields { grid-template-columns: 1fr; }
  .bs-ctl select { width: 10rem; }
  .bs-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
  .next-step { grid-template-columns: 1fr; }
  .mesh-stage { aspect-ratio: 4 / 3; min-height: 220px; }
  .section-heading { flex-wrap: wrap; }
  .section-heading h2 { flex: 1 1 60%; }
  .mode-switch { margin-left: 0; margin-top: 6px; }
  .item-fields { grid-template-columns: 1fr; }
  .process-note li { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
