/* Runtime theme layer */
html,body{font-size:var(--theme-base-font,14px)}
body{font-size:var(--theme-base-font,14px)}
.sidebar{width:var(--theme-sidebar-width,248px);border-radius:0;padding-top:calc(36px * var(--theme-density,1));}
.workspace{margin-right:var(--theme-sidebar-width,248px)}
.topbar{height:var(--theme-topbar-height,82px)}
main{max-width:var(--theme-content-width,1550px);padding-top:calc(36px * var(--theme-density,1));padding-bottom:calc(48px * var(--theme-density,1))}
.panel,.stat,.tool-card,.planner-shell,.login-card,.sidebar-note,.hero{border-radius:var(--theme-radius,14px)}
.button,.icon-button,input,select,textarea{border-radius:var(--theme-button-radius,9px)}
.button.primary{background:var(--accent)}
.theme-shadow-none .panel,.theme-shadow-none .stat,.theme-shadow-none .tool-card,.theme-shadow-none .hero{box-shadow:none!important}
.theme-shadow-deep .panel,.theme-shadow-deep .stat,.theme-shadow-deep .tool-card,.theme-shadow-deep .hero{box-shadow:var(--shadow)}
.theme-sidebar-glass .sidebar{background:color-mix(in srgb,var(--surface) 82%,transparent);backdrop-filter:blur(var(--theme-glass-blur,14px));-webkit-backdrop-filter:blur(var(--theme-glass-blur,14px))}
.theme-sidebar-floating .sidebar{inset:12px 12px 12px auto;height:auto;border:1px solid var(--line);border-radius:calc(var(--theme-radius,14px) + 6px);box-shadow:var(--shadow)}
.theme-sidebar-floating .workspace{margin-right:calc(var(--theme-sidebar-width,248px) + 12px)}
.theme-card-lifted .panel,.theme-card-lifted .stat,.theme-card-lifted .tool-card{box-shadow:var(--shadow);transform:translateZ(0)}
.theme-card-glass .panel,.theme-card-glass .stat,.theme-card-glass .tool-card{background:color-mix(in srgb,var(--surface) 82%,transparent);backdrop-filter:blur(var(--theme-glass-blur,14px));-webkit-backdrop-filter:blur(var(--theme-glass-blur,14px))}
.theme-card-three_d .panel,.theme-card-three_d .stat,.theme-card-three_d .tool-card{box-shadow:0 15px 0 color-mix(in srgb,var(--line) 62%,transparent),var(--shadow);transform:perspective(900px) rotateX(calc(var(--theme-perspective,6deg) * .12));transform-origin:center top}
.theme-density-compact .panel,.theme-density-compact .stat,.theme-density-compact .tool-card{padding:calc(18px * var(--theme-density))}.theme-density-spacious .panel,.theme-density-spacious .stat,.theme-density-spacious .tool-card{padding:calc(26px * var(--theme-density))}
.theme-animation-none *{scroll-behavior:auto!important;transition:none!important;animation:none!important}.theme-animation-rich .tool-card:hover,.theme-animation-rich .stat:hover,.theme-animation-rich .panel.theme-hover:hover{transform:perspective(900px) translateY(-7px) rotateX(calc(var(--theme-perspective,6deg) * -.2));}
@media(max-width:900px){.sidebar{width:min(88vw,var(--theme-sidebar-width,248px))}.workspace,.theme-sidebar-floating .workspace{margin-right:0}.theme-sidebar-floating .sidebar{inset:0 0 0 auto;border-radius:0}}

/* Theme studio */
.theme-studio-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:22px;align-items:start}.theme-library{position:sticky;top:calc(var(--theme-topbar-height,82px) + 18px)}.theme-library-list{display:grid;gap:8px}.theme-library-item{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:10px;transition:.2s}.theme-library-item:hover,.theme-library-item.active{border-color:var(--accent);background:var(--soft)}.theme-library-item strong,.theme-library-item small{display:block}.theme-library-item small{color:var(--muted);font-size:9px}.theme-swatch{width:46px;height:40px;border-radius:10px;background:linear-gradient(135deg,var(--swatch-accent) 0 34%,var(--swatch-bg) 34% 68%,var(--swatch-surface) 68%);border:1px solid var(--line);flex:0 0 auto}.theme-library-actions{display:grid;gap:8px;margin-top:18px}.theme-library-actions form,.theme-library-actions button{width:100%}.theme-builder-stack{display:grid;gap:22px}.theme-preview-panel{overflow:hidden}.theme-mini-app{direction:rtl;height:260px;border:1px solid var(--line);border-radius:calc(var(--theme-radius) + 4px);display:grid;grid-template-columns:23% 1fr;overflow:hidden;background:var(--bg);box-shadow:var(--shadow);perspective:900px}.theme-mini-sidebar{background:var(--surface);border-left:1px solid var(--line);padding:20px 13px;display:grid;align-content:start;gap:13px}.theme-mini-sidebar i{width:42px;height:42px;background:var(--accent);border-radius:var(--theme-button-radius)}.theme-mini-sidebar b{height:12px;border-radius:20px;background:var(--soft)}.theme-mini-content{padding:18px;display:grid;grid-template-rows:20px 1fr auto;gap:15px}.theme-mini-top{display:block;background:var(--surface);border-radius:var(--theme-button-radius);border:1px solid var(--line)}.theme-mini-hero{background:linear-gradient(125deg,var(--soft),color-mix(in srgb,var(--accent) 10%,var(--surface)));border-radius:var(--theme-radius);border:1px solid var(--line)}.theme-mini-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.theme-mini-cards i{height:58px;background:var(--surface);border:1px solid var(--line);border-radius:var(--theme-radius);box-shadow:var(--shadow)}.theme-card-three_d .theme-mini-cards i{transform:rotateX(calc(var(--theme-perspective) * -1));box-shadow:0 7px 0 color-mix(in srgb,var(--line) 70%,transparent),var(--shadow)}.theme-builder-form details{border:1px solid var(--line);border-radius:var(--theme-radius);padding:0 16px}.theme-builder-form summary{cursor:pointer;padding:14px 0;font-weight:700}.theme-builder-form details>div{padding:0 0 18px}.theme-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.theme-color-field{display:grid;grid-template-columns:56px 1fr;gap:8px}.theme-color-field input[type=color]{height:43px;padding:3px}.theme-builder-form output{color:var(--accent);font-size:10px;float:left}.theme-builder-form input[type=range]{padding:0}.theme-check{align-content:end}.theme-toggle-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(max-width:1050px){.theme-studio-shell{grid-template-columns:1fr}.theme-library{position:static}.theme-library-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.theme-library-list,.theme-fields-grid,.theme-toggle-grid{grid-template-columns:1fr}.theme-mini-app{height:210px}}
