/* ==========================================================================
   APP SPECIFIC STYLES (SPA - PREMIUM STUDIO)
   ========================================================================== */

:root {
    --white: var(--bg-surface, #FFFFFF);
    --bg-main: var(--bg-main, #FAF9F6);
    --border-color: var(--border-medium, rgba(0,0,0,0.15));
    --text-main: var(--text-primary, #111111);
    --text-secondary: var(--text-muted, #666666);
    --font-body: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    --font-serif: var(--font-serif, 'Playfair Display', serif);
}

/* View transitions */
.view-enter {
    opacity: 0;
    transform: translateY(10px);
}
.view-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.view-leave {
    opacity: 1;
}
.view-leave-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* -------------------------------------
   NEW 3-PANE CONFIGURATOR UI (Premium Style)
   ------------------------------------- */

.configurator-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header Specific for Configurator */
.config-header {
    height: 60px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.config-header .logo {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-decoration: none;
}

.config-nav {
    display: flex;
    gap: 2.5rem;
}

.config-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.config-nav a:hover {
    color: var(--text-main);
}

/* Main Workspace */
.config-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 1. Sleek Modern Dark Tools Sidebar */
.tools-sidebar {
    width: 84px;
    background: linear-gradient(180deg, #18191c 0%, #0d0e11 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    flex-shrink: 0;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.tool-btn {
    width: 100%;
    margin-bottom: 6px;
    padding: 12px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn svg {
    margin-bottom: 5px;
    transition: transform 0.2s ease, stroke 0.2s ease;
}

.tool-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.03em;
    opacity: 0.85;
}

.tool-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.tool-btn:hover svg {
    transform: translateY(-1px) scale(1.08);
}

.tool-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tool-btn.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--accent-gold, #d4af37);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.tool-btn.active svg {
    stroke: #ffffff;
    transform: scale(1.05);
}

.tools-sidebar-bottom {
    margin-top: auto;
    width: 100%;
}

/* 2. Options Panel (White) */
.options-panel {
    width: 380px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 5;
    box-shadow: 2px 0 15px rgba(0,0,0,0.03);
}

.panel-header {
    padding: 25px;
    padding-bottom: 15px;
}

.panel-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    padding-top: 10px;
}

.panel-footer {
    padding: 20px;
    background: var(--bg-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.price {
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-cart {
    background: #7a8a6b; /* Mapiful greenish primary */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-cart:hover {
    background: #6a7a5b;
}

/* 3. Preview Area (Gray) */
.preview-area {
    flex: 1;
    background-color: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px;
}

/* The Poster Frame */
.poster-frame {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 50 / 70; /* Standard poster ratio */
    background: var(--poster-background, var(--white));
    padding: 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    display: block;
    position: relative;
    transition: padding 0.3s;
}

.poster-map-shell {
    position: absolute;
    background: #f8f8f8;
    overflow: hidden;
}

.poster-map-container {
    width: 100%;
    height: 100%;
    position: relative;
    border: none;
}

.map-live-unavailable {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    padding: 20px;
    color: var(--poster-text, #555);
    font-size: 0.72rem;
    text-align: center;
    opacity: 0.7;
}

.poster-text-zone {
    position: absolute;
    left: 0;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.poster-title {
    max-width: 82%;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
    white-space: nowrap;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 500;
    font-size: var(--poster-title-size, 2rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1.1;
    color: var(--poster-text, var(--text-main));
}

.poster-subtitle {
    max-width: 82%;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
    white-space: nowrap;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 500;
    font-size: var(--poster-subtitle-size, 0.9rem);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--poster-text, var(--text-secondary));
    opacity: 0.68;
}

.poster-divider {
    width: var(--poster-divider-width, 30px);
    height: var(--poster-divider-height, 1px);
    background-color: var(--poster-text, var(--text-main));
    margin: var(--poster-divider-margin, 4px) auto;
    opacity: 0.8;
}

.poster-coordinates {
    max-width: 82%;
    margin: var(--poster-coordinates-gap, 2px) auto 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 500;
    font-size: var(--poster-coordinates-size, 0.72rem);
    line-height: 1.2;
    color: var(--poster-text, var(--text-secondary));
    opacity: 0.55;
    letter-spacing: 0.1em;
}

.poster-footer {
    max-width: 82%;
    margin: var(--poster-footer-gap, 2px) auto 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--poster-text, var(--text-secondary));
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: var(--poster-footer-size, 0.8rem);
    line-height: 1.2;
    letter-spacing: 0.08em;
    opacity: 0.62;
}

.styled-input.is-geocoding {
    background-image: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.15), transparent);
    background-size: 200% 100%;
    animation: geocodingPulse 1.1s linear infinite;
}

.styled-input.has-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

@keyframes geocodingPulse {
    to { background-position: -200% 0; }
}

/* Map Overlays */
.map-zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

.map-zoom-btn {
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #333;
}
.map-zoom-btn:first-child {
    border-bottom: 1px solid #ddd;
}

/* UI Elements inside Panels */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.styled-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.styled-input:focus {
    border-color: var(--text-main);
}

/* Themes Grid */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.theme-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-card:hover {
    border-color: #888;
}

.theme-card.active {
    border-color: var(--text-main);
    box-shadow: 0 0 0 1px var(--text-main);
}

.theme-preview {
    width: 100%;
    aspect-ratio: 1;
    background-color: #eee;
    margin-bottom: 8px;
    border-radius: 2px;
}

.theme-name {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Stop Inputs specific */
.stops-list {
    margin-top: 10px;
}
.stop-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}
.stop-item-drag {
    color: #ccc;
    cursor: grab;
}
.stop-item input {
    flex: 1;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: var(--bg-main);
}

/* Hidden elements */
.d-none {
    display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 992px) {
    .config-workspace {
        flex-direction: column;
    }
    
    .tools-sidebar {
        flex-direction: row;
        width: 100%;
        height: 60px;
        padding: 0;
        justify-content: space-around;
        order: 2; /* Move to bottom */
    }
    
    .tool-btn {
        padding: 10px 0;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .tool-btn.active {
        border-left: none;
        border-bottom: 3px solid var(--white);
    }
    
    .tools-sidebar-bottom {
        display: none;
    }
    
    .options-panel {
        width: 100%;
        height: 40vh; /* Fixed height at bottom */
        order: 3;
    }
    
    .preview-area {
        order: 1; /* Map on top */
        padding: 20px;
    }
}

/* -------------------------------------
   GENERATION OVERLAY
   ------------------------------------- */
.generation-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(10px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    animation: fadeIn 0.3s ease forwards;
}

.generation-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exact-preview-result {
    width: min(100%, 1040px);
    max-height: calc(100vh - 48px);
    padding: 24px;
    flex-direction: column;
    align-items: center;
    overflow: auto;
}

.exact-preview-heading {
    max-width: 620px;
    margin-bottom: 18px;
}

.exact-preview-heading h3,
.generation-error h3 {
    margin: 7px 0 5px;
    font-family: var(--font-serif);
    font-size: 1.55rem;
}

.exact-preview-heading p,
.generation-error p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.exact-preview-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(197, 160, 89, 0.14);
    color: #8f6d2f;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#exact-preview-image {
    display: block;
    max-width: min(100%, 520px);
    max-height: 62vh;
    object-fit: contain;
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
}

.generation-error {
    width: min(100%, 540px);
    max-width: 540px;
    padding: 38px;
    flex-direction: column;
    align-items: center;
}

.generation-error-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff0ed;
    color: #b53b2d;
    font-size: 1.6rem;
    font-weight: 700;
}

.generation-error.is-unavailable .generation-error-icon {
    background: #f4efe4;
    color: #8b6a32;
}

.generation-error-lead {
    max-width: 450px;
    margin: 4px auto 0;
    line-height: 1.55;
}

.generation-error-reassurance {
    width: 100%;
    margin-top: 20px;
    padding: 15px 17px;
    border: 1px solid #dfd3bb;
    border-radius: 12px;
    background: #fbf8f1;
    color: #514936;
    text-align: left;
}

.generation-error-reassurance[hidden] {
    display: none;
}

.generation-error-reassurance strong,
.generation-error-reassurance span {
    display: block;
}

.generation-error-reassurance strong {
    margin-bottom: 5px;
    color: #29251e;
    font-size: 0.88rem;
}

.generation-error-reassurance span {
    font-size: 0.8rem;
    line-height: 1.55;
}

.generation-error-detail {
    margin-top: 12px;
    color: #91887a !important;
    font-size: 0.72rem !important;
}

.generation-error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 22px;
}

.generation-error-actions button {
    min-height: 43px;
    padding: 10px 18px;
}

@media (max-width: 680px) {
    .exact-preview-result {
        padding: 16px;
    }

    #exact-preview-image {
        max-height: 55vh;
    }

    .result-actions {
        width: 100%;
        flex-direction: column;
    }

    .generation-error {
        padding: 24px 18px;
    }

    .generation-error-actions {
        flex-direction: column-reverse;
    }

    .generation-error-actions button {
        width: 100%;
    }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(197, 160, 89, 0.3);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* -------------------------------------
   FORMAT SELECTION
   ------------------------------------- */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.format-card {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-surface);
}

.format-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.format-card.active {
    border-color: var(--accent-gold);
    background: rgba(197, 160, 89, 0.05);
    box-shadow: 0 0 0 1px var(--accent-gold);
}

.format-card h4 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.format-price {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--accent-gold);
    margin-top: 8px;
    font-size: 1.1rem;
}

/* -------------------------------------
   INTENT WIZARD (STORY SELECTION)
   ------------------------------------- */
.intent-wizard-container {
    padding: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

.intent-header {
    text-align: center;
    margin-bottom: 24px;
}

.intent-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-gold, #c5a059);
    margin-bottom: 6px;
}

.intent-title {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--text-main, #111);
    margin-bottom: 6px;
}

.intent-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary, #666);
}

.intent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.intent-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 16px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.intent-card:hover {
    border-color: var(--accent-gold, #c5a059);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(197, 160, 89, 0.15);
}

.intent-card.selected {
    border-color: var(--accent-gold, #c5a059);
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.06) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: 0 0 0 1.5px var(--accent-gold, #c5a059), 0 8px 20px rgba(197, 160, 89, 0.12);
}

.intent-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--accent-gold, #c5a059);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.intent-card:hover .intent-icon-wrapper,
.intent-card.selected .intent-icon-wrapper {
    background: var(--accent-gold, #c5a059);
    color: #ffffff;
}

.intent-card-title {
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main, #111);
    margin-bottom: 4px;
}

.intent-card-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-gold, #c5a059);
    margin-bottom: 6px;
}

.intent-card-desc {
    font-size: 0.73rem;
    color: var(--text-secondary, #666);
    line-height: 1.35;
}

.subquestion-box {
    background: rgba(248, 248, 248, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 16px;
    margin-top: 15px;
    animation: fadeIn 0.25s ease-out;
}

.subquestion-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main, #111);
    margin-bottom: 12px;
}

.suboptions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suboption-chip {
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary, #334155);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suboption-chip:hover {
    border-color: var(--accent-gold, #c5a059);
    color: var(--accent-gold, #c5a059);
}

.suboption-chip.active {
    border-color: var(--accent-gold, #c5a059);
    background: var(--accent-gold, #c5a059);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.gpx-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #ffffff;
    border: 1.5px dashed var(--accent-gold, #c5a059);
    border-radius: 8px;
    color: var(--accent-gold, #c5a059);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.gpx-upload-btn:hover {
    background: rgba(197, 160, 89, 0.08);
}

/* -------------------------------------
   START PAGE (GUIDED ONBOARDING)
   ------------------------------------- */
.start-page-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: #f8f8f8;
}

.start-wizard-card {
    max-width: 840px;
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
    padding: 44px;
    border: 1px solid rgba(0,0,0,0.06);
    animation: fadeIn 0.3s ease-out;
}

.start-wizard-header {
    text-align: center;
    margin-bottom: 32px;
}

.start-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold, #c5a059);
    display: block;
    margin-bottom: 8px;
}

.start-title {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 2.1rem;
    font-weight: 600;
    color: #111111;
    margin-bottom: 8px;
}

.start-subtitle {
    color: #666666;
    font-size: 0.92rem;
}

.start-form-group {
    margin-bottom: 20px;
}

.start-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #222222;
    margin-bottom: 8px;
}

.start-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-medium, #cbd5e1);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111111;
    outline: none;
    transition: border-color 0.2s ease;
}

.start-input:focus {
    border-color: var(--accent-gold, #c5a059);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.start-progress {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 16px;
}

.start-progress-dot {
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: #e7e3dc;
    transition: background 0.2s ease;
}

.start-progress-dot.active {
    background: var(--accent-gold, #c5a059);
}

.start-intent-grid {
    gap: 16px;
}

.start-intent-card {
    width: 100%;
    min-height: 205px;
    padding: 22px 20px;
    text-align: left;
    font: inherit;
}

.start-intent-card .intent-icon-wrapper,
.intent-card-soon .intent-icon-wrapper {
    width: 44px;
    height: 44px;
}

.intent-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.intent-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f4efe5;
    color: #79633e;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.intent-card-featured .intent-card-badge {
    background: #e8f1ec;
    color: #416453;
}

.intent-card-check {
    position: absolute;
    right: 16px;
    bottom: 14px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid #dedbd4;
    border-radius: 50%;
    color: transparent;
    font-size: 0.72rem;
}

.start-intent-card.selected .intent-card-check {
    border-color: var(--accent-gold, #c5a059);
    background: var(--accent-gold, #c5a059);
    color: #fff;
}

.intent-card-soon {
    min-height: 205px;
    padding: 22px 20px;
    cursor: default;
    opacity: 0.68;
    background: #fafafa;
}

.intent-card-soon:hover {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transform: none;
}

.start-actions {
    gap: 14px;
    margin-top: 30px;
}

.start-actions-centered {
    display: flex;
    justify-content: center;
}

.start-actions-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.start-actions .btn-primary,
.start-actions .btn-outline {
    min-height: 48px;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 650;
    cursor: pointer;
}

.start-step2-container {
    max-width: 690px;
    margin: 0 auto;
}

.start-help {
    margin: -3px 0 9px;
    color: #777;
    font-size: 0.76rem;
    line-height: 1.45;
}

.start-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.start-label-optional {
    color: #999;
    font-size: 0.72rem;
    font-weight: 400;
}

.start-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 0.84rem;
    cursor: pointer;
}

.start-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold, #c5a059);
}

.start-error {
    margin: 18px 0 0;
    padding: 10px 13px;
    border: 1px solid #efc5c5;
    border-radius: 8px;
    background: #fff7f7;
    color: #a33c3c;
    font-size: 0.82rem;
    text-align: center;
}

.route-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.route-mode-card {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: 78px 1fr 22px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #dedbd4;
    border-radius: 12px;
    background: #fff;
    color: #252525;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.route-mode-card:hover {
    border-color: var(--accent-gold, #c5a059);
    transform: translateY(-2px);
}

.route-mode-card.selected {
    border-color: var(--accent-gold, #c5a059);
    box-shadow: 0 0 0 1.5px var(--accent-gold, #c5a059);
}

.route-mode-visual {
    display: grid;
    height: 58px;
    place-items: center;
    border-radius: 8px;
    background: #f3f1ec;
}

.route-mode-visual svg {
    width: 68px;
    fill: none;
    stroke: var(--accent-gold, #c5a059);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.route-mode-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.route-mode-copy strong {
    font-size: 0.79rem;
}

.route-mode-copy small {
    color: #76716a;
    font-size: 0.67rem;
    line-height: 1.35;
}

.route-mode-check {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border: 1px solid #dedbd4;
    border-radius: 50%;
    color: transparent;
    font-size: 0.7rem;
}

.route-mode-card.selected .route-mode-check {
    border-color: var(--accent-gold, #c5a059);
    background: var(--accent-gold, #c5a059);
    color: #fff;
}

.route-mode-editor {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-medium, #e2e8f0);
}

.route-mode-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.route-mode-editor-btn {
    padding: 9px 8px;
    border: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
}

.route-mode-editor-btn.active {
    border-color: var(--accent-gold, #c5a059);
    background: rgba(197, 160, 89, 0.09);
    color: #765e36;
}

.route-invert-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
    font-size: 0.75rem;
    cursor: pointer;
}

.route-mode-editor-help {
    margin-top: 9px;
    color: #777;
    font-size: 0.69rem;
    line-height: 1.4;
}

.design-recommendations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.design-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid #e2dfd8;
    border-radius: 14px;
    background: #fff;
    color: #222;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.design-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-gold, #c5a059);
    box-shadow: 0 10px 26px rgba(31, 27, 20, 0.09);
}

.design-card.selected {
    border-color: var(--accent-gold, #c5a059);
    box-shadow: 0 0 0 1.5px var(--accent-gold, #c5a059), 0 10px 26px rgba(31, 27, 20, 0.08);
}

.design-card-rank {
    min-height: 18px;
    color: #8a7147;
    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.design-poster-mini {
    display: flex;
    aspect-ratio: 5 / 7;
    flex-direction: column;
    margin: 9px 0 13px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: var(--design-bg);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.design-map-mini {
    display: grid;
    flex: 1;
    place-items: center;
    overflow: hidden;
    background: color-mix(in srgb, var(--design-map) 16%, var(--design-bg));
}

.design-map-mini svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--design-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.design-map-mini .lake-shape {
    fill: var(--design-map);
    stroke: var(--design-map);
}

.design-title-line,
.design-subtitle-line {
    height: 4px;
    margin: 10px auto 0;
    border-radius: 99px;
    background: var(--design-map);
}

.design-title-line {
    width: 56%;
}

.design-subtitle-line {
    width: 36%;
    height: 2px;
    margin-top: 5px;
    opacity: 0.55;
}

.design-card-name {
    font-family: var(--font-serif, 'Playfair Display', serif);
    font-size: 1rem;
    font-weight: 600;
}

.design-card-description {
    min-height: 50px;
    margin-top: 5px;
    color: #73706a;
    font-size: 0.72rem;
    line-height: 1.45;
}

.design-select-indicator {
    margin-top: 9px;
    color: var(--accent-gold, #c5a059);
    font-size: 0.7rem;
    font-weight: 700;
}

.design-reassurance {
    margin: 20px 0 0;
    color: #777;
    font-size: 0.78rem;
    text-align: center;
}

@media (max-width: 720px) {
    .start-page-container {
        align-items: flex-start;
        padding: 24px 12px;
    }

    .start-wizard-card {
        padding: 28px 18px;
        border-radius: 16px;
    }

    .start-title {
        font-size: 1.65rem;
    }

    .start-intent-grid,
    .design-recommendations,
    .start-form-row,
    .route-mode-grid {
        grid-template-columns: 1fr;
    }

    .start-intent-card,
    .intent-card-soon {
        min-height: 170px;
    }

    .design-recommendations {
        gap: 12px;
    }

    .design-card {
        display: grid;
        grid-template-columns: 105px 1fr;
        column-gap: 14px;
    }

    .design-card-rank,
    .design-poster-mini {
        grid-row: 1 / span 4;
        grid-column: 1;
    }

    .design-card-rank {
        z-index: 1;
        align-self: start;
        margin: 8px;
        padding: 4px;
        color: #5d4b2e;
        background: rgba(255, 255, 255, 0.84);
    }

    .design-poster-mini {
        width: 105px;
        margin: 0;
    }

    .design-card-name {
        align-self: end;
    }

    .design-card-description {
        min-height: auto;
    }

    .start-actions-split {
        flex-direction: column-reverse;
    }

    .start-actions .btn-primary,
    .start-actions .btn-outline {
        width: 100%;
    }
}

/* -------------------------------------
   CIRCULAR MAP FRAME (dessin_map_rond)
   ------------------------------------- */
.poster-map-container.is-round-mask {
    border-radius: 50% !important;
    overflow: hidden !important;
    margin: 20px auto !important;
    max-width: 80% !important;
    aspect-ratio: 1 / 1 !important;
    box-shadow: inset 0 0 0 4px var(--accent-gold, #c5a059), 0 8px 25px rgba(0,0,0,0.12) !important;
}

/* ========================================================================== 
   STUDIO 2026 — Atelier Au Temps des Toiles
   ========================================================================== */
.studio-page {
    height: 100vh;
    overflow: hidden;
    background: #eeeae2;
}

.studio-page .header {
    position: relative;
    height: 64px;
    padding: 10px 3%;
    background: #fbfaf6;
    border-bottom-color: #ded9cf;
    backdrop-filter: none;
}

.studio-page .header-inner {
    max-width: none;
}

.studio-page .logo-mark {
    width: 32px;
    height: 32px;
    background: #1b1b19;
}

.studio-page .logo-text {
    font-size: 1.18rem;
}

.studio-page .desktop-nav,
.studio-page .header-actions {
    display: none;
}

.studio-page #app-root {
    height: calc(100vh - 64px) !important;
}

.studio-page .configurator-wrapper {
    height: 100%;
    min-height: 0;
    background: #f3f0e9;
}

.studio-commandbar {
    display: flex;
    height: 54px;
    flex: 0 0 54px;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: #fffefa;
    border-bottom: 1px solid #ded9cf;
}

.studio-commandbar-title {
    display: flex;
    align-items: baseline;
    gap: 11px;
}

.studio-commandbar-title span {
    color: #9b7a3f;
    font-size: 0.63rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.studio-commandbar-title strong {
    color: #262522;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
}

.studio-commandbar-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #77736c;
    font-size: 0.68rem;
}

.studio-live-status,
.studio-format-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #e4e0d8;
    border-radius: 999px;
    background: #fff;
}

.studio-live-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6f937c;
    box-shadow: 0 0 0 3px rgba(111, 147, 124, 0.13);
}

.studio-page .config-workspace {
    min-height: 0;
    background: #f0ede6;
}

.studio-page .tools-sidebar {
    width: 76px;
    padding: 14px 9px;
    gap: 7px;
    background: #fffefa;
    border-right: 1px solid #ded9cf;
    box-shadow: none;
}

.studio-page .tool-btn {
    height: 66px;
    margin: 0;
    padding: 9px 4px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #79756e;
}

.studio-page .tool-btn svg {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

.studio-page .tool-label {
    font-size: 0.61rem;
    font-weight: 650;
    letter-spacing: 0;
}

.studio-page .tool-btn:hover {
    color: #242320;
    background: #f6f3ed;
    border-color: #ebe6dc;
}

.studio-page .tool-btn.active {
    color: #292721;
    background: #eee5d2;
    border-color: #ddc99f;
    box-shadow: none;
}

.studio-page .tool-btn.active::before {
    left: -9px;
    width: 3px;
    height: 28px;
    background: #b48a43;
    box-shadow: none;
}

.studio-page .tool-btn.active svg {
    stroke: #8e682c;
}

.studio-page .tool-btn[data-tab="frames"],
.studio-page .tool-btn[data-tab="icons"],
.studio-page .tool-btn[data-tab="advanced"] {
    display: none;
}

.studio-page .options-panel {
    width: clamp(330px, 27vw, 390px);
    min-height: 0;
    background: #fbfaf6;
    border-right: 1px solid #d9d4ca;
    box-shadow: 10px 0 28px rgba(56, 49, 37, 0.04);
}

.studio-panel-intro {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 8px;
}

.studio-panel-intro > span {
    color: #aaa297;
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.studio-page .btn-back-question {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8b6a32;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 650;
    cursor: pointer;
}

.studio-page .panel-header {
    padding: 14px 22px 10px;
}

.studio-page .panel-title {
    margin: 0 0 5px;
    color: #211f1b;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    line-height: 1.12;
}

.studio-page .panel-subtitle {
    max-width: 310px;
    color: #777169;
    font-size: 0.76rem;
    line-height: 1.45;
}

.studio-page .panel-content {
    min-height: 0;
    padding: 10px 22px 18px;
    scrollbar-width: thin;
    scrollbar-color: #c8bda9 transparent;
}

.studio-page .panel-content::-webkit-scrollbar {
    width: 5px;
}

.studio-page .panel-content::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #c8bda9;
}

.studio-page .panel-footer {
    flex: 0 0 auto;
    padding: 13px 18px !important;
    gap: 7px !important;
    background: #fffefa !important;
    border-top: 1px solid #ded9cf !important;
}

.studio-page #btn-preview-exact {
    padding: 12px !important;
    border-radius: 9px !important;
    background: #1c1c1a !important;
    box-shadow: 0 7px 18px rgba(28, 28, 26, 0.16) !important;
    font-size: 0.82rem !important;
}

.studio-page .panel-footer .btn-next {
    padding: 6px !important;
    border: 0 !important;
    color: #77613c !important;
    font-size: 0.69rem !important;
}

.studio-page .preview-area {
    min-width: 0;
    padding: 50px 32px 24px;
    background-color: #ebe7df;
    background-image: radial-gradient(rgba(91, 81, 63, 0.12) 0.7px, transparent 0.7px);
    background-size: 18px 18px;
}

.preview-area-label {
    position: absolute;
    top: 14px;
    left: 22px;
    display: flex;
    align-items: baseline;
    gap: 9px;
    color: #68635b;
}

.preview-area-label span {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 600;
}

.preview-area-label small {
    color: #989188;
    font-size: 0.62rem;
}

.studio-page .poster-frame {
    width: auto;
    height: calc(100% - 12px);
    max-width: min(48vw, 540px);
    max-height: 720px;
    border: 1px solid rgba(79, 68, 49, 0.08);
    box-shadow: 0 25px 65px rgba(61, 52, 37, 0.19), 0 3px 10px rgba(61, 52, 37, 0.1);
}

.studio-page .map-zoom-controls {
    top: 12px;
    left: 12px;
    overflow: hidden;
    border: 1px solid rgba(38, 35, 29, 0.1);
    border-radius: 9px;
    background: rgba(255, 254, 250, 0.9);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
}

.studio-page .map-zoom-btn {
    width: 32px;
    height: 32px;
    color: #39352e;
    font-size: 1rem;
}

.studio-page .styled-input {
    padding: 10px 11px;
    border-color: #dcd6cb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.82rem;
}

.studio-page .styled-input:focus {
    border-color: #b08a4c;
    box-shadow: 0 0 0 3px rgba(176, 138, 76, 0.1);
}

.studio-page .stop-item {
    gap: 7px;
    margin-bottom: 7px;
}

.studio-page .stop-item-drag {
    color: #b9b1a5;
}

.studio-page .btn-secondary {
    padding: 9px;
    border: 1px dashed #c9bda9;
    border-radius: 8px;
    color: #755c34;
    font-size: 0.75rem;
}

.studio-page .route-mode-editor {
    margin-bottom: 13px;
    padding-bottom: 13px;
}

.studio-page .route-mode-editor-btn {
    border-radius: 7px;
    font-size: 0.69rem;
}

.studio-page .themes-grid {
    margin-top: 0;
}

.studio-page .theme-card {
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
}

.studio-page .theme-card:hover {
    transform: translateY(-2px);
}

.studio-page .theme-card.active {
    border: 0;
    box-shadow: none;
}

.studio-page .format-card {
    padding: 12px 8px;
    border-color: #ddd7cc;
    border-radius: 9px;
}

@media (max-width: 1120px) and (min-width: 801px) {
    .studio-page .config-workspace {
        flex-direction: row;
    }

    .studio-page .tools-sidebar {
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        order: initial;
    }

    .studio-page .options-panel {
        width: 320px;
        height: auto;
        order: initial;
    }

    .studio-page .tools-sidebar {
        width: 68px;
    }

    .studio-page .preview-area {
        order: initial;
        padding-right: 18px;
        padding-left: 18px;
    }

    .studio-page .poster-frame {
        max-width: 46vw;
        max-height: 640px;
    }
}

@media (max-width: 800px) {
    .studio-page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .studio-page #app-root,
    .studio-page .configurator-wrapper {
        height: auto !important;
        min-height: calc(100vh - 64px);
    }

    .studio-commandbar {
        height: 48px;
        padding: 0 14px;
    }

    .studio-commandbar-title span,
    .studio-format-status,
    .preview-area-label small {
        display: none;
    }

    .studio-page .config-workspace {
        display: grid;
        grid-template-rows: auto minmax(410px, 58vh) auto;
        overflow: visible;
    }

    .studio-page .tools-sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: grid;
        width: 100%;
        height: 58px;
        grid-template-columns: repeat(4, 1fr);
        order: 1;
        padding: 5px 8px;
        border-right: 0;
        border-bottom: 1px solid #ded9cf;
    }

    .studio-page .tool-btn {
        height: 47px;
        flex-direction: row;
        gap: 6px;
    }

    .studio-page .tool-btn svg {
        margin: 0;
    }

    .studio-page .tool-btn.active::before {
        display: none;
    }

    .studio-page .preview-area {
        min-height: 410px;
        order: 2;
        padding: 48px 18px 18px;
    }

    .studio-page .poster-frame {
        width: auto;
        height: 100%;
        max-width: 86vw;
    }

    .studio-page .options-panel {
        width: 100%;
        height: auto;
        min-height: 410px;
        order: 3;
        border-top: 1px solid #ded9cf;
        border-right: 0;
    }

    .studio-page .panel-content {
        max-height: 55vh;
    }
}
