body.studio { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.bar { height: 60px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.bar .brand { font-size: 1.2rem; }
.bar-title { flex: 1; text-align: center; font-size: .92rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) { .bar-title, .brand-sub { display: none; } .bar { justify-content: space-between; } #share span, #signin span { display: none; } #share, #signin { padding: 0 12px; } }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; }
.viewport.stage { aspect-ratio: auto; border-radius: 0; border: 0; min-height: 260px; height: 100%; }
.panel { border-left: 1px solid var(--line); background: var(--paper); overflow-y: auto; display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 1fr) minmax(0, 46vh); grid-template-rows: minmax(260px, 1fr) minmax(0, 46dvh); }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
}

.tabs { display: flex; gap: 4px; padding: 12px 16px 0; position: sticky; top: 0; background: var(--paper); z-index: 2; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 10px 0 12px; cursor: pointer; color: var(--ink-3); font-family: var(--font-ui); font-weight: 700; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel { padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 24px; }

.group { display: flex; flex-direction: column; gap: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-ui); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.group-head .val { letter-spacing: 0; text-transform: none; font-size: .88rem; color: var(--ink); font-weight: 600; }
.hint { font-size: .86rem; color: var(--ink-3); line-height: 1.5; }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 10px; justify-items: center; }
.swatch-grid .swatch { width: 34px; height: 34px; }
.swatch-group { grid-column: 1 / -1; justify-self: start; font-size: .78rem; color: var(--ink-3); margin: 2px 0 -4px; }
.swatch-grid.labelled { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px 4px; align-items: start; }
.swatch-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 3px 2px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink-2); border-radius: 8px; }
.swatch-cell .swatch { pointer-events: none; }
.swatch-cell:hover .swatch.gem { transform: rotate(45deg) scale(.88); }
.swatch-cell[aria-pressed="true"] .swatch { box-shadow: inset 0 0 0 1px #0002, 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.swatch-cell[aria-pressed="true"] .swatch-name { color: var(--ink); font-weight: 600; }
.swatch-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.swatch-name { font-size: .68rem; line-height: 1.2; text-align: center; max-width: 66px; overflow-wrap: anywhere; }
.swatch-group:first-child { margin-top: 0; }
.scale-ends { display: flex; justify-content: space-between; font-size: .76rem; color: var(--ink-3); margin-top: -8px; }
.stone-pick { margin: 0 0 12px; }
.stone-pick button { flex: 0 0 auto; min-width: 38px; padding: 0 10px; }
.swatch.custom { position: relative; background: var(--c); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.swatch.custom::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 600; text-shadow: 0 1px 2px #0008; pointer-events: none; }
.swatch.custom[aria-pressed="true"]::after { content: ''; }
.swatch.gem.custom::after { transform: rotate(-45deg); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.cols-2, .seg.cols-3, .seg.cols-4 { display: grid; }
.seg.cols-2 { grid-template-columns: repeat(2, 1fr); } .seg.cols-3 { grid-template-columns: repeat(3, 1fr); } .seg.cols-4 { grid-template-columns: repeat(4, 1fr); }
.seg button svg { width: 15px; height: 15px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: var(--font-ui); font-weight: 600; font-size: .88rem; color: var(--ink-2); transition: all .2s; }
.seg button:hover { border-color: var(--accent); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 24px; margin: 0; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-family: var(--font-ui); font-weight: 600; font-size: .92rem; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; order: 2; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px #0003; transition: transform .2s var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; cursor: pointer; color: var(--ink-2); transition: border-color .2s, background .2s; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.dropzone span { font-size: .86rem; color: var(--ink-3); }
.dropzone .formats { font-family: var(--font-mono); font-size: .76rem; }

.parts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.parts li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .88rem; }
.parts li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parts select { font: inherit; font-size: .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); padding: 4px 6px; }

.glass { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(10px); }
.vp-tools { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; }
.vp-tools .icon-btn[aria-pressed="false"] { color: var(--ink-3); }
.open-full { display: none; }

.drop { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: var(--radius-lg); display: grid; place-items: center; background: color-mix(in srgb, var(--viewer-bg) 70%, transparent); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 5; text-align: center; }
.drop > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop svg { width: 32px; height: 32px; color: var(--accent); }
.drop span { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-3); }
body.dragging .drop { opacity: 1; }

/* Declarative controls */
.sec + .sec { border-top: 1px solid var(--line); padding-top: 22px; }
.sec .acc-body, .acc .acc-body { display: flex; flex-direction: column; gap: 20px; }
.sec-title { margin: 0 0 14px; font-family: var(--font-ui); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.tabpanel { gap: 0; }
.tabpanel > .sec { padding-bottom: 22px; }
.select { font: inherit; font-size: .92rem; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 0 10px; width: 100%; }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-ui); font-weight: 600; font-size: .92rem; cursor: pointer; }
.color-chip { width: 44px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--line); position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px #0001; }
.color-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.small { grid-template-columns: repeat(4, 1fr); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 5px 5px 7px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; color: var(--ink-2); font-family: var(--font-ui); font-weight: 600; font-size: .74rem; transition: border-color .2s, box-shadow .2s; min-width: 0; }
.tile:hover { border-color: var(--accent); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.tile-swatch { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px #0002; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.file-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 12px; border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--radius); cursor: pointer; color: var(--ink-2); font-family: var(--font-ui); font-weight: 600; font-size: .86rem; transition: border-color .2s, background .2s; min-width: 0; }
.file-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-btn svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.bar-link svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .bar-link span { display: none; } .bar-link { padding: 0 10px; } }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Playground: accordion panel */
.playground .workspace { grid-template-columns: 1fr 360px; }
.acc { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 15px 16px; font-family: var(--font-ui); font-weight: 700; font-size: .95rem; user-select: none; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary svg { width: 17px; height: 17px; color: var(--accent); }
.acc summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s var(--ease); }
.acc[open] summary::after { transform: rotate(-135deg); }
.acc .acc-body { padding: 4px 16px 22px; }
@media (max-width: 860px) { .playground .workspace { grid-template-columns: 1fr; } }

/* Embed mode: viewer only */
body.embed .bar, body.embed .panel, body.embed .vp-tools { display: none; }
body.embed .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr; }
body.embed .open-full { display: grid; position: absolute; right: 12px; top: 12px; }

/* Dialogs */
.modal { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); color: var(--ink); padding: 24px; width: min(620px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px #0006; }
.modal::backdrop { background: color-mix(in srgb, #000 40%, transparent); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.3rem; }
.modal > .hint { margin-bottom: 16px; }
.share-grid { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start; }
.qr { background: #fff; border-radius: var(--radius); padding: 10px; border: 1px solid var(--line); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; }
.share-fields { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-ui); font-weight: 700; font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); padding: 0 12px; font: .85rem var(--font-mono); letter-spacing: 0; text-transform: none; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .share-grid { grid-template-columns: 1fr; } .qr { width: 160px; } }

.modal-ar { width: min(720px, calc(100vw - 32px)); }
.ar-body { position: relative; height: min(60dvh, 480px); border-radius: var(--radius); overflow: hidden; background: var(--viewer-bg); margin-bottom: 14px; }
.ar-body model-viewer { width: 100%; height: 100%; --poster-color: transparent; }

/* Share dialog: tabs + email */
.modal-share { width: min(660px, calc(100vw - 32px)); }
.share-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.share-tabs button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 4px 10px; margin-right: 12px; cursor: pointer; color: var(--ink-3); font-family: var(--font-ui); font-weight: 700; margin-bottom: -1px; }
.share-tabs button svg { width: 16px; height: 16px; }
.share-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.email-form { display: flex; flex-direction: column; gap: 14px; }
.email-form .field input, .email-form .field textarea { font: 400 1rem var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--ink) 30%, var(--paper)); border-radius: var(--radius-sm); padding: 10px 12px; }
.email-form .field input:focus, .email-form .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.email-form .field textarea { resize: vertical; }
.modal .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .modal .two { grid-template-columns: 1fr; } }
.modal .check { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.modal .check input { accent-color: var(--accent); }

/* The "updated Terms" dialog (js/legal/update.js): on every staff page, so here rather than in app.css */
.modal-legal { width: min(640px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: 22px; }
.modal-legal .modal-head { margin-bottom: 8px; }
.modal-legal .modal-head h2 { font-size: 1.3rem; line-height: 1.25; }
.legal-form { display: flex; flex-direction: column; gap: 14px; }
.legal-changes { max-height: min(40dvh, 320px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; font-size: .92rem; color: var(--ink-2); }
.legal-changes h3 { font-family: var(--font-ui); font-weight: 800; font-size: 1rem; color: var(--ink); }
.legal-changes h3 small { font-weight: 600; font-size: .8rem; color: var(--ink-3); }
.legal-changes ul { margin: 6px 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.legal-changes a, .legal-form a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-agree { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font-family: var(--font-ui); font-weight: 700; color: var(--ink); background: var(--paper); }
.legal-agree:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.legal-agree input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.legal-agree:has(input[aria-invalid="true"]) { border-color: #b3412f; }
.legal-ack { font-size: .9rem; color: var(--ink-2); }
.modal-legal .field-error, .legal-error { font-size: .86rem; color: #9b2c1f; }
.legal-error[hidden], .modal-legal .field-error[hidden] { display: none; }
:root[data-theme="dark"] :is(.modal-legal .field-error, .legal-error) { color: #f3a093; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.modal-legal .field-error, .legal-error) { color: #f3a093; } }
.legal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.legal-actions .btn { min-height: 44px; justify-content: center; }
.legal-actions .btn-primary { min-width: 200px; }
.legal-disagree { font-size: .88rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 10px; }
.legal-disagree summary { cursor: pointer; font-family: var(--font-ui); font-weight: 700; color: var(--ink); min-height: 32px; display: flex; align-items: center; }
.legal-disagree ul { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@media (max-width: 560px) {
  .modal-legal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 18px 16px; }
  .legal-changes { max-height: none; }
  .legal-actions { flex-direction: column-reverse; }
  .legal-actions .btn { width: 100%; }
}

/* Shared-link note card */
.share-card { position: absolute; top: 16px; left: 16px; max-width: min(360px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: .92rem; z-index: 4; box-shadow: 0 12px 40px -18px #0006; }
.share-card-head { display: flex; align-items: center; gap: 10px; }
.share-card-head strong { flex: 1; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.05rem; letter-spacing: -0.01em; }
.share-card .icon-btn { width: 30px; height: 30px; }
.share-card p { color: var(--ink-2); }
.share-card .btn { align-self: flex-start; }

/* Parts editor */
.parts-editor { display: flex; flex-direction: column; gap: 14px; }
.part-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.part-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: .88rem; background: var(--surface); }
.part-list li:hover { border-color: var(--accent); }
.part-list li[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.part-list .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-list .rtag { font-size: .74rem; color: var(--ink-3); }
.part-list .conf, .parts .conf { font-size: .7rem; color: var(--ink-3); font-style: normal; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.part-list .badge { font-size: .68rem; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; }
.role-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-3); }
.role-metal { background: linear-gradient(135deg, #f6d58c, #b58a3c); }
.role-gem { background: linear-gradient(135deg, #cfe6ff, #6aa0ff); }
.role-accent { background: linear-gradient(135deg, #fff, #b9c6d8); box-shadow: inset 0 0 0 1px #0002; }
.part-detail { display: flex; flex-direction: column; gap: 12px; }
.part-detail:not(:empty) { border-top: 1px solid var(--line); padding-top: 16px; }
.part-detail .sec-title { margin: 0; }
.part-detail .sec .acc-body { gap: 18px; }
.playground .viewer-canvas { cursor: crosshair; }
.playground .viewer-canvas:active { cursor: grabbing; }

.hint.warn { color: var(--ink); background: color-mix(in srgb, #E8891A 14%, transparent); border: 1px solid color-mix(in srgb, #E8891A 45%, transparent); border-radius: var(--radius); padding: 10px 12px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.08); }
@media (max-width: 1440px) { #save-look span { display: none; } #save-look { padding: 0 11px; } }
@media (max-width: 560px) { #enquire span { display: none; } }

/* AR dialog */
.modal-ar { width: min(760px, calc(100vw - 32px)); }
.ar-size { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .92rem; margin: 0 0 14px; }
.ar-size svg { width: 16px; height: 16px; color: var(--accent); }
.ar-size .hint { font-size: .8rem; }
.ar-phone { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.ar-phone[hidden] { display: none; }
.ar-phone-text { display: flex; flex-direction: column; gap: 8px; }
.ar-reqs { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.ar-go { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
@media (max-width: 560px) { .ar-phone { grid-template-columns: 1fr; } .ar-phone .qr { width: 140px; } }

/* Try-on */
.tryon { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.tryon-start { display: flex; flex-direction: column; gap: 16px; }
.tryon-start .hint { display: flex; align-items: center; gap: 8px; }
.tryon-start .hint svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.tryon-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .2s, transform .2s; }
.choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice svg { width: 26px; height: 26px; color: var(--accent); }
.choice strong { font-family: var(--font-ui); font-weight: 700; font-size: 1rem; }
.tryon-phone { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tryon-phone .qr { width: 150px; }
.tryon-phone strong { font-family: var(--font-ui); display: block; margin-bottom: 4px; }
.tryon-phone .btn { margin-top: 8px; }
@media (max-width: 560px) { .tryon-phone { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.choice span { color: var(--ink-3); font-size: .88rem; }
.tryon-view { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.tryon-view[hidden] { display: none; }
.tryon-stage { position: relative; width: 100%; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #000; }
.tryon-stage .to-zoom { position: absolute; inset: 0; will-change: transform; }
.tryon-stage video, .tryon-stage img, .tryon-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.tryon-stage canvas { cursor: grab; touch-action: none; }
.tryon-stage.mirror video, .tryon-stage.mirror canvas { transform: scaleX(-1); }
.tryon-status { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; white-space: nowrap; }
.tryon-status[hidden] { display: none; }
.tryon-controls { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 760px) { .tryon-view { grid-template-columns: 1fr; } .tryon-choices { grid-template-columns: 1fr; } }
@media (max-width: 560px) { #tryon span { display: none; } }
.qr-wait { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; font-size: .8rem; color: #555; padding: 8px; }

/* Playground: what the customer may change, with drill-down chips */
.cust-opts .opt-group { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cust-opts .opt-group:last-of-type { border-bottom: 0; }
.cust-opts .opt-label { font-weight: 600; font-size: .88rem; }
.cust-opts .opt-group .hint { margin: 0; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.opt-chips .chip-check { font-size: .8rem; }
.opt-chips .dot.rainbow { background: conic-gradient(#f55, #fd5, #5d5, #5dd, #55f, #d5d, #f55); }
.chip-check { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 10px 5px 8px; gap: 6px; background: var(--paper); font-family: var(--font-ui); font-weight: 600; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip-check input { width: 14px; height: 14px; }
.chip-check .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px #0002; }
@media (max-width: 1100px) { .bar .account-chip > span { display: none; } }

.bar .platform-credit { font-family: var(--font-ui); font-weight: 600; font-size: .74rem; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.bar .platform-credit:hover { color: var(--ink); }
@media (max-width: 1100px) { .bar .platform-credit { display: none; } }

/* Customer view: EN / ES language switch */
.lang-switch { display: inline-flex; height: 38px; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); flex: none; }
.lang-switch button { min-width: 34px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); font-family: var(--font-ui); background: transparent; color: var(--ink-2); font-size: .78rem; font-weight: 600; letter-spacing: .06em; cursor: pointer; transition: background-color .2s, color .2s; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* Phones: icon-only actions (their title names them) so the bar fits with the language switch. */
@media (max-width: 560px) {
  .customer .bar-actions { gap: 6px; }
  .customer #ar span { display: none; }
  .customer #ar, .customer #tryon, .customer #enquire { padding: 0 11px; }
  .customer .bar .brand { min-width: 0; overflow: hidden; }
  .lang-switch button { min-width: 28px; padding: 0 4px; }
}
@media (prefers-reduced-motion: reduce) { .choice:hover { transform: none; } }

/* Playground: owners' get-started checklist */
.onboarding { margin: 12px 16px 4px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.onboarding-head { display: flex; align-items: center; gap: 10px; }
.onboarding-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.onboarding ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; }
.onboarding li { display: flex; align-items: center; gap: 8px; }
.onboarding li svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.onboarding li.done { color: var(--ink-3); text-decoration: line-through; }
.onboarding a { color: var(--ink); }

/* ── Business switcher (Playground · Branding · Customer view) and account menu, js/appnav.js ── */
.app-nav { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); flex: none; }
.app-nav:empty { display: none; }
.app-nav a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--radius-sm); text-decoration: none; font-family: var(--font-ui); font-weight: 700; font-size: .84rem; color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.app-nav a:hover { color: var(--ink); background: var(--surface); }
.app-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.app-nav svg { width: 15px; height: 15px; }
.acct-menu { position: relative; flex: none; }
.acct-menu:empty { display: none; }
.acct > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: .84rem; }
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary:hover, .acct[open] > summary { border-color: var(--accent); }
.acct .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-family: var(--font-ui); font-weight: 800; font-size: .8rem; }
.acct-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 260px; padding: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.acct-who { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-who small { color: var(--ink-3); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.acct-pop a, .acct-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); text-decoration: none; font-family: var(--font-ui); font-weight: 600; font-size: .88rem; text-align: left; cursor: pointer; }
.acct-pop a:hover, .acct-pop button:hover { background: var(--paper-2); }
.acct-pop svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.acct-pop .platform-credit { font-size: .78rem; color: var(--ink-3); }
.acct-pop .platform-credit:empty { display: none; }
.acct-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.acct-pop .danger, .acct-pop .danger svg { color: #B3261E; }
:root[data-theme="dark"] .acct-pop .danger, :root[data-theme="dark"] .acct-pop .danger svg { color: #F2B8B5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .acct-pop .danger, :root:not([data-theme="light"]) .acct-pop .danger svg { color: #F2B8B5; } }
@media (max-width: 1400px) { .playground .bar-title { display: none; } .playground .bar-actions { margin-left: auto; } }
@media (max-width: 1100px) { .app-nav span, .acct-name { display: none; } .app-nav a { padding: 0 9px; } .acct > summary { padding: 0 4px; } }
@media (max-width: 560px) { .playground #reset-all, .playground #undo, .playground #redo { display: none; } }

/* Customer view, for signed-in staff only: what this page is, and the way back */
.staff-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px 18px; flex-wrap: wrap; padding: 6px 12px; background: var(--ink); color: var(--paper); font-family: var(--font-ui); font-size: .8rem; font-weight: 600; }
.staff-bar span, .staff-bar a { display: inline-flex; align-items: center; gap: 6px; }
.staff-bar a { color: inherit; }
.staff-bar svg { width: 14px; height: 14px; }

/* Top bar: a long business name shortens instead of wrapping. */
.bar .brand { min-width: 0; flex-shrink: 1; }
.bar .brand > span[data-brand="name"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 22ch; }
.bar-actions { flex: none; }

/* Dialogs are not marketing sections: no page-section padding inside them. */
.modal section { padding: 0; }
/* AR on a computer: a still of the piece next to the phone hand-off (no second 3D engine). */
.ar-body.still { height: auto; min-height: 200px; display: grid; place-items: center; padding: 12px; }
.ar-still { max-height: 280px; width: auto; max-width: 100%; }
/* Header icons never shrink to dots when the bar is crowded. */
.customer .bar-actions > * { flex: none; }

/* ── Customer gallery (js/gallery.js): thumbnails beside the stage, photos first and the 360° view last ── */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; min-width: 0; }
.gallery.has-photos { grid-template-columns: 88px minmax(0, 1fr); }
.gallery-stage { position: relative; min-height: 0; min-width: 0; }
/* A photo on the stage: the 360° view keeps its size underneath (its canvas stays warm), out of sight and out of the accessibility tree. */
.gallery[data-mode="photo"] #viewport { visibility: hidden; }
.thumbs { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper); scrollbar-width: thin; }
.thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--viewer-bg); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: none; color: var(--accent); font-family: var(--font-ui); font-weight: 800; font-size: .7rem; transition: border-color .15s, box-shadow .15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { border-color: var(--accent); }
.thumb[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumb-360 svg { width: 22px; height: 22px; }
.photo-stage { position: absolute; inset: 0; background: var(--viewer-bg); overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.photo-stage.zoomed { cursor: zoom-out; }
.photo-img { width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 50%; transition: transform .25s var(--ease); will-change: transform; }
.photo-stage.zoomed .photo-img { transition: none; }
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.photo-nav.prev { left: 12px; }
.photo-nav.next { right: 12px; }
.photo-count { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); }
@media (max-width: 860px) {
  .gallery.has-photos { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .thumbs { flex-direction: row; order: 2; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; padding: 8px 10px; }
  .thumb { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .photo-img { transition: none; } }

/* Links customers must confirm: the customer's email before the link is made */
.link-email { margin-bottom: 14px; }
.link-email input { font: 400 1rem var(--font-body); }
/* Recent links in the Send dialog */
.recent-links { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.recent-links summary { cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: .88rem; }
.recent-links ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.recent-links li { display: flex; align-items: center; gap: 8px; }
.recent-links li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-links small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The Send dialog's 360° spin block (js/spinBlock.js) and its progress chip beside Send to Customer */
.spin-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.spin-block h4 { margin: 0; font-family: var(--font-ui); font-size: .88rem; }
.spin-block .hint { margin: 0; }
.spin-block .spin-row { display: grid; gap: 6px; }
.spin-block progress { width: 100%; }
.spin-chip { font-variant-numeric: tabular-nums; }
/* "Confirm it's you" on a customer link */
.verify-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; width: min(380px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.verify-card strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.15rem; }
.verify-card .btn { align-self: flex-start; }
.verify-card input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; font: 600 1.1rem var(--font-mono); letter-spacing: .2em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }

/* A link with a PIN (js/linkPin.js): the same card, larger touch targets, the reason in plain words */
.pin-card strong { display: flex; align-items: center; gap: 8px; }
.pin-card strong svg { width: 20px; height: 20px; flex: none; }
.pin-card input { height: 46px; font-size: 1.3rem; }
.pin-card .btn { align-self: stretch; min-height: 46px; padding-inline: 18px; }
.pin-card input:disabled { opacity: .55; }
.pin-card [data-msg]:empty { display: none; }
.pin-card [data-msg][data-kind="error"] { color: var(--ink); background: color-mix(in srgb, #E8891A 14%, transparent); border: 1px solid color-mix(in srgb, #E8891A 45%, transparent); border-radius: var(--radius); padding: 8px 10px; }
/* A link of photos only (no 360° view, no 3D): no viewer tools; the rail stays */
.photos-only #viewport .vp-tools, .photos-only #toggle-rotate, .photos-only #reset-view { display: none; }
/* "Shown with this stone: Oval · 1.20 ct" on a reshaped piece, in the note card or on its own over the stage */
.edited-note { margin: 0; }
.edited-note.pill { position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: calc(100% - 24px); white-space: normal; }
/* The original file's download in the customer bar: icon only on phones, like the others */
@media (max-width: 560px) { .customer #download-file span { display: none; } }
.panel-credits { margin: 0; padding: 12px 16px 16px; font-size: .78rem; color: var(--ink-3); }
.panel-credits a { color: inherit; }
/* Try-on: which side of the hand the camera sees */
.tryon-credit { font-size: .78rem; }
#to-side-note:empty { display: none; }

/* A link waiting on its email code or PIN (share.js resolveShare): only the card shows on the stage. */
.stage.gated .vp-tools, .stage.gated .open-full, .stage.gated .loading { display: none; }

/* The Report link and its dialog on a customer's page (js/report.js) */
.panel-credits { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.report-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.report-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-report { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow: auto; }
.report-form { display: flex; flex-direction: column; gap: 14px; }
.report-reasons { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.report-reasons legend { font-weight: 700; margin-bottom: 6px; }
.report-form .field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; }
.report-form .field input, .report-form .field textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.report-form .opt { font-weight: 400; color: var(--ink-3); }
.report-done { display: flex; flex-direction: column; gap: 14px; }
