/*
 * ═══════════════════════════════════════════════════════════════
 * 🎨 ATLAS STUDIO — Styles du Panneau Latéral (Phase 1)
 * ═══════════════════════════════════════════════════════════════
 * 
 * Convention Flexbox-Responsive :
 *   - Pas de pixels fixes pour la structure
 *   - clamp() pour typographie et espacements
 *   - Variables CSS centralisées
 */

/* ─── VARIABLES STUDIO ─── */
:root {
    /* Panneau */
    --studio-width: clamp(380px, 38vw, 85vw);
    --studio-bg: rgba(10, 15, 30, 0.95);
    --studio-border: rgba(255, 255, 255, 0.08);
    --studio-radius: clamp(0.5rem, 1vw, 0.75rem);
    --studio-padding: clamp(0.75rem, 1.5vw, 1.25rem);

    /* Typographie Studio */
    --studio-font-title: clamp(0.875rem, 0.8rem + 0.3vw, 1.05rem);
    --studio-font-body: clamp(0.75rem, 0.72rem + 0.15vw, 0.875rem);
    --studio-font-small: clamp(0.625rem, 0.6rem + 0.1vw, 0.75rem);

    /* Couleurs */
    --studio-accent: #6366f1;
    --studio-accent-soft: rgba(99, 102, 241, 0.15);
    --studio-accent-glow: rgba(99, 102, 241, 0.3);
    --studio-text: rgba(255, 255, 255, 0.85);
    --studio-text-muted: rgba(255, 255, 255, 0.45);
    --studio-surface: rgba(255, 255, 255, 0.04);
    --studio-surface-hover: rgba(255, 255, 255, 0.08);
    --studio-success: #10b981;
    --studio-warning: #f59e0b;
    --studio-error: #ef4444;

    /* Animation */
    --studio-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Onglets */
    --studio-tab-height: clamp(2rem, 2.5vw, 2.5rem);
}

/* ═══════════════════════════════════════════════════════════════
   PANNEAU PRINCIPAL (DRAWER)
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--studio-width);
    height: 100vh;
    background: var(--studio-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-left: 1px solid var(--studio-border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 9500;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--studio-text);
    transform: translateX(100%);
    transition: transform var(--studio-transition);
    overflow: hidden;
}

.atlas-studio-drawer.open {
    transform: translateX(0);
}

/* ─── MODE COMPACT (réduit à une barre d'icônes) ─── */
.atlas-studio-drawer.compact {
    --studio-width: 60px;
    width: 60px;
}

.atlas-studio-drawer.compact .atlas-studio-logo-text,
.atlas-studio-drawer.compact .atlas-studio-tab span:not(.atlas-studio-tab-icon),
.atlas-studio-drawer.compact .atlas-studio-content,
.atlas-studio-drawer.compact .atlas-studio-footer .atlas-studio-status span:last-child,
.atlas-studio-drawer.compact .atlas-studio-version,
.atlas-studio-drawer.compact .atlas-studio-visibility-toggle {
    display: none;
}

.atlas-studio-drawer.compact .atlas-studio-tabs {
    display: flex;
    flex-direction: column;
    padding: clamp(0.25rem, 0.5vw, 0.5rem);
    gap: 4px;
}

.atlas-studio-drawer.compact .atlas-studio-tab {
    justify-content: center;
    padding: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-studio-drawer.compact .atlas-studio-tab-icon {
    width: clamp(1.1rem, 1.3vw, 1.3rem);
    height: clamp(1.1rem, 1.3vw, 1.3rem);
}

.atlas-studio-drawer.compact .atlas-studio-header {
    justify-content: center;
    padding: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-studio-drawer.compact .atlas-studio-close {
    display: none;
}

.atlas-studio-drawer.compact .atlas-studio-footer {
    justify-content: center;
}

/* ─── POIGNÉE DE REDIMENSIONNEMENT ─── */
.atlas-studio-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.2s ease;
}

.atlas-studio-resize-handle:hover,
.atlas-studio-resize-handle.dragging {
    background: var(--studio-accent-glow);
}

.atlas-studio-resize-handle::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: var(--studio-text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.atlas-studio-resize-handle:hover::before,
.atlas-studio-resize-handle.dragging::before {
    opacity: 0.6;
}

/* ─── EN-TÊTE ─── */
.atlas-studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--studio-padding);
    border-bottom: 1px solid var(--studio-border);
    flex-shrink: 0;
}

.atlas-studio-logo {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 0.8vw, 0.6rem);
}

.atlas-studio-logo-icon {
    width: clamp(1.25rem, 1.5vw, 1.5rem);
    height: clamp(1.25rem, 1.5vw, 1.5rem);
    color: var(--studio-accent);
    flex-shrink: 0;
}

.atlas-studio-logo-text {
    font-size: var(--studio-font-title);
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.atlas-studio-close {
    width: clamp(1.75rem, 2vw, 2rem);
    height: clamp(1.75rem, 2vw, 2rem);
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.atlas-studio-close:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

/* ═══════════════════════════════════════════════════════════════
   ONGLETS (TABS) — Grille responsive auto-fill (1→2→3 colonnes)
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(2px, 0.3vw, 4px);
    padding: clamp(0.25rem, 0.5vw, 0.5rem) var(--studio-padding);
    border-bottom: 1px solid var(--studio-border);
    flex-shrink: 0;
}

.atlas-studio-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.2rem, 0.4vw, 0.35rem);
    height: var(--studio-tab-height);
    padding: 0 clamp(0.4rem, 0.8vw, 0.7rem);
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    font-size: var(--studio-font-small);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-studio-tab:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-studio-tab.active {
    background: var(--studio-accent-soft);
    color: #a5b4fc;
    font-weight: 600;
}

.atlas-studio-tab-icon {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENU DES PANNEAUX
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--studio-padding);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    container-type: inline-size;
    container-name: studio-content;
}

.atlas-studio-content::-webkit-scrollbar {
    width: 4px;
}

.atlas-studio-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.atlas-studio-panel {
    display: none;
    flex-direction: column;
    gap: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-studio-panel.active {
    display: flex;
}

/* ─── Placeholder pour les panneaux Phase 2+ ─── */
.atlas-studio-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3rem) var(--studio-padding);
    text-align: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-studio-placeholder-icon {
    width: clamp(2rem, 3vw, 2.5rem);
    height: clamp(2rem, 3vw, 2.5rem);
    color: var(--studio-text-muted);
    opacity: 0.5;
}

.atlas-studio-placeholder-title {
    font-size: var(--studio-font-body);
    font-weight: 600;
    color: var(--studio-text-muted);
}

.atlas-studio-placeholder-desc {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    opacity: 0.7;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   PIED DE PAGE (STATUS BAR)
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.4rem, 0.8vw, 0.6rem) var(--studio-padding);
    border-top: 1px solid var(--studio-border);
    flex-shrink: 0;
}

.atlas-studio-status {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.5vw, 0.4rem);
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
}

.atlas-studio-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--studio-success);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.atlas-studio-status-dot.atlas-status-public {
    background: #2196f3;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.5);
}

.atlas-studio-version {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    opacity: 0.5;
}

/* --- Toggle Visibilité Scène (footer) --- */
.atlas-studio-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    user-select: none;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.atlas-studio-visibility-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.atlas-studio-visibility-toggle input[type="checkbox"] {
    display: none;
}

.atlas-studio-visibility-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    font-weight: 500;
    color: var(--studio-text-muted, #999);
    transition: color 0.25s ease;
}

.atlas-studio-visibility-toggle input:checked ~ .atlas-studio-visibility-label {
    color: #64b5f6;
}

.atlas-visibility-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.atlas-visibility-text {
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   BOUTON TOGGLE (FLOTTANT — Hors du drawer)
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-toggle-btn {
    position: fixed;
    top: clamp(0.75rem, 1.5vw, 1.25rem);
    right: clamp(0.75rem, 1.5vw, 1.25rem);
    width: clamp(2.25rem, 3vw, 2.75rem);
    height: clamp(2.25rem, 3vw, 2.75rem);
    border-radius: 10px;
    border: 1px solid var(--studio-border);
    background: var(--studio-bg);
    backdrop-filter: blur(12px);
    color: var(--studio-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9400;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.atlas-studio-toggle-btn:hover {
    background: var(--studio-accent-soft);
    border-color: var(--studio-accent);
    transform: scale(1.05);
}

.atlas-studio-toggle-btn.hidden {
    display: none;
}

/* Bouton flottant désactivé — le bouton est désormais dans la navbar PSV */
.atlas-studio-toggle-btn {
    display: none !important;
}

.atlas-studio-toggle-btn svg {
    width: clamp(1rem, 1.3vw, 1.25rem);
    height: clamp(1rem, 1.3vw, 1.25rem);
}

/* ─── Bouton Atlas Studio dans la Navbar PSV ─── */
.psv-navbar [data-psv-button="atlas-studio"] {
    color: var(--studio-accent);
    opacity: 0.85;
}

.psv-navbar [data-psv-button="atlas-studio"]:hover,
.psv-navbar [data-psv-button="atlas-studio"].psv-button--active {
    color: var(--studio-accent);
    opacity: 1;
    background: var(--studio-accent-soft);
}

.psv-navbar [data-psv-button="atlas-studio"] svg {
    width: 20px;
    height: 20px;
}

/* ─── Fix cross-navigateur : input[type="color"] dans le Studio ─── 
   !important obligatoire pour surcharger les styles inline des composants.
   Doc Chromium : sans -webkit-appearance:none, le swatch natif s'étend 
   et crée un gros bloc coloré qui ignore width/height.
   ─────────────────────────────────────────────────────────────────────── */
.atlas-studio-drawer input[type="color"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 36px !important;
    height: 28px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 2px !important;
    border: 1px solid var(--studio-border) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    display: inline-block !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.atlas-studio-drawer input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

.atlas-studio-drawer input[type="color"]::-webkit-color-swatch {
    border: none !important;
    border-radius: 3px !important;
}

.atlas-studio-drawer input[type="color"]::-moz-color-swatch {
    border: none !important;
    border-radius: 3px !important;
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS TOAST
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-toast {
    position: fixed;
    bottom: clamp(3.5rem, 5vw, 4.5rem);
    right: clamp(0.75rem, 1.5vw, 1.25rem);
    padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1rem);
    border-radius: 8px;
    font-size: var(--studio-font-body);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
    z-index: 9600;
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.6vw, 0.5rem);
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-width: clamp(200px, 30vw, 320px);
}

.atlas-studio-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.atlas-studio-toast.info {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

.atlas-studio-toast.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.atlas-studio-toast.warning {
    background: rgba(245, 158, 11, 0.9);
    color: #1a1a2e;
}

.atlas-studio-toast.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.atlas-studio-toast-icon {
    width: clamp(0.9rem, 1.1vw, 1.1rem);
    height: clamp(0.9rem, 1.1vw, 1.1rem);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 2 — PALETTE DE HOTSPOTS (marker-palette.js)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Bandeau de placement ─── */
.atlas-palette-placement-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.4rem, 0.8vw, 0.6rem);
    padding: clamp(0.5rem, 1vw, 0.75rem);
    background: var(--studio-accent-soft);
    border: 1px solid var(--studio-accent-glow);
    border-radius: var(--studio-radius);
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
    animation: atlas-pulse-border 2s ease infinite;
}

@keyframes atlas-pulse-border {
    0%, 100% { border-color: var(--studio-accent-glow); }
    50% { border-color: var(--studio-accent); }
}

.atlas-palette-placement-info {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    flex: 1;
    min-width: 0;
}

.atlas-palette-placement-icon {
    width: clamp(1rem, 1.2vw, 1.25rem);
    height: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--studio-accent);
    flex-shrink: 0;
    animation: atlas-crosshair-spin 3s linear infinite;
}

@keyframes atlas-crosshair-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.atlas-palette-placement-text {
    font-size: var(--studio-font-small);
    color: #a5b4fc;
    line-height: 1.3;
}

.atlas-palette-cancel-btn {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.3vw, 0.3rem);
    padding: clamp(0.25rem, 0.5vw, 0.35rem) clamp(0.4rem, 0.7vw, 0.6rem);
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    font-size: var(--studio-font-small);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.atlas-palette-cancel-btn svg {
    width: clamp(0.75rem, 0.9vw, 0.9rem);
    height: clamp(0.75rem, 0.9vw, 0.9rem);
}

.atlas-palette-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ─── Barre d'outils ─── */
.atlas-palette-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.3rem, 0.6vw, 0.5rem) 0;
    margin-bottom: clamp(0.4rem, 0.8vw, 0.6rem);
    border-bottom: 1px solid var(--studio-border);
}

.atlas-palette-toolbar-count {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    font-weight: 500;
}

.atlas-palette-toolbar-actions {
    display: flex;
    gap: clamp(0.2rem, 0.4vw, 0.3rem);
}

.atlas-palette-tool-btn {
    width: clamp(1.5rem, 1.8vw, 1.75rem);
    height: clamp(1.5rem, 1.8vw, 1.75rem);
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-palette-tool-btn svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
}

.atlas-palette-tool-btn:hover:not(:disabled) {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-palette-tool-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.atlas-palette-tool-btn--danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* ─── Warning Banner ─── */
.atlas-palette-warning {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.4rem, 0.6vw, 0.5rem);
    padding: clamp(0.5rem, 0.8vw, 0.65rem);
    margin-bottom: clamp(0.6rem, 1vw, 0.8rem);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: var(--studio-font-small);
    color: #fcd34d;
    line-height: 1.4;
}

.atlas-palette-warning-icon {
    flex-shrink: 0;
    width: clamp(0.9rem, 1.1vw, 1rem);
    height: clamp(0.9rem, 1.1vw, 1rem);
    color: #f59e0b;
}

.atlas-palette-warning-icon svg {
    width: 100%;
    height: 100%;
}

/* ─── Sections ─── */
.atlas-palette-section {
    margin-bottom: 0;
}

/* ─── Range inputs natifs dans les sections Effets (Lens Flare, Meteo, etc.) ─── */
/* Corrige le track/thumb invisibles sur fond sombre sans classe .atlas-editor-range */
.atlas-palette-section input[type="range"] {
    accent-color: var(--studio-accent);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENU RESPONSIVE — @container (Living With Pixels / Flexbox-Responsive)
   Panneau Studio : 1 colonne (etroit) -> 2 colonnes (moyen) -> 3 colonnes (large)
   CSS Grid + align-items:start : chaque section prend sa hauteur naturelle,
   zero trou (contrairement a columns: qui cree des espaces vides).
   ═══════════════════════════════════════════════════════════════ */

/* Layout fluide auto-fill : les sections s imbriqueent naturellement
   selon la largeur disponible sans colonnes fixes (Flexbox-Responsive).
   minmax(260px, 1fr) -> 1 col etroit / 2 col moyen / 3 col large */
@container studio-content (min-width: 440px) {
    .atlas-studio-panel.active {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: clamp(0.75rem, 1.2vw, 1rem);
        align-items: start;
    }
}

.atlas-palette-section-header {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.9rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: clamp(0.5rem, 0.8vw, 0.65rem);
    padding-bottom: clamp(0.3rem, 0.5vw, 0.4rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atlas-palette-section-icon {
    width: clamp(0.95rem, 1.1vw, 1.15rem);
    height: clamp(0.95rem, 1.1vw, 1.15rem);
    flex-shrink: 0;
    color: var(--studio-accent);
}

/* ─── Grille des types de hotspots ─── */
.atlas-palette-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.25rem, 0.4vw, 0.35rem);
}

.atlas-palette-item {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 0.7vw, 0.6rem);
    padding: clamp(0.4rem, 0.7vw, 0.55rem) clamp(0.5rem, 0.8vw, 0.65rem);
    border-radius: var(--studio-radius);
    border: 1px solid transparent;
    background: var(--studio-surface);
    color: var(--studio-text);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.atlas-palette-item:hover {
    background: var(--studio-surface-hover);
    border-color: var(--studio-border);
    transform: translateX(2px);
}

.atlas-palette-item:active {
    transform: translateX(4px) scale(0.98);
}

.atlas-palette-item-icon {
    width: clamp(1.75rem, 2.2vw, 2rem);
    height: clamp(1.75rem, 2.2vw, 2rem);
    border-radius: 8px;
    background: color-mix(in srgb, var(--palette-color) 15%, transparent);
    color: var(--palette-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.atlas-palette-item-icon svg {
    width: clamp(0.9rem, 1.1vw, 1.1rem);
    height: clamp(0.9rem, 1.1vw, 1.1rem);
}

.atlas-palette-item-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.atlas-palette-item-label {
    font-size: var(--studio-font-body);
    font-weight: 500;
}

.atlas-palette-item-hint {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    opacity: 0.6;
}

.atlas-palette-item-action {
    width: clamp(1rem, 1.2vw, 1.25rem);
    height: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--studio-text-muted);
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.atlas-palette-item:hover .atlas-palette-item-action {
    opacity: 0.6;
}

/* ─── Grille des templates ─── */
.atlas-palette-templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.2rem, 0.4vw, 0.3rem);
}

.atlas-palette-template {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.4vw, 0.35rem);
    padding: clamp(0.35rem, 0.6vw, 0.45rem) clamp(0.4rem, 0.7vw, 0.5rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-family: inherit;
    font-size: var(--studio-font-small);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    overflow: hidden;
}

.atlas-palette-template:hover {
    background: var(--studio-surface-hover);
    border-color: var(--studio-accent-glow);
    transform: translateY(-1px);
}

.atlas-palette-template-emoji {
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    flex-shrink: 0;
}

.atlas-palette-template-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Liste des marqueurs existants ─── */
.atlas-palette-markers-list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.15rem, 0.3vw, 0.2rem);
}

.atlas-palette-marker-item {
    display: flex;
    align-items: center;
    gap: clamp(0.35rem, 0.6vw, 0.5rem);
    padding: clamp(0.3rem, 0.5vw, 0.4rem) clamp(0.4rem, 0.7vw, 0.5rem);
    border-radius: 6px;
    background: var(--studio-surface);
    cursor: pointer;
    transition: all 0.15s ease;
}

.atlas-palette-marker-item:hover {
    background: var(--studio-surface-hover);
}

.atlas-palette-marker-icon {
    width: clamp(1.25rem, 1.5vw, 1.5rem);
    height: clamp(1.25rem, 1.5vw, 1.5rem);
    color: var(--marker-color);
    flex-shrink: 0;
}

.atlas-palette-marker-icon svg {
    width: 100%;
    height: 100%;
}

.atlas-palette-marker-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.atlas-palette-marker-label {
    font-size: var(--studio-font-small);
    font-weight: 500;
    color: var(--studio-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-palette-marker-coords {
    font-size: clamp(0.6rem, 0.55rem + 0.1vw, 0.7rem);
    color: var(--studio-text-muted);
    opacity: 0.6;
    font-family: 'Courier New', monospace;
}

.atlas-palette-marker-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.atlas-palette-marker-item:hover .atlas-palette-marker-actions {
    opacity: 1;
}

.atlas-palette-marker-action-btn {
    width: clamp(1.25rem, 1.5vw, 1.5rem);
    height: clamp(1.25rem, 1.5vw, 1.5rem);
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-palette-marker-action-btn svg {
    width: clamp(0.7rem, 0.85vw, 0.85rem);
    height: clamp(0.7rem, 0.85vw, 0.85rem);
}

.atlas-palette-marker-action-btn:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-palette-marker-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 2 — ÉDITEUR DE PROPRIÉTÉS (property-editor.js)
   ═══════════════════════════════════════════════════════════════ */

.atlas-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-editor-back-btn {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.3vw, 0.3rem);
    padding: clamp(0.25rem, 0.4vw, 0.35rem) clamp(0.4rem, 0.6vw, 0.5rem);
    border-radius: 6px;
    border: none;
    background: var(--studio-surface);
    color: var(--studio-text-muted);
    font-size: var(--studio-font-small);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.atlas-editor-back-btn svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
}

.atlas-editor-back-btn:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-editor-header-actions {
    display: flex;
    gap: clamp(0.2rem, 0.3vw, 0.3rem);
}

.atlas-editor-action-btn {
    width: clamp(1.75rem, 2vw, 2rem);
    height: clamp(1.75rem, 2vw, 2rem);
    border-radius: 6px;
    border: none;
    background: var(--studio-surface);
    color: var(--studio-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-editor-action-btn svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
}

.atlas-editor-action-btn:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-editor-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.atlas-editor-id {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    padding: clamp(0.3rem, 0.5vw, 0.4rem) clamp(0.4rem, 0.7vw, 0.5rem);
    background: var(--studio-surface);
    border-radius: 6px;
    margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-editor-id-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.atlas-editor-id-text {
    font-size: clamp(0.6rem, 0.55rem + 0.1vw, 0.7rem);
    font-family: 'Courier New', monospace;
    color: var(--studio-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Formulaire ─── */
.atlas-editor-form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1vw, 0.75rem);
}

.atlas-editor-field {
    display: flex;
    flex-direction: column;
    gap: clamp(0.15rem, 0.3vw, 0.25rem);
}

.atlas-editor-field-row {
    display: flex;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
}

.atlas-editor-field--half {
    flex: 1;
}

.atlas-editor-label {
    font-size: var(--studio-font-small);
    font-weight: 600;
    color: var(--studio-text-muted);
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.3vw, 0.25rem);
}

.atlas-editor-label-hint {
    font-size: clamp(0.6rem, 0.55rem + 0.1vw, 0.65rem);
    font-weight: 400;
    color: var(--studio-text-muted);
    opacity: 0.6;
    margin-left: clamp(0.25rem, 0.4vw, 0.35rem);
}

.atlas-editor-hint {
    font-size: clamp(0.6rem, 0.55rem + 0.1vw, 0.65rem);
    color: var(--studio-text-muted);
    opacity: 0.7;
    margin-top: clamp(0.15rem, 0.2vw, 0.2rem);
    line-height: 1.4;
}

.atlas-editor-label svg {
    width: clamp(0.75rem, 0.9vw, 0.9rem);
    height: clamp(0.75rem, 0.9vw, 0.9rem);
}

.atlas-editor-input,
.atlas-editor-select,
.atlas-editor-textarea {
    padding: clamp(0.35rem, 0.6vw, 0.45rem) clamp(0.4rem, 0.7vw, 0.5rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-size: var(--studio-font-body);
    font-family: inherit;
    transition: border-color 0.15s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

/* Masquer les spinners natifs sur les inputs numériques (Largeur/Hauteur) */
.atlas-editor-size-input::-webkit-inner-spin-button,
.atlas-editor-size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.atlas-editor-size-input {
    -moz-appearance: textfield;
    appearance: textfield;
    text-align: center;
    letter-spacing: 0.05em;
}

.atlas-editor-input:focus,
.atlas-editor-select:focus,
.atlas-editor-textarea:focus {
    border-color: var(--studio-accent);
    box-shadow: 0 0 0 2px var(--studio-accent-soft);
}

.atlas-editor-textarea {
    resize: vertical;
    min-height: clamp(3rem, 5vw, 4rem);
    font-family: 'Courier New', monospace;
    font-size: var(--studio-font-small);
}

.atlas-editor-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #0f172a !important; /* Force dark background */
    color-scheme: dark; /* Dropdown natif en mode sombre (Chrome/Edge/Firefox) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right clamp(0.3rem, 0.5vw, 0.4rem) center;
    background-size: clamp(0.9rem, 1.1vw, 1.1rem);
    padding-right: clamp(1.5rem, 2vw, 2rem);
}

.atlas-editor-select option {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    padding: 8px;
}

.atlas-editor-select option:checked,
.atlas-editor-select option:hover {
    background-color: #1e40af !important;
    color: white !important;
}

/* ─── Slider (Range) ─── */
.atlas-editor-range {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--studio-surface);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.atlas-editor-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
    border-radius: 50%;
    background: var(--studio-accent);
    cursor: pointer;
    border: 2px solid var(--studio-bg);
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.3);
}

.atlas-editor-range::-moz-range-thumb {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
    border-radius: 50%;
    background: var(--studio-accent);
    cursor: pointer;
    border: 2px solid var(--studio-bg);
}

/* ─── Couleurs ─── */
.atlas-editor-colors {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.2rem, 0.35vw, 0.3rem);
}

.atlas-editor-color-swatch {
    width: clamp(1.25rem, 1.5vw, 1.5rem);
    height: clamp(1.25rem, 1.5vw, 1.5rem);
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.atlas-editor-color-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.atlas-editor-color-swatch.active {
    border-color: white;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.atlas-editor-color-custom {
    height: clamp(1.5rem, 1.8vw, 1.75rem);
    padding: 2px;
    margin-top: clamp(0.2rem, 0.3vw, 0.25rem);
    cursor: pointer;
}

/* ─── Coordonnées ─── */
.atlas-editor-coords {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    padding: clamp(0.3rem, 0.5vw, 0.4rem);
    background: var(--studio-surface);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.atlas-editor-coord {
    font-size: var(--studio-font-small);
    color: var(--studio-accent);
    font-weight: 600;
}

.atlas-editor-coord-sep {
    color: var(--studio-text-muted);
    opacity: 0.4;
}

/* ─── Ligne de boutons ─── */
.atlas-editor-field-row {
    display: flex;
    gap: clamp(0.4rem, 0.6vw, 0.5rem);
    align-items: center;
}

/* ─── Bouton Prévisualiser ─── */
.atlas-editor-preview-btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    padding: clamp(0.5rem, 0.8vw, 0.65rem) clamp(0.75rem, 1.2vw, 1rem);
    border-radius: var(--studio-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--studio-text-secondary);
    font-size: calc(var(--studio-font-body) * 0.95);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.atlas-editor-preview-btn svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
    opacity: 0.8;
}

.atlas-editor-preview-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--studio-text);
}

.atlas-editor-preview-btn:hover svg {
    opacity: 1;
}

/* ─── Bouton Appliquer ─── */
.atlas-editor-save-btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    padding: clamp(0.5rem, 0.8vw, 0.65rem) clamp(0.75rem, 1.2vw, 1rem);
    border-radius: var(--studio-radius);
    border: none;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    font-size: var(--studio-font-body);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    margin-top: 0;
}

.atlas-editor-save-btn svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
}

.atlas-editor-save-btn:hover {
    background: linear-gradient(135deg, #818cf8, #a5b4fc);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.atlas-editor-save-btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 2 — HOTSPOT VISUEL (dans le panorama PSV)
   ═══════════════════════════════════════════════════════════════ */

.atlas-studio-hotspot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    width: 100%;
    height: 100%;
}

.atlas-studio-hotspot:hover {
    transform: scale(1.15);
}

.atlas-studio-hotspot-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--hotspot-color, #6366f1);
    opacity: 0.5;
    animation: atlas-hotspot-pulse 2s ease-in-out infinite;
}

@keyframes atlas-hotspot-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.15; }
}

@keyframes atlas-marker-highlight {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
    50% { transform: scale(1.4); box-shadow: 0 0 20px rgba(99, 102, 241, 0.8); }
}

.atlas-studio-hotspot-icon {
    width: 100%;
    height: 100%;
    background: var(--hotspot-color, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px color-mix(in srgb, var(--hotspot-color, #6366f1) 40%, transparent);
    animation: atlas-icon-breathe 3.5s ease-in-out infinite;
}

@keyframes atlas-icon-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.87); }
}

/* Pause l'animation au survol pour éviter le conflit avec le scale :hover */
.atlas-studio-hotspot:hover .atlas-studio-hotspot-icon {
    animation-play-state: paused;
    transform: scale(1);
}

.atlas-studio-hotspot-icon svg {
    width: 60%;
    height: 60%;
    color: white;
    stroke-width: 2.5;
}

/* ═══════════════════════════════════════════════════════════════
   POPUP CONTENU HOTSPOT (Affiché au clic sur un marqueur)
   ═══════════════════════════════════════════════════════════════ */

.atlas-content-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.atlas-content-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.atlas-content-popup {
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: var(--studio-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    
    /* 📏 TAILLE ADAPTATIVE : s'adapte au contenu */
    width: fit-content;
    min-width: clamp(280px, 40vw, 350px);
    max-width: clamp(400px, 85vw, 800px);
    max-height: 85vh;
    
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
    /* 🎬 ANIMATION SLIDE depuis le HAUT de l'écran */
    transform: translateY(-100vh);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Courbe "easeOutQuad" fluide */
}

.atlas-content-popup-overlay.show .atlas-content-popup {
    /* Glisse depuis le haut jusqu'au centre */
    transform: translateY(0);
}

.atlas-content-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.6rem, 1.2vw, 0.9rem) var(--studio-padding);
    border-bottom: 1px solid var(--studio-border);
    flex-shrink: 0;
}

.atlas-content-popup-title {
    font-size: var(--studio-font-title);
    font-weight: 600;
    color: var(--studio-text);
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
}

.atlas-content-popup-title-icon {
    width: clamp(1rem, 1.2vw, 1.25rem);
    height: clamp(1rem, 1.2vw, 1.25rem);
    flex-shrink: 0;
}

.atlas-content-popup-close {
    width: clamp(1.5rem, 2vw, 1.75rem);
    height: clamp(1.5rem, 2vw, 1.75rem);
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.atlas-content-popup-close:hover {
    background: var(--studio-surface-hover);
    color: var(--studio-text);
}

.atlas-content-popup-close svg {
    width: clamp(0.85rem, 1vw, 1rem);
    height: clamp(0.85rem, 1vw, 1rem);
}

.atlas-content-popup-body {
    padding: var(--studio-padding);
    overflow-y: auto;
    flex: 1 1 auto; /* Permet au contenu de grandir/rétrécir selon besoin */
    font-size: var(--studio-font-body);
    color: var(--studio-text);
    line-height: 1.6;
    
    /* 📏 Gestion intelligente de la hauteur selon le contenu */
    min-height: fit-content;
}

/* Styles pour le contenu HTML injecté */
.atlas-content-popup-body h1,
.atlas-content-popup-body h2,
.atlas-content-popup-body h3,
.atlas-content-popup-body h4 {
    color: var(--studio-text);
    margin: 0 0 0.5em 0;
}

.atlas-content-popup-body p {
    margin: 0 0 0.8em 0;
}

.atlas-content-popup-body ul,
.atlas-content-popup-body ol {
    margin: 0 0 0.8em 0;
    padding-left: 1.5em;
}

.atlas-content-popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0.5em 0;
}

.atlas-content-popup-body a {
    color: var(--studio-accent);
    text-decoration: none;
}

.atlas-content-popup-body a:hover {
    text-decoration: underline;
}

.atlas-content-popup-body button {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.atlas-content-popup-body button:hover {
    opacity: 0.85;
}

/* Actions en bas du popup */
.atlas-content-popup-actions {
    display: flex;
    gap: clamp(0.4rem, 0.8vw, 0.6rem);
    padding: clamp(0.5rem, 1vw, 0.75rem) var(--studio-padding);
    border-top: 1px solid var(--studio-border);
    flex-shrink: 0;
}

.atlas-content-popup-action-btn {
    flex: 1;
    padding: clamp(0.4rem, 0.8vw, 0.6rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-size: var(--studio-font-small);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.atlas-content-popup-action-btn:hover {
    background: var(--studio-surface-hover);
    border-color: var(--studio-accent);
}

.atlas-content-popup-action-btn.primary {
    background: var(--studio-accent);
    border-color: var(--studio-accent);
    color: white;
}

.atlas-content-popup-action-btn.primary:hover {
    background: #4f46e5;
}

/* ═══════════════════════════════════════════════════════════════
   COMPOSANTS GÉNÉRIQUES — Effets / Carte / Vidéo (Phase 2)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Groupe d'actions (boutons) ─── */
.atlas-studio-action-group {
    display: flex;
    gap: clamp(0.35rem, 0.6vw, 0.5rem);
    flex-wrap: wrap;
    margin: clamp(0.4rem, 0.7vw, 0.5rem) 0;
}

.atlas-studio-action-btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.25rem, 0.4vw, 0.35rem);
    padding: clamp(0.35rem, 0.6vw, 0.5rem) clamp(0.5rem, 0.9vw, 0.75rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-size: var(--studio-font-small);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

/* Fix : empêcher les SVG icônes de s'étendre sur tout le bouton */
.atlas-studio-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.atlas-studio-action-btn:hover {
    background: var(--studio-surface-hover);
    border-color: var(--studio-accent);
}

.atlas-studio-action-btn--primary {
    background: var(--studio-accent);
    border-color: var(--studio-accent);
    color: white;
}

.atlas-studio-action-btn--primary:hover {
    background: #4f46e5;
}

.atlas-studio-action-btn--danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--studio-error);
}

.atlas-studio-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--studio-error);
}

.atlas-studio-action-btn--template {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--studio-success);
    background: rgba(16, 185, 129, 0.08);
}

.atlas-studio-action-btn--template:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--studio-success);
}

/* ─── Sélecteur (select) ─── */
.atlas-studio-select {
    width: 100%;
    padding: clamp(0.35rem, 0.6vw, 0.5rem) clamp(0.5rem, 0.8vw, 0.65rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background-color: #0f172a; /* Force fond sombre — évite dropdown blanc OS */
    color: var(--studio-text);
    color-scheme: dark; /* Dropdown natif en mode sombre (Chrome/Edge/Firefox) */
    font-size: var(--studio-font-body);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.atlas-studio-select:hover,
.atlas-studio-select:focus {
    border-color: var(--studio-accent);
    outline: none;
}

.atlas-studio-select option {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

/* ─── Champ de saisie ─── */
.atlas-studio-input {
    padding: clamp(0.3rem, 0.5vw, 0.4rem) clamp(0.5rem, 0.8vw, 0.65rem);
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-size: var(--studio-font-body);
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.atlas-studio-input:hover,
.atlas-studio-input:focus {
    border-color: var(--studio-accent);
    outline: none;
}

.atlas-studio-input::placeholder {
    color: var(--studio-text-muted);
}

/* ─── Groupe de contrôle (label + input) ─── */
.atlas-studio-control-group {
    display: flex;
    flex-direction: column;
    gap: clamp(0.25rem, 0.4vw, 0.35rem);
    margin-bottom: clamp(0.5rem, 0.8vw, 0.6rem);
    break-inside: avoid;
}

.atlas-studio-control-label {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    font-weight: 500;
}

/* ─── Carte d'information ─── */
.atlas-studio-info-card {
    display: flex;
    flex-direction: column;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
    padding: clamp(0.5rem, 0.8vw, 0.75rem);
    border-radius: var(--studio-radius);
    background: var(--studio-surface);
    border: 1px solid var(--studio-border);
    margin: clamp(0.4rem, 0.7vw, 0.5rem) 0;
    break-inside: avoid;
}

.atlas-studio-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.atlas-studio-info-label {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
}

.atlas-studio-info-value {
    font-size: var(--studio-font-small);
    color: var(--studio-text);
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ─── Liste d'items ─── */
.atlas-studio-items-list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.2rem, 0.3vw, 0.25rem);
    max-height: clamp(8rem, 15vh, 12rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ─── État vide ─── */
.atlas-studio-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 1.2vw, 1rem);
    color: var(--studio-text-muted);
    font-size: var(--studio-font-small);
    font-style: italic;
    text-align: center;
}

/* ─── Ligne horizontale d'inputs ─── */
.atlas-studio-control-group > div[style*="display: flex"] {
    display: flex;
    gap: clamp(0.3rem, 0.5vw, 0.4rem);
}

/* ─── Audio Item (panneau Audio Studio) ─── */
.atlas-audio-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--studio-radius-md, 0.5rem);
    padding: 14px 12px;
    margin-bottom: 10px;
    transition: border-color 0.15s ease;
    break-inside: avoid;
}

.atlas-audio-item:hover {
    border-color: rgba(134, 239, 172, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   FIX GLOBAL — input[type=number] : suppression flèches & scroll
   Empêche l'emballement des valeurs au survol/scroll dans le Studio
   ═══════════════════════════════════════════════════════════════ */
.atlas-studio input[type="number"]::-webkit-outer-spin-button,
.atlas-studio input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.atlas-studio input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ═══════════════════════════════════════════════════════════════
   ACCORDÉON — Audio Spatial (liste repliable)
   ═══════════════════════════════════════════════════════════════ */
.atlas-audio-accordion {
    padding: 0;
    overflow: hidden;
}

.atlas-audio-acc-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    min-height: 44px;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.atlas-audio-accordion[data-expanded="true"] .atlas-audio-acc-header {
    border-bottom-color: rgba(165, 180, 252, 0.15);
    background: rgba(165, 180, 252, 0.04);
}

.atlas-audio-acc-header:hover {
    background: rgba(165, 180, 252, 0.07);
}

.atlas-audio-acc-toggle {
    background: none;
    border: none;
    color: rgba(165, 180, 252, 0.7);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.15s ease;
}
.atlas-audio-accordion[data-expanded="true"] .atlas-audio-acc-toggle {
    transform: rotate(180deg);
    color: #a5b4fc;
}
.atlas-audio-acc-toggle:hover { color: #a5b4fc; }

.atlas-audio-acc-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #a5b4fc;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.atlas-audio-acc-summary {
    flex: 1;
    font-size: 0.75rem;
    color: var(--studio-text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 2px;
    transition: opacity 0.2s ease;
}
.atlas-audio-accordion[data-expanded="true"] .atlas-audio-acc-summary {
    opacity: 0;
    pointer-events: none;
}

.atlas-audio-acc-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.atlas-audio-acc-body {
    padding: 0 12px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease, padding 0.2s ease;
}
.atlas-audio-accordion[data-expanded="true"] .atlas-audio-acc-body {
    max-height: 600px;
    padding: 12px 12px 14px;
}

/* ═══════════════════════════════════════════════════════════════
   DOUBLE PISTE AUDIO D'ENTRÉE (Musique + Ambiance)
   ═══════════════════════════════════════════════════════════════ */

.atlas-audio-track-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    transition: border-color 0.2s ease;
}
.atlas-audio-track-card:hover {
    border-color: rgba(255,255,255,0.16);
}
.atlas-audio-track-card--ambience {
    background: rgba(110,231,183,0.03);
    border-color: rgba(110,231,183,0.12);
}
.atlas-audio-track-card--ambience:hover {
    border-color: rgba(110,231,183,0.22);
}

.atlas-audio-track-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.atlas-audio-track-badge--music {
    background: rgba(139,92,246,0.18);
    color: #a5b4fc;
    border: 1px solid rgba(139,92,246,0.28);
}
.atlas-audio-track-badge--ambience {
    background: rgba(52,211,153,0.14);
    color: #6ee7b7;
    border: 1px solid rgba(52,211,153,0.22);
}

/* Boutons de sélection de mode (URL fixe / Playlist R2) */
.atlas-audio-mode-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: var(--studio-font-small);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: var(--studio-text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    min-width: 0;
}
.atlas-audio-mode-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.22);
    color: var(--studio-text-primary);
}
.atlas-audio-mode-btn--active {
    background: rgba(139,92,246,0.18);
    border-color: rgba(139,92,246,0.4);
    color: #c4b5fd;
    font-weight: 600;
}
.atlas-audio-mode-btn--active:hover {
    background: rgba(139,92,246,0.28);
}

/* Bouton chargement playlist */
.atlas-audio-playlist-load-btn {
    background: rgba(139,92,246,0.15) !important;
    border-color: rgba(139,92,246,0.35) !important;
    color: #a5b4fc !important;
}
.atlas-audio-playlist-load-btn:hover {
    background: rgba(139,92,246,0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SPATIAL AUDIO ZONE MARKER (overlay admin — debug visuel)
   ═══════════════════════════════════════════════════════════════ */

.atlas-spatial-zone-container {
    pointer-events: none;
}

.atlas-spatial-zone-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    user-select: none;
}

.atlas-sz-inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.35);
    border: 2px solid rgba(139, 92, 246, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.55);
}

.atlas-sz-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 2px dashed rgba(139, 92, 246, 0.55);
    animation: atlas-sz-pulse-anim 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes atlas-sz-pulse-anim {
    0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 0.75; }
    50%  { transform: translate(-50%, -50%) scale(1.3); opacity: 0.25; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.75; }
}

.atlas-sz-label {
    margin-top: 8px;
    background: rgba(12, 8, 36, 0.88);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 10px;
    color: #c4b5fd;
    white-space: nowrap;
    text-align: center;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLE VISIBILITÉ (PUBLIC / PRIVÉ)
   ═══════════════════════════════════════════════════════════════ */

.atlas-editor-visibility-label {
    display: flex !important;
    flex-direction: column;
    gap: 0.4rem;
}

.atlas-editor-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.atlas-editor-toggle-input {
    display: none;
}

.atlas-editor-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.atlas-editor-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.atlas-editor-toggle-input:checked + .atlas-editor-toggle-switch {
    background: var(--studio-success, #10b981);
}

.atlas-editor-toggle-input:checked + .atlas-editor-toggle-switch::after {
    transform: translateX(16px);
}

.atlas-editor-toggle-status {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
}

/* ─── Badge privé sur les hotspots ─── */
.atlas-studio-hotspot-private {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    line-height: 1;
    z-index: 10;
    pointer-events: none;
}

.atlas-hotspot-private {
    opacity: 0.6;
}

.atlas-hotspot-private .atlas-studio-hotspot-ring {
    border-style: dashed !important;
}

/* ═══════════════════════════════════════════════════════════════
   POPUP PUBLIQUE (lecture seule pour visiteurs)
   ═══════════════════════════════════════════════════════════════ */

.atlas-public-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    background: rgba(10, 15, 30, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    max-width: min(500px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: atlas-popup-in 0.25s ease-out;
    font-family: 'Inter', system-ui, sans-serif;
    color: #e2e8f0;
}

@keyframes atlas-popup-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.atlas-public-popup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid;
}

.atlas-public-popup-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.atlas-public-popup-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.atlas-public-popup-icon svg {
    width: 100%;
    height: 100%;
}

.atlas-public-popup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.atlas-public-popup-close:hover {
    color: #fff;
}

.atlas-public-popup-content {
    padding: 1rem 1.25rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.atlas-public-popup-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.atlas-public-popup-content a {
    color: #6366f1;
    text-decoration: none;
}

.atlas-public-popup-content a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   🌦️ EFFETS — Météo Toggles (Phase 4 — T4.2)
   ═══════════════════════════════════════════════════════════════ */

.atlas-effect-toggles-row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    margin-bottom: clamp(0.3rem, 0.5vw, 0.5rem);
}

.atlas-effect-toggle {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 0.4vw, 0.4rem);
    padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 0.8vw, 0.75rem);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--studio-text-muted, rgba(255,255,255,0.5));
    font-size: var(--studio-font-small, 0.75rem);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.atlas-effect-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--studio-text-primary, rgba(255,255,255,0.9));
}

.atlas-effect-toggle--active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

.atlas-effect-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.atlas-effect-toggle-dot.active {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   🌦️ EFFETS — Weather Canvas & Fog Overlay
   ═══════════════════════════════════════════════════════════════ */

#atlas-weather-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#atlas-fog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 49;
    transition: opacity 0.5s ease;
}

#atlas-vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 48;
    transition: opacity 0.3s ease;
}

#atlas-color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 47;
    mix-blend-mode: multiply;
    transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   🛤️ TOUR BUILDER — Phase 5 (Circuits Virtuels)
   ═══════════════════════════════════════════════════════════════ */

/* --- Hint Text --- */
.atlas-tour-hint {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* --- Badge compteur --- */
.atlas-tour-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--studio-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    padding: 0 0.3rem;
    margin-left: 0.4rem;
}

/* --- Grille des Panoramas Disponibles --- */
.atlas-tour-nodes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.3rem, 0.6vw, 0.6rem);
    max-height: clamp(140px, 22vh, 280px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent) transparent;
}

.atlas-tour-node-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: var(--studio-surface);
    cursor: grab;
    transition: var(--studio-transition);
    overflow: hidden;
}

.atlas-tour-node-card:hover {
    border-color: var(--studio-accent);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.atlas-tour-node-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.atlas-tour-node-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.35rem;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    position: relative;
}

.atlas-tour-node-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Badge source (local / remote D1) */
.atlas-tour-node-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    font-size: 0.6rem;
    line-height: 1;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.atlas-tour-node-badge--remote {
    background: rgba(99, 102, 241, 0.6);
    color: #fff;
}

.atlas-tour-node-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--studio-text-muted);
}

.atlas-tour-node-label {
    font-size: clamp(0.55rem, 0.7vw, 0.7rem);
    color: var(--studio-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 0.15rem;
}

/* --- Textarea description circuit --- */
.atlas-tour-textarea {
    resize: vertical;
    min-height: 2.4rem;
    max-height: 6rem;
    font-family: inherit;
}

/* --- Options Row (Loop, Autoplay, Speed) --- */
.atlas-tour-options-row {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1vw, 1rem);
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.atlas-tour-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--studio-font-small);
    color: var(--studio-text);
    cursor: pointer;
    user-select: none;
}

.atlas-tour-toggle-label input[type="checkbox"] {
    accent-color: var(--studio-accent);
    width: 1rem;
    height: 1rem;
}

.atlas-tour-speed-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.atlas-tour-speed-select {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
    min-width: unset !important;
}

/* --- Liste des Étapes --- */
.atlas-tour-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: clamp(60px, 10vh, 100px);
    max-height: clamp(200px, 40vh, 500px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent) transparent;
}

/* --- Drop Zone (placeholder quand vide) --- */
.atlas-tour-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: clamp(1rem, 2vw, 2rem);
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 0.75rem;
    color: var(--studio-text-muted);
    font-size: var(--studio-font-small);
    transition: var(--studio-transition);
}

.atlas-tour-drop-zone.drag-over {
    border-color: var(--studio-accent);
    background: rgba(99, 102, 241, 0.06);
    color: var(--studio-accent);
}

.atlas-tour-drop-zone--append {
    padding: 0.6rem;
    font-size: 0.7rem;
    border-style: dashed;
    border-width: 1.5px;
    opacity: 0.6;
}

.atlas-tour-drop-zone--append:hover,
.atlas-tour-drop-zone--append.drag-over {
    opacity: 1;
}

/* --- Carte d'une Étape --- */
.atlas-tour-step {
    background: var(--studio-surface);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 0.6rem;
    overflow: hidden;
    transition: var(--studio-transition);
    cursor: default;
}

.atlas-tour-step:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.atlas-tour-step.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.atlas-tour-step.drop-above {
    border-top: 2.5px solid var(--studio-accent);
}

.atlas-tour-step.playing {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.atlas-tour-step-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: rgba(0,0,0,0.15);
}

.atlas-tour-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--studio-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.atlas-tour-step-grip {
    cursor: grab;
    color: var(--studio-text-muted);
    font-size: 0.9rem;
    user-select: none;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.atlas-tour-step:hover .atlas-tour-step-grip {
    opacity: 1;
}

.atlas-tour-step-name {
    flex: 1;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    font-weight: 500;
    color: var(--studio-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-tour-step-goto,
.atlas-tour-step-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 0.3rem;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    transition: var(--studio-transition);
    flex-shrink: 0;
    padding: 0;
}

.atlas-tour-step-goto:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent);
}

.atlas-tour-step-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* --- Paramètres d'une Étape (yaw, transition, pause) --- */
.atlas-tour-step-settings {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.6rem);
    padding: 0.35rem 0.5rem;
    flex-wrap: wrap;
}

.atlas-tour-step-setting {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: clamp(0.55rem, 0.65vw, 0.7rem);
}

.atlas-tour-step-setting label {
    color: var(--studio-text-muted);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.atlas-tour-step-setting .atlas-studio-input {
    width: clamp(3rem, 4vw, 4rem);
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
    text-align: center;
}

.atlas-tour-step-setting .atlas-studio-select {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    min-width: unset;
}

.atlas-tour-set-yaw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: none;
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent);
    cursor: pointer;
    transition: var(--studio-transition);
    padding: 0;
    flex-shrink: 0;
}

.atlas-tour-set-yaw:hover {
    background: var(--studio-accent);
    color: #fff;
}

/* --- Boutons de Contrôle --- */
.atlas-tour-controls-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.atlas-tour-play-btn:not(:disabled) {
    background: #10b981 !important;
    border-color: #10b981 !important;
}

.atlas-tour-play-btn:not(:disabled):hover {
    background: #059669 !important;
}

.atlas-tour-stop-btn:not(:disabled) {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #fff !important;
}

/* --- Circuits Sauvegardés --- */
.atlas-tour-saved-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: clamp(120px, 20vh, 250px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent) transparent;
}

.atlas-tour-saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1.5px solid rgba(255,255,255,0.06);
    background: var(--studio-surface);
    transition: var(--studio-transition);
}

.atlas-tour-saved-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.atlas-tour-saved-item.active {
    border-color: var(--studio-accent);
    background: rgba(99, 102, 241, 0.08);
}

.atlas-tour-saved-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}

.atlas-tour-saved-name {
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    font-weight: 500;
    color: var(--studio-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-tour-saved-meta {
    font-size: 0.6rem;
    color: var(--studio-text-muted);
}

.atlas-tour-saved-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.atlas-tour-saved-load,
.atlas-tour-saved-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3rem;
    border: none;
    background: transparent;
    color: var(--studio-text-muted);
    cursor: pointer;
    transition: var(--studio-transition);
    padding: 0;
}

.atlas-tour-saved-load:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent);
}

.atlas-tour-saved-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   PHASE 7 — UX, RACCOURCIS & CURSEURS (studio-shortcuts.js)
   ═══════════════════════════════════════════════════════════════ */

/* ── T7.2 — Curseurs contextuels ── */

.atlas-cursor-crosshair,
.atlas-cursor-crosshair canvas {
    cursor: crosshair !important;
}

.atlas-cursor-grab,
.atlas-cursor-grab canvas {
    cursor: grab !important;
}

.atlas-cursor-grab:active canvas,
.atlas-cursor-grab:active {
    cursor: grabbing !important;
}

.atlas-cursor-move,
.atlas-cursor-move canvas {
    cursor: move !important;
}

.atlas-cursor-pointer,
.atlas-cursor-pointer canvas {
    cursor: pointer !important;
}

.atlas-cursor-none,
.atlas-cursor-none canvas {
    cursor: none !important;
}

/* ── T7.3 — Indicateur grille d'alignement ── */

.atlas-grid-indicator {
    position: fixed;
    bottom: clamp(1rem, 2vw, 1.5rem);
    left: clamp(1rem, 2vw, 1.5rem);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: clamp(0.3rem, 0.5vw, 0.45rem) clamp(0.5rem, 0.8vw, 0.7rem);
    background: rgba(99, 102, 241, 0.85);
    color: white;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    font-weight: 600;
    border-radius: 6px;
    z-index: 9500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.atlas-grid-indicator svg {
    width: clamp(0.7rem, 0.85vw, 0.85rem);
    height: clamp(0.7rem, 0.85vw, 0.85rem);
    flex-shrink: 0;
}

/* ── T7.4 — Mode aperçu ── */

.atlas-preview-banner {
    position: fixed;
    top: clamp(0.75rem, 1.5vw, 1.25rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    padding: clamp(0.4rem, 0.7vw, 0.6rem) clamp(0.8rem, 1.2vw, 1rem);
    background: rgba(16, 185, 129, 0.9);
    color: white;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-weight: 600;
    border-radius: 8px;
    z-index: 9600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.atlas-preview-banner:hover {
    background: rgba(16, 185, 129, 1);
    transform: translateX(-50%) scale(1.02);
}

.atlas-preview-banner svg {
    width: clamp(0.9rem, 1.1vw, 1.1rem);
    height: clamp(0.9rem, 1.1vw, 1.1rem);
    flex-shrink: 0;
}

.atlas-preview-hint {
    font-size: clamp(0.55rem, 0.65vw, 0.65rem);
    font-weight: 400;
    opacity: 0.8;
    margin-left: 0.3rem;
}

/* En mode aperçu : masquer les éléments d'édition */
.atlas-preview-mode .atlas-studio-drawer,
.atlas-preview-mode .atlas-studio-toggle,
.atlas-preview-mode .atlas-studio-hotspot-edit,
.atlas-preview-mode .atlas-grid-indicator {
    display: none !important;
}

/* ── T7.5 — Overlay aide raccourcis ── */

.atlas-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9700;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.atlas-shortcuts-overlay.show {
    opacity: 1;
}

.atlas-shortcuts-dialog {
    background: var(--studio-bg, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: clamp(320px, 45vw, 520px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.atlas-shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.75rem, 1.2vw, 1rem) clamp(1rem, 1.5vw, 1.25rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.atlas-shortcuts-header h3 {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.8rem, 1vw, 1rem);
    font-weight: 700;
    color: var(--studio-text, #e0e0e0);
    margin: 0;
}

.atlas-shortcuts-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.5rem, 2vw, 2rem);
    height: clamp(1.5rem, 2vw, 2rem);
    border: none;
    background: transparent;
    color: var(--studio-text-muted, #888);
    border-radius: 0.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.atlas-shortcuts-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.atlas-shortcuts-body {
    padding: clamp(0.5rem, 1vw, 0.75rem) clamp(1rem, 1.5vw, 1.25rem);
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 0.8vw, 0.75rem);
}

.atlas-shortcuts-category-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--studio-accent, #6366f1);
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 0.2rem;
}

.atlas-shortcuts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.2rem, 0.35vw, 0.3rem) 0;
}

.atlas-shortcuts-keys {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: var(--studio-text, #e0e0e0);
    padding: clamp(0.15rem, 0.2vw, 0.2rem) clamp(0.35rem, 0.5vw, 0.5rem);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.atlas-shortcuts-desc {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    color: var(--studio-text-muted, #999);
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 3 — POLYGONES & ZONES INTERACTIVES
   ═══════════════════════════════════════════════════════════════════ */

/* --- Bannière mode dessin --- */
.atlas-polygon-draw-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 8px;
    color: #81c784;
    font-size: clamp(0.65rem, 0.75vw, 0.75rem);
    line-height: 1.4;
    animation: atlas-polygon-banner-pulse 2s ease-in-out infinite;
}

.atlas-polygon-draw-banner.hidden { display: none; }

@keyframes atlas-polygon-banner-pulse {
    0%, 100% { border-color: rgba(76, 175, 80, 0.4); }
    50% { border-color: rgba(76, 175, 80, 0.8); }
}

/* --- Vertex markers (dessin) --- */
.atlas-polygon-vertex {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid #fff;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.atlas-polygon-vertex:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.atlas-polygon-vertex--drawing {
    background: #ff9800;
    border-color: #fff;
    animation: atlas-vertex-blink 1s ease-in-out infinite;
}

.atlas-polygon-vertex--first {
    background: #2196f3;
    border-color: #fff;
    width: 14px;
    height: 14px;
}

.atlas-polygon-vertex--first:hover {
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.7);
}

@keyframes atlas-vertex-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Liste des polygones dans la palette --- */
.atlas-polygon-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.atlas-polygon-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.atlas-polygon-list-item.selected {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.4);
}

.atlas-polygon-list-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.atlas-polygon-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.atlas-polygon-list-label {
    font-size: clamp(0.65rem, 0.75vw, 0.75rem);
    font-weight: 500;
    color: var(--studio-text, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-polygon-list-meta {
    font-size: clamp(0.55rem, 0.6vw, 0.6rem);
    color: var(--studio-text-muted, #999);
}

.atlas-polygon-list-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.atlas-polygon-list-actions button {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--studio-text-muted, #999);
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s ease;
    padding: 0;
}

.atlas-polygon-list-actions button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--studio-text, #e0e0e0);
}

.atlas-polygon-list-actions button.delete:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #ef5350;
}

/* --- Panneau propriétés polygone --- */
.atlas-polygon-props-section {
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

/* T2.2 — Header polygone : séparation claire titre / boutons */
.atlas-polygon-props-section:first-child {
    padding-top: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.6rem;
}

.atlas-polygon-props-section h4 {
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    font-weight: 600;
    color: var(--studio-text-muted, #999);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.atlas-polygon-props-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.atlas-polygon-props-row label {
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    color: var(--studio-text-muted, #999);
    min-width: 60px;
    flex-shrink: 0;
}

.atlas-polygon-props-row input[type="color"] {
    width: 28px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.atlas-polygon-props-row input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: #4caf50;
}

.atlas-polygon-props-row input[type="number"] {
    width: 50px;
    padding: 0.15rem 0.3rem;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: var(--studio-text, #e0e0e0);
    text-align: center;
}

.atlas-polygon-props-row input[type="text"],
.atlas-polygon-props-row select {
    flex: 1;
    padding: 0.25rem 0.4rem;
    font-size: clamp(0.6rem, 0.7vw, 0.7rem);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: var(--studio-text, #e0e0e0);
}

.atlas-polygon-props-row select {
    cursor: pointer;
}

/* --- Liste des vertex dans le panneau propriétés --- */
.atlas-polygon-vertex-list {
    max-height: 120px;
    overflow-y: auto;
    padding: 0.3rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.atlas-polygon-vertex-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.3rem;
    font-size: clamp(0.55rem, 0.6vw, 0.6rem);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--studio-text-muted, #999);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.atlas-polygon-vertex-item:last-child { border-bottom: none; }

.atlas-polygon-vertex-num {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 600;
    color: #81c784;
    flex-shrink: 0;
}

.atlas-polygon-vertex-coords {
    color: var(--studio-text, #e0e0e0);
    font-size: clamp(0.55rem, 0.6vw, 0.6rem);
}

/* ═══════════════════════════════════════════════════════════════
   🔒 ATLAS STUDIO — Barre de contrôle Tour Privacy
   Affichée dans le pied de page du drawer pour les créateurs.
   ═══════════════════════════════════════════════════════════════ */
#atlas-tour-privacy-bar {
    padding: 0.65rem 0.85rem 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 20, 45, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.atlas-privacy-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.atlas-privacy-header__icon {
    font-size: 0.75rem;
    line-height: 1;
}

.atlas-privacy-header__title {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.atlas-privacy-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.atlas-privacy-pill {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(203, 213, 225, 0.75);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.atlas-privacy-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.atlas-privacy-pill[data-status="public"].atlas-privacy-pill--active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}
.atlas-privacy-pill[data-status="private"].atlas-privacy-pill--active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}
.atlas-privacy-pill[data-status="draft"].atlas-privacy-pill--active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.18);
}
.atlas-privacy-pill__icon {
    font-size: 0.75rem;
    line-height: 1;
}
.atlas-privacy-pill__label {
    line-height: 1;
}

.atlas-privacy-hint {
    font-size: 0.62rem;
    color: rgba(100, 116, 139, 0.85);
    line-height: 1.45;
    margin: 0;
    font-style: italic;
}

/* Mode compact : cacher la barre privacy (trop étroite) */
.atlas-studio-drawer.compact #atlas-tour-privacy-bar {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🗄️ D1 RESTORE PANEL — Panneau de Restauration (Superadmin)
   ═══════════════════════════════════════════════════════════════════════════ */

.atlas-restore-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    color: var(--studio-text, #e2e8f0);
    font-size: 0.78rem;
}

/* Badge superadmin */
.atlas-restore-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: linear-gradient(90deg, rgba(251,191,36,0.15), rgba(251,191,36,0.05));
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 6px;
    color: #fbbf24;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Avertissement */
.atlas-restore-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 0.74rem;
    line-height: 1.5;
}
.atlas-restore-warning svg { flex-shrink: 0; margin-top: 1px; }
.atlas-restore-warning strong { display: block; color: #f87171; margin-bottom: 3px; }
.atlas-restore-warning p { margin: 0; opacity: 0.8; }

/* Sections */
.atlas-restore-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px;
    background: rgba(15,23,42,0.4);
    border: 1px solid rgba(51,65,85,0.6);
    border-radius: 8px;
}

.atlas-restore-section-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--studio-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
    margin-bottom: 2px;
}

/* Zone de dépôt de fichier */
.atlas-restore-file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px;
    border: 2px dashed rgba(51,65,85,0.7);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    color: var(--studio-text-muted, #94a3b8);
    font-size: 0.74rem;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(15,23,42,0.3);
}
.atlas-restore-file-drop:hover,
.atlas-restore-file-drop.dragover {
    border-color: var(--studio-accent, #6366f1);
    background: rgba(99,102,241,0.07);
    color: var(--studio-text, #e2e8f0);
}

/* Infos fichier sélectionné */
.atlas-restore-file-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 6px;
    font-size: 0.74rem;
    color: #86efac;
}
.atlas-restore-clear-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(148,163,184,0.6);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.atlas-restore-clear-btn:hover { color: #f87171; background: rgba(239,68,68,0.1); }

/* Checkboxes tables */
.atlas-restore-tables {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.atlas-restore-table-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}
.atlas-restore-table-check:hover { background: rgba(99,102,241,0.08); }
.atlas-restore-table-check input[type="checkbox"] { cursor: pointer; accent-color: var(--studio-accent, #6366f1); }
.atlas-restore-table-name {
    font-family: monospace;
    font-size: 0.76rem;
    color: #c4b5fd;
    min-width: 110px;
}
.atlas-restore-table-desc {
    font-size: 0.68rem;
    color: var(--studio-text-muted, #94a3b8);
    opacity: 0.8;
}

/* Note sécurité */
.atlas-restore-security-note {
    margin: 4px 0 0 0;
    font-size: 0.68rem;
    color: rgba(148,163,184,0.65);
    font-style: italic;
}

/* Modes radio */
.atlas-restore-modes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.atlas-restore-mode-radio {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(51,65,85,0.5);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.atlas-restore-mode-radio:hover { border-color: var(--studio-accent, #6366f1); background: rgba(99,102,241,0.06); }
.atlas-restore-mode-radio input[type="radio"] { cursor: pointer; margin-top: 2px; accent-color: var(--studio-accent, #6366f1); }
.atlas-restore-mode-content { display: flex; flex-direction: column; gap: 2px; }
.atlas-restore-mode-title { font-size: 0.76rem; font-weight: 600; color: var(--studio-text, #e2e8f0); }
.atlas-restore-mode-desc { font-size: 0.68rem; color: var(--studio-text-muted, #94a3b8); line-height: 1.4; }

/* Confirmation */
.atlas-restore-confirm-section {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.2);
}
.atlas-restore-confirm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.74rem;
    color: #fde68a;
}
.atlas-restore-confirm-check input { accent-color: #f59e0b; cursor: pointer; }

/* Bouton Restaurer */
.atlas-restore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.atlas-restore-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.atlas-restore-btn:active:not(:disabled) { transform: translateY(0); }
.atlas-restore-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(51,65,85,0.8);
}

/* Zone résultats */
.atlas-restore-results {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    line-height: 1.5;
}
.atlas-restore-results.success {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
}
.atlas-restore-results.error {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}
.atlas-restore-results-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    margin-bottom: 6px;
}
.atlas-restore-results-header span:first-child {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}
.success .atlas-restore-results-header span:first-child { background: rgba(34,197,94,0.2); }
.error .atlas-restore-results-header span:first-child { background: rgba(239,68,68,0.2); }
.atlas-restore-results p { margin: 3px 0; }


/* ═══════════════════════════════════════════════════════════════
   PRESET BAR — Barre de presets en haut de chaque onglet
   ═══════════════════════════════════════════════════════════════ */

.atlas-preset-bar {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--studio-radius);
    padding: clamp(0.5rem, 1vw, 0.75rem);
    margin-bottom: clamp(0.6rem, 1.2vw, 1rem);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* ─── En-tête ─── */
.atlas-preset-bar-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.atlas-preset-bar-icon {
    color: var(--studio-accent);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.atlas-preset-bar-title {
    font-size: var(--studio-font-small);
    font-weight: 600;
    color: var(--studio-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 1;
}

.atlas-preset-bar-count {
    font-size: var(--studio-font-small);
    color: var(--studio-text-muted);
    background: var(--studio-surface);
    border-radius: 9999px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1.6;
}

/* ─── Zone sélecteur + boutons charger/suppr ─── */
.atlas-preset-bar-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.atlas-preset-select {
    flex: 1;
    background: var(--studio-surface);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
    color: var(--studio-text);
    font-size: var(--studio-font-small);
    padding: 4px 8px;
    height: 30px;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 0;
}

.atlas-preset-select:hover,
.atlas-preset-select:focus {
    border-color: var(--studio-accent);
    outline: none;
}

.atlas-preset-select option {
    background: #1a1f35;
    color: var(--studio-text);
}

.atlas-preset-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ─── Boutons preset ─── */
.atlas-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    color: var(--studio-text);
    font-size: var(--studio-font-small);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.atlas-preset-btn:hover:not(:disabled) {
    background: var(--studio-surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.atlas-preset-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Charger */
.atlas-preset-btn--load {
    border-color: rgba(99, 102, 241, 0.35);
    color: #818cf8;
}
.atlas-preset-btn--load:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--studio-accent);
}

/* Sauvegarder */
.atlas-preset-btn--save {
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
    flex-shrink: 0;
}
.atlas-preset-btn--save:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--studio-success);
}

/* Supprimer */
.atlas-preset-btn--delete {
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
    padding: 4px 7px;
}
.atlas-preset-btn--delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--studio-error);
}

/* ─── Ligne sauvegarde : input + bouton save ─── */
.atlas-preset-save-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.atlas-preset-name-input {
    flex: 1;
    height: 30px;
    padding: 4px 8px;
    font-size: var(--studio-font-small);
    min-width: 0;
}

/* ─── Feedback ─── */
.atlas-preset-feedback {
    font-size: var(--studio-font-small);
    padding: 4px 8px;
    border-radius: 5px;
    line-height: 1.4;
}

.atlas-preset-feedback--success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.atlas-preset-feedback--error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.atlas-preset-feedback--warning {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   HELP MODAL — Modal d'aide contextuelle (accordéons Animation)
   ═══════════════════════════════════════════════════════════════ */

.atlas-help-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: atlas-help-modal-fadein 0.18s ease;
}

@keyframes atlas-help-modal-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.atlas-help-modal {
    background: #0f172a;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 12px;
    max-width: clamp(340px, 88vw, 640px);
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(6,182,212,0.12);
    animation: atlas-help-modal-slidein 0.18s ease;
}

@keyframes atlas-help-modal-slidein {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.atlas-help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.65rem, 2vw, 0.95rem) clamp(0.85rem, 3vw, 1.25rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 182, 212, 0.08);
    flex-shrink: 0;
}

.atlas-help-modal-title {
    font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);
    font-weight: 700;
    color: #67e8f9;
    letter-spacing: 0.04em;
}

.atlas-help-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.atlas-help-modal-close:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

.atlas-help-modal-body {
    overflow-y: auto;
    padding: clamp(0.85rem, 2.5vw, 1.25rem) clamp(0.85rem, 3vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(6, 182, 212, 0.3) transparent;
}

.atlas-help-modal-intro {
    font-size: clamp(0.875rem, 0.83rem + 0.22vw, 0.975rem);
    color: #94a3b8;
    margin-bottom: clamp(0.75rem, 2vw, 1.1rem);
    line-height: 1.72;
    padding: clamp(0.55rem, 1.5vw, 0.75rem) clamp(0.65rem, 2vw, 0.9rem);
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(6, 182, 212, 0.5);
    border-radius: 0 5px 5px 0;
}

.atlas-help-param-block {
    margin-bottom: clamp(0.65rem, 2vw, 0.9rem);
    padding: clamp(0.65rem, 2vw, 0.9rem) clamp(0.75rem, 2.5vw, 1.1rem);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.atlas-help-param-title {
    font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.025rem);
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: clamp(0.4rem, 1.2vw, 0.6rem);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.atlas-help-param-desc {
    font-size: clamp(0.85rem, 0.8rem + 0.25vw, 0.95rem);
    color: #94a3b8;
    line-height: 1.78;
}

.atlas-help-param-desc strong {
    color: #67e8f9;
    font-weight: 600;
}

.atlas-help-param-desc em {
    color: #a5b4fc;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   🛤️ TOUR BUILDER MODAL — Modale Fullscreen Éditeur de Circuits
   Convention : Flexbox-Responsive, clamp(), pas de pixels fixes
   ═══════════════════════════════════════════════════════════════ */

/* --- Overlay & Conteneur modale --- */
.atlas-tour-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.atlas-tour-modal-overlay.visible {
    opacity: 1;
}

.atlas-tour-modal {
    display: flex;
    flex-direction: column;
    width: clamp(800px, 92vw, 1600px);
    height: clamp(500px, 88vh, 960px);
    background: var(--studio-bg, #0f172a);
    border: 1.5px solid rgba(99, 102, 241, 0.25);
    border-radius: clamp(0.75rem, 1vw, 1.25rem);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.1);
    overflow: hidden;
    animation: atlas-tour-modal-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes atlas-tour-modal-in {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- Header modale --- */
.atlas-tour-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.6rem, 1vw, 1rem) clamp(1rem, 1.5vw, 1.5rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.atlas-tour-modal-title {
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 0.6vw, 0.75rem);
    font-size: clamp(0.95rem, 1.1vw, 1.2rem);
    font-weight: 600;
    color: var(--studio-text, #e2e8f0);
}

.atlas-tour-modal-title svg {
    color: var(--studio-accent, #6366f1);
    flex-shrink: 0;
}

.atlas-tour-modal-subtitle {
    font-size: clamp(0.7rem, 0.8vw, 0.85rem);
    font-weight: 400;
    color: var(--studio-text-muted, #94a3b8);
}

.atlas-tour-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.8rem, 2.2vw, 2.4rem);
    height: clamp(1.8rem, 2.2vw, 2.4rem);
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: var(--studio-text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.atlas-tour-modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* --- Corps 3 colonnes Flexbox --- */
.atlas-tour-modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- Colonne générique --- */
.atlas-tour-modal-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* --- Colonne gauche : Panoramas --- */
.atlas-tour-modal-col--left {
    flex: 0 0 clamp(240px, 28%, 380px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: clamp(0.6rem, 1vw, 1rem);
    gap: clamp(0.4rem, 0.6vw, 0.75rem);
}

/* --- Colonne centre : Étapes --- */
.atlas-tour-modal-col--center {
    flex: 1 1 auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: clamp(0.6rem, 1vw, 1rem);
    gap: clamp(0.4rem, 0.6vw, 0.75rem);
}

/* --- Colonne droite : Config + Contrôles --- */
.atlas-tour-modal-col--right {
    flex: 0 0 clamp(220px, 25%, 340px);
    padding: clamp(0.6rem, 1vw, 1rem);
    gap: clamp(0.5rem, 0.8vw, 1rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent, #6366f1) transparent;
}

/* --- En-tête de colonne --- */
.atlas-tour-modal-col-header {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    font-size: clamp(0.7rem, 0.8vw, 0.85rem);
    font-weight: 700;
    color: var(--studio-accent, #6366f1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: clamp(0.3rem, 0.4vw, 0.5rem);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    flex-shrink: 0;
}

.atlas-tour-modal-col-header svg {
    width: clamp(14px, 1vw, 18px);
    height: clamp(14px, 1vw, 18px);
    flex-shrink: 0;
}

/* --- Barre de recherche + import --- */
.atlas-tour-modal-search-row {
    display: flex;
    gap: clamp(0.3rem, 0.4vw, 0.5rem);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: clamp(0.2rem, 0.3vw, 0.35rem);
}

.atlas-tour-modal-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    background: var(--studio-surface, #1e293b);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0 clamp(0.3rem, 0.5vw, 0.5rem);
    transition: border-color 0.2s;
}

.atlas-tour-modal-search-input-wrap:focus-within {
    border-color: var(--studio-accent, #6366f1);
}

.atlas-tour-modal-search-input-wrap svg {
    color: var(--studio-text-muted, #94a3b8);
    flex-shrink: 0;
}

.atlas-tour-modal-search-input-wrap .atlas-studio-input {
    border: none;
    background: transparent;
    padding: clamp(0.25rem, 0.4vw, 0.4rem) 0;
    font-size: clamp(0.7rem, 0.8vw, 0.85rem);
}

/* --- Boutons modale --- */
.atlas-tour-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.2rem, 0.3vw, 0.35rem);
    padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 0.8vw, 0.8rem);
    border-radius: 0.5rem;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: var(--studio-surface, #1e293b);
    color: var(--studio-text, #e2e8f0);
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.atlas-tour-modal-btn:hover {
    border-color: var(--studio-accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.atlas-tour-modal-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.atlas-tour-modal-btn--accent {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.atlas-tour-modal-btn--accent:hover {
    background: rgba(99, 102, 241, 0.2);
}

.atlas-tour-modal-btn--play:not(:disabled) {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.atlas-tour-modal-btn--play:not(:disabled):hover {
    background: #059669;
}

.atlas-tour-modal-btn--stop:not(:disabled) {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.atlas-tour-modal-btn--save {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--studio-accent, #6366f1);
}

.atlas-tour-modal-btn--save:hover {
    background: var(--studio-accent, #6366f1);
    color: #fff;
}

/* --- Liste panoramas (modale) — vue liste horizontale --- */
.atlas-tour-modal-nodes-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(0.15rem, 0.25vw, 0.3rem);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(0.2rem, 0.3vw, 0.4rem);
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent, #6366f1) transparent;
}

.atlas-tour-modal-node-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(0.4rem, 0.5vw, 0.6rem);
    border-radius: 0.5rem;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    background: var(--studio-surface, #1e293b);
    cursor: grab;
    transition: all 0.2s ease;
    overflow: hidden;
    padding: clamp(0.2rem, 0.3vw, 0.35rem) clamp(0.3rem, 0.4vw, 0.5rem);
    min-height: clamp(2.75rem, 3.5vw, 3.5rem);
}

.atlas-tour-modal-node-card:hover {
    border-color: var(--studio-accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 2px 0 0 var(--studio-accent, #6366f1);
}

.atlas-tour-modal-node-card.in-steps {
    border-color: rgba(16, 185, 129, 0.35);
    opacity: 0.7;
}

.atlas-tour-modal-node-card.dragging {
    opacity: 0.35;
    transform: scale(0.93);
}

.atlas-tour-modal-node-thumb {
    width: clamp(3.5rem, 6vw, 5rem);
    min-width: clamp(3.5rem, 6vw, 5rem);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    border-radius: 4px;
    flex-shrink: 0;
}

.atlas-tour-modal-node-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.atlas-tour-modal-node-footer {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.3vw, 0.3rem);
    flex: 1;
    min-width: 0;
}

.atlas-tour-modal-node-label {
    flex: 1;
    font-size: var(--fs-body-small, 0.875rem);
    color: var(--studio-text, #e2e8f0);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    word-break: break-word;
}

.atlas-tour-modal-node-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.3rem, 1.6vw, 1.7rem);
    height: clamp(1.3rem, 1.6vw, 1.7rem);
    border-radius: 50%;
    border: 1.5px solid rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
    color: var(--studio-accent, #6366f1);
    font-size: clamp(0.8rem, 0.9vw, 1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.atlas-tour-modal-node-add:hover {
    background: var(--studio-accent, #6366f1);
    color: #fff;
    transform: scale(1.15);
}

.atlas-tour-modal-node-add.added {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
    cursor: default;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
}

/* --- Conteneur des étapes (modale) --- */
.atlas-tour-modal-steps-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 0.6vw, 0.6rem);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent, #6366f1) transparent;
    padding: clamp(0.2rem, 0.3vw, 0.3rem);
}

/* --- Drop zone modale (plus grande) --- */
.atlas-tour-modal-drop-zone {
    min-height: clamp(80px, 12vh, 160px);
}

/* --- Carte d'une étape (modale — version spacieuse) --- */
.atlas-tour-modal-step {
    display: flex;
    gap: clamp(0.5rem, 0.8vw, 0.8rem);
    padding: clamp(0.5rem, 0.7vw, 0.75rem);
    background: var(--studio-surface, #1e293b);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.6rem;
    transition: all 0.2s ease;
    cursor: default;
}

.atlas-tour-modal-step:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.atlas-tour-modal-step.dragging {
    opacity: 0.35;
    transform: scale(0.97);
}

.atlas-tour-modal-step.drop-above {
    border-top: 3px solid var(--studio-accent, #6366f1);
}

.atlas-tour-modal-step.playing {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.atlas-tour-modal-step-left {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    flex-shrink: 0;
}

.atlas-tour-modal-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.5rem, 1.8vw, 2rem);
    height: clamp(1.5rem, 1.8vw, 2rem);
    border-radius: 50%;
    background: var(--studio-accent, #6366f1);
    color: #fff;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    font-weight: 700;
    flex-shrink: 0;
}

.atlas-tour-modal-step-thumb {
    width: clamp(60px, 7vw, 90px);
    aspect-ratio: 16 / 9;
    border-radius: 0.4rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.atlas-tour-modal-step-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atlas-tour-modal-step-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.2rem;
    color: var(--studio-text-muted, #94a3b8);
}

.atlas-tour-modal-step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(0.25rem, 0.4vw, 0.4rem);
    min-width: 0;
}

.atlas-tour-modal-step-name-row {
    display: flex;
    align-items: center;
    gap: clamp(0.3rem, 0.4vw, 0.5rem);
}

.atlas-tour-modal-step-name {
    flex: 1;
    font-size: clamp(0.7rem, 0.85vw, 0.9rem);
    font-weight: 500;
    color: var(--studio-text, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-tour-modal-step-goto,
.atlas-tour-modal-step-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.4rem, 1.6vw, 1.8rem);
    height: clamp(1.4rem, 1.6vw, 1.8rem);
    border-radius: 0.35rem;
    border: none;
    background: transparent;
    color: var(--studio-text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.atlas-tour-modal-step-goto:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent, #6366f1);
}

.atlas-tour-modal-step-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* --- Paramètres étape (modale) --- */
.atlas-tour-modal-step-settings {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 0.8vw, 1rem);
    flex-wrap: wrap;
}

.atlas-tour-modal-step-setting {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 0.3vw, 0.3rem);
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
}

.atlas-tour-modal-step-setting label {
    color: var(--studio-text-muted, #94a3b8);
    font-size: clamp(0.55rem, 0.65vw, 0.7rem);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.atlas-tour-modal-step-setting .atlas-studio-input {
    width: clamp(3.5rem, 4.5vw, 5rem);
    padding: clamp(0.15rem, 0.25vw, 0.25rem) clamp(0.3rem, 0.4vw, 0.4rem);
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    text-align: center;
}

.atlas-tour-modal-step-setting .atlas-studio-select {
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    padding: clamp(0.15rem, 0.25vw, 0.25rem) clamp(0.3rem, 0.4vw, 0.4rem);
    min-width: unset;
}

.atlas-tour-modal-set-yaw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.2rem, 1.4vw, 1.5rem);
    height: clamp(1.2rem, 1.4vw, 1.5rem);
    border-radius: 50%;
    border: none;
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent, #6366f1);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.atlas-tour-modal-set-yaw:hover {
    background: var(--studio-accent, #6366f1);
    color: #fff;
}

/* --- Sections colonne droite --- */
.atlas-tour-modal-section {
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 0.6vw, 0.6rem);
}

.atlas-tour-modal-section--grow {
    flex: 1;
    min-height: 0;
}

/* --- Formulaire config --- */
.atlas-tour-modal-form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.4rem, 0.6vw, 0.6rem);
}

.atlas-tour-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.atlas-tour-modal-field label {
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    color: var(--studio-text-muted, #94a3b8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.atlas-tour-modal-textarea {
    resize: vertical;
    min-height: clamp(2.5rem, 4vh, 4rem);
    max-height: clamp(5rem, 10vh, 8rem);
    font-family: inherit;
}

/* --- Options (checkboxes + speed) --- */
.atlas-tour-modal-options {
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 1vw, 1rem);
    flex-wrap: wrap;
}

.atlas-tour-modal-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    color: var(--studio-text, #e2e8f0);
    cursor: pointer;
    user-select: none;
}

.atlas-tour-modal-checkbox input[type="checkbox"] {
    accent-color: var(--studio-accent, #6366f1);
    width: clamp(0.9rem, 1vw, 1.1rem);
    height: clamp(0.9rem, 1vw, 1.1rem);
}

.atlas-tour-modal-speed {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.atlas-tour-modal-speed label {
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    color: var(--studio-text-muted, #94a3b8);
    font-weight: 500;
}

.atlas-tour-modal-speed .atlas-studio-select {
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    padding: clamp(0.2rem, 0.3vw, 0.3rem) clamp(0.4rem, 0.5vw, 0.5rem);
    min-width: unset;
}

/* --- Contrôles modale --- */
.atlas-tour-modal-controls {
    display: flex;
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
    flex-wrap: wrap;
}

.atlas-tour-modal-controls .atlas-tour-modal-btn {
    flex: 1;
    justify-content: center;
}

/* --- Circuits sauvegardés (modale) --- */
.atlas-tour-modal-saved-list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.25rem, 0.4vw, 0.4rem);
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--studio-accent, #6366f1) transparent;
}

.atlas-tour-modal-saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.4rem, 0.6vw, 0.6rem) clamp(0.5rem, 0.7vw, 0.75rem);
    border-radius: 0.5rem;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    background: var(--studio-surface, #1e293b);
    transition: all 0.2s ease;
}

.atlas-tour-modal-saved-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.atlas-tour-modal-saved-item.active {
    border-color: var(--studio-accent, #6366f1);
    background: rgba(99, 102, 241, 0.08);
}

.atlas-tour-modal-saved-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}

.atlas-tour-modal-saved-name {
    font-size: clamp(0.65rem, 0.8vw, 0.85rem);
    font-weight: 500;
    color: var(--studio-text, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atlas-tour-modal-saved-meta {
    font-size: clamp(0.55rem, 0.65vw, 0.7rem);
    color: var(--studio-text-muted, #94a3b8);
}

.atlas-tour-modal-saved-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.atlas-tour-modal-saved-load,
.atlas-tour-modal-saved-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.5rem, 1.8vw, 1.9rem);
    height: clamp(1.5rem, 1.8vw, 1.9rem);
    border-radius: 0.35rem;
    border: none;
    background: transparent;
    color: var(--studio-text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.atlas-tour-modal-saved-load:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--studio-accent, #6366f1);
}

.atlas-tour-modal-saved-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
