/* Cream glass controls share the hero's color and type tokens. */
.atlas-theme .control-panel {
    padding: 30px 24px;
    color: var(--studio-ink);
    background: var(--studio-gradient);
    font-family: var(--studio-font);
    font-size: var(--studio-body);
    line-height: 1.65;
}
.atlas-theme .control-panel :is(#design-form, #checkout-form).glass-panel {
    padding: 24px;
    border: 1px solid #fffdfbd9;
    border-radius: 28px;
    background: linear-gradient(145deg, #fffefa9c 0%, #fffaf343 48%, #fffef87a 100%);
    box-shadow: 0 18px 48px #41473112, 0 3px 10px #41473108, inset 0 1px 0 #ffffff, inset 0 -1px 0 #ffffff66;
    backdrop-filter: blur(28px) saturate(135%);
    -webkit-backdrop-filter: blur(28px) saturate(135%);
    color: var(--studio-ink);
    font: 400 var(--studio-body)/1.65 var(--studio-font);
}
.atlas-theme #design-form .editorial-intro { margin: 0 0 20px; }
.atlas-theme .control-panel .editorial-kicker {
    padding-bottom: 12px;
    border-color: #283b3620;
    color: var(--studio-muted);
    font: 500 var(--studio-caption)/1.5 var(--studio-font);
    letter-spacing: .12em;
}
.atlas-theme .control-panel .editorial-intro h2 {
    margin: 16px 0 8px;
    color: var(--studio-ink);
    font: 400 var(--studio-heading)/1.2 var(--studio-serif);
    letter-spacing: -.025em;
}
.atlas-theme #design-form .editorial-intro p,
.atlas-theme .control-panel .editorial-intro p {
    display: block;
    margin: 0;
    color: var(--studio-muted);
    font: 400 var(--studio-body)/1.65 var(--studio-font);
}
.atlas-theme .control-panel .worktable-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid #ffffffaa;
    border-radius: 20px;
    background: #ffffff45;
    box-shadow: inset 0 1px 0 #ffffffb3, 0 3px 12px #283b3608;
}
.atlas-theme .control-panel .worktable-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 7px 3px;
    border: 0;
    border-radius: 15px;
    color: var(--studio-muted);
    background: transparent;
    box-shadow: none;
    font: 500 var(--studio-control)/1.3 var(--studio-font);
    white-space: normal;
    transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.atlas-theme .control-panel .worktable-tab.is-active {
    background: var(--studio-ink);
    color: #fffdf8;
    font-weight: 600;
    box-shadow: 0 3px 8px #283b3626, inset 0 1px 0 #ffffff26;
}
.atlas-theme .control-panel .worktable-tab:not(.is-active):hover { background: #ffffff80; color: var(--studio-ink); }
.atlas-theme .control-panel .guide-heading { margin: 24px 0 0; }
.atlas-theme .control-panel .guide-step-number {
    margin-bottom: 0;
    color: var(--studio-muted);
    font: 500 var(--studio-caption)/1.5 var(--studio-font);
    letter-spacing: .14em;
}
.atlas-theme .control-panel .worktable-panels { padding-top: 18px; }
.atlas-theme .control-panel :is(#design-form, #checkout-form) :is(.control-group > label, .slider-group > label, .toggles-section h3, .poster-palettes legend, .section-title) {
    color: var(--studio-ink);
    font: 500 12px/1.5 var(--studio-font);
    letter-spacing: 0;
    text-transform: none;
}
.atlas-theme :is(#design-form, #checkout-form) .control-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.atlas-theme :is(#design-form, #checkout-form) .control-group select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #ffffffd9;
    border-radius: 15px;
    background: #fffdf875;
    box-shadow: inset 0 1px 2px #283b3609, 0 1px 0 #ffffff8c;
    color: var(--studio-ink);
    font: 400 var(--studio-body)/1.5 var(--studio-font);
}
.atlas-theme .control-panel input::placeholder { color: #768077; opacity: 1; }
.atlas-theme .control-panel :is(.field-hint, .field-status, .slider-hint, .location-attribution, .address-help, .option-price) {
    color: var(--studio-muted);
    font-family: var(--studio-font);
    font-size: var(--studio-control);
    line-height: 1.65;
}
.atlas-theme .control-panel .field-status.error { color: #8d3f35; }
.atlas-theme .control-panel :is(.selected-location-name, .selected-location-summary) { color: var(--studio-ink); font: 400 var(--studio-body)/1.65 var(--studio-font); }
.atlas-theme .control-panel :is(.selected-location-status, .selected-location .coords) { color: var(--studio-muted); font: 400 var(--studio-control)/1.65 var(--studio-font); }
.atlas-theme .control-panel .selected-location-summary { padding: 10px 12px; border: 1px solid #ffffffb3; border-radius: 14px; background: #fffdf84d; }
.atlas-theme #design-form .story-toggle-button { border: 1px solid #ffffffd9; border-right: 0; border-radius: 15px 0 0 15px; background: #fffdf88c; }
.atlas-theme #design-form .story-toggle-text { color: var(--studio-ink); font: 500 var(--studio-control)/1.4 var(--studio-font); letter-spacing: 0; text-transform: none; }
.atlas-theme #design-form .story-input-inline #story-input { border-left: 0; border-radius: 0 15px 15px 0; }
.atlas-theme #design-form .story-input-inline.story-disabled #story-input { background: #fffdf84d; color: var(--studio-muted); }
.atlas-theme .control-panel .autocomplete-results { border: 1px solid #ffffffcc; border-radius: 15px; background: #fff9e9f5; box-shadow: 0 12px 30px #283b3620; }
.atlas-theme .control-panel .autocomplete-item .city-name { color: var(--studio-ink); }
.atlas-theme .control-panel .autocomplete-item .city-details { color: var(--studio-muted); }
.atlas-theme .control-panel .autocomplete-item:hover { background: #e7ede45c; }
.atlas-theme .control-panel .palette-options { gap: 10px; }
.atlas-theme .control-panel .palette-option {
    padding: 8px;
    border: 1px solid #ffffffb3;
    border-radius: 15px;
    background: #fffdf84d;
    color: var(--studio-ink);
    box-shadow: 0 2px 6px #283b3605;
    font: 500 var(--studio-control)/1.4 var(--studio-font);
    transition: border-color 160ms, background 160ms, box-shadow 160ms;
}
.atlas-theme .control-panel .palette-option:has(input:checked) {
    border-color: #405f4f99;
    background: #fffdf8c9;
    box-shadow: inset 0 0 0 1px #405f4f55, 0 3px 10px #283b360c;
}
.atlas-theme .control-panel .palette-preview { border-radius: 8px; }
.atlas-theme .control-panel .palette-option small { color: var(--studio-muted); font: 400 var(--studio-caption)/1.5 var(--studio-font); }
.atlas-theme .control-panel #design-form .settings-sheet .toggle-label {
    min-height: 44px;
    color: var(--studio-ink);
    font: 400 var(--studio-body)/1.5 var(--studio-font);
}
.atlas-theme .control-panel .toggle-group { padding: 0; border-color: #283b3617; }
.atlas-theme .control-panel #design-form .settings-sheet .toggle-group .field-hint { margin: 0 0 6px; }
.atlas-theme .control-panel .toggles-section h3 { margin-bottom: 8px; }
.atlas-theme .control-panel .toggle-slider { background: #283b3629; border: 1px solid #ffffff8c; }
.atlas-theme .control-panel .toggle-switch input:checked + .toggle-slider { background: #3d604f; }
.atlas-theme .control-panel input[type="range"] { accent-color: #3d604f; }
.atlas-theme .control-panel .guide-actions { gap: 10px; margin-top: 22px; }
.atlas-theme .control-panel :is(.guide-actions button, .buy-btn, .pay-btn) {
    min-height: 48px;
    border: 1px solid #365547;
    border-radius: 24px;
    font: 500 var(--studio-body)/1.4 var(--studio-font);
}
.atlas-theme .control-panel :is(.guide-next, .buy-btn, .pay-btn) { color: #fffdf5; background: #2d443a; box-shadow: 0 4px 12px #283b3617, inset 0 1px 0 #ffffff20; }
.atlas-theme .control-panel .guide-previous { color: var(--studio-ink); background: #fffdf866; border-color: #ffffffb3; }
.atlas-theme .control-panel .guide-next { min-width: 120px; }
.atlas-theme .control-panel .store-legal-links { border-color: #283b3620; font-family: var(--studio-font); }
.atlas-theme .control-panel .store-legal-links a { color: var(--studio-muted); }
.atlas-theme #checkout-form .section-title { color: var(--studio-ink); }
.atlas-theme #checkout-form .radio-options { gap: 8px; border: 0; }
.atlas-theme #checkout-form .radio-option { padding: 12px; border: 1px solid #ffffff99; border-radius: 15px; background: #fffdf84d; }
.atlas-theme #checkout-form .radio-option:has(input:checked) { border-color: #405f4f99; background: #fffdf8b3; }
.atlas-theme .control-panel :is(input, select, button, .palette-option):focus-visible,
.atlas-theme .control-panel .palette-option:has(input:focus-visible) { outline: 2px solid #426453; outline-offset: 3px; }
@media (hover: hover) {
    .atlas-theme .control-panel .palette-option:hover,
    .atlas-theme .control-panel .worktable-tab:not(.is-active):hover { background-color: #fffdf88c; }
    .atlas-theme .control-panel :is(.guide-next, .buy-btn, .pay-btn):hover { background: #21392e; }
}
@media (max-width: 900px) {
    /* Size the preview first; worktable.js measures its bottom for the drawer. */
    .atlas-theme.mobile-drawer-ready .poster-container {
        padding: 12px 0 96px;
        align-items: center;
    }
    .atlas-theme.mobile-drawer-ready .poster-container .poster {
        width: min(90vw, calc((100dvh - 224px) * .75));
        height: auto;
        max-width: none;
        max-height: none;
        margin: 0 auto;
        flex: none;
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .poster-container {
        height: var(--mobile-preview-height);
        padding: 12px 0;
    }
    .atlas-theme.mobile-drawer-ready .control-panel {
        padding: 0 12px calc(16px + env(safe-area-inset-bottom));
        border: 1px solid #ffffffb3;
        border-bottom: 0;
        border-radius: 28px 28px 0 0;
        background: radial-gradient(ellipse at 75% 28%, #fff9e9f0 0%, #f5eedfe8 42%, #e8e1d3f0 100%);
        backdrop-filter: blur(28px) saturate(135%);
        -webkit-backdrop-filter: blur(28px) saturate(135%);
        box-shadow: 0 -16px 48px #283b361a, inset 0 1px 0 #ffffff;
    }
    .atlas-theme.mobile-drawer-ready:not(.mobile-side-open) .control-panel { transform: translateY(100%); visibility: hidden; }
    .atlas-theme.mobile-drawer-ready .control-panel :is(#design-form, #checkout-form).glass-panel { padding: 16px 12px 20px; border-radius: 22px; }
    .atlas-theme.mobile-drawer-ready .mobile-side-close-button {
        margin: 0;
        padding: 12px;
        min-height: 48px;
        border: 0;
        color: var(--studio-ink);
        background: #fff9e9eb;
        border-radius: 24px 24px 12px 12px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        font: 500 12px/1.5 var(--studio-font);
    }
    .atlas-theme.mobile-drawer-ready .mobile-side-open-button {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        min-height: 72px;
        padding: 14px 18px;
        border: 1px solid #ffffffd9;
        border-radius: 25px;
        color: var(--studio-ink);
        background: linear-gradient(135deg, #fff9e9e8, #f5eedfd9);
        box-shadow: 0 8px 28px #283b3621, inset 0 1px 0 #ffffff;
        backdrop-filter: blur(24px) saturate(135%);
        -webkit-backdrop-filter: blur(24px) saturate(135%);
    }
    .atlas-theme .mobile-drawer-label { font: 400 var(--studio-heading)/1.2 var(--studio-serif); }
    .atlas-theme .mobile-drawer-label small { margin-top: 4px; color: var(--studio-muted); font: 400 var(--studio-control)/1.5 var(--studio-font); }
    .atlas-theme .mobile-drawer-arrow { color: var(--studio-ink); }
    .atlas-theme .mobile-drawer-grip { background: #68706866; }
    .atlas-theme.mobile-drawer-ready .control-panel { font-size: 11px; line-height: 1.4; }
    .atlas-theme.mobile-drawer-ready .control-panel :is(#design-form, #checkout-form).glass-panel { padding: 10px 12px 16px; font-size: 11px; line-height: 1.4; }
    .atlas-theme.mobile-drawer-ready .mobile-side-close-button {
        height: 28px; min-height: 28px; padding: 0; margin-bottom: 0;
        border-radius: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .atlas-theme.mobile-drawer-ready .mobile-side-close-button .mobile-drawer-grip { top: 12px; }
    .atlas-theme .control-panel .guide-heading { margin-top: 10px; }
    .atlas-theme .control-panel .guide-step-number { font-size: 9px; line-height: 1.3; }
    .atlas-theme .control-panel .worktable-panels { padding-top: 10px; }
    .atlas-theme .control-panel .worktable-tab { font-size: 10px; }
    .atlas-theme .control-panel :is(#design-form, #checkout-form) .control-group { margin-bottom: 12px; }
    .atlas-theme .control-panel :is(#design-form, #checkout-form) :is(.control-group > label, .slider-group > label, .toggles-section h3, .poster-palettes legend, .section-title) { font-size: 11px; line-height: 1.4; margin-bottom: 5px; }
    .atlas-theme .control-panel :is(.field-hint, .field-status, .slider-hint, .location-attribution, .address-help, .option-price, .selected-location-status, .selected-location .coords) { font-size: 10px; line-height: 1.4; }
    .atlas-theme .control-panel :is(.selected-location-name, .selected-location-summary) { font-size: 11px; line-height: 1.4; }
    .atlas-theme .control-panel .selected-location-summary { padding: 6px 10px; }
    .atlas-theme .control-panel .autocomplete-item { padding: 8px 10px; min-height: 44px; }
    .atlas-theme .control-panel .autocomplete-item .city-name { font-size: 12px; }
    .atlas-theme .control-panel .autocomplete-item .city-details { font-size: 10px; }
    .atlas-theme .control-panel #design-form .settings-sheet .toggle-label { font-size: 11px; }
    .atlas-theme .control-panel .guide-actions { margin-top: 14px; }
    /* Keep field text in proportion to the compact mobile editor. */
    .atlas-theme :is(#design-form, #checkout-form) .control-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    .atlas-theme :is(#design-form, #checkout-form) .control-group select { font-size: 13px; line-height: 1.4; min-height: 40px; padding: 8px 10px; }
    .atlas-theme .control-panel .palette-options { gap: 8px; }
    .atlas-theme .control-panel .palette-option { padding: 6px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .atlas-theme .control-panel :is(#design-form, #checkout-form).glass-panel { background: #fff9e9; }
}
@media (max-width: 360px) {
    .atlas-theme #design-form .date-time-group { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
}
@media (prefers-reduced-transparency: reduce) {
    .atlas-theme .control-panel :is(#design-form, #checkout-form).glass-panel { background: #fff9e9; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    .atlas-theme .control-panel :is(.palette-option, .worktable-tab) { transition: none; }
}
