/* Общая оболочка студии; цвета пользовательского макета независимы. */
:root{--y:#efc756;--y2:#f6db91;--bg:#0c0c0c;--surface:#151515;--border:#36342c;--text:#f5f5f0;--text2:#d0cec5;--muted:#b3afa1;--accent-blue:#efc756;--accent-green:#efc756}body{background:#0c0c0c}#topbar{background:#0d0d0d;border-bottom:1px solid #343128;box-shadow:none}button{touch-action:manipulation}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #efc756;outline-offset:3px}.step1-inner{padding-top:58px}.step1-title,.step2-title{font-weight:400;letter-spacing:-.06em;line-height:1.04}.step1-sub,.step2-sub{color:#c3bfb3;font-size:16px;line-height:1.7}.hero-glow,.hero-grid{display:none}.step1-badge{border-color:#5f5130;background:#1f1b11;letter-spacing:.12em}.prod-card{background:linear-gradient(150deg,#1e1b12,#131313 55%);border-color:#444034;border-radius:22px;box-shadow:none;transition:transform .2s,border-color .2s}.prod-card:hover{border-color:#c5a454;transform:translateY(-3px);box-shadow:none}.prod-name{font-weight:500;font-size:20px;letter-spacing:-.025em}.prod-desc{color:#bab7ad;line-height:1.6}.size-card{border-color:#474034;border-radius:16px;background:#161513}.size-card.active,.size-card.selected{border-color:#efc756;background:#2a2313}.unit-btn,.next-btn,.qbtn{border-radius:12px;box-shadow:none;animation:none}.next-btn,.qbtn{font-weight:600}.sb-title{font-size:16px;font-weight:600;letter-spacing:-.02em}.sb-section{border-color:#38352b}#ai-prompt{min-height:130px;font-size:14px;line-height:1.65;border-radius:14px;background:#101010;border:1px solid #776231;color:#fff;padding:16px}#ai-generate{border-radius:12px;min-height:48px;box-shadow:none;font-weight:600}#ai-presets button{border-radius:9px;padding:10px;border-color:#50462e;background:#1c1911;color:#dfd6bc}.ai-header{background:linear-gradient(120deg,#2b2412,#141414);border-color:#5a4e2d}.ai-header-avatar{background:#16140e;box-shadow:none;border:1px solid #736132}.ai-header-avatar:after{display:none}.ai-header-status{color:#c7c1ae}.ai-header-status-dot{background:#efc756;box-shadow:none}#ai-assist-panel{border-radius:22px;border:1px solid #88713b;background:#101010;box-shadow:0 22px 80px #0008}.ai-body{background:#101010}.ai-msg-bubble{font-size:14px;line-height:1.65}.ai-msg.assistant .ai-msg-bubble{background:#1d1c18;color:#f5f4ed;border:1px solid #36332a;border-radius:15px 15px 15px 4px}.ai-msg.user .ai-msg-bubble{background:#efc756;color:#13110b;border-radius:15px 15px 4px 15px}.ai-input-wrap{background:#111;border-color:#52462b}.ai-input-wrap textarea{border-radius:12px;background:#191813;color:#fff;font-size:16px}.ai-action-card{background:#252014;border-color:#766235;border-radius:13px}.ai-suggest-bar{background:#14130f}.ai-header-btn{border-radius:9px;min-width:34px;min-height:34px}#ai-assist-fab{box-shadow:0 8px 28px #0006;background:#efc756}#ai-assist-fab:hover{transform:translateY(-2px);box-shadow:0 10px 30px #0007}#ai-assist-fab:before{animation:none}.ai-fab-badge{background:#eee1bc;color:#111}body.light-mode{--bg:#f1efea;--surface:#fff;--text:#171717;--text2:#333}
@media(max-width:640px){.step1-inner{padding-top:34px}.step1-title,.step2-title{font-size:43px}.step1-sub,.step2-sub{font-size:14px}.prod-card{border-radius:17px}.prod-name{font-size:17px}#ai-assist-panel{left:8px!important;right:8px!important;width:auto!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;max-height:calc(100dvh - 20px)!important}.ai-msg-bubble{font-size:14px}.ai-header{padding:14px}.ai-header-btn{width:34px;height:34px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* Единый контрол выделения: без второй рамки Fabric, с движением и поворотом за холстом. */
#selection-overlay{position:fixed!important;pointer-events:auto!important;cursor:move;touch-action:none;will-change:width,height,transform;animation:none!important}
#selection-overlay.show{display:block!important}
#selection-overlay.is-locked{cursor:not-allowed}
#selection-overlay.is-locked .sov-handle{display:none!important}
#sov-rotate-handle{display:none!important;visibility:hidden!important;pointer-events:auto!important;position:fixed!important;width:26px!important;height:26px!important;padding:0!important;transform:translate(-50%,-50%)!important;align-items:center;justify-content:center;border:1px solid rgba(18,16,10,.28)!important;border-radius:8px!important;background:#f5c842!important;color:#17140b!important;box-shadow:0 5px 14px rgba(0,0,0,.24)!important;cursor:grab!important;z-index:1005!important;transition:transform .15s ease,background .15s ease,box-shadow .15s ease!important}
#sov-rotate-handle.show{display:flex!important;visibility:visible!important}
#sov-rotate-handle:hover{background:#ffda63!important;transform:translate(-50%,-50%) translateY(-1px)!important;box-shadow:0 7px 16px rgba(0,0,0,.28)!important}
#sov-rotate-handle:active{cursor:grabbing!important;transform:translate(-50%,-50%) scale(.96)!important}
#sov-rotate-handle:before{content:""!important;display:block!important;position:absolute;left:50%;top:100%;width:1px;height:8px;background:linear-gradient(#efc756,rgba(239,199,86,.15));transform:translateX(-50%)}
#sov-rotate-handle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.sov-dragging,body.sov-dragging *{user-select:none!important}

/* Компактный дизайн-помощник: видимый знак, читаемый диалог и доступное поле ввода. */
#ai-assist-panel{width:min(390px,calc(100vw - 32px));height:min(550px,calc(100dvh - 96px));border-radius:20px;border:1px solid #66552f;background:#111;box-shadow:0 20px 55px #0009}
#ai-assist-panel .ai-header{min-height:64px;padding:12px 14px!important;gap:10px;background:#171611;border-bottom:1px solid #353127}
#ai-assist-panel .ai-header-avatar{width:36px;height:36px;border-radius:11px;background:#292416!important;color:#f5c842!important;border:1px solid #6c582c;box-shadow:none!important}
#ai-assist-panel .ai-header-avatar svg{width:21px;height:21px;fill:currentColor}
#ai-assist-panel .ai-header-title{font-size:14px;letter-spacing:-.02em;line-height:1.2}
#ai-assist-panel .ai-header-title .ai-by{color:#a89b78}
#ai-assist-panel .ai-header-title .ai-dorik{animation:none;background:none;-webkit-text-fill-color:#f5c842;color:#f5c842}
#ai-assist-panel .ai-header-status{font-size:11px;color:#cbc5b7;margin-top:3px}
#ai-assist-panel .ai-header-status-dot{width:6px;height:6px;background:#e7c15b;animation:none}
#ai-assist-panel .ai-header-btns{gap:4px!important}
#ai-assist-panel .ai-header-btn,#ai-assist-panel .ai-header-btn.close{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;background:transparent!important;border:1px solid transparent!important;border-radius:9px!important;color:#c9c4b9!important;box-shadow:none!important}
#ai-assist-panel .ai-header-btn:hover,#ai-assist-panel .ai-header-btn.close:hover{background:#2a271e!important;border-color:#504833!important;color:#fff!important;box-shadow:none!important;transform:none!important}
#ai-assist-panel .ai-body{padding:18px 14px 14px;background:radial-gradient(ellipse at 50% 0%,#1a1812 0%,#111 46%);gap:12px}
#ai-assist-panel .ai-msg{max-width:88%;gap:0}
#ai-assist-panel .ai-msg-avatar{display:none!important}
#ai-assist-panel .ai-msg-bubble{padding:11px 13px;font-size:13px;line-height:1.5;letter-spacing:0;border-radius:13px;box-shadow:none}
#ai-assist-panel .ai-msg.user .ai-msg-bubble{color:#1d180b;background:#f5c842;border-color:#f5c842;border-bottom-right-radius:4px}
#ai-assist-panel .ai-msg.assistant .ai-msg-bubble{color:#f5f3ec;background:#20201d;border-color:#383630;border-bottom-left-radius:4px}
#ai-assist-panel .ai-suggest-bar.show{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:10px 14px;border-top:1px solid #302d24;overflow:visible;white-space:normal;background:#15140f}
#ai-assist-panel .ai-suggest-chip{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;padding:7px 8px;font-size:11px;font-weight:600;color:#e7ddc3;background:#242116;border:1px solid #483d24;border-radius:9px}
#ai-assist-panel .ai-suggest-chip:hover{background:#302814;border-color:#a78940;color:#fff}
#ai-assist-panel .ai-input-wrap{padding:10px 14px 12px;background:#171611;border-top:1px solid #393328}
#ai-assist-panel .ai-input-row{min-height:48px;padding:5px 5px 5px 8px;gap:6px;background:#22211e;border-color:#53472d;border-radius:12px}
#ai-assist-panel .ai-mic-btn{width:32px;height:32px;border-radius:8px;background:transparent;color:#bbb5a8}
#ai-assist-panel .ai-send-btn{width:36px;height:36px;border-radius:9px;background:#f5c842;box-shadow:none}
#ai-assist-panel #ai-input-text{box-sizing:border-box;min-width:0;width:auto;min-height:26px;height:26px;max-height:110px;padding:3px 0;font-size:13px;line-height:20px;overflow-y:auto}
#ai-assist-panel #ai-input-text::placeholder{color:#bdb7aa;opacity:1}
#ai-assist-panel .ai-input-hint{font-size:10px;color:#858075;margin-top:7px}
@media(max-width:600px){#ai-assist-panel{width:100%;height:88dvh;max-height:88dvh;border-radius:20px 20px 0 0}#ai-assist-panel .ai-header{padding:10px 14px!important}#ai-assist-panel .ai-input-wrap{padding-bottom:calc(12px + env(safe-area-inset-bottom))}#ai-assist-panel #ai-input-text{font-size:16px}}
