/* Web Template Creator - app theme and pages. Built on the same UI library the generated templates use. */
@layer theme {
  :root, [data-ui-theme="light"] {
    --wt-primary: #5b4cf0; --wt-primary-rgb: 91, 76, 240; --wt-secondary: #c026d3; --wt-secondary-rgb: 192, 38, 211;
    --wt-accent: #f59e0b; --wt-accent-rgb: 245, 158, 11; --wt-on-primary: #fff; --wt-link: #4a3bd6; --wt-link-rgb: 74, 59, 214;
    --wt-bg: #f6f6fb; --wt-surface: #ffffff; --wt-surface-2: #f1f0fa; --wt-text: #1d1d2c; --wt-muted: #5d5f73; --wt-border: #e3e2ef;
    --wt-radius: .55rem; --wt-radius-lg: 1rem;
    --wt-font-heading: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --wt-font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --wt-shadow: 0 1px 2px rgba(20, 18, 60, .06), 0 8px 24px rgba(20, 18, 60, .08);
    --wt-shadow-lg: 0 2px 6px rgba(20, 18, 60, .08), 0 24px 48px rgba(20, 18, 60, .14);
    --wt-gradient: linear-gradient(135deg, #5b4cf0, #c026d3);
  }
  [data-ui-theme="dark"] {
    --wt-bg: #0e0d18; --wt-surface: #171627; --wt-surface-2: #1e1d31; --wt-text: #e7e6f3; --wt-muted: #a2a1b8; --wt-border: #2c2b42;
    --wt-link: #a59cff; --wt-link-rgb: 165, 156, 255;
    --wt-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --wt-shadow-lg: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 48px rgba(0, 0, 0, .5);
  }
}

.app-body { min-height: 100vh; display: flex; flex-direction: column; }
.app-body > main { flex: 1; }
.app-hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  background: radial-gradient(48rem 26rem at 10% -10%, rgba(var(--wt-primary-rgb), .18), transparent 70%), radial-gradient(40rem 22rem at 95% 0%, rgba(var(--wt-secondary-rgb), .14), transparent 70%); }
.app-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: -.03em; }
.app-mockup { border-radius: 1.1rem; overflow: hidden; border: 1px solid var(--wt-border); box-shadow: var(--wt-shadow-lg); background: var(--wt-surface); }
.app-mockup-bar { display: flex; gap: .4rem; padding: .6rem .8rem; border-bottom: 1px solid var(--wt-border); background: var(--wt-surface-2); }
.app-mockup-bar i { width: .65rem; height: .65rem; border-radius: 50%; background: #e2e2ea; display: inline-block; }
.app-tile { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: .7rem; color: #fff; font-weight: 700; font-size: .85rem; text-align: center; padding: .5rem; }
.app-swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--wt-surface); box-shadow: 0 0 0 1px var(--wt-border); }
.app-swatches { display: inline-flex; }
.app-swatches .app-swatch + .app-swatch { margin-inline-start: -.35rem; }

/* studio */
.studio { display: grid; gap: 1.5rem; padding-block: 1.5rem 4rem; }
@media (min-width: 1200px) { .studio { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; } }
.studio-step { background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius-lg); margin-bottom: 1.25rem; scroll-margin-top: 5rem; }
.studio-step > header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--wt-border); }
.studio-step > header h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .6rem; }
.studio-step > header .num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-size: .8rem; color: #fff; background: var(--wt-gradient); }
.studio-step > header p { margin: 0; color: var(--wt-muted); font-size: .875rem; flex-basis: 100%; }
.studio-step > .body { padding: 1.25rem; }
.studio-side { position: sticky; top: 5rem; }
.studio-side .wt-panel { height: auto; }

.opt-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.opt-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.opt-grid.is-small { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label { display: flex; flex-direction: column; gap: .3rem; height: 100%; padding: .75rem .85rem; cursor: pointer; border: 1.5px solid var(--wt-border); border-radius: .75rem;
  background: var(--wt-surface); transition: border-color .15s, box-shadow .15s, background .15s; font-size: .875rem; }
.opt label:hover { border-color: rgba(var(--wt-primary-rgb), .5); }
.opt input:checked + label { border-color: var(--wt-primary); background: rgba(var(--wt-primary-rgb), .06); box-shadow: 0 0 0 3px rgba(var(--wt-primary-rgb), .15); }
.opt input:focus-visible + label { outline: 2px solid var(--wt-primary); outline-offset: 2px; }
.opt label strong { font-size: .925rem; display: flex; align-items: center; gap: .45rem; }
.opt label small { color: var(--wt-muted); line-height: 1.35; }
.opt .bi { font-size: 1.1rem; color: var(--wt-primary); }
.opt.is-random label { border-style: dashed; }
.opt-palette .bar { display: flex; height: 1.6rem; border-radius: .45rem; overflow: hidden; }
.opt-palette .bar span { flex: 1; }
.fx-group { border: 1px solid var(--wt-border); border-radius: .8rem; padding: .85rem 1rem; margin-bottom: .75rem; }
.fx-group h3 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.fx-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.fx-chips .chip input { position: absolute; opacity: 0; pointer-events: none; }
.fx-chips .chip { position: relative; }
.fx-chips .chip label { display: inline-block; padding: .3rem .7rem; font-size: .8rem; border: 1px solid var(--wt-border); border-radius: 50rem; cursor: pointer; background: var(--wt-surface); }
.fx-chips .chip input:checked + label { color: #fff; background: var(--wt-primary); border-color: var(--wt-primary); }
.fx-chips .chip input:focus-visible + label { outline: 2px solid var(--wt-primary); outline-offset: 2px; }
.fx-chips.is-off { opacity: .45; pointer-events: none; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--wt-border); font-size: .875rem; }
.summary-row span:first-child { color: var(--wt-muted); }
.summary-row span:last-child { font-weight: 600; text-align: end; }
.studio-nav a { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: .5rem; color: var(--wt-text); text-decoration: none; font-size: .875rem; }
.studio-nav a:hover { background: rgba(var(--wt-primary-rgb), .07); }

/* batch results */
.result-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; background: var(--wt-surface); border: 1px solid var(--wt-border); border-radius: var(--wt-radius-lg); transition: box-shadow .2s, transform .2s; }
.result-card:hover { box-shadow: var(--wt-shadow); transform: translateY(-2px); }
.result-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.result-card .body { padding: 1rem 1.15rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.result-meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.preview-frame { width: 100%; height: 70vh; border: 0; border-radius: var(--wt-radius-lg); background: #fff; }
.app-footer { padding: 1.75rem 0; border-top: 1px solid var(--wt-border); color: var(--wt-muted); font-size: .875rem; background: var(--wt-surface); }
