/* --- DESIGN SYSTEM & THEMES --- */
:root {
    --col-cobalt: #303083; --col-gold: #C5A059; --col-gold-light: #E5C585;
    --col-parchment: #F9F4E8; --col-ink: #4A3B32; --col-teal: #1A5F8D;
    --glass-bg: rgba(255, 255, 255, 0.82); --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 12px 40px 0 rgba(31, 38, 135, 0.15); --map-bg: #fdfcf6;
    --panel-bg: rgba(255,255,255,0.6); --text-muted: #666; --glass-blur: 20px;
    --font-display: 'Amiri', serif; --font-ui: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --col-cobalt: #D4B06A; --col-gold: #A88A4F; --col-gold-light: #C5A059;
    --col-parchment: #0E1117; --col-ink: #E0E0E0; --col-teal: #428bca;
    --glass-bg: rgba(22, 27, 34, 0.85); --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 12px 40px 0 rgba(0, 0, 0, 0.5); --map-bg: #0E1117;
    --panel-bg: rgba(0,0,0,0.3); --text-muted: #aaa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-ui); color: var(--col-ink); overflow: hidden; background: var(--map-bg); transition: background 0.4s ease; }
[dir="rtl"] body { font-family: 'Noto Kufi Arabic', 'Amiri', sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .popup-title { font-family: 'Amiri', serif; }

#map { height: 100vh; width: 100vw; z-index: 1; background: var(--map-bg); }

[data-theme="dark"] .leaflet-layer, [data-theme="dark"] .leaflet-control-zoom-in,
[data-theme="dark"] .leaflet-control-zoom-out, [data-theme="dark"] .leaflet-control-attribution { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }

/* --- UI: CONTROLS & SIDEBAR --- */
.top-controls { position: absolute; top: 24px; inset-inline-end: 24px; z-index: 1000; display: flex; gap: 10px; }
.icon-btn { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-soft); color: var(--col-cobalt); font-size: 1.2rem; font-weight: bold; transition: all 0.2s; border: 1px solid rgba(128,128,128,0.2); font-family: var(--font-ui); }
.icon-btn:hover { transform: translateY(-2px); background: var(--col-cobalt); color: #fff; }

.sidebar { position: absolute; top: 24px; inset-inline-start: 24px; width: 420px; max-width: 90vw; height: calc(100vh - 140px); z-index: 1000; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); border-radius: 20px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; overflow: hidden; transform: translateX(0); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
[dir="ltr"] .sidebar.closed-desktop { transform: translateX(calc(-100% - 24px)); }
[dir="rtl"] .sidebar.closed-desktop { transform: translateX(calc(100% + 24px)); }

.desktop-toggle-btn { position: absolute; top: 24px; inset-inline-end: 20px; background: rgba(0,0,0,0.05); color: var(--col-ink); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; transition: background 0.2s; font-size: 1.1rem; }
.desktop-toggle-btn:hover { background: rgba(0,0,0,0.1); }
[data-theme="dark"] .desktop-toggle-btn { background: rgba(255,255,255,0.1); color: #fff; }
[data-theme="dark"] .desktop-toggle-btn:hover { background: rgba(255,255,255,0.2); }
[dir="rtl"] .desktop-toggle-btn { transform: rotate(0deg); }

.desktop-open-btn { position: absolute; top: 24px; inset-inline-start: 24px; z-index: 999; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); box-shadow: var(--shadow-soft); padding: 10px 20px; border-radius: 12px; color: var(--col-cobalt); font-family: var(--font-display); font-size: 1.5rem; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(128,128,128,0.2); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
[dir="ltr"] .desktop-open-btn { transform: translateX(-150%); }
[dir="rtl"] .desktop-open-btn { transform: translateX(150%); }
.desktop-open-btn.visible { transform: translateX(0) !important; }

.close-sidebar-btn { display: none; }
.mobile-top-bar { display: none; }

.brand-header { padding: 1.5rem 2rem 1rem; border-bottom: 1px solid rgba(128,128,128,0.1); position: relative; }
h1 { font-family: var(--font-display); color: var(--col-cobalt); font-size: 2.2rem; line-height: 1.1; margin-bottom: 0.2rem; letter-spacing: -0.5px; }
.subtitle { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--col-gold); font-weight: 700; display: block; }
[dir="rtl"] .subtitle { letter-spacing: 0; }

.nav-menu { display: flex; padding: 0.5rem 1rem; border-bottom: 1px solid rgba(128,128,128,0.1); }
.nav-item { flex: 1; text-align: center; color: var(--col-ink); font-size: 0.9rem; font-weight: 500; padding: 0.75rem 0; border-radius: 8px; margin: 0 4px; transition: all 0.2s ease; cursor: pointer; border: none; background: transparent; font-family: inherit; }
.nav-item:hover { background: rgba(48, 48, 131, 0.05); color: var(--col-cobalt); }
.nav-item.active { background: var(--col-cobalt); color: white; box-shadow: 0 4px 12px rgba(48, 48, 131, 0.3); }
[data-theme="dark"] .nav-item { color: var(--text-muted); }
[data-theme="dark"] .nav-item:hover { color: var(--col-ink); background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .nav-item.active { background: var(--col-cobalt); color: white; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }

.content-panel { flex-grow: 1; overflow-y: auto; padding: 1.5rem 2rem; scrollbar-width: thin; scrollbar-color: var(--col-gold) transparent; position: relative; }
.content-panel::-webkit-scrollbar { width: 6px; }
.content-panel::-webkit-scrollbar-thumb { background-color: var(--col-gold); border-radius: 3px; }

.panel-section { display: none; animation: fadeIn 0.3s ease; }
.panel-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

p { line-height: 1.7; font-size: 0.95rem; margin-bottom: 1rem; color: var(--col-ink); }
strong { color: var(--col-cobalt); }
h3 { font-family: var(--font-display); color: var(--col-ink); margin-bottom: 1rem; font-size: 1.5rem; border-bottom: 2px solid var(--col-gold-light); display: inline-block; padding-bottom: 5px; }

/* Widgets */
.widget-box { background: var(--panel-bg); padding: 1rem; border-radius: 12px; border: 1px solid rgba(128,128,128,0.1); margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.widget-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; font-weight: 700; color: var(--col-cobalt); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.8rem; }
[dir="rtl"] .widget-header { letter-spacing: 0; }

.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(128,128,128,0.3); transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
[dir="rtl"] .slider:before { left: auto; right: 3px; }
input:checked + .slider { background-color: var(--col-cobalt); }
[dir="ltr"] input:checked + .slider:before { transform: translateX(20px); }
[dir="rtl"] input:checked + .slider:before { transform: translateX(-20px); }

.range-slider-container { position: relative; padding: 5px 0; }
.range-info { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; text-align: end; }
.simple-slider { width: 100%; -webkit-appearance: none; height: 4px; background: rgba(128,128,128,0.2); border-radius: 2px; outline: none; margin: 10px 0; }
.simple-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--col-cobalt); cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.filter-select { width: 100%; padding: 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid rgba(128,128,128,0.2); background: var(--glass-bg); color: var(--col-ink); font-family: inherit; font-size: 0.85rem; outline: none; cursor: pointer; }
.cal-btn { flex: 1; border: none; background: transparent; color: var(--col-ink); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 0.8rem; font-weight: 600; transition: all 0.2s; }
.cal-btn.active { background: var(--col-cobalt); color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
[data-theme="dark"] .cal-btn { color: var(--text-muted); }
[data-theme="dark"] .cal-btn.active { color: white; background: var(--col-cobalt); }

.ms-list { list-style: none; }
.ms-item { padding: 12px; border-bottom: 1px solid rgba(128,128,128,0.1); cursor: pointer; transition: all 0.2s; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
[dir="ltr"] .ms-item:hover { background: rgba(197, 160, 89, 0.1); transform: translateX(4px); }
[dir="rtl"] .ms-item:hover { background: rgba(197, 160, 89, 0.1); transform: translateX(-4px); }
.ms-info h4 { font-size: 0.9rem; margin: 0; color: var(--col-ink); }
.ms-info span { font-size: 0.75rem; color: var(--text-muted); }
.ms-year { font-weight: 600; color: var(--col-cobalt); font-size: 0.8rem; background: rgba(128,128,128,0.1); padding: 4px 8px; border-radius: 6px; display: inline-block; direction: ltr;}
[dir="rtl"] .ms-year { direction: rtl; }

/* Timeline Dock */
.timeline-dock { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 800px; max-width: 90vw; height: 80px; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); border-radius: 40px; box-shadow: var(--shadow-soft); z-index: 1000; display: flex; align-items: center; padding: 0 2rem; gap: 1.5rem; }
.timeline-year-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 110px; }
.timeline-year-val { font-family: var(--font-display); font-size: 2.2rem; color: var(--col-cobalt); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr;}
[dir="rtl"] .timeline-year-val { direction: rtl; }
.timeline-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--col-gold); font-weight: 700; }
[dir="rtl"] .timeline-label { letter-spacing: 0; }

.timeline-track-container { flex-grow: 1; position: relative; height: 40px; display: flex; align-items: center; } 
input[type=range].timeline-input { width: 100%; -webkit-appearance: none; background: transparent; z-index: 2; }
input[type=range].timeline-input:focus { outline: none; }
input[type=range].timeline-input::-webkit-slider-runnable-track { width: 100%; height: 4px; background: rgba(128,128,128,0.3); border-radius: 2px; cursor: pointer; }
input[type=range].timeline-input::-webkit-slider-thumb { -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%; background: var(--col-cobalt); border: 4px solid var(--col-parchment); box-shadow: 0 2px 6px rgba(0,0,0,0.3); cursor: pointer; margin-top: -10px; transition: transform 0.1s; }
input[type=range].timeline-input::-webkit-slider-thumb:hover { transform: scale(1.15); }

.timeline-ticks { position: absolute; top: 50%; left: 0; right: 0; height: 10px; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; z-index: 0; padding: 0 10px; }
.tick { width: 1px; height: 6px; background: rgba(128,128,128,0.3); }
.tick.major { height: 12px; background: var(--col-gold); }

/* --- POPUP & GALLERY UI --- */
[dir="rtl"] .leaflet-popup-content-wrapper, [dir="rtl"] .leaflet-popup-content, [dir="rtl"] .leaflet-popup-tip { direction: rtl !important; text-align: right !important; }
.leaflet-popup-content-wrapper { background: var(--col-parchment); color: var(--col-ink); border-radius: 12px; padding: 0; overflow: hidden; box-shadow: var(--shadow-soft); border: 1px solid rgba(197, 160, 89, 0.2); }
.leaflet-popup-content { margin: 0; width: 340px !important; }
.leaflet-popup-tip { background: var(--col-parchment); }

.gallery-wrapper { width: 100%; height: 180px; background: #111; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.gallery-img { max-width: 100%; max-height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s ease; }
.gallery-img.loaded { opacity: 1; }

.gallery-nav-btn { 
    position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; 
    background: rgba(20, 20, 20, 0.4); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; 
    color: rgba(255,255,255,0.9); font-size: 12px; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 10; 
}
.gallery-nav-btn:hover { background: var(--col-cobalt); border-color: var(--col-gold); transform: translateY(-50%) scale(1.1); color: white; }

[dir="ltr"] .gallery-nav-btn.prev-btn { left: 10px; }
[dir="ltr"] .gallery-nav-btn.next-btn { right: 10px; }
[dir="rtl"] .gallery-nav-btn.prev-btn { right: 10px; }
[dir="rtl"] .gallery-nav-btn.next-btn { left: 10px; }
[dir="rtl"] .gallery-nav-btn.prev-btn:hover, [dir="rtl"] .gallery-nav-btn.next-btn:hover { transform: translateY(-50%) scale(1.1); }

.image-counter { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.6); color: white; padding: 4px 8px; border-radius: 12px; font-size: 0.7rem; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2); z-index: 10; direction: ltr;}
.details-box { padding: 20px; }
.popup-title { font-family: var(--font-display); color: var(--col-cobalt); font-size: 1.5rem; line-height: 1.2; margin-bottom: 4px; }
.popup-subtitle { font-size: 0.8rem; color: var(--col-gold); font-weight: 600; margin-bottom: 12px; border-bottom: 1px solid rgba(128,128,128,0.1); padding-bottom: 12px; }
[dir="rtl"] .popup-title, [dir="rtl"] .popup-subtitle { text-align: right; }
[dir="ltr"] .popup-title, [dir="ltr"] .popup-subtitle { text-align: left; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.meta-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.meta-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
[dir="rtl"] .meta-label { letter-spacing: 0; text-align: right; }
[dir="ltr"] .meta-label { text-align: left; }
.meta-value { font-size: 0.85rem; font-weight: 600; }
[dir="rtl"] .meta-value { text-align: right; }
[dir="ltr"] .meta-value { text-align: left; }

.certainty-alert { display: flex; align-items: center; gap: 8px; background: rgba(197, 160, 89, 0.15); border-inline-start: 3px solid var(--col-gold); padding: 8px 10px; border-radius: 4px; font-size: 0.75rem; color: var(--col-ink); margin-bottom: 12px; line-height: 1.4; }
.certainty-icon { color: var(--col-gold); font-size: 1rem; font-weight: bold; }

.related-btn { width: 100%; padding: 8px; background: rgba(128,128,128,0.1); border: none; border-radius: 6px; color: var(--col-cobalt); font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.2s; margin-top: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none;}
.related-btn:hover { background: rgba(128,128,128,0.2); }
[data-theme="dark"] .related-btn { background: rgba(255,255,255,0.1); color: var(--col-ink); }
[data-theme="dark"] .related-btn:hover { background: rgba(255,255,255,0.2); }

/* --- DETAIL PANEL STYLES --- */
.detail-gallery-wrap { height: 240px; border-radius: 12px; margin-bottom: 20px; box-shadow: var(--shadow-soft); overflow: hidden; position: relative; }
.detail-gallery-img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s ease; }
.detail-title { margin-bottom: 5px; color: var(--col-cobalt); font-family: var(--font-display); font-size: 1.8rem; }
.detail-repo { margin-bottom: 15px; color: var(--col-gold); font-size: 0.85rem; font-weight: 600; }
.detail-desc { font-size: 0.95rem; line-height: 1.7; margin-bottom: 20px; }
.detail-biblio { font-size: 0.85rem; line-height: 1.6; color: var(--text-muted); }

.empire-label { background: transparent; border: none; box-shadow: none; font-family: var(--font-display); font-size: 1.2rem; color: var(--col-ink); text-shadow: 0 0 4px rgba(255,255,255,0.8); font-weight: bold; }
[data-theme="dark"] .empire-label { color: #fff; text-shadow: 0 0 6px #000; }
.custom-pin-container { display: flex; justify-content: center; align-items: flex-end; }
.custom-pin { width: 16px; height: 16px; border-radius: 50%; background: var(--col-cobalt); border: 2px solid var(--col-parchment); box-shadow: 0 0 0 2px var(--col-gold), 0 4px 10px rgba(0,0,0,0.4); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-pin-container:hover .custom-pin { transform: scale(1.4) translateY(-2px); background: var(--col-gold); box-shadow: 0 0 0 2px var(--col-cobalt), 0 6px 12px rgba(0,0,0,0.4); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(48, 48, 131, 0.15) !important; }
.marker-cluster div { background-color: var(--col-cobalt) !important; color: #fff; border: 2px solid var(--col-gold); font-family: var(--font-ui); font-weight: 600; }

.toast-notification { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); padding: 12px 24px; border-radius: 30px; box-shadow: var(--shadow-soft); font-family: inherit; font-size: 0.9rem; font-weight: 500; color: var(--col-cobalt); z-index: 9999; opacity: 0; pointer-events: none; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toast-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

/* ============= GALLERY LIGHTBOX (WooCommerce-Style Modal) ============= */
.gallery-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-lightbox-overlay.active {
    opacity: 1;
}
.gallery-lightbox-container {
    position: relative;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gallery-lightbox-main {
    width: 100%;
    height: 60vh;
    max-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.gallery-lightbox-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}
.gallery-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}
.gallery-lightbox-close:hover { background: rgba(255,255,255,0.25); }
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover { background: var(--col-cobalt); border-color: var(--col-gold); }
.gallery-lightbox-prev { left: -60px; }
.gallery-lightbox-next { right: -60px; }
.gallery-lightbox-counter {
    color: #fff;
    font-size: 0.85rem;
    margin-top: 12px;
    background: rgba(255,255,255,0.1);
    padding: 4px 14px;
    border-radius: 20px;
}
.gallery-lightbox-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 0;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.gallery-lightbox-thumbnails::-webkit-scrollbar { height: 4px; }
.gallery-lightbox-thumbnails::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }
.gallery-lightbox-thumb {
    flex-shrink: 0;
    width: 70px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: all 0.2s;
}
.gallery-lightbox-thumb:hover { opacity: 0.85; border-color: rgba(255,255,255,0.4); }
.gallery-lightbox-thumb.active { opacity: 1; border-color: var(--col-gold); }
.gallery-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 600px) {
    .desktop-toggle-btn, .desktop-open-btn, .top-controls { display: none !important; }
    .mobile-top-bar { display: flex; align-items: center; justify-content: space-between; position: absolute; top: 15px; left: 15px; right: 15px; height: 55px; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); border: var(--glass-border); border-radius: 12px; box-shadow: var(--shadow-soft); z-index: 1001; padding: 0 15px; }
    .mobile-menu-btn { font-size: 1.5rem; color: var(--col-cobalt); cursor: pointer; padding: 5px; border: none; background: transparent; }
    .mobile-brand { font-family: var(--font-display); font-size: 1.4rem; color: var(--col-cobalt); font-weight: bold; line-height: 1; }
    .mobile-actions { display: flex; gap: 6px; align-items: center; }
    .mobile-actions .icon-btn { width: 34px; height: 34px; font-size: 0.9rem; box-shadow: none; border: 1px solid rgba(128,128,128,0.2); background: transparent; }
    [data-theme="dark"] .mobile-actions .icon-btn { color: var(--col-ink); }
    .sidebar { position: fixed; top: 0; inset-inline-start: 0; width: 85vw; height: 100vh; border-radius: 0 20px 20px 0; z-index: 2000; box-shadow: 5px 0 25px rgba(0,0,0,0.2); }
    [dir="rtl"] .sidebar { border-radius: 20px 0 0 20px; box-shadow: -5px 0 25px rgba(0,0,0,0.2); }
    [dir="ltr"] .sidebar { transform: translateX(-105%); }
    [dir="rtl"] .sidebar { transform: translateX(105%); }
    .sidebar.open { transform: translateX(0) !important; }
    .close-sidebar-btn { display: block; position: absolute; top: 25px; inset-inline-end: 20px; font-size: 1.4rem; color: var(--col-ink); cursor: pointer; z-index: 10; background: rgba(0,0,0,0.05); width: 32px; height: 32px; border-radius: 50%; text-align: center; line-height: 32px; border: none; }
    .timeline-dock { bottom: 20px; width: 92%; padding: 0 1rem; height: 70px; border-radius: 35px; }
    .timeline-year-val { font-size: 1.6rem; }
    .leaflet-popup-content { width: 280px !important; }
    .leaflet-control-zoom { margin-bottom: 110px !important; }
    .gallery-lightbox-prev { left: 10px; }
    .gallery-lightbox-next { right: 10px; }
    .gallery-lightbox-main { height: 40vh; }
    .gallery-lightbox-thumb { width: 50px; height: 38px; }
}