/* Versa Theme Builder — page-specific interface styles. */
[data-theme-builder]{scroll-margin-top:5rem}
.theme-builder-guide{padding:1rem;border:1px solid var(--versa-border);border-radius:var(--versa-radius);background:var(--versa-panel);box-shadow:var(--versa-shadow-sm)}
.theme-builder-guide>span{display:block;margin-bottom:.65rem;color:var(--versa-ink);font-size:.8rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.theme-builder-guide ol{display:grid;grid-template-columns:repeat(5,1fr);gap:.45rem;margin:0;padding:0;list-style:none}
.theme-builder-guide button{display:flex;width:100%;min-height:3rem;align-items:center;justify-content:center;gap:.35rem;padding:.5rem;border:1px solid var(--versa-border);border-radius:calc(var(--versa-button-radius) - 2px);background:var(--versa-soft);color:var(--versa-text);font-size:.8rem;font-weight:700;transition:color var(--versa-transition),background var(--versa-transition),border-color var(--versa-transition),transform var(--versa-transition)}
.theme-builder-guide button b{display:grid;width:1.35rem;height:1.35rem;place-items:center;border-radius:50%;background:var(--versa-primary-soft);color:var(--versa-primary-strong);font-size:.7rem}
.theme-builder-guide button:is(:hover,:focus-visible){transform:translateY(-2px);border-color:var(--versa-primary);background:var(--versa-primary-soft);color:var(--versa-primary-strong)}
.theme-mode-picker{padding:0;border:0}
.theme-mode-options{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;padding:.4rem;border:1px solid var(--versa-border);border-radius:var(--versa-button-radius);background:var(--versa-panel);box-shadow:var(--versa-shadow-sm)}
.theme-mode-options button{display:flex;min-height:3rem;align-items:center;justify-content:center;gap:.5rem;padding:.55rem .75rem;border:1px solid transparent;border-radius:calc(var(--versa-button-radius) - 3px);background:transparent;color:var(--versa-muted);font-weight:700;transition:color var(--versa-transition),background var(--versa-transition),border-color var(--versa-transition),transform var(--versa-transition)}
.theme-mode-options button:is(:hover,:focus-visible){color:var(--versa-primary);border-color:var(--versa-border-strong)}
.theme-mode-options button.is-active{background:var(--versa-primary);color:var(--versa-on-primary);border-color:var(--versa-primary);box-shadow:var(--versa-shadow-sm)}
.theme-builder-controls{border-color:var(--versa-border);box-shadow:var(--versa-shadow-sm)}
.theme-builder-controls .form-control-color{height:2.75rem;padding:.3rem;cursor:pointer}
.theme-builder-groups{border-top:1px solid var(--versa-border)}
.theme-builder-groups details{border-bottom:1px solid var(--versa-border)}
.theme-builder-groups summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;font-weight:700;cursor:pointer;list-style:none;color:var(--versa-ink)}
.theme-builder-groups summary::-webkit-details-marker{display:none}
.theme-builder-groups summary::after{content:"+";font-size:1.25rem;font-weight:500;color:var(--versa-primary)}
.theme-builder-groups details[open] summary::after{content:"−"}
.theme-builder-group{padding:0 0 1.25rem}
.theme-builder-group>p:first-child{margin-top:-.25rem}
.theme-builder-group .form-label{font-size:.875rem;font-weight:600}
.theme-builder-group output{float:right;color:var(--versa-muted);font-weight:500}
.theme-builder-preview{overflow:hidden;isolation:isolate;border:1px solid var(--versa-border);border-radius:var(--versa-radius-lg);background:var(--versa-page);box-shadow:var(--versa-shadow)}
.theme-preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem}
.theme-preview-toolbar>div{display:flex;gap:.35rem;padding:.3rem;border:1px solid var(--versa-border);border-radius:var(--versa-button-radius);background:var(--versa-panel)}
.theme-preview-toolbar button{display:grid;min-height:2.4rem;place-items:center;padding:.4rem .7rem;border:1px solid transparent;border-radius:calc(var(--versa-button-radius) - 3px);background:transparent;color:var(--versa-muted);font-size:.8rem;font-weight:700}
.theme-preview-toolbar button:is(:hover,:focus-visible){border-color:var(--versa-border-strong);color:var(--versa-primary)}
.theme-preview-toolbar button.is-active{border-color:var(--versa-primary);background:var(--versa-primary);color:var(--versa-on-primary)}
.theme-preview-stage{margin-inline:auto;transition:max-width var(--versa-transition)}
.theme-preview-stage[data-preview-width-stage="desktop"]{max-width:100%}.theme-preview-stage[data-preview-width-stage="tablet"]{max-width:760px}.theme-preview-stage[data-preview-width-stage="mobile"]{max-width:390px}
.theme-preview-panel[hidden]{display:none!important}.theme-preview-panel{animation:theme-preview-in var(--versa-transition) both}
@keyframes theme-preview-in{from{opacity:.25;transform:translateY(8px)}to{opacity:1;transform:none}}
.theme-preview-hero{padding:clamp(2rem,5vw,4rem);background:var(--versa-gradient-hero);color:var(--versa-on-dark)}
.theme-preview-hero :is(h3,p){color:inherit}
.theme-preview-hero h3{max-width:12ch;margin:.8rem 0;font-family:var(--versa-heading-font-family);font-size:clamp(2rem,5vw,3.5rem);font-weight:var(--versa-heading-weight);line-height:1}
.theme-preview-hero p{max-width:36rem;font-size:1.1rem}
.theme-preview-hero>.badge{background:var(--versa-primary-soft);color:var(--versa-primary-strong)}
.theme-preview-body{position:relative;z-index:1;padding:clamp(1.25rem,4vw,2rem);border-radius:0 0 calc(var(--versa-radius-lg) - 1px) calc(var(--versa-radius-lg) - 1px);background:var(--versa-page);background-clip:padding-box}
.theme-preview-card{height:100%;padding:1.5rem;border:1px solid var(--versa-border);border-radius:var(--versa-radius);background:var(--versa-panel);box-shadow:var(--versa-shadow-sm);color:var(--versa-text);transition:transform var(--versa-transition),box-shadow var(--versa-transition)}
.theme-preview-card:hover{transform:translateY(-3px);box-shadow:var(--versa-shadow)}
.theme-preview-card--soft{background:var(--versa-soft)}
.theme-preview-card i{color:var(--versa-primary);font-size:1.75rem}
.theme-preview-card h4{margin:.75rem 0 .4rem;color:var(--versa-ink);font-family:var(--versa-heading-font-family);font-weight:var(--versa-heading-weight)}
.theme-preview-card p{color:var(--versa-muted)}
.theme-preview-card a{color:var(--versa-primary);font-weight:700}
.theme-preview-ring{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.7fr);align-items:center;gap:clamp(1.5rem,4vw,3rem);padding:clamp(1.25rem,4vw,2.5rem);border-radius:var(--versa-radius);background:var(--versa-gradient-page)}
.theme-preview-ring h3,.theme-preview-form h3{margin:.4rem 0 .75rem;color:var(--versa-ink);font-family:var(--versa-heading-font-family);font-size:clamp(1.6rem,4vw,2.6rem);font-weight:var(--versa-heading-weight);letter-spacing:var(--versa-heading-tracking);line-height:1.05}
.theme-preview-cutout{width:min(100%,280px)}
.theme-preview-form{padding:clamp(.5rem,3vw,1.5rem)}
.theme-preview-form textarea{resize:none}
.theme-preview-panel table{margin:1rem 0 0;border-color:var(--versa-border)}
.theme-preview-panel table th{background:var(--versa-soft);color:var(--versa-ink)}
.theme-preview-panel table th span{float:right;color:var(--versa-muted);font-size:.75em}
.theme-preview-app{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.25rem;border-radius:var(--versa-radius);background:var(--versa-app-background);color:var(--versa-on-dark)}
.theme-preview-app span,.theme-preview-app strong{display:block;color:inherit}
.theme-preview-app span{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;opacity:.8}
.theme-preview-app button{min-height:2.75rem;padding:.6rem 1.15rem;border:0;border-radius:var(--versa-button-radius);background:var(--versa-app-action);color:var(--versa-app-ink);font-weight:700}
.theme-contrast-list{display:grid;gap:.65rem}
.theme-contrast-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.75rem;padding:.75rem;border:1px solid var(--versa-border);border-radius:var(--versa-radius-sm)}
.theme-contrast-swatch{display:flex;overflow:hidden;width:3.5rem;height:1.75rem;border:1px solid var(--versa-border);border-radius:999px}
.theme-contrast-swatch span{flex:1}
.theme-contrast-item strong,.theme-contrast-item small{display:block}
.theme-contrast-item small{color:var(--versa-muted)}
.theme-contrast-result{font-size:.78rem}
.theme-code{max-height:34rem;overflow:auto;border-radius:var(--versa-radius);background:var(--versa-dark);color:var(--versa-on-dark)}
.theme-code pre{padding:1.5rem;color:inherit;font-size:.8rem;line-height:1.65;white-space:pre-wrap}
.theme-preset-card{position:relative;width:100%;height:100%;padding:1.5rem;border:1px solid var(--versa-border);border-radius:var(--versa-radius);background:var(--versa-panel);color:var(--versa-text);text-align:left;box-shadow:var(--versa-shadow-sm);transition:transform var(--versa-transition),box-shadow var(--versa-transition),border-color var(--versa-transition)}
.theme-preset-card:is(:hover,:focus-visible){transform:translateY(-3px);border-color:var(--versa-primary);box-shadow:var(--versa-shadow)}
.theme-preset-card.is-active{border-color:var(--versa-primary);box-shadow:0 0 0 3px rgba(var(--versa-primary-rgb),.16),var(--versa-shadow-sm)}
.theme-preset-card .theme-preset-check{position:absolute;top:1rem;right:1rem;display:grid;width:1.75rem;height:1.75rem;place-items:center;border-radius:50%;background:var(--versa-primary);color:var(--versa-on-primary);opacity:0;transform:scale(.75);transition:opacity var(--versa-transition),transform var(--versa-transition)}
.theme-preset-card.is-active .theme-preset-check{opacity:1;transform:scale(1)}
.theme-preset-card .theme-preset-label{border:1px solid var(--versa-border-strong);background:var(--versa-soft-strong);color:var(--versa-ink)}
.theme-preset-card code{overflow-wrap:anywhere}
@media(min-width:1200px){.theme-builder-preview-column{position:sticky;top:6rem;align-self:start}.theme-builder-preview{position:relative;top:auto}}
@media(max-width:767.98px){.theme-builder-guide ol{grid-template-columns:repeat(2,1fr)}.theme-builder-guide li:last-child{grid-column:1/-1}.theme-preview-toolbar{align-items:stretch;flex-direction:column}.theme-preview-toolbar>div:first-child{overflow-x:auto}.theme-preview-toolbar>div:first-child button{flex:1}.theme-preview-toolbar>div:last-child{align-self:flex-end}.theme-preview-ring{grid-template-columns:1fr}.theme-preview-cutout{width:min(72%,260px);margin:auto}}
@media(max-width:575.98px){.theme-mode-options button{flex-direction:column;gap:.15rem;font-size:.8rem}.theme-preview-app{align-items:flex-start;flex-direction:column}.theme-preview-app button{width:100%}.theme-contrast-item{grid-template-columns:auto 1fr}.theme-contrast-result{grid-column:2}.theme-preview-stage[data-preview-width-stage]{max-width:100%}.theme-preview-toolbar>div:first-child button{padding:.4rem .55rem;font-size:.72rem}}
@media(prefers-reduced-motion:reduce){.theme-preview-stage,.theme-preview-panel,.theme-builder-guide button{transition:none;animation:none}}
