:root { font-family:"Segoe UI",system-ui,sans-serif; color:#352a40; background:#fffaf6; --purple:#6d50b6; --line:#e9e2ea; --muted:#756d7e; --paper:#fffaf6; }
body { min-width:280px; overflow:auto; }
button,input { font:inherit; } button { color:inherit; cursor:pointer; } button,input,a { touch-action:manipulation; }
.app-shell { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(380px,1fr); height:calc(100dvh - 76px); min-height:540px; max-width:1800px; margin:auto; }
.studio { min-width:0; min-height:0; display:grid; grid-template-rows:58px minmax(0,1fr) 78px; background:radial-gradient(ellipse at 35% 20%,#f9f1ed,#eee7ef 75%); }
.brand-bar,.studio-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 24px; }
.brand-bar { color:var(--muted); font-size:12px; } .top-actions { display:flex; gap:6px; }
.quiet-button { min-height:44px; border:1px solid #dcd4df; border-radius:12px; padding:8px 13px; color:#584b67; background:#ffffffb3; font-size:12px; font-weight:650; white-space:nowrap; }
.quiet-button[aria-pressed=true] { background:#e8def7; border-color:#ab94ce; }
.canvas-wrap { position:relative; min-width:0; min-height:0; overflow:hidden; }
#preview { display:block; width:100%; height:100%; touch-action:none; }
.view-chip { position:absolute; top:12px; left:24px; display:flex; align-items:center; gap:7px; font-size:11px; color:#796b7b; background:#fffaf6c9; border:1px solid #ffffffb5; padding:8px 11px; border-radius:999px; pointer-events:none; }
.pulse { width:6px; height:6px; border-radius:50%; background:#8aac9b; }
.viewport-hint { position:absolute; bottom:14px; left:0; right:0; text-align:center; font-size:11px; color:#7d7285; pointer-events:none; }
.studio-footer { background:#fffaf6c4; border-top:1px solid #ffffff9c; } .studio-footer>div { min-width:0; display:grid; gap:4px; } .studio-footer strong { font-size:14px; font-weight:650; } .studio-footer span { font-size:11px; line-height:1.4; color:var(--muted); overflow-wrap:anywhere; }
.loading { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:10px; background:#f4eef3; color:#665771; transition:opacity .2s; z-index:2; text-align:center; padding:20px; }
.loading.is-hidden { opacity:0; visibility:hidden; pointer-events:none; } .loading small { max-width:280px; line-height:1.5; }
.loader-orbit { width:32px; height:32px; border:3px solid #e0d5eb; border-top-color:#a384c7; border-radius:50%; animation:spin 1s linear infinite; } @keyframes spin { to { transform:rotate(360deg); } }
.builder { min-width:0; min-height:0; display:flex; flex-direction:column; border-left:1px solid var(--line); background:#fffdfb; }
.controls-scroll { min-width:0; min-height:0; flex:1; overflow:auto; padding:28px 30px 24px; scrollbar-color:#d7cadf transparent; scrollbar-width:thin; }
.builder-heading { margin-bottom:26px; } .eyebrow { color:#b0617d; font-size:10px; letter-spacing:1.8px; text-transform:uppercase; font-weight:750; margin:0 0 10px; }
h1 { margin:0; font-size:34px; letter-spacing:-1.1px; line-height:1.08; font-weight:700; } h1 em { font-style:normal; color:#805ba9; } .builder-heading>p:last-child { font-size:13px; line-height:1.6; color:var(--muted); max-width:340px; margin:12px 0 0; }
.section-label { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; } .section-label h2 { display:flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:650; } .section-label h3 { margin:0; font-size:12px; font-weight:650; } .section-label>span { font-size:10px; color:var(--muted); text-align:right; }
.step-number { width:24px; height:24px; display:inline-grid; place-items:center; border-radius:50%; background:#f1eaf8; color:#805aaa; font-size:11px; flex:none; }
.random-button { background:none; border:0; padding:8px 0 8px 8px; min-height:44px; color:#805aaa; font-size:11px; font-weight:650; }
.preset-row { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.preset { min-width:0; padding:10px 2px 9px; display:grid; justify-items:center; gap:7px; border:1px solid var(--line); border-radius:15px; background:white; font-size:10px; font-weight:650; }
.preset-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:11px; color:#655077; font-size:15px; } .preset.is-active { background:#f7f1fc; border-color:#a78bc8; box-shadow:0 2px 8px #79539b0a; }
.customize-section { margin-top:26px; }
.part-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; padding:4px; border-radius:13px; background:#f0eaf3; margin-bottom:18px; }
.part-tab { min-width:0; min-height:44px; border:0; border-radius:10px; background:none; font-size:12px; font-weight:650; color:#82728d; }.part-tab.is-active { color:#704f97; background:white; box-shadow:0 2px 5px #6b4e7d10; }
.control-panel { display:none; } .control-panel.is-active { display:block; }
.choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.choice { min-width:0; display:flex; gap:9px; align-items:center; text-align:left; border:1px solid var(--line); border-radius:12px; padding:10px; min-height:59px; background:white; }
.choice.is-active { border-color:#a98bc7; background:#f7f1fc; box-shadow:inset 0 0 0 1px #ac8bc640; }.choice:hover { border-color:#a98bc7; }
.choice-swatch { width:28px; height:28px; flex:none; border-radius:10px; background:var(--swatch); display:grid; place-items:center; color:#634b75; font-size:14px; }.choice-copy { min-width:0; display:grid; gap:3px; }.choice strong { font-size:13px; font-weight:650; }.choice small { font-size:11px; color:var(--muted); line-height:1.3; }
.segment-bar { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; padding:5px; border-radius:12px; background:#f1eaf7; }.segment-bar button { height:44px; background:white; border:0; border-radius:9px; font-size:24px; color:#805aaa; }.segment-bar>div { display:grid; text-align:center; gap:3px; }.segment-bar span { font-size:9px; text-transform:uppercase; letter-spacing:1px; color:var(--muted); }.segment-bar strong { font-size:12px; }
.segment-strip { display:flex; flex-wrap:wrap; gap:6px; padding:10px 0; }.segment-pill { width:44px; height:44px; background:white; border:1px solid var(--line); border-radius:10px; }.segment-pill.is-active { background:#efe4f9; border-color:#a98bc7; }
.range-control { display:grid; gap:10px; margin-top:10px; }.range-control>span { display:flex; align-items:center; justify-content:space-between; font-size:12px; }.range-control output { background:#eee5f6; color:#805aaa; border-radius:8px; padding:3px 8px; }input[type=range] { width:100%; min-width:0; height:30px; accent-color:#9972bb; }
.compatibility-note { padding:10px 12px; margin:10px 0; border-radius:10px; background:#f9f4ec; font-size:11px; line-height:1.5; color:#837162; }.control-group { margin-top:18px; padding-top:16px; border-top:1px solid #f0eaf2; }.joint-angle-control { margin-top:18px; padding:14px; background:#f6f0fa; border-radius:12px; }.joint-angle-control small { font-size:10px; color:var(--muted); line-height:1.5; }
.saved-card,.about-preview { margin-top:22px; padding-top:16px; border-top:1px solid var(--line); font-size:12px; }.saved-card summary,.about-preview summary { cursor:pointer; min-height:44px; color:#6d5c7b; }.saved-card summary span { float:right; color:#9b8d9f; font-size:10px; }.saved-designs { display:grid; gap:8px; padding-top:8px; }.saved-item { display:flex; align-items:center; justify-content:space-between; gap:8px; }.saved-item button { min-height:44px; border:0; background:#f5eef9; border-radius:8px; padding:9px 11px; color:#705084; text-align:left; overflow-wrap:anywhere; }.saved-item .delete { flex:none; background:#faf0f3; color:#ac5471; }.about-preview p { line-height:1.6; color:var(--muted); }.about-preview a { color:#805aaa; }
.review-dock { flex:none; padding:16px 22px; display:flex; gap:12px; align-items:center; justify-content:space-between; border-top:1px solid var(--line); background:#fffdfb; }.review-dock>div { min-width:0; display:grid; gap:4px; }.review-dock strong { font-size:12px; font-weight:650; }.review-dock small { font-size:9px; color:var(--muted); line-height:1.4; }.primary-button { display:flex; align-items:center; justify-content:center; gap:14px; min-height:46px; border:0; border-radius:12px; padding:12px 18px; color:white; background:#725296; font-size:12px; font-weight:650; white-space:nowrap; box-shadow:0 3px 10px #71509315; }.primary-button:hover { background:#624381; }
.review-dialog { width:min(490px,calc(100% - 28px)); max-height:calc(100dvh - 30px); border:1px solid #e9deee; padding:26px; border-radius:22px; background:#fffcfa; color:#352a40; box-shadow:0 30px 100px #33223f50; }.review-dialog::backdrop { background:#30233970; backdrop-filter:blur(4px); }.review-top { display:flex; justify-content:space-between; gap:12px; }.review-top h2 { font-size:24px; margin:0; letter-spacing:-.6px; }.close-button { flex:none; width:44px; height:44px; border:1px solid var(--line); background:white; border-radius:50%; font-size:24px; }.review-intro,.local-note,.review-limit { font-size:12px; line-height:1.5; color:var(--muted); }.design-summary { padding:0; list-style:none; display:grid; gap:8px; margin:20px 0; }.design-summary li { padding:12px; background:#f5eef8; border-radius:11px; display:grid; gap:4px; }.design-summary strong { font-size:12px; }.design-summary span { font-size:11px; line-height:1.6; color:#7e6b8a; }.name-label { display:block; font-size:12px; font-weight:650; margin-bottom:8px; }#design-name { width:100%; border:1px solid #dcd0e5; border-radius:10px; min-height:44px; padding:10px; font-size:14px; background:white; }.save-button { width:100%; }.save-status { color:#517e67; font-size:12px; line-height:1.5; }.save-status:empty { display:none; }.download-button { min-height:44px; width:100%; border:1px solid #dcd0e5; border-radius:10px; background:white; color:#805aaa; font-size:12px; }.review-limit { font-size:10px; margin-bottom:0; }
.toast { position:fixed; bottom:90px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 28px); padding:12px 16px; background:#493654; color:white; font-size:12px; line-height:1.5; border-radius:12px; z-index:30; opacity:0; visibility:hidden; pointer-events:none; }.toast.is-visible { opacity:1; visibility:visible; }
@media(min-width:701px) and (max-width:1000px) { .app-shell { grid-template-columns:minmax(0,1fr) minmax(340px,.9fr); }.controls-scroll { padding:24px 20px; }h1 { font-size:30px; }.review-dock { padding:14px 16px; gap:8px; }.review-dock>div { max-width:140px; }.primary-button { padding:12px; } }
@media(max-width:700px) { .app-shell { display:block; height:auto; min-height:0; padding-bottom:84px; }.studio { height:360px; height:clamp(310px,46svh,390px); min-height:0; grid-template-rows:48px minmax(0,1fr) 62px; }.brand-bar,.studio-footer { padding:7px 16px; }.brand-bar { font-size:11px; }.quiet-button { padding:7px 10px; font-size:11px; }.studio-footer strong { font-size:12px; }.studio-footer span { font-size:10px; }.view-chip { top:6px; left:16px; font-size:10px; }.viewport-hint { font-size:9px; bottom:7px; }.builder { border-left:0; border-top:1px solid var(--line); }.controls-scroll { overflow:visible; padding:25px 20px 22px; }.builder-heading { margin-bottom:22px; }h1 { font-size:28px; }h1 br { display:none; }.builder-heading>p:last-child { font-size:12px; max-width:360px; }.eyebrow { font-size:9px; letter-spacing:1.3px; }.section-label h2 { font-size:13px; }.preset-row { gap:5px; }.preset { font-size:9px; padding:8px 1px; }.review-dock { position:fixed; bottom:0; left:0; right:0; z-index:10; padding:12px 16px max(12px,env(safe-area-inset-bottom)); box-shadow:0 -4px 20px #44264b0b; }.review-dock>div { max-width:47%; }.review-dock strong { font-size:11px; }.review-dock small { font-size:9px; }.primary-button { font-size:11px; gap:9px; padding:12px 14px; }.review-dialog { padding:20px; }.review-top h2 { font-size:22px; } }
@media(max-width:350px) { .controls-scroll { padding-left:14px; padding-right:14px; }.section-label>span { max-width:100px; }.choice { padding:8px; gap:6px; }.choice-swatch { width:23px; height:23px; }.review-dock { padding-left:12px; padding-right:12px; }.review-dock small { max-width:130px; } }
.saved-storage-status:empty { display:none; }
.saved-storage-status, .saved-unavailable { margin:0 0 10px; color:#75636c; line-height:1.5; font-size:12px; }
.studio.has-build-notice { grid-template-rows:58px minmax(0,1fr) auto 78px; }
.build-error { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 24px; background:#fff2e9; border-top:1px solid #ead6c8; color:#745344; font-size:12px; line-height:1.5; }
.build-error[hidden] { display:none; }
.build-error span { min-width:0; }
.build-error button { flex:none; }
@media(max-width:700px) { .studio.has-build-notice { grid-template-rows:48px minmax(0,1fr) auto 62px; } .build-error { padding:8px 16px; gap:8px; font-size:11px; } .build-error button { padding:7px 10px; } }
.print-palette { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
.print-palette span { width:24px; height:24px; border-radius:50%; border:1px solid #0002; }
#print-result { padding:12px 0; }
#print-download { display:flex; align-items:center; justify-content:center; text-decoration:none; margin-bottom:10px; background:var(--purple); color:white; font-weight:650; }
#download-3mf:disabled { opacity:.65; cursor:wait; }
#preset-row .preset-icon { width:42px; height:42px; }
.preset-icon svg { width:34px; height:34px; fill:currentColor; }
.preset small { color:var(--muted); font-size:9px; font-weight:400; }
.preset { gap:4px; }
.select-label { display:block; font-size:12px; font-weight:650; margin:0 0 7px; }
.part-select { width:100%; min-height:46px; border:1px solid #dcd0e5; border-radius:11px; background:white; padding:10px 32px 10px 12px; color:#584b67; font:inherit; font-size:12px; }
.part-select-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px 12px; margin-top:16px; }
.color-editor { display:grid; gap:12px; margin-top:18px; }
.color-editor:empty { display:none; }
.color-editor fieldset { border:1px solid var(--line); border-radius:12px; margin:0; padding:12px; display:flex; flex-wrap:wrap; gap:10px 14px; }
.color-editor legend { font-size:11px; font-weight:650; padding:0 5px; }
.color-editor label { display:flex; align-items:center; gap:7px; font-size:11px; }
.color-editor input[type=color] { width:36px; height:36px; padding:2px; border:1px solid #dcd0e5; border-radius:9px; background:white; cursor:pointer; }
.color-reset { margin-left:auto; background:none; border:0; color:#805aaa; font-size:10px; cursor:pointer; min-height:36px; }

/* Optional Cardboard scenery: the existing product viewer owns rendering. */
.studio{grid-template-rows:58px minmax(0,1fr) auto 78px;background:linear-gradient(180deg,#dfebe6 0%,#dce7d9 100%)}
.studio.has-build-notice{grid-template-rows:58px minmax(0,1fr) auto auto 78px}
.world-toolbar{display:flex;align-items:center;gap:12px;padding:8px 24px;background:#faf8f1b8;border-top:1px solid #ffffff9e;color:#68756b;font-size:11px}
.world-toolbar label{font-weight:650}.world-toolbar select{font:inherit;color:#46594d;min-height:40px;border:1px solid #d1dacf;border-radius:10px;padding:8px 28px 8px 10px;background:#fffdf8;max-width:210px}
.view-chip{color:#63736a;background:#fffdf4b0}.viewport-hint{color:#6c796e}.studio-footer{background:#faf8f2df}
@media(max-width:800px){.studio{min-height:460px;grid-template-rows:54px minmax(290px,52dvh) auto 70px}.studio.has-build-notice{grid-template-rows:54px minmax(290px,52dvh) auto auto 70px}.world-toolbar{padding:8px 16px}}
@media(prefers-reduced-motion:reduce){.loading{transition:none}}
