[hidden] { display: none !important; }

:root {
    --ink: #1c2a26;
    --muted: #5d6a65;
    --line: #dde2df;
    --panel: #ffffff;
    --stage: #e8e9e7;
    --accent: #1f4d43;
    --accent-ink: #ffffff;
    --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --panel-w: 360px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--panel);
    color-scheme: light;
    color: var(--ink);
    font: 15px/1.45 var(--font);
    -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
/* iPhone browsers give every button about 15 px of padding a side: round icon buttons say none, or their icon
   sits off centre (the circle is narrower than that padding) */
.icon-btn, .ar-btn, .swatch, .poster-btn { -webkit-appearance: none; appearance: none; }

.viewer {
    display: grid;
    grid-template-columns: 1fr var(--panel-w);
    height: 100vh;
    height: 100dvh;
}

.viewer.no-ui { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
.viewer.no-ui .panel { display: none; }

/* ---------- 3D stage ---------- */

.stage {
    position: relative;
    min-height: 0;
    background: var(--stage);
    overflow: hidden;
}

.stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    cursor: grab;
}

.stage canvas:active { cursor: grabbing; }

.stage-tools {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(28, 42, 38, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover { background: #fff; }
.icon-btn svg { display: block; width: 18px; height: 18px; flex: none; }
.icon-btn.toggle[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
/* phones pinch to zoom, so the zoom buttons only take room there */
@media (pointer: coarse) { .icon-btn.zoom { display: none; } }

.hint {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--muted);
    pointer-events: none;
    transition: opacity 0.6s;
}

.loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    background: var(--stage);
    transition: opacity 0.4s;
}

.loading.done { opacity: 0; pointer-events: none; }
.loading-title { margin: 0; font-weight: 500; text-align: center; }
.loading-bar { width: 200px; height: 2px; background: rgba(28, 42, 38, 0.12); }
.loading-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.loading.error .loading-title { color: #9b2c1f; max-width: 34ch; }

/* ---------- AR ---------- */

.ar-btn {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(28, 42, 38, 0.2);
}

.ar-btn svg { width: 18px; height: 18px; }

.ar-overlay { position: fixed; inset: 0; pointer-events: none; font: 15px/1.4 var(--font); }
.ar-exit {
    position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; pointer-events: auto;
    height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--ink); font-weight: 600;
}
.ar-hint {
    position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0;
    padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; white-space: nowrap;
}

.qr-dialog {
    width: min(340px, 92vw); padding: 24px; border: 0; border-radius: 16px; text-align: center;
    color: var(--ink); font: 15px/1.45 var(--font); box-shadow: 0 24px 60px rgba(28, 42, 38, 0.25);
}
.qr-dialog::backdrop { background: rgba(28, 42, 38, 0.35); }
.qr-dialog h2 { margin: 0 0 6px; font-size: 19px; }
.qr-dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.qr-dialog img { display: block; margin: 0 auto 16px; image-rendering: pixelated; }
.qr-dialog .text-btn { width: 100%; flex: none; }

/* ---------- options panel ---------- */

.panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-left: 1px solid var(--line);
    background: var(--panel);
}

.panel-head {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--line);
}

.product-name {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.product-desc {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.product-size {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.price {
    margin: 14px 0 0;
    font-size: 21px;
    font-weight: 500;
}

.groups {
    flex: 1;
    overflow-y: auto;
    padding: 4px 24px 24px;
}

.group {
    padding: 18px 0 16px;
    border-bottom: 1px solid var(--line);
}

.group:last-child { border-bottom: 0; }

.group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.group-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.group-value {
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

/* size and count sliders */
.param .group-value { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.param-row { display: flex; align-items: center; gap: 12px; }
.param-row input[type="range"] { flex: 1; min-width: 0; height: 28px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.param-num {
    display: flex; align-items: center; flex: 0 0 auto; width: 92px; height: 36px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: text;
}
.param-num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.param-num input {
    width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
    font: inherit; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink);
}
.param-num span { margin-left: 4px; color: var(--muted); font-size: 13px; }
.param-ends { display: flex; justify-content: space-between; margin-top: 2px; padding-right: 104px; color: var(--muted); font-size: 12px; }

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.swatch {
    position: relative;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.swatch .chip {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    box-shadow: inset 0 0 0 1px rgba(28, 42, 38, 0.14);
}

.swatch::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.swatch:hover::after { border-color: var(--line); }

/* glass and gems: a glossy highlight over the stone colour */
.chip.glass, .mini.glass {
    background-image: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 14%, rgba(255, 255, 255, 0) 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.18)) !important;
    background-blend-mode: normal !important;
}

/* options a rule makes unavailable */
.swatch.blocked, .choice.blocked { cursor: not-allowed; opacity: 0.38; }
.swatch.blocked .chip::before {
    content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
    background: #fff; transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(28, 42, 38, 0.25);
}
.choice.blocked { text-decoration: line-through; }
.swatch[aria-pressed="true"]::after { border-color: var(--accent); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.choice:hover { border-color: #b9c2be; }

.choice[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.choice .mini {
    width: 20px;
    height: 20px;
    margin-left: -6px;
    border-radius: 50%;
    background-size: cover;
    background-blend-mode: multiply;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.panel-foot {
    display: flex;
    gap: 8px;
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
}

.text-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.text-btn:hover { border-color: #b9c2be; }
.text-btn svg { width: 16px; height: 16px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 8px);
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens: 3D on top, options below ---------- */

/* share and save image join the round buttons on the 3D view on phones (viewer.js) */
.icon-btn.phone-only { display: none; }

/* more options below: a fade at the bottom of the list while it can scroll further */
.groups::after {
    content: ""; position: sticky; bottom: -1px; display: block; height: 36px; margin: -36px -24px 0;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--panel) 0%, transparent), var(--panel) 85%);
    pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.panel.more-below .groups::after { opacity: 1; }
.viewer[data-panel="bottom"] .groups::after { display: none; }

@media (max-width: 760px) {
    /* the 3D view keeps a good share of the screen; the options get the rest, with nothing else below them */
    .viewer {
        grid-template-columns: 1fr;
        grid-template-rows: 46vh minmax(0, 1fr);
        grid-template-rows: 46dvh minmax(0, 1fr);
    }
    .panel { border-left: 0; border-top: 1px solid var(--line); }
    .panel-head { padding: 12px 16px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
    .product-name { font-size: 18px; }
    .product-desc { display: none; }
    .product-size { margin-top: 2px; font-size: 12.5px; }
    .price { margin: 0; font-size: 17px; white-space: nowrap; }
    .groups { padding: 0 16px 16px; }
    .groups::after { margin: -36px -16px 0; }
    .group { padding: 14px 0 12px; }
    .group-head { margin-bottom: 10px; }
    .panel-foot { display: none; }
    .icon-btn.phone-only { display: grid; }
    .order-cta { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
    .stage-tools { left: 12px; bottom: 12px; }
    .ar-btn { right: 12px; bottom: 12px; }
    .stage-tools { gap: 5px; }
    .icon-btn { width: 36px; height: 36px; }
}
/* short phones (small iPhones, landscape-ish browser bars) */
@media (max-width: 760px) and (max-height: 620px) {
    .viewer { grid-template-rows: 42vh minmax(0, 1fr); grid-template-rows: 42dvh minmax(0, 1fr); }
}

/* narrow phones: the AR button shrinks to "AR" so the round tool buttons keep their room */
.ar-btn .ar-short { display: none; }
@media (max-width: 480px) {
    .ar-btn { padding: 0 14px 0 11px; }
    .ar-btn .ar-long { display: none; }
    .ar-btn .ar-short { display: inline; }
    .hint { top: 12px; bottom: auto; white-space: nowrap; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* iPhones zoom the page in when you type in a field with text smaller than 16 px, and the page then slides
   about: on phones, fields use 16 px */
@media (max-width: 760px), (pointer: coarse) {
    input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea { font-size: 16px !important; }
}
.param-row input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.param-note { margin: 6px 0 0; color: var(--accent); font-size: 13px; font-weight: 500; }
.draft-badge {
    position: absolute; top: 12px; left: 12px; z-index: 3; margin: 0; padding: 6px 12px; border-radius: 999px;
    background: #f6e7c8; color: #6b4b12; font-size: 13px; font-weight: 500; pointer-events: none;
}

/* ---------- embed looks: dark theme, transparent stage, panel position ---------- */

:root[data-theme="dark"] {
    --ink: #edf0f2;
    --muted: #9aa5ad;
    --line: rgba(255, 255, 255, 0.12);
    --panel: #1d2226;
    color-scheme: dark;
}
:root[data-theme="dark"] .choice, :root[data-theme="dark"] .text-btn, :root[data-theme="dark"] .param-num { background: #262c31; color: var(--ink); }
:root[data-theme="dark"] .choice:hover, :root[data-theme="dark"] .text-btn:hover { border-color: rgba(255, 255, 255, 0.3); }
:root[data-theme="dark"] .param-num input { color: var(--ink); }
:root[data-theme="dark"] .icon-btn { background: rgba(29, 34, 38, 0.82); border-color: rgba(255, 255, 255, 0.14); color: var(--ink); }
:root[data-theme="dark"] .icon-btn:hover { background: #2a3136; }
:root[data-theme="dark"] .qr-dialog { background: var(--panel); color: var(--ink); }
:root[data-theme="dark"] .share-url { background: #262c31; color: var(--ink); }
:root[data-theme="dark"] .title-card { background: rgba(29, 34, 38, 0.78); color: var(--ink); }
:root[data-theme="dark"] .hint { color: var(--muted); }

/* a transparent stage lets the client's page show through */
:root[data-transparent="1"], :root[data-transparent="1"] body { background: transparent; }
:root[data-transparent="1"] .stage, :root[data-transparent="1"] .loading { background: transparent; }

.viewer[data-panel="left"] { grid-template-columns: var(--panel-w) 1fr; }
.viewer[data-panel="left"] .panel { order: -1; border-left: 0; border-right: 1px solid var(--line); }
.viewer[data-panel="left"] .stage-tools { left: auto; right: 16px; }
.viewer[data-panel="left"] .ar-btn { right: auto; left: 16px; }
.viewer[data-panel="bottom"] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
.viewer[data-panel="bottom"] .panel { border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; max-height: 42dvh; }
.viewer[data-panel="bottom"] .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 20px 12px; }
.viewer[data-panel="bottom"] .product-desc { display: none; }
.viewer[data-panel="bottom"] .price { margin: 0; white-space: nowrap; }
.viewer[data-panel="bottom"] .groups { display: flex; gap: 28px; overflow-x: auto; overflow-y: auto; padding: 4px 20px 12px; }
.viewer[data-panel="bottom"] .group { flex: 0 0 auto; min-width: 220px; max-width: 360px; border-bottom: 0; }
.viewer[data-panel="bottom"] .panel-foot { padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); }

/* ---------- showcase: a model without options fills the page ---------- */

.viewer.showcase { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
.viewer.showcase .panel { display: none; }
.title-card {
    position: absolute; top: 16px; left: 16px; z-index: 2; max-width: min(420px, calc(100% - 32px));
    padding: 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.title-card .product-name { font-size: 20px; }
.title-card .product-desc { margin-top: 4px; font-size: 13.5px; }
.title-card .product-size { margin-top: 4px; }
.viewer.showcase.no-ui .title-card { display: none; }

/* ---------- "Made with" mark ---------- */

.made-with {
    position: absolute; top: 14px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: var(--ink); font-size: 12px; font-weight: 500; text-decoration: none; opacity: 0.85;
}
.made-with:hover { opacity: 1; }
.made-with svg { width: 14px; height: 14px; }
:root[data-theme="dark"] .made-with { background: rgba(29, 34, 38, 0.7); }
.draft-badge ~ .made-with, .made-with ~ .draft-badge { top: 52px; }

/* ---------- the client's logo, in the corner where "Made with" was (white-label embeds) ---------- */

.client-logo {
    position: absolute; top: 14px; right: 16px; z-index: 2; display: block; box-sizing: content-box;
    width: auto; height: auto; max-width: 140px; max-height: 32px; padding: 6px 10px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    object-fit: contain; pointer-events: none;
}
:root[data-theme="dark"] .client-logo { background: rgba(255, 255, 255, 0.85); }
.draft-badge ~ .client-logo, .client-logo ~ .draft-badge { top: 52px; }

/* ---------- share dialog ---------- */

.share-row { display: flex; gap: 8px; margin: 0 0 10px; }
.share-url {
    flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); font: inherit; font-size: 13px;
}
.share-row .text-btn { flex: 0 0 auto; padding: 0 16px; }
.qr-dialog .text-btn + .text-btn { margin-top: 8px; }
.text-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- click to load: a still picture until someone asks for 3D ---------- */

.poster {
    position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
    background: var(--stage, #e8e9e7); transition: opacity 0.35s;
}
.poster-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.poster-btn {
    position: relative; display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px 0 18px;
    border: 0; border-radius: 999px; background: var(--accent, #1f4d43); color: var(--accent-ink, #fff);
    font: 600 15px/1 var(--font); cursor: pointer; box-shadow: 0 10px 30px rgba(28, 42, 38, 0.25);
}
.poster-btn svg { width: 20px; height: 20px; }
.poster.has-img .poster-btn { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); }
.poster.starting { opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
    .viewer[data-panel="left"] { grid-template-columns: 1fr; }
    .viewer[data-panel="left"] .panel { order: 0; border-right: 0; }
    .title-card { top: 12px; left: 12px; padding: 10px 14px; }
    .title-card .product-desc { display: none; }
    .made-with span { display: none; }
    .made-with { padding: 6px; top: 12px; right: 12px; }
    .client-logo { top: 12px; right: 12px; max-width: 96px; max-height: 24px; padding: 5px 8px; }
    .viewer.showcase .hint { top: auto; bottom: 62px; }
}

/* engraving: text field, character count, font choices */
.engrave-row {
    display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: text;
}
.engrave-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.engrave-input {
    flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 16px; color: var(--ink);
}
.engrave-input::placeholder { color: var(--muted); }
.engrave-count { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.engrave-fonts { margin-top: 10px; }
.engrave-font { font-size: 17px; letter-spacing: 0.01em; }
:root[data-theme="dark"] .engrave-row { background: #262c31; border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .engrave-input { color: var(--ink); }

/* ---------- personalise: the fill-in form (personalise.js) ---------- */

.design-finishes { margin: 0 0 14px; }
.design-fields { display: flex; flex-direction: column; gap: 14px; }
.design-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.design-label .req { font-weight: 400; }
.engrave-row.multi { height: auto; align-items: flex-start; padding: 10px 12px; }
.engrave-input.multi { min-height: 44px; resize: vertical; font-family: inherit; line-height: 1.35; }
.design-style { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.design-fonts .engrave-font { min-height: 34px; padding: 4px 12px; font-size: 15px; }
.design-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.design-color { width: 28px; height: 28px; padding: 0; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 50%; cursor: pointer; }
.design-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.design-pic { display: flex; align-items: center; gap: 10px; }
.design-pic .text-btn { flex: 0 1 auto; padding: 0 14px; min-height: 40px; }
.design-thumb {
    display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; overflow: hidden;
    border: 1px solid var(--line); border-radius: 8px;
    background: repeating-conic-gradient(#ececec 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}
.design-thumb canvas { display: block; }
.design-qr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.design-qr-head .text-btn { flex: 0 0 auto; padding: 0 14px; min-height: 38px; }
.design-qr-sum { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.design-qr { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.design-mini { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.design-mini input, .design-mini select {
    height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink); font: inherit; font-size: 15px;
}
.design-mini input:focus, .design-mini select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.design-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.design-open { width: 100%; margin-top: 16px; }
.design-w { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: #fdf3df; color: #6b4a00; font-size: 13px; }
.design-w.stop { background: #fde7e5; color: #8c1d18; }
:root[data-theme="dark"] .design-mini input, :root[data-theme="dark"] .design-mini select { background: #262c31; border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .design-w { background: #3a3220; color: #f3dca6; }

/* the free editor takes the options panel's place, wider; the 3D stays beside it */
.design-host { display: none; }
.viewer.designing, .viewer[data-panel="bottom"].designing { grid-template-columns: minmax(0, 1fr) min(900px, 64vw); grid-template-rows: minmax(0, 1fr); }
.viewer.designing .panel { display: none; }
.viewer.designing .design-host { display: block; min-width: 0; min-height: 0; border-left: 1px solid var(--line); }
.viewer[data-panel="left"].designing { grid-template-columns: min(900px, 64vw) minmax(0, 1fr); }
.viewer[data-panel="left"].designing .design-host { order: -1; border-left: 0; border-right: 1px solid var(--line); }
.design-peek { display: none !important; }

@media (max-width: 760px) {
    /* phones: the editor covers the screen; "See it in 3D" folds it down to its top bar */
    .viewer.designing, .viewer[data-panel="left"].designing, .viewer[data-panel="bottom"].designing { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
    .viewer.designing .design-host { position: fixed; inset: 0; z-index: 20; border: 0; }
    .viewer.designing .design-host.peek { top: auto; height: auto; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12); }
    .viewer.designing .design-host.peek .dz-main { display: none; }
    .design-peek { display: inline-flex !important; }
    .dz-zoom, .dz-tools .dz-icon[aria-label^="Zoom"] { display: none; }
}

/* ---------- ready designs: "Choose a design" ---------- */

.design-gallery .design-note { margin: -6px 0 10px; }
.rd-cats { margin: 0 0 10px; }
.rd-list {
    display: flex; gap: 10px; margin: 0 -24px; padding: 2px 24px 6px; list-style: none;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.rd-list li { flex: 0 0 auto; scroll-snap-align: start; }
.rd-card {
    display: flex; flex-direction: column; gap: 6px; width: 104px; padding: 0; border: 0; background: none;
    color: var(--ink); cursor: pointer; text-align: left; font: inherit;
}
.rd-thumb {
    display: grid; place-items: center; width: 104px; height: 78px; overflow: hidden; border-radius: 10px;
    background: #f2f3f1; box-shadow: inset 0 0 0 1px var(--line);
}
.rd-thumb img, .rd-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-thumb canvas { object-fit: contain; }
.rd-own { font: 600 24px/1 var(--font); color: var(--muted); }
.rd-name { font-size: 12.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-card:hover .rd-thumb { box-shadow: inset 0 0 0 1px #b9c2be; }
.rd-card[aria-pressed="true"] .rd-thumb { box-shadow: 0 0 0 2px var(--accent); }
.rd-card[aria-pressed="true"] .rd-name { font-weight: 600; }
:root[data-theme="dark"] .rd-thumb { background: #262c31; }

/* ---------- order requests ---------- */

.order-cta { padding: 14px 24px 0; border-top: 1px solid var(--line); }
.order-cta[hidden] { display: none; }
.order-cta + .panel-foot { border-top: 0; padding-top: 10px; }
.order-btn {
    width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
    font: 600 15px/1 var(--font); cursor: pointer;
}
.order-btn:hover { filter: brightness(1.06); }
.viewer.order-view .order-cta { display: none; }
.order-badge { background: #dcefe6; color: #1f4d43; }

.order-dialog {
    width: min(440px, 94vw); max-height: 92vh; max-height: 92dvh; padding: 24px; border: 0; border-radius: 16px;
    color: var(--ink); background: var(--panel); font: 15px/1.45 var(--font); box-shadow: 0 24px 60px rgba(28, 42, 38, 0.25);
    overflow-y: auto;
}
.order-dialog::backdrop { background: rgba(28, 42, 38, 0.4); }
.order-dialog h2 { margin: 0 0 6px; font-size: 20px; }
.order-dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.order-list { margin: 0 0 16px; padding-left: 20px; font-size: 14px; }
.order-form { display: flex; flex-direction: column; gap: 12px; }
.order-form .order-lead { margin-bottom: 4px; }
.order-dialog .order-test { padding: 8px 11px; border-radius: 10px; background: #fbefd7; color: #6b4a0e; font-size: 13px; }
.order-field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 500; }
.order-field small { color: var(--muted); font-weight: 400; font-size: 12px; }
.order-field input, .order-field textarea {
    width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink); font: 15px/1.35 var(--font); box-sizing: border-box;
}
.order-field textarea { resize: vertical; min-height: 72px; }
.order-field input:focus, .order-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.order-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: end; }
.order-price { display: flex; flex-direction: column; margin: 0 0 4px !important; text-align: right; }
.order-price span { font-size: 12px; }
.order-price strong { color: var(--ink); font-size: 18px; }
.order-price small { color: var(--muted); font-size: 12px; }
.order-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.order-check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.order-error { margin: 0 !important; padding: 10px 12px; border-radius: 10px; background: #fbe9e7; color: #8a2a1d !important; }
.order-error[hidden] { display: none; }
.order-actions { display: flex; gap: 8px; margin-top: 6px; }
.order-actions.stack { flex-direction: column; }
.order-actions .text-btn { text-decoration: none; color: var(--ink); }
.order-actions .text-btn.primary { color: var(--accent-ink); }
.order-actions .text-btn.ghost { border-color: transparent; background: none; }
.order-actions .text-btn:disabled { opacity: 0.7; cursor: progress; }
.text-btn.wa { background: #1f7a4d; border-color: #1f7a4d; color: #fff !important; }
.wa-icon {
    width: 18px; height: 18px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2Zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.2-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.9 11.9 0 0 0 4.6 4c1.7.7 2.3.8 3.2.7.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Zm0 18.2a8.2 8.2 0 0 1-4.2-1.2l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2Zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.2-.4.2-.4.7-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.9 11.9 0 0 0 4.6 4c1.7.7 2.3.8 3.2.7.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.order-sent { text-align: center; }
.order-tick {
    display: grid; place-items: center; width: 52px; height: 52px; margin: 4px auto 12px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 26px; font-weight: 700;
}
.order-code-label { margin: 8px 0 2px !important; font-size: 12.5px !important; text-transform: uppercase; letter-spacing: 0.06em; }
.order-code { margin: 0 0 14px !important; color: var(--ink) !important; font: 700 30px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: 0.04em; }
.order-est { color: var(--ink) !important; font-weight: 500; }
:root[data-theme="dark"] .order-field input, :root[data-theme="dark"] .order-field textarea { background: #262c31; }
:root[data-theme="dark"] .order-error { background: #4a2420; color: #ffd6cf !important; }
@media (max-width: 480px) {
    .order-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
    .order-row { grid-template-columns: 1fr 1fr; }
}
.viewer[data-panel="bottom"] .order-cta { padding: 8px 20px 0; }
