/*
 * Atlas edition
 * A sharper, editorial alternative that keeps the original page untouched.
 */

.atlas-theme {
    --bg-dark: #dedbd4;
    --bg-poster: #08121e;
    --bg-center: #0b1724;
    --bg-darker: #f2f0eb;
    --star-color: #f2eee2;
    --star-bright: #fffaf0;
    --star-dim: #aab6c1;
    --constellation-line: rgba(206, 170, 101, 0.68);
    --grid-line: rgba(190, 185, 170, 0.18);
    --circle-border: rgba(208, 181, 127, 0.52);
    --text-primary: #16191d;
    --text-secondary: #686762;
    --accent-gold: #8e6b31;
    --glass-bg: transparent;
    --glass-border: #d5d0c6;
    --input-bg: #fbfaf7;
    --input-border: #cbc6bb;
    --frame-border: transparent;
    background: #dedbd4;
    color: #16191d;
    -webkit-font-smoothing: antialiased;
}

.atlas-theme .app-container {
    background: #dedbd4;
}

.atlas-theme .poster-container {
    padding: 28px clamp(28px, 4vw, 72px);
    background: #11151b;
}

.atlas-theme .poster {
    max-width: 620px;
    background: #08121e;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.atlas-theme .poster::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 42%);
}

.atlas-theme .poster::after {
    content: "";
    position: absolute;
    z-index: 4;
    inset: -9px;
    border: 9px solid #2c1a11;
    border-image: linear-gradient(
        135deg,
        #4b2e1d 0%,
        #2d1a11 27%,
        #1a0f0a 48%,
        #3b2417 72%,
        #21130d 100%
    ) 1;
    box-shadow:
        0 0 0 1px rgba(12, 7, 4, 0.82),
        inset 0 0 0 1px rgba(205, 156, 102, 0.16),
        0 10px 28px rgba(35, 24, 16, 0.24);
    opacity: var(--room-progress, 0);
    pointer-events: none;
}

.atlas-theme .poster-frame {
    inset: 4.6%;
    border: 0;
    padding: 0 5.2% 4.4%;
}

.atlas-theme:not(.show-poster-header) .atlas-edition {
    visibility: hidden;
}

.atlas-edition {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(206, 170, 101, 0.34);
    color: rgba(216, 191, 143, 0.72);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: clamp(5.5px, 0.62vw, 7px);
    font-weight: 400;
    letter-spacing: 0.15em;
}

.atlas-theme .starmap-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    margin-top: 1.8%;
}

.atlas-theme .starmap-circle {
    width: 92%;
    max-height: 100%;
    border: 1px solid rgba(206, 170, 101, 0.55);
    background: #0a1724;
    transform: translateY(-2%);
    box-shadow: 0 0 0 7px rgba(115, 143, 166, 0.035);
    perspective: 1100px;
}

.atlas-theme #starmap {
    image-rendering: auto;
}

/* Location journey: pitch down from the sky to Earth, then look back up. */
.location-flip-stage,
.location-flip-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.location-flip-stage {
    transform-style: preserve-3d;
}

.location-flip-face {
    overflow: hidden;
    will-change: transform, opacity;
}

.location-star-face {
    background: #0a1724;
}

.location-earth-face {
    display: none;
}

.atlas-compass {
    transition: opacity 700ms ease, translate 900ms cubic-bezier(0.22, 0.7, 0.25, 1);
}

.atlas-theme .poster.location-journey-active .atlas-edition,
.atlas-theme .poster.location-journey-active .atlas-rule,
.atlas-theme .poster.location-journey-active .personal-message,
.atlas-theme .poster.location-journey-active .location-info,
.atlas-theme .poster.location-journey-active .magnitude-legend,
.atlas-theme .poster.location-journey-active .atlas-compass {
    opacity: 0;
    translate: 0 10px;
}

.location-globe-reticle {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 17%;
    aspect-ratio: 1;
    border: 1px solid rgba(226, 195, 137, 0.72);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.7);
    transition: opacity 260ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.location-globe-reticle::before,
.location-globe-reticle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(226, 195, 137, 0.7);
    transform: translate(-50%, -50%);
}

.location-globe-reticle::before {
    width: 142%;
    height: 1px;
}

.location-globe-reticle::after {
    width: 1px;
    height: 142%;
}

.location-globe-reticle i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f5dda5;
    box-shadow: 0 0 9px rgba(245, 221, 165, 0.8);
    transform: translate(-50%, -50%);
}

.location-journey-located .location-globe-reticle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.atlas-compass {
    position: absolute;
    z-index: 3;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.atlas-theme.show-compass .atlas-compass {
    opacity: 1;
}

.atlas-compass-axis {
    position: absolute;
    top: 7%;
    bottom: 7%;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        rgba(226, 194, 131, 0.9) 0,
        rgba(206, 170, 101, 0.28) 34%,
        rgba(206, 170, 101, 0.08) 50%,
        rgba(145, 174, 201, 0.18) 70%,
        rgba(145, 174, 201, 0.48) 100%
    );
}

.atlas-compass-axis::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 7px solid rgba(226, 194, 131, 0.95);
}

.atlas-compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid rgba(226, 194, 131, 0.75);
    background: rgba(10, 23, 36, 0.82);
}

.atlas-cardinal {
    position: absolute;
    color: rgba(226, 194, 131, 0.88);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: clamp(5px, 0.62vw, 7px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 3px #0a1724;
}

.atlas-cardinal-north {
    top: 2.5%;
    left: 50%;
    transform: translateX(-50%);
}

.atlas-cardinal-south {
    bottom: 2.5%;
    left: 50%;
    transform: translateX(-50%);
}

.atlas-cardinal-east {
    top: 50%;
    left: 2.5%;
    transform: translateY(-50%);
}

.atlas-cardinal-west {
    top: 50%;
    right: 2.5%;
    transform: translateY(-50%);
}

.atlas-rule {
    width: 34%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1%;
}

.atlas-rule span {
    height: 1px;
    flex: 1;
    background: rgba(206, 170, 101, 0.42);
}

.atlas-rule i {
    width: 3px;
    height: 3px;
    border: 1px solid rgba(206, 170, 101, 0.72);
    transform: rotate(45deg);
}

.atlas-theme .personal-message {
    padding: 2.1% 0 1.4%;
}

.atlas-theme .message-text {
    font-size: clamp(10px, 1.55vw, 14px);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.035em;
    color: #f1eadb;
}

.atlas-theme .location-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px 13px;
    padding-top: 1.2%;
}

.atlas-theme .info-location,
.atlas-theme .info-date,
.atlas-theme .info-coords {
    margin: 0;
    color: rgba(191, 204, 215, 0.78);
    font-size: clamp(5.8px, 0.72vw, 7px);
    line-height: 1.2;
    letter-spacing: 0.13em;
}

.atlas-theme .info-date::before,
.atlas-theme .info-coords::before {
    content: "·";
    margin-right: 13px;
    color: rgba(206, 170, 101, 0.72);
}

.atlas-theme .info-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.moon-phase-emblem {
    display: inline-flex;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    filter: drop-shadow(0 0 2px rgba(206, 170, 101, 0.12));
}

.moon-phase-emblem svg {
    display: block;
    width: 100%;
    height: 100%;
}

.magnitude-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 1.15%;
    color: rgba(169, 184, 196, 0.58);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: clamp(4.8px, 0.56vw, 5.8px);
    line-height: 1;
    letter-spacing: 0.09em;
}

.magnitude-legend-title {
    margin-right: 1px;
    color: rgba(206, 170, 101, 0.56);
    letter-spacing: 0.13em;
}

.magnitude-entry {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.magnitude-star {
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f2eee2;
    box-shadow: 0 0 3px rgba(242, 238, 226, 0.25);
}

.magnitude-star-bright {
    width: 5px;
    height: 5px;
}

.magnitude-star-medium {
    width: 3.5px;
    height: 3.5px;
    opacity: 0.82;
}

.magnitude-star-dim {
    width: 2px;
    height: 2px;
    opacity: 0.64;
}

.atlas-theme .control-panel {
    width: 390px;
    padding: 38px 32px 30px;
    gap: 28px;
    background: #f2f0eb;
    border: 0;
}

.atlas-panel-intro {
    flex: 0 0 auto;
}

.atlas-panel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 13px;
    border-bottom: 1px solid #cfcac0;
    color: #74716a;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.17em;
}

.atlas-panel-intro h1 {
    margin: 22px 0 12px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.55rem;
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -0.035em;
    color: #11151b;
}

.atlas-panel-intro p {
    max-width: 300px;
    color: #6c6962;
    font-size: 0.75rem;
    line-height: 1.6;
}

.atlas-theme .glass-panel {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.atlas-theme .control-group {
    margin-bottom: 16px;
}

.atlas-theme .control-group label,
.atlas-theme .toggles-section h3,
.atlas-theme .slider-group label,
.atlas-theme .section-title {
    color: #6d665a;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.atlas-theme .control-group input,
.atlas-theme .control-group select {
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #cbc6bb;
    border-radius: 2px;
    background-color: #fbfaf7;
    color: #171a1e;
    font-size: 0.82rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.atlas-theme .control-group input::placeholder {
    color: #99958d;
    font-style: normal;
}

.atlas-theme .control-group input:focus,
.atlas-theme .control-group select:focus {
    border-color: #7b6847;
    box-shadow: 0 0 0 2px rgba(123, 104, 71, 0.12);
}

.atlas-theme .control-group input[type="date"],
.atlas-theme .control-group input[type="time"] {
    color-scheme: light;
}

.atlas-theme .story-toggle-button {
    border-color: #cbc6bb;
    border-radius: 2px 0 0 2px;
    background: #e7e3db;
}

.atlas-theme .story-input-inline #story-input {
    border-radius: 0 2px 2px 0;
}

.atlas-theme .story-toggle-text,
.atlas-theme .selected-location .coords,
.atlas-theme .option-price,
.atlas-theme .terms-link {
    color: #80602b;
}

.atlas-theme .selected-location {
    margin-top: 8px;
}

.atlas-theme .selected-location-summary {
    padding: 9px 10px;
    border: 1px solid #d8d3c9;
    border-left: 2px solid #9c7b43;
    background: rgba(255, 255, 255, 0.34);
}

.atlas-theme .selected-location-status {
    color: #8b857b;
}

.atlas-theme .selected-location-name {
    color: #292c2f;
}

.atlas-theme .location-attribution {
    margin: 14px 0 0;
    text-align: center;
    color: #78736b;
    font-size: 0.58rem;
}

.atlas-theme .location-label-group {
    margin-top: 4px;
    padding: 12px;
    border: 1px solid #d8d3c9;
    background: rgba(255, 255, 255, 0.28);
}

.atlas-theme .location-label-group input {
    background: #fffefa;
}

.atlas-theme .field-hint {
    margin: 6px 0 0;
    color: #868077;
    font-size: 0.62rem;
    line-height: 1.45;
}

.atlas-theme .field-status {
    min-height: 0;
    margin: 5px 0 0;
    color: #817b72;
    font-size: 0.62rem;
    line-height: 1.35;
}

.atlas-theme .field-status:empty {
    display: none;
}

.atlas-theme .field-status.error {
    color: #9b4f45;
}

.atlas-theme .settings-sheet-body {
    padding: 15px 14px;
    border: 1px solid #d5d0c6;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.34);
}

.atlas-theme .toggle-label {
    color: #5f5d58;
}

.atlas-theme .toggle-group.toggle-dependent {
    position: relative;
    margin-left: 10px;
    padding-left: 10px;
}

.atlas-theme .toggle-group.toggle-dependent::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 1px;
    background: rgba(128, 96, 43, 0.28);
}

.atlas-theme .toggle-group.toggle-disabled {
    opacity: 0.38;
}

.atlas-theme .toggle-group.toggle-disabled .toggle-label {
    cursor: not-allowed;
}

.atlas-theme .toggle-slider {
    border-color: #bab5ab;
    background: #ddd9d1;
}

.atlas-theme .toggle-switch input:checked + .toggle-slider {
    border-color: #6c5b3d;
    background: #bca36f;
}

.atlas-theme .toggle-switch input:checked + .toggle-slider::before,
.atlas-theme .slider-wrapper input[type="range"]::-webkit-slider-thumb {
    background: #18202a;
}

.atlas-theme .slider-wrapper span {
    color: #25282c;
}

.atlas-theme .checkout-section {
    border-color: #d5d0c6;
}

.atlas-theme .buy-btn,
.atlas-theme .pay-btn {
    border: 1px solid #10151b;
    border-radius: 2px;
    background: #10151b;
    color: #f4f1e9;
    box-shadow: none;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.atlas-theme .buy-btn:hover,
.atlas-theme .pay-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #26313b;
    box-shadow: none;
}

.atlas-theme .radio-option {
    border-color: #cbc6bb;
    border-radius: 2px;
    background: #fbfaf7;
}

.atlas-theme .option-name,
.atlas-theme .back-btn {
    color: #25282c;
}

.atlas-theme .radio-custom {
    border-color: #aaa49a;
}

.atlas-theme .radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #171b20;
}

.atlas-theme .radio-option input[type="radio"]:checked + .radio-custom::after {
    background: #171b20;
}

/* Keep customization choices and checkout choices on one type scale. */
.atlas-theme #checkout-form .section-title {
    font-size: 0.62rem;
    line-height: 1.4;
}

.atlas-theme #checkout-form .option-name {
    font-size: 0.8rem;
    line-height: 1.4;
}

.atlas-theme .autocomplete-results {
    border-color: #cbc6bb;
    border-radius: 0 0 2px 2px;
    background: #fbfaf7;
}

.atlas-theme .autocomplete-item .city-name {
    color: #202327;
}

.atlas-theme .autocomplete-item:hover {
    background: #ece8df;
}

/* Atlas mobile drawer primitives stay inert on desktop. */
.mobile-customizer-handle,
.mobile-customizer-backdrop,
.mobile-room-context,
.mobile-room-toggle {
    display: none;
}

.mobile-customizer-scroll {
    display: contents;
}

/* Desktop room preview: confined to the poster pane. */
@media (min-width: 901px) {
    .atlas-theme .poster-container {
        position: relative;
        isolation: isolate;
        cursor: grab;
    }

    .atlas-theme .poster {
        position: relative;
        z-index: 2;
        transform: translate3d(0, var(--room-poster-y, 0), 0) scale(var(--room-poster-scale, 1));
        transform-origin: center center;
        will-change: transform;
    }

    .atlas-theme.mobile-room-view .poster {
        outline: none;
        box-shadow: 0 24px 56px rgba(42, 31, 21, 0.34), 0 2px 8px rgba(42, 31, 21, 0.22);
    }

    .mobile-room-context {
        display: block;
        position: absolute;
        z-index: 1;
        inset: 0;
        overflow: hidden;
        background-image:
            linear-gradient(to bottom, rgba(248, 241, 229, 0.025), rgba(58, 46, 34, 0.08)),
            url('../assets/atlas/scandinavian-room-v1.jpg');
        background-position: center center;
        background-size: cover;
        opacity: var(--room-progress, 0);
        pointer-events: none;
        transform: scale(var(--room-backdrop-scale, 1.045));
        transform-origin: center;
        will-change: opacity, transform;
    }

    .mobile-room-context::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(255, 250, 241, 0.015) 58%, rgba(38, 29, 21, 0.12));
        pointer-events: none;
    }

    .mobile-room-caption {
        position: absolute;
        z-index: 1;
        right: 24px;
        bottom: 22px;
        color: rgba(54, 45, 36, 0.68);
        font-size: 0.54rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    .mobile-room-toggle {
        position: absolute;
        z-index: 6;
        top: 30px;
        right: 30px;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 32px;
        padding: 8px 12px;
        border: 1px solid rgba(216, 196, 156, 0.46);
        border-radius: 999px;
        background: rgba(8, 18, 30, 0.78);
        color: #dfc994;
        box-shadow: 0 6px 18px rgba(3, 8, 14, 0.2);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        font-size: 0.54rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.09em;
        text-transform: uppercase;
        cursor: pointer;
        transition: color 220ms ease, background 220ms ease, border-color 220ms ease;
    }

    .atlas-theme.mobile-room-view .mobile-room-toggle {
        border-color: rgba(72, 58, 44, 0.24);
        background: rgba(246, 240, 229, 0.88);
        color: #514334;
    }

    .mobile-room-toggle-arrow {
        font-size: 0.78rem;
        line-height: 0.7;
    }

    .atlas-theme.mobile-room-dragging .poster-container,
    .atlas-theme.mobile-room-dragging .poster-container * {
        cursor: grabbing;
        user-select: none;
    }
}

@media (max-width: 900px) {
    .atlas-theme .app-container {
        gap: 0;
        background: #f2f0eb;
    }

    .atlas-theme .poster-container {
        padding: 12px 12px 18px;
        gap: 12px;
        background: #11151b;
    }

    .atlas-theme .mobile-poster-header {
        padding: 9px 6px;
        border: 0;
        border-bottom: 1px solid rgba(206, 170, 101, 0.3);
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .atlas-theme .mobile-header-title {
        color: #d7b979;
    }

    .atlas-theme .mobile-header-subtitle {
        color: #b8c4ce;
    }

    .atlas-theme .mobile-menu-button {
        border: 1px solid rgba(206, 170, 101, 0.3);
        border-radius: 2px;
        background: transparent;
    }

    .atlas-theme .mobile-menu-button span {
        background: #d8c49c;
    }

    .atlas-theme .poster {
        width: min(72vw, 380px);
        aspect-ratio: 3 / 4;
    }

    .atlas-theme .control-panel {
        width: 100%;
        padding: 28px max(18px, 5vw) 30px;
        gap: 24px;
        background: #f2f0eb;
    }

    .atlas-panel-intro h1 {
        margin-top: 18px;
        font-size: 2.2rem;
    }

    .atlas-theme #design-form {
        padding: 0;
        gap: 11px 12px;
    }

    .atlas-theme #checkout-form {
        padding: 0;
    }

    .atlas-theme .settings-sheet-toggle {
        border: 1px solid #bdb7ac;
        border-radius: 2px;
        background: transparent;
        color: #5d5547;
        box-shadow: none;
    }

    .atlas-theme .settings-sheet.settings-sheet-open .settings-sheet-toggle {
        border-color: #181d23;
        background: #181d23;
        color: #f2f0eb;
        box-shadow: none;
    }

    .atlas-theme .settings-sheet-body {
        border-color: #c8c2b7;
        border-radius: 2px;
        background: #f8f6f1;
        box-shadow: 0 16px 34px rgba(25, 28, 31, 0.18);
    }

    .atlas-theme .message-text {
        font-size: clamp(9px, 2.4vw, 13px);
    }
}

@media (max-width: 480px) {
    .atlas-theme .poster {
        width: min(82vw, 340px);
    }

    .atlas-theme .poster-frame {
        inset: 4.6%;
        padding: 0 5.2% 4.4%;
    }

    .atlas-edition {
        min-height: 24px;
    }

    .atlas-theme .control-panel {
        padding: 24px 16px 28px;
    }

    .atlas-panel-intro p {
        font-size: 0.72rem;
    }

    .atlas-theme #design-form {
        padding: 0;
    }
}

/* Poster-first mobile experience with a persistent customization peek. */
@media (max-width: 900px) {
    html,
    body.atlas-theme {
        --mobile-drawer-peek: calc(76px + env(safe-area-inset-bottom));
        width: 100%;
        height: 100%;
        min-height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .atlas-theme .app-container {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .atlas-theme .poster-container {
        position: relative;
        isolation: isolate;
        width: 100%;
        height: 100dvh;
        min-height: 0;
        box-sizing: border-box;
        padding: 8px 12px calc(var(--mobile-drawer-peek) + 12px);
        gap: 8px;
        overflow: hidden;
        touch-action: pan-y;
    }

    .atlas-theme .mobile-poster-header {
        position: relative;
        z-index: 5;
        flex: 0 0 auto;
        min-height: 52px;
    }

    .atlas-theme .poster {
        position: relative;
        z-index: 2;
        flex: 0 1 auto;
        width: min(92vw, 380px);
        max-width: 100%;
        max-height: calc(100dvh - 162px - env(safe-area-inset-bottom));
        margin: 0 auto;
        aspect-ratio: 3 / 4;
        transform: translate3d(0, var(--room-poster-y, 0), 0) scale(var(--room-poster-scale, 1));
        transform-origin: center center;
        will-change: transform;
    }

    .atlas-theme.mobile-room-view .poster {
        outline: none;
        box-shadow: 0 18px 38px rgba(35, 27, 18, 0.3), 0 1px 5px rgba(35, 27, 18, 0.24);
    }

    .mobile-room-context {
        display: block;
        position: absolute;
        z-index: 1;
        top: 68px;
        right: 0;
        bottom: var(--mobile-drawer-peek);
        left: 0;
        overflow: hidden;
        background-image:
            linear-gradient(to bottom, rgba(248, 241, 229, 0.03), rgba(58, 46, 34, 0.08)),
            url('../assets/atlas/scandinavian-room-v1.jpg');
        background-position: center center;
        background-size: cover;
        opacity: var(--room-progress, 0);
        pointer-events: none;
        transform: scale(var(--room-backdrop-scale, 1.045));
        transform-origin: center;
        will-change: opacity, transform;
    }

    .mobile-room-context::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(255, 250, 241, 0.02) 60%, rgba(38, 29, 21, 0.1));
        pointer-events: none;
    }

    .mobile-room-caption {
        position: absolute;
        z-index: 1;
        right: 13px;
        bottom: 12px;
        color: rgba(54, 45, 36, 0.7);
        font-size: 0.5rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.13em;
        text-transform: uppercase;
    }

    .mobile-room-toggle {
        position: absolute;
        z-index: 6;
        top: 75px;
        right: 18px;
        display: flex;
        align-items: center;
        gap: 7px;
        min-height: 30px;
        padding: 7px 10px;
        border: 1px solid rgba(216, 196, 156, 0.45);
        border-radius: 999px;
        background: rgba(8, 18, 30, 0.76);
        color: #dfc994;
        box-shadow: 0 5px 16px rgba(3, 8, 14, 0.2);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        font-size: 0.5rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        cursor: pointer;
        transition: color 220ms ease, background 220ms ease, border-color 220ms ease;
        -webkit-tap-highlight-color: transparent;
    }

    .atlas-theme.mobile-room-view .mobile-room-toggle {
        border-color: rgba(72, 58, 44, 0.24);
        background: rgba(246, 240, 229, 0.84);
        color: #514334;
    }

    .mobile-room-toggle-arrow {
        font-size: 0.72rem;
        line-height: 0.7;
    }

    .atlas-theme.mobile-room-dragging,
    .atlas-theme.mobile-room-dragging * {
        cursor: grabbing;
        user-select: none;
    }

    .atlas-theme .mobile-menu-button {
        width: auto;
        min-width: 68px;
        height: 34px;
        padding: 0 9px;
        flex-direction: row;
        gap: 7px;
    }

    .atlas-theme .mobile-menu-button .mobile-menu-label {
        width: auto;
        height: auto;
        border-radius: 0;
        background: transparent;
        color: #d8c49c;
        font-size: 0.52rem;
        font-weight: 600;
        line-height: 1;
        letter-spacing: 0.13em;
        text-transform: uppercase;
    }

    .atlas-theme .mobile-menu-button .mobile-menu-chevron {
        width: 6px;
        height: 6px;
        border-top: 1px solid #d8c49c;
        border-right: 1px solid #d8c49c;
        border-radius: 0;
        background: transparent;
        transform: rotate(-45deg) translate(-1px, 1px);
        transition: transform 260ms ease;
    }

    .atlas-theme.mobile-customizer-open .mobile-menu-button .mobile-menu-chevron {
        transform: rotate(135deg) translate(-1px, 1px);
    }

    .mobile-customizer-backdrop {
        display: block;
        position: fixed;
        z-index: 70;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(5, 10, 16, 0.22);
        opacity: 0;
        pointer-events: none;
        transition: opacity 300ms ease;
        -webkit-tap-highlight-color: transparent;
    }

    .atlas-theme.mobile-customizer-open .mobile-customizer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .atlas-theme .control-panel {
        position: fixed;
        z-index: 80;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(76dvh, 680px);
        max-height: none;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        border: 0;
        border-radius: 18px 18px 0 0;
        background: #f2f0eb;
        box-shadow: 0 -18px 50px rgba(6, 10, 14, 0.24);
        overflow: hidden;
        transform: translateY(calc(100% - var(--mobile-drawer-peek)));
        transition: transform 360ms cubic-bezier(0.22, 0.82, 0.24, 1), height 280ms ease;
        will-change: transform;
    }

    .atlas-theme.mobile-customizer-open .control-panel {
        transform: translateY(0);
    }

    .atlas-theme.mobile-customizer-measuring .control-panel {
        transition: none;
    }

    .atlas-theme.mobile-customizer-checkout .control-panel {
        height: min(92dvh, 820px);
    }

    .mobile-customizer-handle {
        position: relative;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: 1fr;
        align-items: center;
        flex: 0 0 calc(76px + env(safe-area-inset-bottom));
        width: 100%;
        min-height: calc(76px + env(safe-area-inset-bottom));
        padding: 13px 22px calc(11px + env(safe-area-inset-bottom));
        border: 0;
        border-top: 1px solid rgba(24, 29, 35, 0.08);
        border-bottom: 1px solid #d8d3c9;
        border-radius: 18px 18px 0 0;
        background: #f2f0eb;
        color: #171b20;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-customizer-grip {
        position: absolute;
        top: 7px;
        left: 50%;
        width: 34px;
        height: 3px;
        border-radius: 2px;
        background: #b8b2a7;
        transform: translateX(-50%);
    }

    .mobile-customizer-copy {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .mobile-customizer-copy strong {
        font-family: 'Cormorant Garamond', Georgia, serif;
        font-size: 1.05rem;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0.005em;
    }

    .mobile-customizer-copy small {
        color: #77736c;
        font-size: 0.55rem;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .mobile-customizer-chevron {
        width: 9px;
        height: 9px;
        margin-right: 3px;
        border-top: 1.5px solid #725a32;
        border-right: 1.5px solid #725a32;
        transform: rotate(-45deg) translate(-1px, 1px);
        transition: transform 260ms ease;
    }

    .atlas-theme.mobile-customizer-open .mobile-customizer-chevron {
        transform: rotate(135deg) translate(-1px, 1px);
    }

    .mobile-customizer-scroll {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        padding: 22px max(18px, 5vw) calc(30px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-customizer-scroll .atlas-panel-intro {
        display: none;
    }

    .atlas-theme:not(.mobile-customizer-open) .mobile-customizer-scroll {
        overflow-y: hidden;
    }

    .atlas-theme .settings-sheet {
        overflow: hidden;
    }

    .atlas-theme .settings-sheet-body {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        max-height: 0;
        padding: 0 14px;
        border-width: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transform: none;
        box-shadow: none;
        transition: max-height 260ms ease, opacity 180ms ease, padding 260ms ease, border-width 260ms ease;
    }

    .atlas-theme .settings-sheet.settings-sheet-open .settings-sheet-body {
        max-height: 680px;
        padding: 15px 14px;
        border-width: 1px;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
    }

    .atlas-theme.mobile-customizer-hint:not(.mobile-customizer-open) .control-panel {
        animation: atlas-customizer-hint 850ms cubic-bezier(0.22, 0.78, 0.28, 1) both;
    }

    @keyframes atlas-customizer-hint {
        0%, 100% {
            transform: translateY(calc(100% - var(--mobile-drawer-peek)));
        }
        48% {
            transform: translateY(calc(100% - var(--mobile-drawer-peek) - 14px));
        }
    }
}

@media (max-width: 480px) {
    .atlas-theme .poster {
        width: min(92vw, 350px);
    }

    .atlas-theme .control-panel {
        padding: 0;
    }

    .mobile-customizer-scroll {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (max-width: 900px) {
    .atlas-theme #checkout-form .option-name,
    .atlas-theme #design-form .settings-sheet .toggle-label {
        font-size: 0.74rem;
    }
}

/* Gallery finish. Decorative light lives outside the astronomical canvas. */
.atlas-theme .poster-container {
    background:
        radial-gradient(ellipse at 42% 38%, #263039 0%, #161e25 40%, #10151a 76%);
}

.atlas-theme .poster {
    box-shadow: 0 38px 80px -20px rgba(0, 0, 0, 0.7),
        0 3px 12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(224, 203, 163, 0.14);
}

.atlas-theme .poster::before {
    z-index: 3;
    background:
        radial-gradient(ellipse at 50% 30%,
            rgba(244, 222, 181, 0.10), transparent 64%),
        linear-gradient(125deg, rgba(228, 235, 246, 0.04), transparent 48%);
    opacity: 0.35;
}

.atlas-panel-intro h1 em { color: #8e6b31; font-weight: 400; }

.atlas-theme .control-panel {
    background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.45), transparent 60%);
}

.atlas-theme .control-group input:not([type="checkbox"]):not([type="range"]),
.atlas-theme .control-group select {
    transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.atlas-theme .control-group input:not([type="checkbox"]):not([type="range"]):focus,
.atlas-theme .control-group select:focus {
    border-color: #957740;
    background: #fffdf8;
    box-shadow: 0 0 0 3px rgba(142, 107, 49, 0.1);
}

.atlas-theme button:focus-visible,
.atlas-theme a:focus-visible {
    outline: 2px solid #b28a48;
    outline-offset: 4px;
}

.atlas-theme .buy-btn,
.atlas-theme .pay-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(115deg, #14212d, #10151b);
    border-color: #786344;
    transition: box-shadow 250ms ease, transform 250ms ease;
}

.atlas-theme .buy-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.atlas-theme .buy-btn > span { color: #d9be86; font-size: 20px; transition: transform 250ms ease; }
.atlas-theme .buy-btn:hover > span { transform: translate(2px, -2px); }
.atlas-theme .buy-btn:hover,
.atlas-theme .pay-btn:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(23, 32, 40, 0.16); }

.atlas-theme .buy-btn::after,
.atlas-theme .pay-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(231, 209, 167, 0.15), transparent 70%);
    transform: translateX(-110%);
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .atlas-theme .poster { animation: gallery-arrive 1200ms ease-out both; }
    .atlas-panel-intro { animation: gallery-rise 800ms 100ms both; }
    .atlas-theme #design-form { animation: gallery-rise 800ms 220ms both; }
    .atlas-theme .buy-btn:hover::after,
    .atlas-theme .pay-btn:hover:not(:disabled)::after { animation: gallery-sheen 800ms ease-out; }
}

@keyframes gallery-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes gallery-rise {
    from { opacity: 0; translate: 0 12px; }
    to { opacity: 1; translate: 0 0; }
}
@keyframes gallery-sheen { to { transform: translateX(110%); } }

@media (prefers-reduced-motion: reduce) {
    .atlas-theme *,
    .atlas-theme *::before,
    .atlas-theme *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation: none !important;
    }
}

/* Menu typography: one family, three roles, and a shared left edge. */
.atlas-theme .control-panel {
    --menu-label: 0.75rem;
    --menu-value: 0.875rem;
    --menu-note: 0.6875rem;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: var(--menu-value);
    line-height: 1.5;
}

.atlas-theme :is(#design-form, #checkout-form) .control-group { margin-bottom: 20px; }
.atlas-theme :is(#design-form, #checkout-form) .control-group > label,
.atlas-theme .slider-group > label,
.atlas-theme .toggles-section h3,
.atlas-theme #checkout-form .section-title,
.atlas-theme :is(#design-form, #checkout-form) .settings-sheet-label {
    font-family: inherit;
    font-size: var(--menu-label);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.015em;
    text-transform: none;
    color: #45443f;
}

.atlas-theme :is(#design-form, #checkout-form) .control-group > label { margin-bottom: 8px; }
.atlas-theme :is(#design-form, #checkout-form) .control-group input,
.atlas-theme :is(#design-form, #checkout-form) .control-group select,
.atlas-theme #design-form .settings-sheet .toggle-label,
.atlas-theme #checkout-form .option-name,
.atlas-theme .option-price,
.atlas-theme .autocomplete-item .city-name {
    font-family: inherit;
    font-size: var(--menu-value);
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
}

.atlas-theme :is(#design-form, #checkout-form) .control-group input[type="date"],
.atlas-theme :is(#design-form, #checkout-form) .control-group input[type="time"],
.atlas-theme .option-price,
.atlas-theme .slider-wrapper span { font-variant-numeric: tabular-nums; }

.atlas-theme .location-label-group {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.atlas-theme .field-hint,
.atlas-theme .field-status,
.atlas-theme .slider-hint,
.atlas-theme .autocomplete-item .city-details,
.atlas-theme .location-attribution {
    font-family: inherit;
    font-size: var(--menu-note);
    font-style: normal;
    line-height: 1.55;
    letter-spacing: 0;
    color: #746f65;
}
.atlas-theme .field-status.error { color: #9b4f45; }

.atlas-theme .selected-location-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 10px 0 0;
    border: 0;
    background: transparent;
}
.atlas-theme .selected-location-status {
    font-size: var(--menu-note);
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.atlas-theme .selected-location-name {
    font-size: var(--menu-label);
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}
.atlas-theme .selected-location .coords,
.atlas-theme .slider-wrapper span {
    font-family: inherit;
    font-size: var(--menu-note);
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    letter-spacing: 0;
}

.atlas-theme .settings-sheet-body {
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid #d5d0c6;
    background: transparent;
}
.atlas-theme .toggle-group { margin-bottom: 0; }
.atlas-theme .toggle-label { min-height: 38px; gap: 16px; }
.atlas-theme .toggle-switch { flex-shrink: 0; }
.atlas-theme .toggle-group.toggle-dependent { margin-left: 0; padding-left: 0; }
.atlas-theme .toggle-group.toggle-dependent::before { display: none; }
.atlas-theme .slider-group { margin-top: 18px; }
.atlas-theme :is(#design-form, #checkout-form) .story-toggle-text {
    font-size: var(--menu-note);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.atlas-theme :is(#design-form, #checkout-form) .buy-btn,
.atlas-theme :is(#design-form, #checkout-form) .pay-btn,
.atlas-theme :is(#design-form, #checkout-form) .back-btn {
    font-family: inherit;
    font-size: var(--menu-value);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.015em;
    text-transform: none;
}
.atlas-theme .mobile-customizer-copy strong {
    font-family: inherit;
    font-size: var(--menu-value);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
}
.atlas-theme .mobile-customizer-copy small {
    font-size: var(--menu-note);
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 900px) {
    .atlas-theme :is(#design-form, #checkout-form) .control-group input,
    .atlas-theme :is(#design-form, #checkout-form) .control-group select { font-size: 1rem; }
    .atlas-theme .settings-sheet-body { padding: 0; border: 0; }
    .atlas-theme .settings-sheet.settings-sheet-open .settings-sheet-body {
        padding: 16px 0 0;
        border-width: 1px 0 0;
        max-height: 850px;
    }
}

/* Optional Matejko-inspired study: midnight pigment, brass, candlelit ivory.
   Scoped to the poster so switching off restores the Atlas presentation. */
.atlas-theme.copernicus-style .poster {
    background:
        radial-gradient(ellipse at 8% 100%, rgba(145, 96, 43, 0.22), transparent 60%),
        linear-gradient(155deg, #071c29, #0b222c 48%, #101c24);
}
.atlas-theme.copernicus-style .poster::before {
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23b6a17e' opacity='.24' filter='url(%23grain)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
    pointer-events: none;
}
.atlas-theme.copernicus-style .poster-frame {
    outline: 1px solid rgba(192, 155, 94, 0.28);
    outline-offset: 10px;
}
.atlas-theme.copernicus-style .starmap-circle {
    background: radial-gradient(ellipse at 25% 100%, #23302c, #0b202b 65%, #071722);
    border-color: rgba(210, 178, 118, 0.72);
    box-shadow: 0 0 0 5px rgba(9, 23, 29, 0.8),
        0 0 0 6px rgba(192, 155, 94, 0.25);
}
.atlas-theme.copernicus-style .location-star-face { background: transparent; }
.atlas-theme.copernicus-style .personal-message {
    width: 100%;
    padding: 3% 0 1.8%;
    text-align: center;
}
.atlas-theme.copernicus-style .message-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(16px, 2vw, 24px);
    line-height: 1.15;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.01em;
    color: #f5e5c5;
    overflow-wrap: anywhere;
}
.atlas-theme.copernicus-style .atlas-rule { width: 24%; }
.atlas-theme.copernicus-style .atlas-rule span { background: rgba(204, 168, 103, 0.55); }
.atlas-theme.copernicus-style .info-location,
.atlas-theme.copernicus-style .info-date,
.atlas-theme.copernicus-style .info-coords { color: #c3b79e; }
.atlas-theme.copernicus-style .location-info { gap: 6px 12px; }
.atlas-theme.copernicus-style .info-location { flex-basis: 100%; text-align: center; }
.atlas-theme.copernicus-style .info-date::before { display: none; }

/* Independent engraved details, deliberately hidden until selected. */
.ornament-rim, .ornament-corner, .ornament-dedication {
    display: none;
    pointer-events: none;
    fill: none;
    stroke: #cbb17c;
    stroke-width: .7;
}
.ornament-rim { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; opacity: .65; }
.ornament-rim-enabled .ornament-rim { display: block; }
.atlas-theme .atlas-compass-axis, .atlas-theme .atlas-compass-center { display: none; }
.ornament-rose { position: absolute; top: 7%; left: 45%; width: 10%; height: 10%; color: #dac28f; stroke: currentColor; stroke-width: 1; opacity: .8; }
.ornament-corner { position: absolute; width: 10%; height: 8%; z-index: 5; opacity: .65; }
.ornament-corners-enabled .ornament-corner { display: block; }
.ornament-nw { top: 3%; left: 3%; }
.ornament-ne { top: 3%; right: 3%; transform: scaleX(-1); }
.ornament-sw { bottom: 3%; left: 3%; transform: scaleY(-1); }
.ornament-se { bottom: 3%; right: 3%; transform: scale(-1); }
.ornament-moon-enabled .moon-phase-emblem {
    width: 18px; height: 18px; flex-basis: 18px;
    padding: 3px; box-sizing: content-box;
    border: 1px solid rgba(203,177,124,.65); border-radius: 50%;
    outline: 1px solid rgba(203,177,124,.25); outline-offset: 3px;
    margin: 3px 6px;
}
.ornament-dedication-enabled .atlas-rule > span,
.ornament-dedication-enabled .atlas-rule > i { display: none; }
.ornament-dedication-enabled .ornament-dedication { display: block; width: 100%; height: auto; max-height: 30px; }
@media (max-width: 900px) {
    .atlas-theme .settings-sheet.settings-sheet-open .settings-sheet-body { max-height: 1300px; }
    .ornament-moon-enabled .moon-phase-emblem { width: 12px; height: 12px; flex-basis: 12px; padding: 2px; }
}

/* Keep engraving contrast independent of the celestial canvas drawing state. */
.constellation-illustrations {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
    fill: none;
    stroke: rgba(226, 206, 164, 0.66);
    stroke-width: 0.85px;
    stroke-linejoin: round;
    stroke-linecap: round;
}
canvas.constellation-illustrations { display: block; opacity: 0; transition: opacity 700ms ease; }
.ornament-illustrations-enabled.illustrations-ready .constellation-illustrations { opacity: 1; }
.illustrations-export .constellation-illustrations { transition: none; }
.illustrations-loading #illustration-status::before {
    content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
    border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%;
    vertical-align: -1px; animation: illustration-loading-spin 900ms linear infinite;
}
@keyframes illustration-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    canvas.constellation-illustrations { transition: none; }
    .illustrations-loading #illustration-status::before { animation: none; }
}

/* Black in the original engravings disappears against the night sky. */
canvas.constellation-illustrations { mix-blend-mode: screen; filter: sepia(.65); border-radius: 50%; }

/* D3-Celestial's orthographic sky fills 960/1024 of its canvas. Expand
   the whole sky layer so stars and illustrations reach the circular border.
   The graduated rim is a separate layer outside the circular border. */
.atlas-theme .location-star-face {
    scale: 1.0666666667;
    transform-origin: center;
}
.atlas-theme.ornament-rim-enabled .starmap-circle { overflow: visible; }
.atlas-graduated-rim {
    position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
    pointer-events: none; z-index: 4; display: none; font-family: Manrope, sans-serif;
}
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .atlas-graduated-rim { filter: var(--sky-filter); }
body.atlas-theme.reference-atlas[data-poster-palette] .atlas-graduated-rim { filter: none; }

/* Optional atlas plate details, independent of astronomical coordinates. */
.atlas-theme { --plate-ink: #cbb17c; }
.ornament-numerals, .ornament-arch {
    display: none; position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 5; pointer-events: none; fill: none; stroke: var(--plate-ink); stroke-width: .45;
}
.ornament-numerals { overflow: visible; stroke: var(--constellation-line); }
.ornament-numerals text { fill: var(--constellation-line); stroke: none; font: 5px Georgia, serif; letter-spacing: .2px; }
.ornament-arch { inset: -9%; width: 118%; height: 118%; overflow: visible; }
.ornament-arch text { fill: var(--plate-ink); stroke: none; font: 6px 'DM Sans', sans-serif; letter-spacing: 2.4px; }
.atlas-theme.ornament-arch-enabled .starmap-circle { overflow: visible; }
.ornament-arch-enabled .ornament-arch, .ornament-numerals-enabled .ornament-numerals { display: block; }
.atlas-theme.ornament-numerals-enabled .starmap-circle { overflow: visible; }
/* Keep the two optional rings and their labels apart when both are selected. */
.ornament-rim-enabled .ornament-numerals { transform: scale(1.12); transform-origin: center; }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .ornament-numerals { filter: var(--sky-filter); }
body.atlas-theme.reference-atlas[data-poster-palette] .ornament-numerals { filter: none; }
.ornament-engraving { display: none; position: absolute; inset: 2.2%; border: 1px solid var(--plate-ink); pointer-events: none; z-index: 4; opacity: .65; }
.ornament-engraving::before { content: ''; position: absolute; inset: 4px; border: 1px solid var(--plate-ink); opacity: .5; }
.ornament-engraving-enabled .ornament-engraving { display: block; }
.ornament-paper { display: none; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: .12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23808080' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
.ornament-paper-enabled .ornament-paper { display: block; }

/* Palette controls belong immediately before checkout. */
.poster-palettes { border: 0; border-top: 1px solid #d7d1c7; margin: 24px 0 0; padding: 20px 0 0; min-width: 0; }
.poster-palettes legend { float: left; width: 100%; margin-bottom: 14px; font: 500 12px 'DM Sans', sans-serif; color: #373b38; }
.palette-options { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.palette-option { position: relative; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #d5cec2; cursor: pointer; font: 500 12px 'DM Sans', sans-serif; color: #373b38; }
.palette-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.palette-option:has(input:checked) { border-color: #947338; background: #eae4d8; box-shadow: inset 0 0 0 1px #947338; }
.palette-option:has(input:focus-visible) { outline: 2px solid #947338; outline-offset: 3px; }
.palette-option small { display: block; margin-top: 3px; font-size: 10px; font-weight: 400; color: #73736a; }
.palette-swatch { display: grid; place-items: center; width: 32px; height: 40px; flex: 0 0 32px; font: 25px Georgia, serif; border: 1px solid #998f7c55; }
.palette-blue { background: #08121e; color: #cbb17c; }
.palette-charcoal { background: #151617; color: #d8d1bf; }
.palette-parchment { background: #eee1c6; color: #57462e; }
.palette-forest { background: #102b25; color: #c9b481; }
body[data-poster-palette="charcoal"] { --plate-bg: #151617; --plate-sky: #181a1b; --plate-ink: #d8d1bf; --plate-text: #eee9df; --plate-muted: #b9b5ab; --sky-filter: grayscale(1); }
body[data-poster-palette="parchment"] { --plate-bg: #eee1c6; --plate-sky: #eaddc1; --plate-ink: #79613e; --plate-text: #392e22; --plate-muted: #6d604c; --sky-filter: invert(1) sepia(.8) saturate(.65); }
body[data-poster-palette="forest"] { --plate-bg: #102b25; --plate-sky: #123129; --plate-ink: #c9b481; --plate-text: #eae4cf; --plate-muted: #b4bca5; --sky-filter: sepia(.3); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .poster { background: var(--plate-bg); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .starmap-circle { background: var(--plate-sky); border-color: var(--plate-ink); box-shadow: none; }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .location-star-face { background: var(--plate-sky); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) #starmap { filter: var(--sky-filter); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .message-text { color: var(--plate-text); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color: var(--plate-muted); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) :is(.atlas-edition,.atlas-compass,.magnitude-legend-title) { color: var(--plate-ink); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .atlas-rule span { background: var(--plate-ink); }
.atlas-theme[data-poster-palette]:not([data-poster-palette="blue"]) .atlas-rule i { border-color: var(--plate-ink); }
.atlas-theme :is(.ornament-rim,.ornament-corner,.ornament-dedication) { stroke: var(--plate-ink); }
.atlas-theme .ornament-rose { color: var(--plate-ink); }
.atlas-theme[data-poster-palette="parchment"] canvas.constellation-illustrations { filter: invert(1) sepia(.65); mix-blend-mode: multiply; }
.atlas-theme[data-poster-palette="charcoal"] canvas.constellation-illustrations { filter: grayscale(1); }
.atlas-theme[data-poster-palette="parchment"] :is(.moon-phase-emblem,.magnitude-star) { filter: invert(1) sepia(.65); }
@media (max-width: 900px) {
    .atlas-theme .settings-sheet.settings-sheet-open .settings-sheet-body { max-height: 1800px; }
}
/* Keep the expanded sky clipped even when the inscription extends outside. */
.atlas-theme.ornament-arch-enabled .location-flip-stage { overflow: hidden; }

/* A separate warm interior for the parchment palette, without a colour tint. */
.atlas-theme[data-poster-palette="parchment"] .mobile-room-context {
    background-color: #b6a48a;
    background-image: url('../assets/atlas/parchment-room-v2.png');
}
.atlas-theme[data-poster-palette="parchment"] .mobile-room-context::after {
    background: linear-gradient(to bottom, transparent 65%, rgba(40, 29, 18, .08));
}
.atlas-theme[data-poster-palette="parchment"] .mobile-room-caption {
    color: #f0eee3;
}

/* Date and time share a row; timezone and DST guidance use its full width. */
.atlas-theme #design-form .date-time-group {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 0;
}
.atlas-theme #design-form .date-time-field { min-width: 0; margin: 0; }
.atlas-theme #design-form .date-time-field input {
    width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
    padding-inline: 10px; min-height: 44px;
}
.atlas-theme #design-form .date-time-group > :is(.field-status, .dst-choice) { grid-column: 1 / -1; }
.atlas-theme #design-form .date-time-group > .field-status:empty { display: none; }
.atlas-theme #design-form .date-time-group { grid-column: 1 / -1; }

/* Checkout suggestions remain in flow so they fit the mobile drawer. */
.atlas-theme .address-suggestions { list-style:none; padding:0; margin:4px 0; max-height:240px; overflow-y:auto; border:1px solid #c9b994; background:#faf8f3; }
.atlas-theme .address-suggestions [role="option"] { padding:12px; font:400 13px/1.5 'DM Sans',sans-serif; cursor:pointer; border-bottom:1px solid #e5dfd4; }
.atlas-theme .address-suggestions [role="option"]:hover,
.atlas-theme .address-suggestions [aria-selected="true"] { background:#ece5d7; }
.atlas-theme .address-help { font:400 11px/1.5 'DM Sans',sans-serif; color:#756d60; margin:6px 0 0; }
.atlas-theme .checkout-notice { border:1px solid #c9b994; padding:12px; margin:12px 0 20px; font:400 13px/1.5 'DM Sans',sans-serif; }
.atlas-theme .checkout-notice p { margin:0; }
.atlas-theme .checkout-notice button { margin-top:8px; padding:8px 12px; background:transparent; border:1px solid #9c824a; color:inherit; cursor:pointer; font:inherit; }

/* Optional atlas treatment. Underlying controls are retained for comparison. */
.atlas-style-control { margin: 18px 0; padding: 14px; border: 1px solid #b7b6aa; background: #ecebe4; }
.atlas-style-control label { display: flex; align-items: center; gap: 10px; font: 600 14px Manrope, sans-serif; cursor: pointer; }
.atlas-style-control input { width: 18px; height: 18px; accent-color: #395d67; }
.atlas-style-control label span { font-size: 10px; text-transform: uppercase; color: #526d72; }
.atlas-style-control p { margin: 9px 0 0; font: 12px/1.5 Manrope, sans-serif; color: #62665f; }
body.atlas-theme.reference-atlas[data-poster-palette] .poster { background: #1b2931; }
body.atlas-theme.reference-atlas[data-poster-palette] .starmap-circle { background: #1b2931; border-color: #60818a66; box-shadow: 0 0 0 5px #1b2931, 0 0 0 5.5px #60818a44; }
body.atlas-theme.reference-atlas[data-poster-palette] .location-star-face { background: #1b2931; }
body.atlas-theme.reference-atlas[data-poster-palette] #starmap { filter: none; }
body.atlas-theme.reference-atlas[data-poster-palette] .message-text { color: #dfd2b7; font-family: Manrope, sans-serif; font-size: 0.85em; letter-spacing: .12em; }
body.atlas-theme.reference-atlas[data-poster-palette] :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color: #b2bdb8; }
body.atlas-theme.reference-atlas[data-poster-palette] .magnitude-legend-title { color: #b6ac79; }
body.atlas-theme.reference-atlas[data-poster-palette] :is(.ornament-rim,.ornament-corner,.ornament-engraving,.ornament-paper,.ornament-arch,.ornament-dedication,.constellation-illustrations,.atlas-compass,.atlas-rule,.atlas-edition) { display: none !important; }

body.atlas-theme.reference-atlas[data-poster-palette] .location-star-face { scale: 1; }

body.atlas-theme.reference-atlas[data-poster-palette] .poster-frame { outline: none; }
body.atlas-theme.reference-atlas[data-poster-palette] .poster::before { background: none; }
body.atlas-theme.reference-atlas[data-poster-palette] .message-text { font-style: normal; }

/* Keep all six brightness classes readable within the poster width. */
.star-symbols .magnitude-legend { flex-wrap: wrap; column-gap: 9px; row-gap: 5px; letter-spacing: .03em; }
.star-symbols .magnitude-entry svg { display: block; flex-shrink: 0; overflow: visible; }

.atlas-coordinate-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; display: none; font-family: Manrope, sans-serif; }
body.atlas-theme.reference-atlas[data-poster-palette] .starmap-circle { box-shadow: none; border-color: #60818a44; }

/* The projected rim is shared by both visual styles. */
body.atlas-theme.ornament-rim-enabled[data-poster-palette] .starmap-circle { box-shadow: none; border-color: #60818a44; }

.atlas-half-globe { display: block; width: 25%; height: auto; aspect-ratio: 220 / 90; flex: 0 0 auto; align-self: center; margin-top: 0; overflow: hidden; color: #c8b992; font-family: Manrope, sans-serif; }
.atlas-theme[data-poster-palette="parchment"] .atlas-half-globe { color: #79613e; }
body.atlas-theme.reference-atlas[data-poster-palette] .atlas-half-globe { color: #c8b992; }

.atlas-half-globe-block { display: none; flex-direction: column; align-items: center; flex: 0 0 auto; width: 100%; margin-top: 1.8%; gap: 4px; }
.atlas-half-globe-block .info-location { width: 100%; text-align: center; overflow-wrap: anywhere; }
.half-globe-enabled .info-date::before { display: none; }

.atlas-theme:not(.show-magnitude) .magnitude-legend { display: none; }

/* Antique atlas: parchment surround and charcoal engraved sky. */
.palette-antique { background: #b69c6c; color: #ded0a7; box-shadow: inset 0 0 0 7px #3b3d38; }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) {
    --plate-bg: #b69c6c; --plate-sky: #3b3d38; --plate-ink: #685a3e;
    --plate-text: #383b34; --plate-muted: #544d3c; --sky-filter: none;
}
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) .poster { background: var(--plate-bg); }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) :is(.starmap-circle,.location-star-face) { background: var(--plate-sky); border-color: #a99c75; box-shadow: none; }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) #starmap { filter: none; }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) .message-text { color: var(--plate-text); }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color: var(--plate-muted); }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) :is(.atlas-edition,.atlas-compass,.magnitude-legend-title,.atlas-half-globe) { color: var(--plate-ink); }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) .atlas-coordinate-grid :is(path,circle) { stroke: #b9aa7e; }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) .atlas-coordinate-grid path { stroke-dasharray: none; }
body.atlas-theme[data-poster-palette="antique"]:is(.reference-atlas, .atlas-theme) .atlas-coordinate-grid text { fill: #c6b98f; }

/* Editorial workbench: the controls support the artwork without competing with it. */
.atlas-theme .control-panel {
    background: #f3f0e8;
    color: #222a2b;
}
.atlas-theme .editorial-intro { margin: 0 0 30px; }
.atlas-theme .editorial-kicker {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid #bdb6a6;
    color: #6e6a5e;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.13em;
}
.atlas-theme .editorial-intro h1 {
    margin: 20px 0 8px;
    color: #1c292b;
    font: 400 2.25rem/0.98 'Cormorant Garamond', Georgia, serif;
    letter-spacing: -0.025em;
}
.atlas-theme .editorial-intro h1 span { color: #a37d3e; }
.atlas-theme .editorial-intro p {
    margin: 0;
    color: #68665d;
    font-size: 0.75rem;
    line-height: 1.55;
}
.atlas-theme .editorial-section-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 28px 0 18px;
    color: #8b764f;
    font-size: 0.625rem;
    font-variant-numeric: tabular-nums;
}
.atlas-theme .editorial-section-heading h2 {
    flex: none;
    margin: 0;
    color: #293334;
    font: 500 1.25rem/1 'Cormorant Garamond', Georgia, serif;
}
.atlas-theme .editorial-rule { flex: 1; border-top: 1px solid #d2cbbb; }
.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 {
    min-height: 44px;
    border-color: #c9c2b3;
    border-radius: 0;
    background-color: #faf8f2;
}
.atlas-theme :is(#design-form, #checkout-form) :is(input, select, button):focus-visible,
.atlas-theme .mobile-customizer-handle:focus-visible {
    outline: 2px solid #987437;
    outline-offset: 2px;
}
.atlas-theme .checkout-intro { margin: 22px 0 28px; }
.atlas-theme #checkout-form .section-title {
    margin-bottom: 12px;
    color: #293334;
    font: 500 1.2rem/1.1 'Cormorant Garamond', Georgia, serif;
}
.atlas-theme #checkout-form .radio-options { gap: 0; border-top: 1px solid #d0c9bb; }
.atlas-theme #checkout-form .radio-option {
    min-height: 48px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #d0c9bb;
    border-radius: 0;
    background: transparent;
    transition: background 160ms ease;
}
.atlas-theme #checkout-form .radio-option:has(input:checked) { background: #e7e3d8; }
.atlas-theme #checkout-form .radio-option:focus-within { outline: 2px solid #987437; outline-offset: -2px; }
.atlas-theme #checkout-form .section-separator { margin: 24px 0; border-color: #d0c9bb; }
.atlas-theme .buy-btn, .atlas-theme .pay-btn { min-height: 50px; background: #243536; border-color: #243536; }
@media (max-width: 900px) {
    .atlas-theme .control-panel {
        height: min(58dvh, 590px);
        border-radius: 12px 12px 0 0;
        background: #f3f0e8;
    }
    .atlas-theme.mobile-customizer-checkout .control-panel { height: min(78dvh, 760px); }
    .atlas-theme .mobile-customizer-handle { background: #f3f0e8; border-radius: 12px 12px 0 0; }
    .atlas-theme.mobile-customizer-open .mobile-customizer-backdrop { opacity: 0; }
    .atlas-theme .mobile-customizer-scroll { padding-top: 18px; }
    .atlas-theme .editorial-intro { margin-bottom: 22px; }
    .atlas-theme .editorial-intro h1 { margin-top: 14px; font-size: 1.9rem; }
    .atlas-theme .editorial-section-heading { margin-top: 22px; }
}

/* Worktable: a centered preview with a horizontal, focused editor below it. */
html:has(body.atlas-theme), body.atlas-theme { height: auto; min-height: 100%; overflow: auto; }
.atlas-theme .app-container { display: flex; flex-direction: column; width: 100%; height: auto; min-height: 100vh; overflow: visible; }
.atlas-theme .poster-container {
    position: relative; flex: none; width: 100%; height: 58vh; min-height: 390px;
    padding: 24px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.atlas-theme .poster { flex: none; width: auto; height: 100%; max-height: 100%; max-width: 100%; aspect-ratio: 3 / 4; }
.atlas-theme .control-panel {
    position: relative; inset: auto; transform: none; display: block; width: 100%; height: auto; max-height: none;
    padding: 28px max(24px, calc((100vw - 920px) / 2)) 40px; overflow: visible; border-radius: 0; box-shadow: none;
}
.atlas-theme .mobile-customizer-handle, .atlas-theme .mobile-customizer-backdrop,
.atlas-theme .mobile-menu-button, .atlas-theme .mobile-room-toggle, .atlas-theme .mobile-room-context { display: none; }
.atlas-theme .mobile-customizer-scroll { display: block; padding: 0; overflow: visible; }
.atlas-theme #design-form { display: block; }
.atlas-theme #design-form.hidden, .atlas-theme #checkout-form.hidden { display: none; }
.atlas-theme .editorial-intro { margin-bottom: 20px; }
.atlas-theme .editorial-intro h1 { margin: 12px 0 4px; font-size: 2rem; }
.atlas-theme .worktable-nav { display: flex; border-top: 1px solid #bdb6a6; border-bottom: 1px solid #bdb6a6; }
.atlas-theme .worktable-tab {
    display: flex; align-items: baseline; justify-content: center; gap: 8px; flex: 1; min-width: 0; min-height: 52px;
    padding: 12px 8px; border: 0; border-right: 1px solid #d6d0c3; background: transparent;
    color: #5d625b; font: 500 0.85rem 'DM Sans', sans-serif; cursor: pointer;
}
.atlas-theme .worktable-tab:last-child { border-right: 0; }
.atlas-theme .worktable-tab.is-active { background: #ded9ca; color: #1d3030; box-shadow: inset 0 -3px #8e6b31; }
.atlas-theme .worktable-tab:focus-visible { outline: 2px solid #987437; outline-offset: -3px; }
.atlas-theme .worktable-number { color: #927b53; font-size: 0.6rem; font-variant-numeric: tabular-nums; }
.atlas-theme .worktable-panels { padding: 22px 0 0; }
.atlas-theme .worktable-section[hidden] { display: none; }
.atlas-theme .worktable-section { max-width: 680px; }
.atlas-theme .worktable-section .poster-palettes { margin: 0; padding: 0; border: 0; }
.atlas-theme .worktable-section .settings-sheet { position: static; padding: 0; border: 0; background: transparent; }
.atlas-theme .worktable-section .settings-sheet-toggle { display: none; }
.atlas-theme .worktable-section .settings-sheet-body {
    position: static; max-height: none; padding: 0; border: 0; opacity: 1; overflow: visible;
    pointer-events: auto; transform: none; background: transparent; box-shadow: none;
}
.atlas-theme #design-form .checkout-section { margin-top: 22px; max-width: 360px; }
.atlas-theme .location-attribution { margin-top: 20px; }
.atlas-theme #checkout-form { max-width: 680px; margin: 0 auto; }
.atlas-theme .checkout-header { display: block; }
@media (max-width: 900px) {
    html:has(body.atlas-theme), body.atlas-theme { height: auto; min-height: 100%; overflow: auto; overscroll-behavior: auto; }
    .atlas-theme .app-container { height: auto; overflow: visible; }
    .atlas-theme .poster-container { height: 52dvh; min-height: 300px; padding: 54px 16px 16px; gap: 0; }
    .atlas-theme .mobile-poster-header { position: absolute; top: 0; left: 16px; right: 16px; min-height: 42px; padding: 8px 0; }
    .atlas-theme .poster { width: auto; height: 100%; max-height: 100%; max-width: 100%; margin: 0; }
    .atlas-theme .control-panel, .atlas-theme.mobile-customizer-checkout .control-panel {
        position: relative; inset: auto; width: 100%; height: auto; max-height: none; padding: 20px 18px 36px;
        transform: none; overflow: visible; border-radius: 0;
    }
    .atlas-theme:not(.mobile-customizer-open) .mobile-customizer-scroll { overflow: visible; }
    .atlas-theme .worktable-tab { flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 2px; font-size: 0.7rem; }
    .atlas-theme .worktable-panels { padding-top: 20px; }
    .atlas-theme .editorial-intro h1 { font-size: 1.7rem; }
    .atlas-theme .worktable-section .settings-sheet-body { max-height: none; padding: 0; opacity: 1; overflow: visible; pointer-events: auto; }
    .atlas-theme #design-form .checkout-section { max-width: none; }
}

/* Guided notebook: the preview gets the room, the active question stays compact. */
@media (min-width: 901px) {
    .atlas-theme .app-container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 410px); align-items: start; background: #151d23; }
    .atlas-theme .poster-container { position: sticky; top: 0; height: 100vh; min-height: 0; padding: 30px 42px; }
    .atlas-theme .poster { height: min(100%, calc((100vw - 460px) * 4 / 3)); width: auto; max-width: 100%; }
    .atlas-theme .control-panel { width: auto; min-height: 100vh; padding: 42px 32px; }
    .atlas-theme.worktable-ordering .poster-container { height: 100vh; }
}
.atlas-theme #design-form .editorial-intro { margin-bottom: 24px; }
.atlas-theme #design-form .editorial-intro h1 { font-size: 1.55rem; }
.atlas-theme #design-form .editorial-intro p { display: none; }
.atlas-theme .worktable-nav { gap: 5px; border: 0; }
.atlas-theme .worktable-tab {
    display: block; min-height: 36px; padding: 8px 2px; border: 0; border-bottom: 2px solid #d0c9ba;
    color: #6b6a60; background: transparent; box-shadow: none; font-size: 0.65rem; white-space: nowrap;
}
.atlas-theme .worktable-tab.is-active { border-bottom-color: #8e6b31; background: transparent; box-shadow: none; color: #263736; }
.atlas-theme .worktable-number { display: none; }
.atlas-theme .guide-heading { margin: 34px 0 0; }
.atlas-theme .guide-step-number { margin: 0 0 12px; color: #957b4e; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.14em; }
.atlas-theme .guide-heading h2 { margin: 0 0 8px; color: #21302f; font: 400 2rem/1.05 'Cormorant Garamond', Georgia, serif; }
.atlas-theme .guide-step-note { margin: 0; color: #6b6a60; font-size: 0.75rem; line-height: 1.5; }
.atlas-theme .worktable-panels { padding-top: 24px; }
.atlas-theme .guide-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.atlas-theme .guide-actions button { min-height: 48px; padding: 0 18px; border: 1px solid #243536; font: 600 0.8rem 'DM Sans', sans-serif; cursor: pointer; }
.atlas-theme .guide-previous { background: transparent; color: #243536; }
.atlas-theme .guide-next { margin-left: auto; min-width: 145px; background: #243536; color: #f8f5eb; }
.atlas-theme .guide-actions button:focus-visible { outline: 2px solid #987437; outline-offset: 2px; }
.atlas-theme .guide-actions button[hidden], .atlas-theme #design-form .checkout-section[hidden] { display: none; }
.atlas-theme #design-form .checkout-section { margin-top: 16px; max-width: none; }
.atlas-theme #design-form .location-attribution { margin-top: 35px; }
@media (max-width: 900px) {
    .atlas-theme .poster-container { height: auto; min-height: 0; padding: 54px 20px 22px; }
    .atlas-theme .poster { width: min(100%, 400px); height: auto; max-height: none; aspect-ratio: 3 / 4; }
    .atlas-theme .control-panel { padding: 22px 20px 40px; }
    .atlas-theme .guide-heading { margin-top: 25px; }
    .atlas-theme .guide-heading h2 { font-size: 1.85rem; }
    .atlas-theme .worktable-tab { display: block; font-size: 0.65rem; }
}

@media (max-width: 900px) {
    .atlas-theme .poster-container {
        display: flex; flex-direction: column; justify-content: flex-start;
        padding-bottom: 14px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .atlas-theme { scroll-behavior: auto; }
}


/* Short examples use the actual map renderer without changing the design form. */
.poster-demo-highlight { animation: poster-demo-glow 1.3s ease-in-out; }
@keyframes poster-demo-glow {
    0%, 100% { opacity: 1; text-shadow: none; }
    35% { opacity: 1; color: #fff2c9; text-shadow: 0 0 8px rgba(248,219,154,.9), 0 0 18px rgba(248,219,154,.4); }
}
.atlas-theme .poster-demo-skip {
    display: none; position: absolute; z-index: 30; right: 8px; top: 8px;
    min-height: 30px; padding: 4px 8px; border: 1px solid rgba(218,196,153,.35);
    background: rgba(8,18,30,.75); color: #e0d0af; font: 500 10px 'DM Sans', sans-serif; cursor: pointer;
}
.atlas-theme .poster-demo-playing .poster-demo-skip { display: block; }
.atlas-theme .poster-demo-replay {
    position: absolute; z-index: 6; right: 20px; bottom: 18px; padding: 8px; border: 0;
    background: transparent; color: #d2b986; font: 500 11px 'DM Sans', sans-serif; cursor: pointer;
}
.atlas-theme .poster-demo-replay[hidden] { display: none; }
.atlas-theme :is(.poster-demo-skip, .poster-demo-replay):focus-visible { outline: 2px solid #d5b87f; outline-offset: 2px; }
@media (max-width: 900px) {
    .atlas-theme .poster-demo-replay { position: static; margin: 0 auto; min-height: 32px; }
}

/* Briefly explain the idea, then reveal the real poster under the examples. */
.atlas-theme .poster-demo-introduction {
    display: none; position: absolute; z-index: 25; inset: 0; flex-direction: column; align-items: center; justify-content: center;
    padding: 12%; text-align: center; color: #f4ead7; background: #0b1825; pointer-events: none;
}
.atlas-theme .poster-demo-playing .poster-demo-introduction { display: flex; animation: poster-demo-reveal 2.2s ease both; }
.atlas-theme .poster-demo-introduction span { color: #c9b58d; font: 600 clamp(7px, .65vw, 10px) 'DM Sans', sans-serif; letter-spacing: .16em; }
.atlas-theme .poster-demo-introduction p { margin: 15px 0 0; font: 400 clamp(21px, 2.3vw, 35px)/1.05 'Cormorant Garamond', Georgia, serif; }
@keyframes poster-demo-reveal { 0%, 55% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
/* Match the poster's message and metadata typefaces in the introduction. */
.atlas-theme .poster-demo-introduction span { font-family: 'Manrope', sans-serif; font-weight: 300; }
.atlas-theme .poster-demo-introduction p { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 400; font-style: normal; letter-spacing: .035em; }
.atlas-theme.reference-atlas .poster-demo-introduction p { font-family: 'Manrope', sans-serif; font-weight: 400; letter-spacing: .12em; }

.atlas-theme .poster-demo-detail-caption { display: none; }
.atlas-theme .poster-demo-playing .poster-demo-detail-caption.is-visible {
    position: absolute; z-index: 20; left: 3%; top: 3%; display: flex; flex-direction: column; gap: 3px;
    max-width: 58%; padding: 7px 9px; background: rgba(7, 17, 27, .83); color: #f0e6d0;
    border-left: 1px solid rgba(213, 184, 127, .65); pointer-events: none;
    font: 400 clamp(8px, .72vw, 10px)/1.35 'Manrope', sans-serif;
    animation: poster-demo-caption-in .4s ease both;
}
.atlas-theme .poster-demo-detail-caption span:first-child { color: #cfb98d; font-size: .8em; letter-spacing: .12em; }
@keyframes poster-demo-caption-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* Style cards use previews captured from the poster renderer. */
.atlas-theme .poster-palettes legend { margin-bottom: 12px; }
.atlas-theme .palette-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.atlas-theme .palette-option {
    display: flex; flex-direction: column; align-items: stretch; gap: 7px;
    padding: 7px 7px 9px; min-width: 0; background: rgba(255, 255, 255, .3);
    font-size: 11px; line-height: 1.3;
}
.atlas-theme .palette-option:has(input:checked) { background: #e9e4d7; }
.atlas-theme .palette-preview { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #15212a; }
.atlas-theme .palette-option small { font-size: 10px; }
@media (max-width: 380px) {
    .atlas-theme .palette-options { gap: 7px; }
    .atlas-theme .palette-option { padding: 5px; font-size: 10px; }
    .atlas-theme .palette-option small { font-size: 9px; }
}

@media (max-width: 900px) {
    .atlas-theme .mobile-poster-header { display: none; }
    .atlas-theme .poster-container { padding-top: 20px; }
}

@media (max-width: 900px) {
    .atlas-theme #design-form .editorial-intro { margin-bottom: 10px; }
}

/* Soft, muted colorways with a darker sky for readable stars. */
body.atlas-theme[data-poster-palette="dusty-rose"] {
    --plate-bg: #cfb1aa; --plate-sky: #775c63; --plate-ink: #6c5154;
    --plate-text: #43383a; --plate-muted: #604d4c; --sky-filter: none;
}
body.atlas-theme[data-poster-palette="dusty-blue"] {
    --plate-bg: #b1c2c4; --plate-sky: #536d79; --plate-ink: #50646b;
    --plate-text: #34454b; --plate-muted: #4d6165; --sky-filter: none;
}
body.atlas-theme[data-poster-palette="dusty-rose"]:is(.reference-atlas, .atlas-theme) .poster,
body.atlas-theme[data-poster-palette="dusty-blue"]:is(.reference-atlas, .atlas-theme) .poster { background: var(--plate-bg); }
body.atlas-theme[data-poster-palette="dusty-rose"]:is(.reference-atlas, .atlas-theme) :is(.starmap-circle, .location-star-face),
body.atlas-theme[data-poster-palette="dusty-blue"]:is(.reference-atlas, .atlas-theme) :is(.starmap-circle, .location-star-face) { background: var(--plate-sky); border-color: rgba(244, 231, 209, .6); box-shadow: none; }
body.atlas-theme[data-poster-palette="dusty-rose"]:is(.reference-atlas, .atlas-theme) .message-text,
body.atlas-theme[data-poster-palette="dusty-blue"]:is(.reference-atlas, .atlas-theme) .message-text { color: var(--plate-text); }
body.atlas-theme[data-poster-palette="dusty-rose"]:is(.reference-atlas, .atlas-theme) :is(.info-location,.info-date,.info-coords,.magnitude-legend),
body.atlas-theme[data-poster-palette="dusty-blue"]:is(.reference-atlas, .atlas-theme) :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color: var(--plate-muted); }

/* Golden paper and a deep ink-blue sky for a stronger contrast. */
body.atlas-theme[data-poster-palette="golden-night"] {
    --plate-bg: #e0be76; --plate-sky: #112e42; --plate-ink: #3c3327;
    --plate-text: #302b24; --plate-muted: #4c4030; --sky-filter: none;
}
body.atlas-theme[data-poster-palette="golden-night"]:is(.reference-atlas, .atlas-theme) .poster { background: var(--plate-bg); }
body.atlas-theme[data-poster-palette="golden-night"]:is(.reference-atlas, .atlas-theme) :is(.starmap-circle,.location-star-face) { background: var(--plate-sky); border-color: #ead7a6; box-shadow: none; }
body.atlas-theme[data-poster-palette="golden-night"]:is(.reference-atlas, .atlas-theme) .message-text { color: var(--plate-text); }
body.atlas-theme[data-poster-palette="golden-night"]:is(.reference-atlas, .atlas-theme) :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color: var(--plate-muted); }

/* Soft pairings of the dusty blue and rose colorways. */
body.atlas-theme[data-poster-palette="rose-blue"] { --plate-bg:#cfb1aa; --plate-sky:#536d79; --plate-ink:#795d62; --plate-text:#403b3d; --plate-muted:#604e50; --sky-filter:none; }
body.atlas-theme[data-poster-palette="blue-rose"] { --plate-bg:#b1c2c4; --plate-sky:#775c63; --plate-ink:#56686a; --plate-text:#354448; --plate-muted:#4b5d60; --sky-filter:none; }
body.atlas-theme[data-poster-palette="moonlight"] { --plate-bg:#e7dad4; --plate-sky:#536d79; --plate-ink:#967777; --plate-text:#474043; --plate-muted:#706064; --sky-filter:none; }
body.atlas-theme:is([data-poster-palette="rose-blue"],[data-poster-palette="blue-rose"],[data-poster-palette="moonlight"]):is(.reference-atlas,.atlas-theme) .poster { background:var(--plate-bg); }
body.atlas-theme:is([data-poster-palette="rose-blue"],[data-poster-palette="blue-rose"],[data-poster-palette="moonlight"]):is(.reference-atlas,.atlas-theme) :is(.starmap-circle,.location-star-face) { background:var(--plate-sky); border-color:rgba(244,231,209,.6); box-shadow:none; }
body.atlas-theme:is([data-poster-palette="rose-blue"],[data-poster-palette="blue-rose"],[data-poster-palette="moonlight"]):is(.reference-atlas,.atlas-theme) .message-text { color:var(--plate-text); }
body.atlas-theme:is([data-poster-palette="rose-blue"],[data-poster-palette="blue-rose"],[data-poster-palette="moonlight"]):is(.reference-atlas,.atlas-theme) :is(.info-location,.info-date,.info-coords,.magnitude-legend) { color:var(--plate-muted); }

/* Mobile bottom drawer keeps the live sky visible above its controls. */
.mobile-side-open-button, .mobile-side-close-button { display: none; }
@media (max-width: 900px) {
    body.atlas-theme.mobile-drawer-ready { --bottom-drawer-height: 56dvh; }
    .atlas-theme.mobile-drawer-ready .mobile-side-open-button {
        display: block; flex: none; min-height: 46px; margin: 12px auto 0; padding: 0 18px;
        border: 1px solid #a89061; background: transparent; color: #ead7af;
        font: 600 .8rem 'DM Sans', sans-serif; cursor: pointer;
    }
    .atlas-theme.mobile-drawer-ready .control-panel {
        position: fixed; z-index: 90; top: auto; right: 0; bottom: 0; left: 0;
        width: 100%; height: var(--bottom-drawer-height); max-height: none;
        padding: 0 18px calc(28px + env(safe-area-inset-bottom));
        overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
        transform: translateY(100%); transition: transform .3s ease; box-shadow: 0 -8px 24px rgba(0,0,0,.2);
        border-radius: 12px 12px 0 0; visibility: hidden;
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open { overflow: hidden; }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .control-panel { transform: translateY(0); visibility: visible; }
    .atlas-theme.mobile-drawer-ready .mobile-side-close-button {
        display: block; position: sticky; top: 0; z-index: 5; width: 100%; min-height: 44px;
        padding: 0; margin: 0 0 8px; border: 0; border-bottom: 1px solid #d6d0c3;
        background: #f3f0e8; color: #475451; text-align: left;
        font: 600 .75rem 'DM Sans', sans-serif; cursor: pointer;
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .poster-container {
        position: fixed; z-index: 10; top: 0; left: 0; width: 100%;
        height: calc(100dvh - var(--bottom-drawer-height)); min-height: 0;
        padding: 10px; display: flex; justify-content: center; overflow: hidden;
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .poster { width: auto; height: 100%; max-width: 100%; max-height: 100%; }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .mobile-side-open-button { display: none; }
    .atlas-theme.mobile-drawer-ready .worktable-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 4px; }
    .atlas-theme.mobile-drawer-ready .worktable-tab { min-height: 42px; white-space: normal; font-size: .65rem; }
    .atlas-theme.mobile-drawer-ready .palette-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .atlas-theme.mobile-drawer-ready .guide-heading { margin-top: 18px; }
    .atlas-theme.mobile-drawer-ready .worktable-panels { padding-top: 12px; }
    .atlas-theme.mobile-drawer-ready .guide-actions { flex-wrap: wrap; }
    .atlas-theme.mobile-drawer-ready .guide-actions button { flex: 1; min-width: 0; padding: 0 8px; }
    .atlas-theme.mobile-drawer-ready.worktable-ordering .control-panel { width: 100%; height: 100dvh; border-radius: 0; }
    .atlas-theme.mobile-drawer-ready.worktable-ordering .mobile-side-close-button { display: none; }
    .atlas-theme.mobile-drawer-ready :is(.mobile-side-open-button,.mobile-side-close-button):focus-visible { outline: 2px solid #987437; outline-offset: 2px; }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .starmap-wrapper { container-type: size; }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .starmap-circle { width: min(90%, 100cqh); max-height: none; flex: none; }
}
@media (prefers-reduced-motion: reduce) {
    .atlas-theme.mobile-drawer-ready .control-panel { transition: none; }
}

/* A visible drawer handle invites customization without covering the poster. */
@media (max-width: 900px) {
    .atlas-theme.mobile-drawer-ready:not(.mobile-side-open) .poster-container { padding-bottom: 90px; }
    .atlas-theme.mobile-drawer-ready .control-panel {
        visibility: visible; pointer-events: none;
        transform: translateY(calc(100% - 76px - env(safe-area-inset-bottom)));
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .control-panel { pointer-events: auto; }
    .atlas-theme.mobile-drawer-ready .mobile-side-open-button {
        position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; width: 100%;
        display: flex; align-items: center; justify-content: space-between;
        min-height: calc(76px + env(safe-area-inset-bottom)); margin: 0;
        padding: 17px 20px calc(12px + env(safe-area-inset-bottom));
        border: 0; border-top: 1px solid #d0c9bb; border-radius: 12px 12px 0 0;
        background: #f3f0e8; color: #243536; text-align: left;
    }
    .atlas-theme.mobile-drawer-ready.mobile-side-open .mobile-side-open-button { display: none; }
    .mobile-drawer-grip { position: absolute; top: 7px; left: 50%; width: 36px; height: 3px; border-radius: 3px; background: #b5ad9d; transform: translateX(-50%); }
    .mobile-drawer-label { font-size: .875rem; line-height: 1.3; }
    .mobile-drawer-label small { display: block; margin-top: 4px; color: #6f7069; font-size: .6875rem; font-weight: 400; }
    .mobile-drawer-arrow { color: #806a43; font-size: 1.2rem; }
}
@media (max-width: 900px) {
    .atlas-theme.mobile-drawer-ready:not(.mobile-side-open) .poster-container { min-height: 100dvh; }
}

.atlas-theme .store-legal-links { display: flex; flex-wrap: wrap; gap: 8px 14px; border-top: 1px solid #d0c9bb; margin-top: 24px; padding-top: 14px; font: 400 11px/1.5 'DM Sans', sans-serif; }
.atlas-theme .store-legal-links a { color: #595b53; text-underline-offset: 3px; }

/* Place the example action with the editor introduction. */
.atlas-theme #design-form .editorial-intro .poster-demo-replay {
    position: static; display: inline-block; margin: 8px 0 0; padding: 6px 0;
    min-height: 36px; color: #5b604f; font: 500 12px/1.4 'DM Sans', sans-serif;
    text-decoration: underline; text-underline-offset: 3px;
}
.atlas-theme #design-form .editorial-intro .poster-demo-replay[hidden] { display: none; }
.atlas-theme .half-globe-option .field-hint { margin: 0 0 12px; }
.atlas-theme .half-globe-option small { color: #77736c; font-size: .7em; font-weight: 500; }
.atlas-theme .classic-stars-option .field-hint { margin: 0 0 12px; }
