/* Geometry only: fonts, fabric and relief inherit the current product theme. */
[data-view="studio"] .studio-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0 22px}
[data-view="studio"] .studio-tool{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-width:0;min-height:118px;padding:16px 6px;border-radius:12px;background:var(--bg);box-shadow:var(--nm-out);transition:box-shadow .14s,background-color .14s;text-align:center}
[data-view="studio"] .studio-tool:active{box-shadow:var(--nm-in)}
[data-view="studio"] .studio-tool svg{width:29px;height:29px;stroke:var(--icon);stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
[data-view="studio"] .studio-tool .product-name{line-height:1.25;overflow-wrap:normal}
[data-view="studio"] .studio-tools-section{animation:slideup .3s ease both}
[data-view="studio"] .studio-tools-section>.divider{animation:none}
[data-view="studio"] .studio-tool .product-ic svg{width:22px;height:22px}
.drawer.return-restored{transition:none!important}
.drawer.return-restored>*{animation:none!important;transition:none!important;opacity:1!important;transform:none!important}
html.tool-return-pending .app{visibility:hidden}
/* Restored drawer/backdrop must share the shell paint gate, without changing their state. */
html:is(.tool-return-pending,.nav-boot,.up-window-pending) :is(.drawer,.overlay){visibility:hidden!important;pointer-events:none!important}
[data-view="studio"] .product-card{border-radius:12px}
/* Extend the existing pebble/velvet recipe without changing shared palettes. */
:root:is([data-theme="dark"],[data-theme="light"]) [data-view="studio"] .studio-tool{background-color:var(--pb-card)!important;background-image:var(--pb-card-image),var(--pb-puff)!important;background-repeat:var(--pb-repeat,no-repeat),no-repeat!important;background-position:top right,center!important;background-size:var(--pb-tile-size,156px 130px),100% 100%!important;box-shadow:var(--pb-shadow)!important}
:root:is([data-theme="dark"],[data-theme="light"]) [data-view="studio"] .studio-tool:active{background-color:var(--pb-well)!important;background-image:none!important;box-shadow:var(--pb-well-shadow)!important}
.ai-generation-overlay{position:absolute;inset:0;z-index:180;display:flex;align-items:center;justify-content:center;padding:calc(var(--tg-safe-area-inset-top,env(safe-area-inset-top,0px)) + var(--tg-content-safe-area-inset-top,0px) + 16px) 18px calc(var(--tg-safe-area-inset-bottom,0px) + 16px);background:rgba(0,0,0,.28);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.ai-generation-sheet{position:relative;width:100%;max-width:420px;max-height:100%;overflow:auto;padding:18px;border-radius:18px;background:var(--bg);box-shadow:0 0 0 1px var(--edge),8px 12px 26px var(--sh-d)}
.ai-generation-close{position:absolute;top:10px;right:10px;width:36px;height:36px;border-radius:10px;background:var(--bg);box-shadow:var(--nm-out-sm);display:flex;align-items:center;justify-content:center;color:var(--icon)}
.ai-generation-close:active{box-shadow:var(--nm-in-sm)}
.ai-generation-close svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round}
.ai-generation-sheet h2{font:500 16px/22px 'Oswald',sans-serif;letter-spacing:.02em;text-align:center;margin:0 32px}
.ai-generation-divider{height:1px;background:var(--line);margin:14px 0 12px}
.ai-generation-sheet p{font:400 13.5px/1.5 'Oswald',sans-serif;letter-spacing:.01em;text-align:center}
@media(prefers-reduced-motion:reduce){[data-view="studio"] .studio-tool{transition:none}}
@media(prefers-reduced-motion:reduce){[data-view="studio"] .studio-tools-section{animation:none}}

/* Keep all tool icons on the same row when a caption wraps on phones. */
@media (max-width:600px){
  [data-view="studio"] .studio-tool{justify-content:flex-start}
  [data-view="studio"] .studio-tool .product-name{max-width:100%;overflow-wrap:anywhere}
}

@media (max-width:350px){
  [data-view="studio"] .studio-tool .product-name{font-size:12px;letter-spacing:.02em}
  [data-view="studio"] .studio-tool[data-tool-route="calculator"] .product-name{font-size:11px;white-space:nowrap}
}
