/* ===== CSS Variables & Base ===== */
:root {
    --color-primary: #2c3e50;
    --color-accent: #c0392b;
    --color-bg: #2c3e50;
    --color-card: #ffffff;
    --color-text: #ecf0f1;
    --color-text-light: #bdc3c7;
    --color-border: #4a6274;
    --color-gold: #d4a948;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --container-width: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.hidden { display: none !important; }

/* ===== Header ===== */
.site-header {
    background: var(--color-primary);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.site-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.main-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-btn:hover, .nav-btn.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    gap: 0.15rem;
    margin-left: 0.5rem;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 0.75rem;
}

.lang-btn {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.lang-btn:hover {
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.4);
}

.lang-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

/* ===== Stats Banner ===== */
.stats-banner {
    background: rgba(0,0,0,0.15);
    color: white;
    padding: 1.5rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gold);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* ===== Filter Bar ===== */
.filter-bar {
    background: #1a2a38;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 1.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-toolbar .search-box {
    flex: 1;
    min-width: 160px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-body);
    color: #2c3e50;
    background: var(--color-card);
}

.search-box input:focus {
    border-color: var(--color-accent);
}

.btn-toggle-filters,
.filter-toolbar #sort-select {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: transparent;
    color: #ecf0f1;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-toolbar #sort-select {
    display: inline-block;
}

.filter-toolbar #sort-select option {
    background: #fff;
    color: #2c3e50;
}

.btn-toggle-filters:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

.btn-toggle-filters.active {
    background: rgba(192,57,43,0.2);
    border-color: var(--color-accent);
    color: white;
}

/* Filter button turns accent when reset button is visible (= filters are active) */
.filter-toolbar:has(.btn-reset-filters:not(.hidden)) .btn-toggle-filters {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Collapsible filter panel with slide animation */
.filter-controls-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.filter-controls-wrapper.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.filter-controls-wrapper > .filter-controls {
    overflow: hidden;
    min-height: 0;
}

.filter-controls-wrapper.expanded > .filter-controls {
    overflow: visible;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-controls select,
.filter-controls input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font-body);
    background: var(--color-card);
    color: #2c3e50;
    min-width: 140px;
}

.filter-controls select option {
    background: #fff;
    color: #2c3e50;
}

.btn-reset-filters {
    padding: 0.5rem 0.85rem;
    border: 1px solid #e74c3c;
    border-radius: var(--radius);
    background: transparent;
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.btn-reset-filters:hover {
    background: #e74c3c;
    color: #fff;
}
.btn-reset-filters.hidden {
    display: none;
}

/* ===== Multi-Select Filters ===== */
.multi-filter {
    position: relative;
}

.multi-filter-toggle {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font-body);
    background: var(--color-card);
    min-width: 140px;
    cursor: pointer;
    text-align: left;
    color: #2c3e50;
    transition: border-color 0.2s;
    white-space: nowrap;
}

.multi-filter-toggle:hover {
    border-color: var(--color-accent);
}

.multi-filter-toggle.has-selection {
    border-color: var(--color-accent);
    background: rgba(192,57,43,0.15);
    color: #fff;
}

.multi-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--color-card);
    color: #2c3e50;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    z-index: 50;
    padding: 0.25rem 0;
}

.multi-filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-card);
    z-index: 1;
}

.multi-filter-search {
    position: sticky;
    top: 33px;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
    outline: none;
    background: var(--color-card);
    z-index: 1;
    box-sizing: border-box;
}

.multi-filter-dropdown-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #2c3e50;
}

.multi-filter-dropdown-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 50%;
}

.multi-filter-dropdown-close:hover {
    color: #333;
    background: rgba(0,0,0,0.08);
}

.multi-filter-dropdown label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.multi-filter-dropdown label:hover {
    background: #f0f0f0;
}

.multi-filter-dropdown input[type="checkbox"] {
    accent-color: var(--color-accent);
}

.multi-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.multi-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    background: var(--color-accent);
    color: white;
    font-size: 0.7rem;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.multi-filter-tag:hover {
    background: #a93226;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    gap: 1px;
    font-size: 1.1em;
    line-height: 1;
}
.star-rating .star.filled {
    color: #f1c40f;
}
.star-rating .star.empty {
    color: #ccc;
}

.star-rating-input {
    display: inline-flex;
    gap: 2px;
    font-size: 1.4rem;
    cursor: pointer;
}
.star-rating-input .star {
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s;
}
.star-rating-input .star.filled {
    color: #f1c40f;
}
.star-rating-input .star:hover,
.star-rating-input .star:hover ~ .star {
    color: #f1c40f;
}

.filter-mode-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: #3498db;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background 0.2s;
}

.filter-mode-toggle:hover {
    background: #2980b9;
}

.filter-mode-toggle.mode-and {
    background: #27ae60;
}

.filter-mode-toggle.mode-and:hover {
    background: #219a52;
}

.filter-mode-toggle.mode-none {
    background: #e74c3c;
}

.filter-mode-toggle.mode-none:hover {
    background: #c0392b;
}

/* ===== Clickable Detail Tags ===== */
.clickable-tag {
    cursor: pointer;
}

/* Non-filterable badges with info buttons are also interactive */
.badge:has(.badge-info-btn) {
    cursor: pointer;
}

.clickable-tag.active-filter {
    box-shadow: inset 0 0 0 1.5px currentColor;
}

.year-range {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.year-range label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    color: #ecf0f1;
}

.year-range input {
    width: 80px;
    min-width: 80px !important;
}

.declination-range {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.declination-range label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    color: #ecf0f1;
}

.declination-range input {
    width: 80px;
    min-width: 80px !important;
}

.declination-range.hidden {
    display: none;
}

.results-info {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

/* ===== Compass Grid ===== */
.compass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.compass-card {
    background: var(--color-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.compass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.compass-card.selected {
    outline: 3px solid var(--color-accent, #8b6914);
    outline-offset: 2px;
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 600px) {
    .compass-card.selected {
        outline: none;
        transform: none;
        box-shadow: var(--shadow);
    }
}

/* 1:1 aspect ratio for overview images */
.card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image .no-image {
    font-size: 3rem;
    opacity: 0.3;
}

.card-image .image-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #2c3e50;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-manufacturer {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(0,0,0,0.08);
    color: #2c3e50;
    font-size: 0.85rem;
    border-radius: 3px;
    font-weight: 500;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.badge-year {
    background: var(--color-primary);
    color: white;
}

.badge-country {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-radioactive {
    background: #fff3e0;
    color: #e65100;
}

.badge-declination {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-type {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-manufacturer {
    background: #fce4ec;
    color: #c62828;
}

.badge-material {
    background: #f3e5f5;
    color: #6a1b9a;
}

.badge-style {
    background: #fff3e0;
    color: #e65100;
}

.badge-dimension {
    background: #e0f2f1;
    color: #00695c;
}

.badge-weight {
    background: #e3f2fd;
    color: #1565c0;
}

.doc-icon {
    vertical-align: -2px;
    flex-shrink: 0;
}
.doc-icon-pdf {
    color: #d32f2f;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 2rem 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: #2c3e50;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-btn:hover { background: rgba(255,255,255,0.1); }
.page-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
    font-size: 1.1rem;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,37,47,0.75);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    backdrop-filter: blur(6px);
}

.modal {
    background: var(--color-card);
    color: #2c3e50;
    border-radius: 0;
    width: 100%;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
    overflow-x: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    display: none;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover { background: rgba(0,0,0,0.7); }

.modal-content { padding: 0; overflow-wrap: break-word; word-break: break-word; }

/* ===== Detail Gallery ===== */
.detail-gallery {
    position: relative;
    width: 100%;
    background: #1a1a1a;
    border-radius: 0;
    overflow: hidden;
    user-select: none;
}

.detail-gallery img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(60vh - 80px);
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gallery-nav:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-nav.prev { left: 0.75rem; }
.gallery-nav.next { right: 0.75rem; }

.gallery-counter {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.gallery-zoom-btn {
    display: none;
}

.gallery-zoom-btn:hover { background: rgba(0,0,0,0.8); }


/* Gallery caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
    z-index: 2;
}
.gallery-caption p { margin: 0 0 0.3rem; }
.gallery-caption p:last-child { margin-bottom: 0; }
.gallery-caption a { color: #7cb9e8; text-decoration: underline; }
.gallery-caption a:hover { color: #a8d4f0; }
.gallery-caption strong { font-weight: 600; }
.gallery-caption ul, .gallery-caption ol { margin: 0.2rem 0; padding-left: 1.3rem; text-align: left; }
.gallery-caption code { background: rgba(255,255,255,0.1); padding: 0.1rem 0.3rem; border-radius: 3px; }

/* Gallery thumbnails strip */
.gallery-thumbs {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #1a1a1a;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbs img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.gallery-thumbs img.active {
    opacity: 1;
    border-color: var(--color-gold);
}

.gallery-thumbs img:hover {
    opacity: 0.85;
}

/* ===== Fullscreen Image Viewer (Zoom) ===== */
.fullscreen-viewer {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.fullscreen-viewer img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.fullscreen-viewer .viewer-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.fullscreen-viewer .viewer-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fullscreen-viewer .viewer-btn:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-viewer .viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-viewer .viewer-nav:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-viewer .viewer-nav.prev { left: 1rem; }
.fullscreen-viewer .viewer-nav.next { right: 1rem; }

.fullscreen-viewer .viewer-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* ===== Detail Body ===== */
/* ===== Detail Nav Hint ===== */
.detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.detail-back-link {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.2s;
}
.detail-back-link:hover {
    color: #2c3e50;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-title-row .detail-title {
    flex: 1;
    min-width: 0;
}

.detail-nav-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.detail-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-highlight, #f5f0e8);
    border: 1px solid rgba(0,0,0,0.12);
    color: var(--color-accent, #8b6914);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
    line-height: 1;
}

.detail-nav-btn:hover {
    background: rgba(139,105,20,0.12);
    border-color: var(--color-accent, #8b6914);
}

.detail-nav-counter {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
    min-width: 3em;
    text-align: center;
}

/* Hide nav buttons on mobile — swipe is used instead, but keep counter visible */
@media (max-width: 600px) {
    .detail-nav-inline .detail-nav-btn {
        display: none;
    }
}

/* ===== Detail Layout ===== */
.detail-layout { display: flex; flex-direction: column; }
.detail-media {
    flex-shrink: 0;
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.detail-media .detail-gallery {
    flex: 1;
    min-height: 0;
}
.detail-media .gallery-thumbs {
    flex-shrink: 0;
}

/* Landscape: image left, text right */
@media (min-width: 768px) and (min-aspect-ratio: 1/1) {
    .modal-overlay {
        padding: 0;
    }
    #detail-modal,
    #compass-detail-modal {
        overflow: hidden;
    }
    .modal {
        max-width: none;
    }
    #detail-modal .modal,
    #compass-detail-modal .modal {
        height: 100vh;
        overflow: hidden;
    }
    .detail-layout {
        flex-direction: row;
        align-items: stretch;
        height: 100vh;
    }
    .detail-media {
        max-height: 100vh;
        width: 50%;
        max-width: 50%;
        overflow: hidden;
        background: #1a1a1a;
        display: flex;
        flex-direction: column;
    }
    .detail-media .detail-gallery {
        flex: 1;
        min-height: 0;
    }
    .detail-media .detail-gallery img {
        max-height: calc(100vh - 80px);
        height: auto;
    }
    .detail-media .gallery-thumbs {
        flex-shrink: 0;
    }
    .detail-layout > .detail-body {
        flex: 1;
        min-width: 0;
        height: 100vh;
        overflow-y: auto;
    }
}

/* ===== Detail Body ===== */
.detail-body {
    padding: 1.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.detail-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.detail-subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.detail-badges .badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7f8c8d;
    margin-bottom: 0.4rem;
}

.detail-section p, .detail-section ul {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2c3e50;
}

.md-content {
    font-size: 0.95rem;
    line-height: 1.6;
}
.md-content p { margin: 0 0 0.5rem; }
.md-content p:last-child { margin-bottom: 0; }
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
    margin: 0.8rem 0 0.3rem;
    font-weight: 700;
    line-height: 1.3;
}
.md-content h1:first-child, .md-content h2:first-child,
.md-content h3:first-child { margin-top: 0; }
.md-content h1 { font-size: 1.2rem; }
.md-content h2 { font-size: 1.1rem; }
.md-content h3 { font-size: 1rem; }
.md-content ul, .md-content ol {
    margin: 0.3rem 0 0.5rem;
    padding-left: 1.5rem;
}
.md-content li { margin-bottom: 0.15rem; }
.md-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.6rem 0;
}
.md-content a { color: var(--color-accent); text-decoration: underline; }
.md-content a:hover { color: #a0302a; }
.md-content code {
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}
.md-content strong { font-weight: 600; }
.md-content em { font-style: italic; }

.detail-section > ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.detail-section > ul li {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.detail-tags .badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
}

/* Info button for lookup descriptions */
.badge-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: transparent;
    color: currentColor;
    font-size: 10px;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    margin-left: 0.3rem;
    pointer-events: none;
    cursor: default;
    border: 1.5px solid currentColor;
    padding: 0;
    vertical-align: middle;
    opacity: 0.4;
    font-family: Arial, Helvetica, sans-serif;
}

/* Style info buttons on touch devices as passive indicators (long-press hint) */
@media (hover: none) and (pointer: coarse) {
    .badge-info-btn,
    .filter-info-btn {
        pointer-events: none;
        opacity: 0.4;
        cursor: default;
    }
    .multi-filter-dropdown label,
    .ms-item {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Description popover */
.desc-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
}
.desc-popover {
    position: fixed;
    z-index: 9999;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    padding: 0.75rem 1rem;
    max-width: 380px;
    min-width: 200px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #2c3e50;
    max-height: 60vh;
    overflow-y: auto;
}
.desc-popover p { margin: 0 0 0.4rem; }
.desc-popover p:last-child { margin-bottom: 0; }
.desc-popover a { color: var(--color-accent); text-decoration: underline; }
.desc-popover a:hover { color: #a0302a; }
.desc-popover strong { font-weight: 600; }
.desc-popover em { font-style: italic; }
.desc-popover h1, .desc-popover h2, .desc-popover h3,
.desc-popover h4, .desc-popover h5, .desc-popover h6 {
    margin: 0.5rem 0 0.25rem;
    font-family: var(--font-display, inherit);
    font-weight: 700;
    line-height: 1.3;
}
.desc-popover h1 { font-size: 1.05rem; }
.desc-popover h2 { font-size: 0.95rem; }
.desc-popover h3 { font-size: 0.88rem; }
.desc-popover h4, .desc-popover h5, .desc-popover h6 { font-size: 0.82rem; }
.desc-popover h1:first-child, .desc-popover h2:first-child,
.desc-popover h3:first-child { margin-top: 0; }
.desc-popover ul, .desc-popover ol {
    margin: 0.25rem 0 0.4rem;
    padding-left: 1.3rem;
}
.desc-popover li { margin-bottom: 0.15rem; }
.desc-popover hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0.5rem 0;
}
.desc-popover code {
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}
.desc-popover-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 50%;
}
.desc-popover-close:hover {
    color: #333;
    background: rgba(0,0,0,0.08);
}

/* Badge tooltip popover (mobile) */
.badge-tooltip-popover {
    text-align: left;
}
.badge-tooltip-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #2c3e50;
    padding-right: 1.2rem;
}
.badge-tooltip-desc {
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #555;
}
.badge-tooltip-desc p:last-child {
    margin-bottom: 0;
}
.badge-tooltip-filter-btn {
    display: block;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    margin-top: 0.25rem;
}
.badge-tooltip-filter-btn:active {
    background: #d5dbdb;
}
@media (hover: hover) and (pointer: fine) {
    .badge-tooltip-filter-btn:hover {
        background: #d5dbdb;
    }
}
.badge-tooltip-filter-btn.remove {
    background: #fdebd0;
    border-color: #e8c39e;
    color: #7d4e1e;
}
.badge-tooltip-filter-btn.remove:active {
    background: #f5cba7;
}

/* Info button inside filter dropdowns */
.filter-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: transparent;
    color: #999;
    font-size: 9px;
    font-weight: normal;
    line-height: 1;
    margin-left: auto;
    cursor: pointer;
    border: 1.5px solid currentColor;
    padding: 0;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
    font-family: Arial, Helvetica, sans-serif;
    pointer-events: auto;
}
.filter-info-btn:hover {
    opacity: 1;
    color: #555;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem;
}

/* ===== Timeline (NYT-inspired) ===== */
.timeline-view {
    background: #1a2a38;
}

.timeline-view .container {
    max-width: 780px;
}

.timeline-view h2 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin: 3.5rem 0 0.6rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #fff;
}

.timeline-description {
    text-align: center;
    color: rgba(255,255,255,0.6);
    margin-bottom: 3rem;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.timeline {
    position: relative;
    padding: 0;
}

.timeline::before {
    display: none;
}

.timeline-decade {
    position: relative;
    margin: 0;
    padding: 0;
    z-index: 2;
}

.timeline-decade-label {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.12);
    background: none;
    padding: 3rem 0 0.75rem;
    border: none;
    border-radius: 0;
    letter-spacing: -0.03em;
    position: relative;
    line-height: 1;
}

.timeline-decade-count {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-item {
    position: relative;
    margin: 0;
    padding: 0.6rem 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow: visible;
}

.timeline-item:hover {
    background: rgba(255,255,255,0.04);
    transform: none;
}

.timeline-item::before {
    display: none;
}

.timeline-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    max-height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.timeline-thumb-placeholder {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    max-height: 56px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    opacity: 0.25;
}

.timeline-item-text {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.timeline-year {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.15rem;
}

.timeline-name {
    font-family: var(--font-display);
    font-weight: 600;
    margin-top: 0;
    font-size: 0.95rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
}

.timeline-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.15rem;
    line-height: 1.3;
}

.timeline-more {
    text-align: center;
    margin: 0 0 2rem;
    padding: 0.75rem 0;
    z-index: 2;
    position: relative;
}

.timeline-more button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.timeline-more button:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

/* ===== Managed Timelines (multi-lane roads) ===== */
.managed-timeline-section {
    margin: 0 0 3rem;
    position: relative;
}

.managed-tl-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2rem 0 0.5rem;
    text-align: center;
    color: #fff;
}

.managed-tl-description {
    color: rgba(255,255,255,0.55);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* Sticky header */
.tl-roads-sticky {
    position: sticky;
    top: 52px;
    z-index: 20;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(26, 42, 56, 0.95);
    backdrop-filter: blur(6px);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 32px;
}

.tl-sticky-chip {
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-bottom: 3px solid;
    white-space: nowrap;
}

/* Canvas — position relative for absolute children */
.tl-roads-canvas {
    position: relative;
    overflow: visible;
    margin-left: 0;
    touch-action: pan-y;
}

/* Lane-window overlay — fixed to the top of the viewport, shown only
   while the timeline section is in view. Holds chevrons, dots, and
   floating road titles for roads whose own header has scrolled out. */
.tl-roads-overlay {
    position: fixed;
    z-index: 90;
    height: 74px;
    pointer-events: none;
    background: transparent;
}
.tl-roads-overlay-titles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.tl-floating-header {
    position: absolute;
    top: 0;
    height: 80px;
    border: 2px solid;
    border-radius: 4px;
    background: rgba(26, 42, 56, 0.95);
    box-sizing: border-box;
    padding: 4px 6px;
    font-family: var(--font-display);
    line-height: 1.15;
    text-align: left;
    overflow: hidden;
    pointer-events: none;
}
.tl-floating-header[hidden] {
    display: none;
}
.tl-floating-header-year {
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.85;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.tl-floating-header-name {
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Bottom-of-viewport lane-window controls */
.tl-roads-controls {
    position: fixed;
    z-index: 90;
    height: 44px;
    pointer-events: none;
}
.tl-roads-nav-btn {
    position: absolute;
    bottom: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: background 0.15s;
    z-index: 2;
}
.tl-roads-nav-btn:hover {
    background: rgba(0,0,0,0.85);
}
.tl-roads-nav-btn[hidden] {
    display: none;
}
.tl-roads-nav-btn.prev { left: 4px; }
.tl-roads-nav-btn.next { right: 4px; }
.tl-roads-nav-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    pointer-events: none;
    z-index: 2;
}
.tl-roads-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: background 0.15s;
}
.tl-roads-nav-dot.active {
    background: rgba(255,255,255,0.9);
}

/* Floating year labels removed entirely */
.tl-roads-year {
    display: none;
}

/* Road column — continuous vertical strip, no rounded corners */
.tl-road-col {
    position: absolute;
    border-left: 2px solid;
    border-right: 2px solid;
    border-top: 2px solid;
    border-bottom: 2px solid;
    border-radius: 0;
    box-sizing: border-box;
    overflow: visible;
}

/* Fuzzy start/end: dashed border */
.tl-road-fuzzy-start {
    border-top-style: dashed;
}
.tl-road-fuzzy-end {
    border-bottom-style: dashed;
}

/* Branch header at top of road */
.tl-road-header {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    text-align: left;
    z-index: 2;
}

.tl-road-branch-year {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: 0.85;
    margin-bottom: 2px;
}

.tl-road-branch-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Branch footer (end year) at bottom of road */
.tl-road-footer {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    opacity: 0.85;
    z-index: 2;
}

/* Road item — compact card: year on top, image below */
.tl-road-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 4px 3px;
    border-radius: 5px;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
    background: #f4ede0;
    color: #1a1a1a;
    border: 1px solid #c39858;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.tl-road-item:hover {
    background: #fff7e6;
    transform: translateY(-1px);
}

.tl-road-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.tl-road-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
    font-size: 1.4rem;
    opacity: 0.4;
    flex-shrink: 0;
}

.tl-road-item-year {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #5a3a14;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: left;
}

/* Event year badge */
.tl-event-year {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #5a3a14;
    margin-right: 0.4rem;
    padding-right: 0.4rem;
    border-right: 1px solid rgba(0,0,0,0.2);
}

/* Event row — container holding chips/cards for one year, flex-wrap so they sit side by side */
.tl-event-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    z-index: 10;
}

/* Event chip — spans all visible lanes, always visible regardless of
   lane viewport offset. Sits on top of roads; road items at the same
   year are pushed down by reflow. */
.tl-event-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #f4ede0;
    color: #1a1a1a;
    border: 1px solid #c39858;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    line-height: 1.3;
    z-index: 5;
    transition: background 0.15s, transform 0.15s;
}

.tl-event-chip:hover {
    background: #fff7e6;
    transform: translateY(-1px);
}

.tl-event-chip-top {
    display: flex;
    align-items: baseline;
    width: 100%;
    gap: 0.5rem;
}

.tl-event-chip-year {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #5a3a14;
    letter-spacing: 0.04em;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 0;
}

.tl-event-chip-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #5a3a14;
    word-break: break-word;
    overflow-wrap: break-word;
}
.tl-event-chip-name.md-content {
    font-size: 1rem;
}

.tl-event-chip-desc {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 3px;
    word-break: break-word;
    overflow-wrap: break-word;
}
.tl-event-chip-desc.md-content {
    font-size: 1rem;
}

/* Standalone compass card — matches road item width (ROAD_WIDTH - 8px) */
.tl-standalone-compass {
    flex-shrink: 0;
}

/* Slide-in panel + backdrop */
.tl-event-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 9998;
    transition: background 0.3s;
    pointer-events: none;
}
.tl-event-backdrop.open {
    background: rgba(0,0,0,0.5);
    pointer-events: auto;
}

.tl-event-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, 92vw);
    background: #f4ede0;
    color: #1a1a1a;
    z-index: 9999;
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.tl-event-panel.open {
    transform: translateX(0);
}

.tl-event-panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0,0,0,0.06);
    color: #1a1a1a;
    font-size: 1.6rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}
.tl-event-panel-close:hover {
    background: rgba(0,0,0,0.12);
}

.tl-event-panel-inner {
    padding: 2.5rem 1.5rem 2rem;
}

.tl-event-panel-year {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: #c39858;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.tl-event-panel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: #1a1a1a;
}

.tl-event-panel-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.04);
}

.tl-event-panel-badges,
.tl-event-panel-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

.tl-event-panel-meta {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.tl-event-panel-meta p {
    margin: 0.5rem 0;
}

.tl-event-panel-meta strong {
    color: #1a1a1a;
}

.tl-event-panel-detail-btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.6rem 1.2rem;
    background: #c39858;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.tl-event-panel-detail-btn:hover {
    background: #b08545;
}

/* Mobile */
@media (max-width: 600px) {
    .tl-event-chip-name {
        font-size: 0.82rem;
    }
    .tl-event-panel-title {
        font-size: 1.3rem;
    }
}

/* Year markers for auto-generated timeline */
.tl-year-marker {
    padding: 1rem 0 0.2rem;
}

.tl-year-marker-label {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== Horizontal Timeline (Managed) ===== */
.htl-wrapper {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
}

.htl-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-align: center;
    margin: 2rem 0 0.5rem;
}

.htl-description {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.htl-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding: 1rem 0 2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-bg);
    position: relative;
}

.htl-canvas {
    position: relative;
    min-height: 160px;
    box-sizing: content-box;
}

.htl-axis {
    position: relative;
    height: 30px;
    box-sizing: content-box;
}

.htl-axis-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-border);
}

.htl-year-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.htl-year-marker::before {
    content: '';
    display: block;
    width: 1px;
    height: 12px;
    background: var(--color-border);
    margin: 0 auto 4px;
}

.htl-year-marker span {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 600;
}

/* Minor year markers (between decades) */
.htl-year-minor::before {
    height: 6px;
}

.htl-year-minor span {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.6;
}

/* Rich tooltip for branch nodes — appended to body */
.htl-tooltip {
    position: fixed;
    transform: translate(-50%, -100%) translateY(-8px);
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 0.5rem;
    z-index: 9999;
    width: 180px;
    pointer-events: none;
    color: #2c3e50;
    animation: htlTipIn 0.15s ease;
}

@keyframes htlTipIn {
    from { opacity: 0; transform: translate(-50%, -100%) translateY(-2px); }
    to { opacity: 1; transform: translate(-50%, -100%) translateY(-8px); }
}

.htl-tooltip-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
}

.htl-tooltip-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.75rem;
    color: #2c3e50;
}

.htl-tooltip-text strong {
    font-size: 0.8rem;
    line-height: 1.2;
    color: #1a1a1a;
}

.htl-tooltip-year {
    color: var(--color-accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}

.htl-tooltip-text span {
    color: #555;
}

/* Branch lane */
.htl-branch {
    position: relative;
    min-height: 90px;
    margin-bottom: 0.5rem;
    box-sizing: content-box;
}

/* Branch track box */
.htl-track {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border: 2px solid;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}

.htl-track.htl-fuzzy-start {
    border-left-style: dashed;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.htl-track.htl-fuzzy-end {
    border-right-style: dashed;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.htl-fuzzy-marker {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.85;
    z-index: 4;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(0,0,0,0.6);
}

.htl-fuzzy-marker-start {
    left: -2px;
    transform: translate(-100%, -50%);
    padding-right: 2px;
}

.htl-fuzzy-marker-end {
    right: -2px;
    transform: translate(100%, -50%);
    padding-left: 2px;
}

.htl-track-label {
    position: absolute;
    top: 2px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    opacity: 0.7;
    white-space: nowrap;
    z-index: 3;
}

.htl-line {
    position: absolute;
    top: 50%;
    height: 3px;
    transform: translateY(-50%);
    border-radius: 2px;
    opacity: 0.35;
    z-index: 1;
}

.htl-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}

.htl-node:hover {
    transform: translate(-50%, -50%) scale(1.08);
    z-index: 10;
}

.htl-node.active {
    z-index: 20;
    transform: translate(-50%, -50%) scale(1.1);
}

.htl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--color-bg);
    flex-shrink: 0;
}

.htl-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.htl-node:hover .htl-thumb {
    box-shadow: var(--shadow-hover);
}

.htl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.htl-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.8rem;
    opacity: 0.3;
}

.htl-node-year {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

/* Standalone events lane */
.htl-events-lane {
    position: relative;
    min-height: 150px;
    margin-bottom: 0.75rem;
    box-sizing: content-box;
}

.htl-event-node {
    top: 50%;
}

.htl-event-node:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.htl-event-badge {
    background: #e67e22;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    cursor: default;
    text-align: center;
}

.htl-event-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #e67e22;
}

.htl-event-tooltip-content {
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 250px;
}

.htl-event-connector {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 1px;
    height: 40px;
    background: #95a5a6;
    opacity: 0.5;
    transform: translateX(-50%);
}

.htl-event-label {
    font-size: 0.65rem;
    color: var(--color-text-light);
    text-align: center;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expanded detail card */
.htl-expanded {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    border-top: 3px solid;
    padding: 0.75rem;
    color: #2c3e50;
    z-index: 30;
    animation: htlExpand 0.2s ease;
}

@keyframes htlExpand {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.htl-expanded-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.htl-expanded-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.htl-expanded-text {
    font-size: 0.85rem;
}

.htl-expanded-text strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.htl-expanded-year {
    color: var(--color-accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
}

.htl-expanded-label {
    color: var(--color-text-light);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.htl-expanded-meta {
    color: var(--color-text-light);
    font-size: 0.78rem;
}

/* Branch entry nodes — smaller to fit inside track */
.htl-branch-node .htl-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,0.9);
}

.htl-branch-node {
    top: 55%;
}

.htl-branch-node:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.htl-branch-node.active {
    transform: translate(-50%, -50%) scale(1.1);
}

.htl-branch-node .htl-node-year {
    font-size: 0.6rem;
}

.htl-branch-node .htl-dot {
    display: none;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--color-primary);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: 0.85rem;
}

/* ===== Articles ===== */
.articles-view h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 2rem 0 1.5rem;
}

.articles-category-heading {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-text);
}

.articles-category-heading:first-child {
    margin-top: 0;
}

.articles-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.articles-list li {
    padding: 0.4rem 0;
}

.articles-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 1.05rem;
    transition: color 0.2s;
}

.articles-list a:hover {
    color: #f5b7b1;
    text-decoration: underline;
}

.article-card {
    background: var(--color-card);
    color: #2c3e50;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.article-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.article-date {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.article-section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gold);
    margin-top: 1.5rem;
    margin-bottom: 0.15rem;
}

.article-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0.25rem 0 0.5rem;
}

.article-meta {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.article-timeline-embed {
    width: 100%;
    margin: 1rem 0 2rem;
}

.article-timeline-embed .htl-wrapper {
    margin-bottom: 0;
    border-bottom: none;
}

.compass-inline-link {
    color: #f5b7b1;
    text-decoration: none !important;
    font-weight: 500;
    border-bottom: 1px dashed #f5b7b1;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.compass-inline-link:hover {
    color: #fadbd8;
    border-bottom-color: #fadbd8;
}

.compass-tooltip-open-btn {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

/* Compass link popover (mobile) */
.compass-link-popover {
    max-width: 180px;
    min-width: 180px;
}
.compass-link-popover .htl-tooltip-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.compass-link-popover .htl-tooltip-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.78rem;
    color: #2c3e50;
    margin-bottom: 0.4rem;
}
.compass-link-popover .htl-tooltip-text strong {
    font-size: 0.85rem;
    line-height: 1.2;
    color: #1a1a1a;
}
.compass-link-popover .htl-tooltip-year {
    color: var(--color-accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}
.compass-link-popover .htl-tooltip-text span {
    color: #555;
}

.article-inline-link {
    color: var(--color-gold);
    text-decoration: none !important;
    font-weight: 500;
    border-bottom: 1px dashed var(--color-gold);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.article-inline-link:hover {
    color: #e0b84e;
    border-bottom-color: #e0b84e;
}

.article-content {
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.article-content h2, .article-content h3 {
    font-family: var(--font-display);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.btn-back {
    background: none;
    border: none;
    color: #f5b7b1;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0;
    font-family: var(--font-body);
    font-weight: 500;
}

.btn-back:hover { text-decoration: underline; }

.article-compass-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.article-compass-card {
    flex-shrink: 0;
    width: 140px;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}

.article-compass-card:hover { transform: translateY(-2px); }

.article-compass-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.article-compass-card .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    font-size: 2rem;
    opacity: 0.3;
    background: rgba(255,255,255,0.08);
}

.article-compass-info {
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-number { font-size: 1.5rem; }

    .compass-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .card-body { padding: 0.75rem; }
    .card-title { font-size: 0.9rem; }
    .card-manufacturer { font-size: 0.75rem; margin-bottom: 0.35rem; }
    .card-meta .badge { font-size: 0.75rem; padding: 0.15rem 0.45rem; }


    .filter-controls select,
    .filter-controls input[type="number"] { min-width: 100px; font-size: 0.8rem; }

    .detail-grid { grid-template-columns: 1fr; }


    .timeline-view h2 { font-size: 2rem; }
    .timeline-decade-label { font-size: 2.5rem; }
    .timeline-thumb, .timeline-thumb-placeholder { width: 48px; height: 48px; min-width: 48px; max-width: 48px; max-height: 48px; }

    .header-content { flex-wrap: wrap; }
    .site-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .compass-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .filter-controls { flex-direction: column; }
    .filter-controls select,
    .filter-controls input[type="number"] { width: 100%; }
    .multi-filter { width: 100%; }
    .multi-filter-toggle { width: 100%; box-sizing: border-box; }
    .multi-filter-dropdown { width: 100%; min-width: 0; }
    .year-range { width: 100%; }
    .year-range input { flex: 1; }
    .declination-range { width: 100%; }
    .declination-range input { flex: 1; }
    .admin-filter-only { width: 100%; }
    .admin-filter-only select { width: 100%; box-sizing: border-box; }
    .btn-reset-filters { width: 100%; box-sizing: border-box; }
    .filter-toolbar { flex-wrap: wrap; }
    .filter-toolbar .search-box { flex-basis: 100%; }
    .btn-toggle-filters { flex: 1; justify-content: center; }
    .filter-toolbar .btn-reset-filters { flex: 1; width: auto; }
    .filter-toolbar select { flex: 1; }
}

/* ===== Welcome Page ===== */
.welcome-view {
    padding: 0;
}

.welcome-hero {
    text-align: center;
    padding: 4rem 1rem 2rem;
    color: white;
}

.welcome-icon {
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.welcome-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.welcome-heading {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.welcome-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2.5rem 0;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.welcome-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.welcome-stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}

.welcome-stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-bottom: 3rem;
    flex-wrap: wrap;
}

.welcome-btn {
    padding: 0.85rem 2rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.welcome-btn-primary {
    background: var(--color-gold);
    color: #1a252f;
    border-color: var(--color-gold);
}

.welcome-btn-primary:hover {
    background: #e0b84e;
    border-color: #e0b84e;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(212,169,72,0.4);
}

.welcome-btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.welcome-btn-secondary:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.welcome-featured {
    padding-bottom: 3rem;
}

.welcome-featured-heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.welcome-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.welcome-stories {
    padding: 2rem 0 3rem;
}

.welcome-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.welcome-story-card {
    background: var(--color-card);
    color: #2c3e50;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.welcome-story-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.welcome-story-section {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.35rem;
}

.welcome-story-card h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.welcome-story-card p {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.welcome-story-link {
    font-size: 0.85rem;
    color: var(--color-gold);
    font-weight: 600;
}

@media (max-width: 600px) {
    .welcome-heading {
        font-size: 1.75rem;
    }
    .welcome-subtitle {
        font-size: 1rem;
    }
    .welcome-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .welcome-stat-number {
        font-size: 1.5rem;
    }
    .welcome-actions {
        flex-direction: column;
        align-items: stretch;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .welcome-btn {
        text-align: center;
    }
    .welcome-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Share Buttons ===== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.65);
    font-size: 0.78rem;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1;
}

.share-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.share-btn svg {
    flex-shrink: 0;
}

.share-copy.share-copied {
    background: rgba(39, 174, 96, 0.2);
    border-color: rgba(39, 174, 96, 0.4);
    color: #27ae60;
}

.share-whatsapp:hover { color: #25D366; border-color: rgba(37, 211, 102, 0.4); }
.share-facebook:hover { color: #1877F2; border-color: rgba(24, 119, 242, 0.4); }
.share-x:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.share-email:hover { color: #f39c12; border-color: rgba(243, 156, 18, 0.4); }

/* On touch devices, show share buttons with full visibility since there's no hover */
@media (hover: none) {
    .share-btn {
        color: rgba(255,255,255,0.85);
        border-color: rgba(255,255,255,0.25);
        background: rgba(255,255,255,0.1);
    }
    .modal .share-btn {
        color: #555;
        border-color: #ccc;
        background: #f0f0f0;
    }
}

/* Share buttons inside white modal (compass detail) */
.modal .share-buttons {
    border-top-color: #e0e0e0;
}

.modal .share-btn {
    border-color: #ddd;
    background: #f5f5f5;
    color: #888;
}

.modal .share-btn:hover {
    background: #e8e8e8;
    color: #333;
    border-color: #ccc;
}

.modal .share-copy.share-copied {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.modal .share-whatsapp:hover { color: #25D366; border-color: rgba(37, 211, 102, 0.3); }
.modal .share-facebook:hover { color: #1877F2; border-color: rgba(24, 119, 242, 0.3); }
.modal .share-x:hover { color: #333; border-color: #aaa; }
.modal .share-email:hover { color: #e67e22; border-color: rgba(230, 126, 34, 0.3); }

/* ===== Mobile Timeline ===== */
.htl-mobile {
    padding: 0.5rem 0;
}

.htl-m-section {
    margin-bottom: 1.25rem;
}

.htl-m-branch-header {
    border-left: 3px solid;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.htl-m-branch-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
}

.htl-m-branch-years {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 600;
}

.htl-m-entry {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.04);
    margin-bottom: 0.35rem;
    transition: background 0.2s;
}

.htl-m-entry[style*="cursor: pointer"]:active {
    background: rgba(255,255,255,0.1);
}

.htl-m-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}

.htl-m-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.htl-m-year {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}

.htl-m-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--color-text);
}

.htl-m-meta {
    font-size: 0.78rem;
    color: var(--color-text-light);
}

.htl-m-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: italic;
}

.htl-m-event {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.75rem;
    background: rgba(230, 126, 34, 0.1);
    border-left: 3px solid #e67e22;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 0.35rem;
}

.htl-m-event .htl-m-year {
    color: #e67e22;
}

.htl-m-desc {
    font-size: 0.8rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

.htl-m-desc p {
    margin: 0 0 0.3rem;
}

.htl-m-desc p:last-child {
    margin-bottom: 0;
}
