        /* --- CORE VARIABLES --- */
        :root {
            --primary-color: #ffffff;
            --accent-color: #ffd700;
            --success-color: #4caf50;
            --danger-color: #ff6b6b;
            --glass-bg: rgba(15, 15, 15, 0.70); 
            --glass-border: rgba(255, 255, 255, 0.12);
            --font-header: 'Cinzel', serif;
            --font-body: 'Lora', serif;
            --font-ui: 'Montserrat', sans-serif;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        input, button, select, textarea { font-family: inherit; }

        body {
            background-color: #050505;
            color: #e0e0e0;
            font-family: var(--font-ui);
            overflow: hidden;
            height: 100vh;
            width: 100vw;
            user-select: none;
        }

        #particle-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
        .background-layer {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            z-index: -2; background-color: #111;
            background-size: cover; background-position: center;
            transition: filter 0.6s ease;
            will-change: filter;
        }
        
        #app-container { 
            position: relative; width: 100%; height: 100%; z-index: 10;
            display: flex; flex-direction: column; padding: 1.5rem 2rem;
            transition: opacity 0.1s linear, padding-right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        /* --- UI UTILITIES --- */
        /* FIX 9: Reduced blur from 20px to 10px â€” halves GPU compositing work */
        .glass-box {
            background: var(--glass-bg);
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--glass-border); border-radius: 12px;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
            transition: background 0.3s, border-color 0.3s;
        }
        .glass-box:hover {
            background: rgba(20, 20, 20, 0.8);
            border-color: rgba(255, 255, 255, 0.25);
        }

        /* --- LIGHTBOX --- */
        #lightbox {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.95); z-index: 5000;
            display: none; justify-content: center; align-items: center;
            opacity: 0; transition: opacity 0.3s ease;
            pointer-events: none;
        }
        #lightbox.active {
            opacity: 1;
            pointer-events: all;
        }
        #lightbox-img {
            max-width: 95%; max-height: 95vh;
            box-shadow: 0 0 50px rgba(0,0,0,0.8);
            border: 1px solid #333;
            transform: scale(0.95); transition: transform 0.3s ease;
        }
        #lightbox.active #lightbox-img { transform: scale(1); }

        /* --- HEADER --- */
        #main-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 0.8rem 2rem; margin-bottom: 0.5rem; flex-shrink: 0; z-index: 20;
            height: 70px;
            transition: opacity 0.3s;
        }
        .logo { 
            font-family: var(--font-header); font-size: 1.6rem; letter-spacing: 4px; 
            color: var(--primary-color); text-shadow: 0 0 10px rgba(255,255,255,0.2); cursor: pointer;
        }
        .back-btn-wrapper {
            display: flex; align-items: center; gap: 8px; cursor: pointer;
            font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 2px;
            font-size: 0.75rem; color: #a0a0a0; transition: color 0.3s;
        }
        .back-btn-wrapper:hover { color: var(--accent-color); }
        .header-controls { display: flex; align-items: center; gap: 1rem; }

        /* --- STAGE --- */
        #content-stage {
            flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px;
            display: flex; flex-direction: column;
            scrollbar-width: thin; scrollbar-color: var(--accent-color) rgba(0,0,0,0.3);
        }
        #content-stage::-webkit-scrollbar { width: 6px; }
        #content-stage::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
        #content-stage::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 10px; }

        /* --- BUTTONS --- */
        .btn-large {
            padding: 0.8rem 2rem; font-family: var(--font-header); font-size: 0.9rem; letter-spacing: 2px;
            background: transparent; border: 1px solid var(--accent-color);
            color: var(--primary-color); cursor: pointer; transition: all 0.3s;
            display: flex; align-items: center; gap: 0.8rem; text-decoration: none;
            justify-content: center;
        }
        .btn-large:hover { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); }

        /* --- LOADING SPINNER --- */
        .loading-container {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            height: 100%; gap: 1rem;
        }
        .spinner {
            width: 50px; height: 50px; border: 3px solid rgba(255,215,0,0.2);
            border-top-color: var(--accent-color); border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* --- VIEW: HOME --- */
        .story-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 2.5rem;
            padding: 2rem 0;
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
            perspective: 1000px;
        }

        .story-card {
            position: relative;
            height: auto;
            aspect-ratio: 2 / 3;
            border-radius: 16px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            border: 1px solid rgba(255,255,255,0.1);
            background: #000;
        }

        .story-card img {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            object-fit: cover;
            transition: transform 0.7s ease, filter 0.5s ease;
            opacity: 0.8;
        }

        .card-info {
            position: absolute;
            bottom: 0; left: 0; width: 100%;
            padding: 2rem;
            background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 40%, transparent 100%);
            transform: translateY(20px);
            transition: transform 0.5s ease;
            z-index: 2;
        }

        .card-title {
            font-family: var(--font-header);
            font-size: 1.6rem;
            color: #fff;
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 10px rgba(0,0,0,0.8);
            transition: color 0.3s;
            line-height: 1.1;
        }

        .card-desc {
            font-size: 0.9rem;
            color: #ccc;
            line-height: 1.5;
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.4s ease 0.1s;
            max-height: 0;
        }

        .story-card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255, 215, 0, 0.2);
            border-color: var(--accent-color);
        }

        .story-card:hover img {
            transform: scale(1.15);
            filter: brightness(1.1);
            opacity: 1;
        }

        .story-card:hover .card-info { transform: translateY(0); }
        .story-card:hover .card-title { color: var(--accent-color); }
        .story-card:hover .card-desc { opacity: 1; transform: translateY(0); max-height: 100px; }

        /* --- AUTHOR SECTION --- */
        .author-section {
            max-width: 1000px;
            margin: 4rem auto 2rem auto;
            padding: 2.5rem;
            display: grid;
            grid-template-columns: 200px 1fr;
            gap: 3rem;
            align-items: start;
        }

        .author-img-wrapper {
            width: 180px; height: 180px;
            border-radius: 50%;
            border: 3px solid var(--accent-color);
            padding: 5px;
            box-shadow: 0 0 25px rgba(255, 215, 0, 0.15);
            margin: 0 auto;
        }
        .author-img {
            width: 100%; height: 100%;
            border-radius: 50%;
            object-fit: cover;
            background-color: #111;
        }

        .author-info h2 {
            font-family: var(--font-header);
            color: var(--accent-color);
            margin-bottom: 1rem;
            font-size: 2rem;
            line-height: 1;
        }
        .author-bio {
            color: #ccc;
            line-height: 1.6;
            margin-bottom: 2rem;
            font-size: 1.05rem;
        }

        .author-links {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            width: 100%;
        }

        .link-row {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1rem;
            text-decoration: none;
            transition: transform 0.2s, background 0.2s;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
        }
        .link-row:hover {
            background: rgba(255, 255, 255, 0.08);
            transform: translateX(10px);
            border-color: var(--accent-color);
        }

        .social-icon {
            width: 48px;
            height: 48px;
            object-fit: cover;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        }

        .link-details { display: flex; flex-direction: column; }
        .link-name { font-family: var(--font-header); color: #fff; font-size: 1.1rem; }
        .link-note { font-size: 0.85rem; color: var(--accent-color); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

        /* --- VIEW: STORY HUB --- */
        .story-hub-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 2rem; gap: 1.5rem; }
        .story-hub-layout {
            display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem;
            width: 100%; max-width: 850px; padding: 2rem !important; align-items: center;
        }
        .hub-cover { width: 100%; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
        .hub-details { display: flex; flex-direction: column; justify-content: center; }
        .hub-details h1 { font-family: var(--font-header); font-size: 2.2rem; margin-bottom: 0.5rem; line-height: 1.1; color: #fff; }
        .hub-meta { color: var(--accent-color); margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; font-weight: 600; opacity: 0.9; }
        .hub-synopsis { 
            font-size: 1rem; line-height: 1.6; color: #ddd; margin-bottom: 2rem;
            max-height: 200px; overflow-y: auto; padding-right: 10px;
        }
        .hub-actions { display: flex; gap: 1rem; }
        .world-hub-bar { width: 100%; max-width: 850px; padding: 1rem 2rem; text-align: center; }
        .world-hub-bar .bar-title { font-family: var(--font-header); font-size: 0.9rem; letter-spacing: 3px; text-transform: uppercase; color: #aaa; margin-bottom: 1rem; }
        .world-hub-bar .bar-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
        .world-hub-bar .btn-large { font-size: 0.8rem; padding: 0.6rem 1.5rem; border-color: rgba(255,255,255,0.2); }

        /* --- VIEW: READER --- */
        .reader-layout { display: flex; gap: 2rem; height: 100%; max-width: 1300px; margin: 0 auto; width: 100%; position: relative; }
        .reader-sidebar { width: 220px; overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.05); padding-right: 0.5rem; flex-shrink: 0; transition: width 0.3s, opacity 0.3s; }
        .chapter-list-item { padding: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; font-size: 0.85rem; transition: 0.2s; color: #888; }
        .chapter-list-item:hover { color: var(--accent-color); padding-left: 1rem; }
        .chapter-list-item.active { border-left: 3px solid var(--accent-color); color: #fff; background: rgba(255,215,0,0.05); }
        .reader-content { flex: 1; max-width: 800px; margin: 0 auto; padding: 3rem 4rem; color: #d0d0d0; overflow-y: auto; position: relative; transition: max-width 0.3s; user-select: text; }
        
        .reader-toolbar { display: flex; justify-content: flex-end; gap: 15px; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }
        .rt-btn { background: transparent; border: none; color: #666; cursor: pointer; transition: 0.2s; font-size: 1rem; }
        .rt-btn:hover, .rt-btn.active { color: var(--accent-color); }
        .font-menu { position: absolute; top: 60px; right: 20px; background: #1a1a1a; border: 1px solid #333; padding: 10px; border-radius: 6px; display: none; flex-direction: column; gap: 8px; z-index: 50; width: 120px; }
        .font-option { cursor: pointer; font-size: 0.8rem; color: #aaa; padding: 4px; border-radius: 4px; }
        .font-option:hover { background: #333; color: #fff; }
        
        body.focus-active #main-header { opacity: 0; pointer-events: none; }
        body.focus-active .reader-sidebar { width: 0; padding: 0; opacity: 0; overflow: hidden; }
        body.focus-active .reader-content { max-width: 900px; background: rgba(10, 10, 10, 0.9); }
        
        .text-sm { font-size: 1rem; } .text-md { font-size: 1.2rem; } .text-lg { font-size: 1.4rem; }
        .font-serif { font-family: var(--font-body); } .font-sans { font-family: var(--font-ui); }

        /* --- VIEW: GALLERY --- */
        .char-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; max-width: 1200px; margin: 0 auto; }
        .char-card {
            width: 220px; height: 350px; position: relative; border-radius: 10px;
            cursor: pointer; background: #000; border: 1px solid rgba(255,255,255,0.1);
            transform-style: preserve-3d; transition: transform 0.1s;
        }
        .char-card.reset-anim { transition: transform 0.5s ease; }
        .char-card-inner { width: 100%; height: 100%; position: relative; overflow: hidden; border-radius: 10px; transform: translateZ(20px); }
        .char-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
        .char-card:hover img { transform: scale(1.1); filter: brightness(0.6); }
        .char-info-overlay {
            position: absolute; bottom: 0; left: 0; width: 100%;
            background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 80%, transparent 100%);
            padding: 1.2rem; transform: translateY(60%) translateZ(30px); transition: transform 0.3s ease;
        }
        .char-card:hover .char-info-overlay { transform: translateY(0) translateZ(30px); }
        .char-name { font-family: var(--font-header); font-size: 1.1rem; color: #fff; }
        .char-role { color: var(--accent-color); font-size: 0.7rem; text-transform: uppercase; font-weight: bold; }
        .char-bio-preview { font-size: 0.75rem; line-height: 1.4; color: #ccc; opacity: 0; transition: opacity 0.3s 0.1s; margin-top: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .char-card:hover .char-bio-preview { opacity: 1; }

        .char-profile-hero { display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem; padding: 2rem; max-width: 900px; margin: 0 auto 2rem auto; align-items: start; }
        .hero-img-container { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
        .hero-img { width: 100%; height: 100%; object-fit: cover; }
        .hero-name { font-family: var(--font-header); font-size: 2.5rem; line-height: 1; color: #fff; margin-bottom: 0.5rem; }
        .hero-role { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 2px; color: var(--accent-color); font-size: 0.8rem; margin-bottom: 1.5rem; opacity: 0.9; }
        .hero-bio { font-family: var(--font-body); font-size: 1rem; line-height: 1.6; color: #d0d0d0; white-space: pre-line; background: rgba(0,0,0,0.2); padding: 1.2rem; border-radius: 6px; max-height: 300px; overflow-y: auto; }
        
        .sub-gallery-grid { column-count: 3; column-gap: 1rem; max-width: 900px; margin: 0 auto; }
        .flex-masonry { display: flex; gap: 1rem; max-width: 900px; margin: 0 auto; align-items: flex-start; }
        .flex-masonry-col { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
        .gallery-item { break-inside: avoid; margin-bottom: 1rem; border-radius: 6px; overflow: hidden; transition: transform 0.3s; cursor: zoom-in; border: 1px solid rgba(255,255,255,0.1); }
        .flex-masonry .gallery-item { margin-bottom: 0; } /* gap handles spacing */
        .gallery-item:hover { transform: scale(1.02); border-color: var(--accent-color); }
        .gallery-item img { display: block; width: 100%; }
        .gallery-archive-header { display:flex; justify-content:space-between; align-items:flex-end; gap:2rem; padding:clamp(1.4rem,4vw,3rem); margin:0 auto 2rem; max-width:1180px; background:linear-gradient(135deg,rgba(0,0,0,.82),rgba(20,20,28,.6)); overflow:hidden; position:relative; }
        .gallery-archive-header::after { content:""; position:absolute; inset:auto -8% -80% 45%; height:220px; background:radial-gradient(circle,var(--accent-color),transparent 68%); opacity:.12; pointer-events:none; }
        .gallery-eyebrow,.gallery-section-heading span,.gallery-art-count { color:var(--accent-color); font:700 .7rem var(--font-ui); letter-spacing:.18em; text-transform:uppercase; }
        .gallery-archive-header h1 { margin:.35rem 0; color:#fff; font:clamp(2rem,5vw,4.5rem)/.98 var(--font-header); }
        .gallery-archive-header p { color:#bbb; max-width:680px; line-height:1.6; }
        .gallery-r18-toggle { flex-shrink:0; border-radius:999px; min-height:0; padding:.65rem 1rem; }
        .gallery-section-heading { display:flex; justify-content:space-between; align-items:end; gap:1rem; max-width:1100px; margin:2.2rem auto 1rem; border-bottom:1px solid rgba(255,255,255,.1); padding-bottom:.8rem; }
        .gallery-section-heading h2 { color:#fff; font:1.8rem var(--font-header); margin:.2rem 0 0; }
        .gallery-section-heading p { color:#888; font-size:.85rem; }
        .gallery-roster { margin-bottom:3rem; }
        .char-card { padding:0; color:inherit; text-align:left; }
        .char-card:focus-visible,.gallery-image-button:focus-visible,.card-deck:focus-visible { outline:2px solid var(--accent-color); outline-offset:4px; }
        .gallery-character-masthead { grid-template-columns:160px 1fr; max-width:1000px; padding:1.3rem; gap:1.5rem; align-items:center; }
        .gallery-character-masthead .hero-bio { max-height:140px; }
        .gallery-controls { position:sticky; top:8px; z-index:80; display:flex; align-items:center; gap:.8rem; max-width:1000px; margin:0 auto 1rem; padding:.75rem; background:rgba(8,8,12,.88); backdrop-filter:blur(16px); }
        .gallery-search { flex:1; min-width:180px; display:flex; align-items:center; gap:.6rem; padding:.65rem .8rem; border:1px solid rgba(255,255,255,.12); border-radius:6px; color:var(--accent-color); }
        .gallery-search input,.gallery-sort select { width:100%; border:0; outline:0; background:transparent; color:#fff; font:inherit; }
        .gallery-sort { display:flex; align-items:center; gap:.5rem; color:#888; font-size:.75rem; text-transform:uppercase; }
        .gallery-sort select { border:1px solid rgba(255,255,255,.12); padding:.6rem; border-radius:6px; background:#111; }
        .gallery-result-count { color:#888; white-space:nowrap; font-size:.8rem; }
        .gallery-tag-row { display:flex; gap:.5rem; flex-wrap:wrap; justify-content:center; max-width:1000px; margin:0 auto 1.5rem; }
        .gallery-tag { border:1px solid rgba(255,255,255,.14); background:rgba(0,0,0,.35); color:#bbb; padding:.45rem .8rem; border-radius:999px; cursor:pointer; }
        .gallery-tag:hover,.gallery-tag.active { background:var(--accent-color); border-color:var(--accent-color); color:#000; }
        .gallery-art-card { background:#090909; box-shadow:0 10px 30px rgba(0,0,0,.28); }
        .gallery-image-button { display:block; width:100%; padding:0; border:0; background:#000; cursor:zoom-in; }
        .gallery-card-topline { position:absolute; top:10px; left:10px; right:10px; z-index:5; display:flex; justify-content:space-between; gap:.5rem; pointer-events:none; }
        .gallery-card-topline > span { background:rgba(0,0,0,.72); color:#fff; padding:.3rem .55rem; border-radius:4px; font-size:.72rem; backdrop-filter:blur(8px); }
        .gallery-mature-badge { color:#ff7272 !important; border:1px solid rgba(255,80,80,.45); }
        .gallery-card-caption { position:absolute; left:0; right:0; bottom:0; padding:3.5rem 1rem 1rem; color:#fff; font-size:.85rem; background:linear-gradient(transparent,rgba(0,0,0,.9)); opacity:0; transform:translateY(8px); transition:.25s; pointer-events:none; }
        .gallery-art-card:hover .gallery-card-caption,.gallery-art-card:focus-within .gallery-card-caption { opacity:1; transform:none; }
        .gallery-comment-button { position:absolute; right:15px; bottom:15px; z-index:10; width:35px; height:35px; border-radius:50%; border:1px solid color-mix(in srgb,var(--accent-color) 35%,transparent); background:rgba(0,0,0,.65); color:var(--accent-color); cursor:pointer; }
        .gallery-comment-button:hover { background:var(--accent-color); color:#000; }
        .gallery-load-more { text-align:center; margin-top:1.5rem; }
        .gallery-empty-state { max-width:700px; margin:2rem auto; padding:3rem; text-align:center; color:#999; }
        .gallery-empty-state i { color:var(--accent-color); font-size:2rem; }
        .archive-landing { width:min(1480px,100%); margin:0 auto; padding:0 0 4rem; }
        .archive-titlebar { position:relative; display:flex; justify-content:space-between; align-items:center; padding:.65rem 1rem; margin-bottom:.65rem; border:1px solid rgba(255,255,255,.1); border-radius:8px; background:rgba(5,8,10,.55); backdrop-filter:blur(12px); }
        .archive-titlebar h1 { margin:.1rem 0 0; color:#f4eee2; font:1.6rem/1 var(--font-header); letter-spacing:.12em; text-transform:uppercase; }
        .archive-titlebar .gallery-r18-toggle { position:static; transform:none; }
        .archive-feature { display:grid; grid-template-columns:minmax(280px,1.1fr) minmax(280px,.9fr) minmax(360px,1.25fr); min-height:500px; border:1px solid color-mix(in srgb,var(--accent-color) 28%,rgba(255,255,255,.08)); border-radius:10px; overflow:hidden; background:rgba(4,7,9,.78); box-shadow:0 24px 60px rgba(0,0,0,.38); }
        .archive-feature-portrait { position:relative; min-height:0; overflow:hidden; background:#050607; }
        .archive-feature-portrait::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,transparent 65%,rgba(4,7,9,.95)),linear-gradient(0deg,rgba(0,0,0,.55),transparent 45%); pointer-events:none; }
        .archive-feature-portrait img { width:100%; height:100%; object-fit:cover; object-position:center top; }
        .archive-feature-copy { position:relative; display:flex; flex-direction:column; justify-content:center; padding:1.35rem 2rem; border-right:1px solid rgba(255,255,255,.08); }
        .archive-feature-copy::after { content:""; position:absolute; right:8%; top:12%; width:130px; aspect-ratio:1; border:1px solid color-mix(in srgb,var(--accent-color) 18%,transparent); border-radius:50%; opacity:.55; }
        .archive-feature-copy h2 { position:relative; z-index:1; margin:.35rem 0 .1rem; color:#fff; font:clamp(2rem,4vw,3.3rem)/.95 var(--font-header); text-transform:uppercase; }
        .archive-feature-role { color:#8fc5ff; font-size:.78rem; letter-spacing:.32em; text-transform:uppercase; }
        .archive-feature-copy p { position:relative; z-index:1; color:#c7c4bd; line-height:1.55; margin:.8rem 0; display:-webkit-box; -webkit-line-clamp:3; line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
        .archive-feature-facts { display:flex; flex-wrap:wrap; gap:1rem; padding:.65rem 0; border-top:1px solid rgba(255,255,255,.08); color:#aaa; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; }
        .archive-feature-facts i { color:var(--accent-color); margin-right:.4rem; }
        .archive-feature-facts b { color:#fff; }
        .archive-open-button { width:min(235px,100%); display:flex; justify-content:space-between; align-items:center; margin-top:.4rem; padding:.75rem 1rem; border:1px solid var(--accent-color); background:linear-gradient(90deg,color-mix(in srgb,var(--accent-color) 14%,transparent),rgba(0,0,0,.35)); color:#fff; text-transform:uppercase; letter-spacing:.16em; cursor:pointer; }
        .archive-open-button:hover { background:var(--accent-color); color:#000; }
        .archive-stats { display:grid; grid-template-columns:repeat(3,1fr); padding:1rem; border:1px solid rgba(255,255,255,.14); border-radius:10px; background:rgba(3,5,6,.68); backdrop-filter:blur(12px); }
        .archive-stats span { display:flex; flex-direction:column; text-align:center; color:#aaa; font-size:.65rem; letter-spacing:.12em; text-transform:uppercase; border-right:1px solid rgba(255,255,255,.1); }
        .archive-stats span:last-child { border-right:0; }
        .archive-stats b { color:#fff; font:1.7rem var(--font-header); }
        .archive-browser-panel { min-width:0; display:flex; flex-direction:column; gap:.7rem; padding:1rem; border-left:1px solid rgba(255,255,255,.08); background:rgba(3,6,8,.55); }
        .archive-browser-heading { display:flex; align-items:end; justify-content:space-between; padding:.2rem .15rem; }
        .archive-browser-heading span { color:var(--accent-color); font-size:.65rem; letter-spacing:.16em; text-transform:uppercase; }
        .archive-browser-heading strong { color:#fff; font:1.2rem var(--font-header); }
        .archive-deck-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-content:start; gap:.7rem; overflow:visible; padding:.25rem .35rem .8rem .1rem; }
        .archive-collection-deck { display:flex; flex-direction:column; gap:.55rem; min-width:0; padding:.45rem; border:1px solid transparent; border-radius:12px; background:rgba(0,0,0,.16); color:#fff; text-align:left; cursor:pointer; transition:border-color .25s,box-shadow .25s,transform .25s; }
        .archive-deck-stack { position:relative; display:block; aspect-ratio:3/4; }
        .archive-profile-card { position:absolute; inset:0; display:block; overflow:hidden; border:1px solid rgba(255,255,255,.14); border-radius:9px; background:#080808; box-shadow:0 10px 24px rgba(0,0,0,.48); transition:transform .3s,filter .3s; }
        .archive-profile-card img { width:100%; height:100%; object-fit:cover; object-position:center top; }
        .archive-collection-deck:hover { transform:translateY(-3px); border-color:color-mix(in srgb,var(--accent-color) 45%,transparent); }
        .archive-collection-deck.is-active { border-color:var(--accent-color); box-shadow:0 0 0 1px color-mix(in srgb,var(--accent-color) 55%,transparent),0 0 24px color-mix(in srgb,var(--accent-color) 32%,transparent); }
        .archive-collection-deck.is-active .archive-profile-card { filter:brightness(1.08); }
        .archive-deck-placeholder { display:grid; place-items:center; height:100%; border:1px solid rgba(255,255,255,.12); border-radius:10px; background:rgba(0,0,0,.65); color:var(--accent-color); font-size:2rem; }
        .archive-deck-copy { display:grid; grid-template-columns:1fr auto; gap:.18rem .5rem; padding:.4rem .2rem; }
        .archive-deck-copy strong { font:1rem var(--font-header); letter-spacing:.08em; text-transform:uppercase; }
        .archive-deck-copy small { grid-column:1; color:#999; font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .archive-deck-copy em { grid-column:2; grid-row:1/3; align-self:center; color:var(--accent-color); font-style:normal; font-size:.68rem; text-transform:uppercase; }
        .archive-collection-deck:hover .archive-deck-copy strong,.archive-collection-deck:focus-visible .archive-deck-copy strong { color:var(--accent-color); }
        .archive-feature-portrait > #archive-feature-image { filter:none; }

        /* --- VIEW: LORE --- */
        .lore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; max-width: 1200px; width: 100%; margin: 1rem auto; }
        .lore-card { 
            display: flex; flex-direction: column; height: 350px; overflow: hidden; 
            cursor: pointer; position: relative; transition: transform 0.3s; 
        }
        .lore-card:hover { transform: translateY(-8px); border-color: var(--accent-color); }
        .lore-card-img { width: 100%; height: 60%; object-fit: cover; transition: transform 0.5s; }
        .lore-card:hover .lore-card-img { transform: scale(1.1); }
        .lore-card-content { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; border-top: 1px solid rgba(255,255,255,0.05); }
        .lore-card-content .title { font-family: var(--font-header); font-size: 1.2rem; color: #fff; margin-bottom: 0.2rem; }
        .lore-card-content .type { font-size: 0.7rem; text-transform: uppercase; color: var(--accent-color); margin-bottom: 0.5rem; letter-spacing: 1px; }
        .lore-card-content .desc { font-size: 0.85rem; color: #bbb; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

        .lore-wiki-layout { max-width: 900px; margin: 0 auto; padding-bottom: 3rem; }
        .lore-wiki-header { position: relative; width: 100%; height: 300px; border-radius: 12px; overflow: hidden; margin-bottom: 2rem; border: 1px solid rgba(255,255,255,0.1); }
        .lore-wiki-header img { width: 100%; height: 100%; object-fit: cover; }
        .lore-wiki-body { padding: 3rem; }
        .lore-wiki-title { font-family: var(--font-header); font-size: 2.5rem; color: var(--accent-color); margin-bottom: 0.5rem; }
        .lore-wiki-type { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 2px; color: #888; margin-bottom: 2rem; font-size: 0.9rem; }
        .lore-wiki-text { font-family: var(--font-body); font-size: 1.1rem; line-height: 1.8; color: #d0d0d0; white-space: pre-line; user-select: text; }

        /* --- VIEW: TIMELINES --- */
        .timeline-hub-screen,
        .story-history-screen,
        .galactic-history-screen { width: min(1180px, 100%); margin: 0 auto; padding: 1rem 0 3rem; }
        .galactic-history-screen {
            position: relative;
            padding: 1rem;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            background:
                linear-gradient(180deg, rgba(3, 8, 9, 0.88), rgba(6, 7, 11, 0.94)),
                repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 74px);
            box-shadow: 0 24px 70px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
        }
        .timeline-hub-header { text-align: center; margin: 1rem auto 2rem; max-width: 760px; }
        .timeline-hub-kicker { font-family: var(--font-ui); color: var(--accent-color); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.16em; font-weight: 700; margin-bottom: 0.65rem; }
        .timeline-hub-title,
        .story-history-title,
        .galactic-history-title { font-family: var(--font-header); color: #fff; line-height: 1.05; }
        .timeline-hub-title { font-size: clamp(2rem, 5vw, 4rem); }
        .timeline-hub-subtitle,
        .galactic-history-subtitle { color: #cfcfcf; line-height: 1.7; margin-top: 0.75rem; }
        .timeline-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
        .timeline-mode-card {
            position: relative; min-height: 320px; padding: 1.4rem; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.75rem;
            background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(5,7,12,0.88)), radial-gradient(circle at 20% 0%, rgba(255,255,255,0.16), transparent 34%);
            border: 1px solid rgba(255,255,255,0.13); border-radius: 8px; color: #fff; cursor: pointer; overflow: hidden; transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
        }
        .timeline-mode-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,0.12), transparent 42%); opacity: 0.75; pointer-events: none; }
        .timeline-mode-card.story { background-color: rgba(16, 32, 38, 0.88); }
        .timeline-mode-card.galactic { background-color: rgba(35, 24, 20, 0.88); }
        .timeline-mode-card:hover { transform: translateY(-6px); border-color: var(--accent-color); box-shadow: 0 18px 45px rgba(0,0,0,0.32), 0 0 26px rgba(255,255,255,0.08); }
        .timeline-mode-icon { position: absolute; top: 1.2rem; right: 1.2rem; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.35); color: var(--accent-color); font-size: 1.35rem; border: 1px solid rgba(255,255,255,0.12); }
        .timeline-mode-eyebrow,
        .timeline-mode-meta { position: relative; font-family: var(--font-ui); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-color); font-weight: 700; }
        .timeline-mode-title { position: relative; font-family: var(--font-header); font-size: 2rem; line-height: 1.05; }
        .timeline-mode-desc { position: relative; color: #d6d6d6; line-height: 1.55; max-width: 520px; }
        .timeline-mode-meta { color: #fff; opacity: 0.78; }

        .timeline-explorer-topbar { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
        .timeline-explorer-title { color: #fff; font-family: var(--font-header); font-size: 1.2rem; }
        .story-history-hero,
        .galactic-history-hero {
            display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-bottom: 1rem; padding: 1.4rem;
            border-radius: 8px; border: 1px solid rgba(255,255,255,0.11); background: rgba(0,0,0,0.36);
        }
        .galactic-history-hero {
            min-height: 180px;
            align-items: flex-end;
            background:
                linear-gradient(120deg, rgba(255,255,255,0.08), transparent 52%),
                radial-gradient(circle at 88% 20%, rgba(123, 211, 255, 0.16), transparent 34%),
                linear-gradient(180deg, rgba(21, 32, 29, 0.82), rgba(5, 7, 10, 0.96));
            border-color: rgba(174, 231, 210, 0.18);
            box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06);
        }
        .story-history-title,
        .galactic-history-title { font-size: clamp(1.8rem, 4vw, 3.2rem); }
        .story-history-stats,
        .galactic-history-metrics { display: grid; grid-template-columns: repeat(3, minmax(90px, 1fr)); gap: 0.6rem; min-width: min(420px, 100%); }
        .galactic-history-metrics { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
        .story-history-stats div,
        .galactic-history-metrics div { padding: 0.85rem; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
        .story-history-stats strong,
        .galactic-history-metrics strong { display: block; color: #fff; font-family: var(--font-header); font-size: 1.25rem; line-height: 1.1; overflow-wrap: anywhere; }
        .story-history-stats span,
        .galactic-history-metrics span { display: block; color: #aaa; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.35rem; }
        .timeline-search-wrapper { position: relative; margin: 0 0 1rem; }
        .timeline-search { width: 100%; height: 48px; padding: 0 1rem 0 2.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.13); background: rgba(0,0,0,0.42); color: #fff; outline: none; font-family: var(--font-ui); }
        .galactic-history-screen .timeline-search { background: rgba(1, 7, 9, 0.82); border-color: rgba(174, 231, 210, 0.18); }
        .timeline-search:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
        .timeline-search-icon { position: absolute; top: 50%; left: 1rem; transform: translateY(-50%); color: var(--accent-color); opacity: 0.8; }
        .story-history-list { position: relative; display: grid; gap: 0.75rem; }
        .story-history-list::before { content: ""; position: absolute; left: 24px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(to bottom, transparent, var(--accent-color), transparent); opacity: 0.35; }
        .story-event-card { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 1rem; padding: 1rem; border-radius: 8px; transition: border-color 0.2s ease, transform 0.2s ease; }
        .story-event-card:hover { border-color: rgba(255,255,255,0.22); transform: translateX(4px); }
        .story-event-index { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #050505; border: 1px solid var(--accent-color); color: var(--accent-color); font-family: var(--font-header); box-shadow: 0 0 16px rgba(255,255,255,0.08); z-index: 1; }
        .story-event-date { color: var(--accent-color); font-family: var(--font-ui); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.35rem; }
        .story-event-body h3 { font-family: var(--font-header); color: #fff; font-size: 1.35rem; margin-bottom: 0.35rem; }
        .story-event-body p { color: #d0d0d0; line-height: 1.6; }
        .timeline-keyword-link {
            color: var(--accent-color, #ffd700);
            text-decoration: none;
            border-bottom: 1px dotted var(--accent-color, rgba(255, 215, 0, 0.5));
            transition: border-bottom-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease;
        }
        .timeline-keyword-link:hover {
            color: #ffffff;
            border-bottom: 1px solid var(--accent-color, #ffd700);
            text-shadow: 0 0 6px var(--accent-color, #ffd700);
        }
        .timeline-event-images {
            display: flex;
            gap: 0.8rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }
        .timeline-event-img-wrapper {
            position: relative;
            width: 140px;
            height: 90px;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(0,0,0,0.4);
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            cursor: pointer;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
        }
        .timeline-event-img-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .timeline-event-img-wrapper:hover {
            transform: translateY(-3px) scale(1.02);
            border-color: var(--accent-color, #ffd700);
            box-shadow: 0 8px 20px rgba(0,0,0,0.7), 0 0 10px rgba(255, 215, 0, 0.2);
        }
        .timeline-event-img-wrapper:hover img {
            transform: scale(1.08);
        }
        .timeline-event-img-caption {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 5px 6px;
            background: linear-gradient(to top, rgba(0,0,0,0.95) 40%, rgba(0,0,0,0.5) 80%, transparent 100%);
            font-family: var(--font-mono, monospace);
            font-size: 0.65rem;
            color: #E2E8F0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
            opacity: 0.85;
            transition: opacity 0.3s, color 0.3s;
        }
        .timeline-event-img-wrapper:hover .timeline-event-img-caption {
            opacity: 1;
            color: #ffffff;
        }
        .story-event-characters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
        .story-event-character { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.6rem 0.35rem 0.35rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; cursor: pointer; font-family: var(--font-ui); font-size: 0.75rem; }
        .story-event-character:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .story-event-character img,
        .story-event-avatar-fallback { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: rgba(0,0,0,0.42); }

        .galactic-era-grid { display: grid; gap: 0.85rem; }
        .galactic-era-card {
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(12, 18, 20, 0.96), rgba(5, 6, 9, 0.98));
            border: 1px solid rgba(174, 231, 210, 0.14);
            box-shadow: 0 16px 38px rgba(0,0,0,0.28);
        }
        .galactic-era-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(to bottom, var(--accent-color), rgba(123,211,255,0.75), transparent); opacity: 0.85; }
        .galactic-era-summary { width: 100%; display: grid; grid-template-columns: 58px minmax(0, 1fr) 32px; align-items: center; gap: 1rem; padding: 1.05rem 1.2rem; border: 0; background: transparent; color: #fff; text-align: left; cursor: pointer; }
        .galactic-era-summary:hover .galactic-era-title { color: var(--accent-color); }
        .galactic-era-number { width: 50px; height: 50px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,0.06); color: #e8f8ff; font-family: var(--font-header); border: 1px solid rgba(174, 231, 210, 0.18); box-shadow: inset 0 0 18px rgba(123,211,255,0.08); }
        .galactic-era-main { min-width: 0; }
        .galactic-era-title { display: block; font-family: var(--font-header); font-size: 1.45rem; line-height: 1.1; transition: color 0.2s ease; }
        .galactic-era-meta { display: block; color: #aac1c4; font-size: 0.78rem; margin-top: 0.35rem; }
        .galactic-era-summary i { justify-self: end; color: var(--accent-color); transition: transform 0.2s ease; }
        .galactic-era-card.open .galactic-era-summary i { transform: rotate(180deg); }
        .galactic-era-detail { display: none; padding: 0 1.2rem 1.2rem 5.3rem; }
        .galactic-era-card.open .galactic-era-detail { display: block; }
        .galactic-section-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
        .galactic-section-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.65rem; border-radius: 999px; border: 1px solid rgba(174,231,210,0.16); background: rgba(255,255,255,0.045); color: #e8e8e8; font-size: 0.78rem; cursor: pointer; transition: 0.2s ease; }
        .galactic-section-chip:hover,
        .galactic-section-chip.active { background: rgba(174,231,210,0.12); border-color: rgba(174,231,210,0.35); color: #fff; }
        .galactic-section-chip small { color: var(--accent-color); }
        .galactic-record-list { display: grid; gap: 0.55rem; }
        .galactic-record-row {
            display: grid;
            grid-template-columns: 42px minmax(0, 1fr);
            gap: 0.8rem;
            padding: 0.75rem;
            border: 1px solid rgba(255,255,255,0.075);
            border-radius: 8px;
            background: rgba(255,255,255,0.035);
        }
        .galactic-record-row.is-extra,
        .galactic-record-row.section-hidden { display: none; }
        .galactic-era-card.show-all-records .galactic-record-row.is-extra:not(.section-hidden) { display: grid; }
        .galactic-record-index { color: var(--accent-color); font-family: var(--font-header); font-size: 0.9rem; padding-top: 0.2rem; text-align: center; }
        .galactic-record-path { color: #9ed3e0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
        .galactic-record-copy p { color: #e2e2dc; line-height: 1.55; font-size: 0.95rem; }
        .galactic-show-more {
            margin-top: 0.85rem;
            padding: 0.65rem 0.9rem;
            border-radius: 8px;
            border: 1px solid rgba(174,231,210,0.2);
            background: rgba(174,231,210,0.08);
            color: #fff;
            cursor: pointer;
            font-family: var(--font-ui);
            width: 100%;
        }
        .galactic-show-more:hover { border-color: var(--accent-color); color: var(--accent-color); }
        .galactic-muted { color: #aaa; }
        .timeline-empty { max-width: 720px; margin: 3rem auto; padding: 2rem; text-align: center; color: #d0d0d0; border-radius: 8px; }
        .timeline-empty h3 { color: var(--accent-color); font-family: var(--font-header); margin-bottom: 0.75rem; }
        .timeline-no-results { display: none; padding: 2rem; text-align: center; color: #aaa; border: 1px dashed rgba(255,255,255,0.14); border-radius: 8px; background: rgba(0,0,0,0.25); }

        .galactic-console-shell {
            width: min(1220px, 100%);
            min-height: 76vh;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 64px minmax(0, 1fr);
            border: 1px solid rgba(166, 205, 224, 0.18);
            border-radius: 8px;
            overflow: hidden;
            background:
                radial-gradient(circle at 58% 8%, rgba(189, 151, 98, 0.22), transparent 24%),
                radial-gradient(circle at 88% 72%, rgba(105, 83, 172, 0.18), transparent 26%),
                linear-gradient(135deg, rgba(5, 10, 16, 0.98), rgba(8, 20, 21, 0.96) 52%, rgba(9, 8, 16, 0.98));
            box-shadow: 0 28px 80px rgba(0,0,0,0.56), inset 0 1px 0 rgba(255,255,255,0.06);
        }
        .galactic-console-rail {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            padding: 1rem 0.65rem;
            border-right: 1px solid rgba(255,255,255,0.08);
            background: rgba(0,0,0,0.34);
        }
        .galactic-console-brand { color: #f4f4f0; font-family: var(--font-header); font-size: 0.78rem; letter-spacing: 0.12em; margin-bottom: 1rem; }
        .galactic-rail-btn {
            width: 40px;
            height: 40px;
            border: 1px solid transparent;
            border-radius: 8px;
            background: transparent;
            color: #9ba9b3;
            cursor: pointer;
            transition: 0.2s ease;
        }
        .galactic-rail-btn:hover,
        .galactic-rail-btn.active { color: #fff; background: rgba(128, 171, 207, 0.16); border-color: rgba(166,205,224,0.14); }
        .galactic-rail-btn.bottom { margin-top: auto; }
        .galactic-console-shell .galactic-history-screen {
            width: 100%;
            padding: 1.35rem 1.65rem;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }
        .galactic-console-top {
            display: grid;
            grid-template-columns: auto minmax(280px, 390px);
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .galactic-console-search { margin: 0; }
        .galactic-overview-panel { display: block; }
        .galactic-console-shell.is-focused .galactic-overview-panel { display: none; }
        #galactic-focus-panel { display: none; }
        .galactic-console-shell.is-focused #galactic-focus-panel { display: block; }
        .galactic-overview-heading {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 1rem;
            margin: 0 0 1.35rem;
        }
        .galactic-overview-heading .galactic-history-title { font-size: clamp(2rem, 4vw, 3.2rem); }
        .galactic-view-toggle {
            display: inline-flex;
            padding: 0.25rem;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            background: rgba(0,0,0,0.22);
        }
        .galactic-view-toggle span { width: 38px; height: 32px; display: grid; place-items: center; color: #a9b4bd; border-radius: 6px; }
        .galactic-view-toggle span.active { color: #fff; background: rgba(128,171,207,0.16); }
        .galactic-era-overview-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.75rem;
        }
        .galactic-era-poster {
            position: relative;
            min-height: 220px;
            padding: 1rem;
            display: flex;
            align-items: flex-end;
            text-align: left;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            overflow: hidden;
            color: #fff;
            cursor: pointer;
            background: #101820;
            box-shadow: inset 0 0 80px rgba(0,0,0,0.28);
            transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
        }
        .galactic-era-poster:hover,
        .galactic-era-poster.active { transform: translateY(-4px); border-color: rgba(210,235,255,0.7); box-shadow: 0 14px 38px rgba(0,0,0,0.34), inset 0 0 80px rgba(0,0,0,0.22); }
        .galactic-era-poster::before {
            content: "";
            position: absolute;
            inset: 0;
            background:
                linear-gradient(to top, rgba(2,5,8,0.88), rgba(2,5,8,0.26) 52%, rgba(255,255,255,0.06)),
                radial-gradient(circle at 28% 24%, rgba(255,255,255,0.32), transparent 8%),
                linear-gradient(145deg, rgba(112,145,178,0.2), transparent 40%);
            z-index: 1;
        }
        .galactic-era-poster-art {
            position: absolute;
            inset: 0;
            opacity: 0.82;
            background:
                radial-gradient(circle at 35% 34%, rgba(255,255,255,0.28), transparent 8%),
                radial-gradient(circle at 52% 38%, rgba(255,255,255,0.18), transparent 16%),
                linear-gradient(150deg, rgba(34, 70, 96, 0.75), rgba(11, 13, 20, 0.94));
        }
        .era-theme-1 .galactic-era-poster-art,
        .era-theme-1.galactic-era-focus::before { background: radial-gradient(circle at 60% 20%, rgba(255,205,121,0.45), transparent 18%), linear-gradient(145deg, rgba(126,76,40,0.72), rgba(22,18,18,0.96)); }
        .era-theme-2 .galactic-era-poster-art,
        .era-theme-2.galactic-era-focus::before { background: radial-gradient(circle at 72% 30%, rgba(255,230,171,0.42), transparent 16%), linear-gradient(145deg, rgba(111,86,51,0.72), rgba(19,24,25,0.96)); }
        .era-theme-3 .galactic-era-poster-art,
        .era-theme-3.galactic-era-focus::before { background: radial-gradient(circle at 82% 16%, rgba(201,53,61,0.55), transparent 17%), linear-gradient(145deg, rgba(91,19,28,0.78), rgba(12,8,13,0.96)); }
        .era-theme-4 .galactic-era-poster-art,
        .era-theme-4.galactic-era-focus::before { background: radial-gradient(circle at 28% 22%, rgba(170,188,204,0.34), transparent 15%), linear-gradient(145deg, rgba(54,67,80,0.78), rgba(9,11,15,0.96)); }
        .era-theme-5 .galactic-era-poster-art,
        .era-theme-5.galactic-era-focus::before { background: radial-gradient(circle at 58% 26%, rgba(196,209,154,0.34), transparent 16%), linear-gradient(145deg, rgba(58,82,55,0.72), rgba(12,18,16,0.96)); }
        .era-theme-6 .galactic-era-poster-art,
        .era-theme-6.galactic-era-focus::before { background: radial-gradient(circle at 36% 34%, rgba(118,159,223,0.42), transparent 18%), linear-gradient(145deg, rgba(38,55,93,0.78), rgba(8,11,19,0.96)); }
        .era-theme-7 .galactic-era-poster-art,
        .era-theme-7.galactic-era-focus::before { background: radial-gradient(circle at 80% 18%, rgba(207,124,213,0.38), transparent 18%), linear-gradient(145deg, rgba(57,38,91,0.76), rgba(13,10,20,0.96)); }
        .galactic-era-poster-number { position: absolute; top: 0.9rem; left: 0.9rem; z-index: 2; padding: 0.3rem 0.45rem; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; color: #cbd8df; background: rgba(0,0,0,0.28); font-size: 0.75rem; }
        .galactic-era-poster-body { position: relative; z-index: 2; display: grid; gap: 0.45rem; width: 100%; }
        .galactic-era-poster-title { font-family: var(--font-header); font-size: 1.35rem; line-height: 1.05; text-transform: uppercase; }
        .galactic-era-poster-range { color: #f1f1ed; font-size: 0.78rem; }
        .galactic-era-poster-count { display: grid; gap: 0.05rem; color: #b9c7cc; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.08em; }
        .galactic-era-poster-count strong { color: #fff; font-size: 1.05rem; letter-spacing: 0; }
        .galactic-overview-hint { text-align: center; color: #98a9ae; margin-top: 0.9rem; font-size: 0.75rem; }
        .galactic-era-focus {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
            gap: 0.85rem;
        }
        .galactic-era-focus::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 8px;
            opacity: 0.85;
            pointer-events: none;
        }
        .galactic-focus-left,
        .galactic-era-timeline {
            position: relative;
            z-index: 1;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(13,19,23,0.78), rgba(7,9,13,0.94));
        }
        .galactic-focus-left { min-height: 560px; padding: 1.2rem; }
        .galactic-focus-back { border: 0; background: transparent; color: #b7c8ce; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; cursor: pointer; margin-bottom: 1.4rem; }
        .galactic-focus-back:hover { color: #fff; }
        .galactic-focus-hero { display: flex; justify-content: space-between; gap: 1rem; min-height: 210px; align-items: flex-start; }
        .galactic-focus-copy { max-width: 500px; }
        .galactic-focus-title { font-family: var(--font-header); color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; display: flex; gap: 0.6rem; align-items: center; }
        .galactic-focus-title i { color: #93dfff; font-size: 1.6rem; }
        .galactic-focus-range { color: #d7e4ea; margin-top: 0.7rem; font-size: 1rem; }
        .galactic-focus-copy p { color: #d0d7d7; line-height: 1.65; margin-top: 1.1rem; }
        .galactic-focus-stats { display: grid; grid-template-columns: repeat(3, 88px); gap: 0.5rem; }
        .galactic-focus-stats div { padding: 0.75rem; border-radius: 8px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
        .galactic-focus-stats strong { color: #fff; display: block; font-family: var(--font-header); font-size: 1.2rem; }
        .galactic-focus-stats span { color: #b4c0c2; text-transform: uppercase; font-size: 0.64rem; letter-spacing: 0.08em; }
        .galactic-subera-heading { margin-top: 1.4rem; color: #c9d6d9; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; }
        .galactic-subera-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; margin-top: 0.75rem; }
        .galactic-subera-card { min-height: 92px; padding: 0.85rem; text-align: left; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.07); color: #fff; cursor: pointer; display: grid; align-content: space-between; transition: 0.2s ease; }
        .galactic-subera-card:hover,
        .galactic-subera-card.active { border-color: rgba(210,235,255,0.78); background: rgba(255,255,255,0.12); }
        .galactic-subera-card span { font-weight: 700; }
        .galactic-subera-card small { color: #c0ced2; }
        .galactic-event-detail { margin-top: 1rem; min-height: 210px; padding: 1.1rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; background: linear-gradient(90deg, rgba(16,26,34,0.92), rgba(16,20,26,0.52)); }
        .galactic-detail-breadcrumb { color: #9fb1b8; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; }
        .galactic-detail-date { margin-top: 1rem; color: #d7e4ea; font-size: 1rem; }
        .galactic-detail-title { margin-top: 0.65rem; color: #fff; font-family: var(--font-header); font-size: 1.55rem; line-height: 1.1; }
        .galactic-event-detail p { margin-top: 0.9rem; color: #d8dfde; line-height: 1.65; max-width: 660px; }
        .galactic-detail-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
        .galactic-detail-tags span { padding: 0.35rem 0.55rem; border-radius: 999px; background: rgba(255,255,255,0.08); color: #cbd6d7; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
        .galactic-era-timeline { padding: 1.1rem; max-height: 680px; overflow: hidden; }
        .galactic-timeline-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
        .galactic-timeline-title { color: #fff; font-family: var(--font-header); font-size: 1.65rem; line-height: 1.1; }
        .galactic-filter-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.08); color: #fff; }
        .galactic-timeline-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem; padding: 0.2rem; margin: 1rem 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; }
        .galactic-timeline-tabs button { border: 0; background: transparent; color: #9eaaae; padding: 0.55rem; border-radius: 6px; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.08em; }
        .galactic-timeline-tabs button.active { background: rgba(105,137,165,0.32); color: #fff; }
        .galactic-timeline-meta { display: inline-grid; margin-bottom: 0.75rem; color: #b9c5c9; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.08em; }
        .galactic-timeline-meta strong { color: #fff; font-family: var(--font-header); font-size: 1.2rem; letter-spacing: 0; }
        .galactic-focused-records { position: relative; display: grid; gap: 0.7rem; max-height: 500px; overflow-y: auto; padding-left: 0.8rem; }
        .galactic-focused-records::before { content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(to bottom, rgba(118,202,255,0.1), rgba(118,202,255,0.75), rgba(118,202,255,0.1)); }
        .galactic-focused-record { position: relative; display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 0.75rem; align-items: start; border: 0; background: transparent; color: #fff; text-align: left; cursor: pointer; padding: 0; }
        .galactic-focused-record::before { content: ""; position: absolute; left: -2px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: #8bd8ff; box-shadow: 0 0 14px #8bd8ff; z-index: 1; }
        .galactic-focused-date { color: #b4c8cf; font-size: 0.72rem; padding-top: 0.65rem; text-align: right; }
        .galactic-focused-card { display: grid; gap: 0.35rem; padding: 0.8rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; background: rgba(255,255,255,0.065); transition: 0.2s ease; }
        .galactic-focused-record:hover .galactic-focused-card,
        .galactic-focused-record.active .galactic-focused-card { border-color: rgba(139,216,255,0.48); background: rgba(255,255,255,0.1); }
        .galactic-focused-card strong { color: #fff; font-size: 0.9rem; }
        .galactic-focused-card span { color: #c0c8ca; line-height: 1.45; font-size: 0.78rem; }

        .galactic-console-shell {
            width: min(1360px, 100%);
            min-height: 82vh;
            background:
                radial-gradient(circle at 60% 6%, rgba(190, 174, 133, 0.22), transparent 23%),
                radial-gradient(circle at 88% 88%, rgba(70, 55, 124, 0.2), transparent 28%),
                linear-gradient(135deg, rgba(3, 9, 16, 0.98), rgba(7, 22, 24, 0.96) 52%, rgba(8, 8, 18, 0.98));
        }
        .galactic-console-shell .galactic-history-screen { padding: 1.65rem 1.9rem; }
        .galactic-console-top { grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); }
        .galactic-overview-heading .galactic-history-title {
            font-size: clamp(2.6rem, 5vw, 4.7rem);
            letter-spacing: 0;
            max-width: 850px;
        }
        .galactic-era-overview-grid { gap: 0.9rem; }
        .galactic-era-poster {
            min-height: 245px;
            padding: 1.1rem;
            border-color: rgba(194,216,228,0.18);
            background: #09111b;
        }
        .galactic-era-poster-art {
            opacity: 1;
            background:
                linear-gradient(to top, rgba(2,5,10,0.9), rgba(2,5,10,0.1) 58%),
                radial-gradient(ellipse at 32% 26%, rgba(188,224,255,0.42), transparent 11%),
                radial-gradient(ellipse at 46% 34%, rgba(103,153,199,0.18), transparent 21%),
                linear-gradient(145deg, #22374d, #0a111c 70%);
        }
        .galactic-era-poster-art::before,
        .galactic-era-poster-art::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
        }
        .galactic-era-poster-art::before {
            height: 48%;
            background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
            clip-path: polygon(0 72%, 12% 60%, 22% 66%, 34% 42%, 45% 62%, 58% 36%, 71% 58%, 84% 44%, 100% 62%, 100% 100%, 0 100%);
        }
        .galactic-era-poster-art::after {
            height: 100%;
            opacity: 0.7;
            background:
                radial-gradient(circle at 18% 20%, rgba(255,255,255,0.9) 0 1px, transparent 2px),
                radial-gradient(circle at 72% 18%, rgba(255,255,255,0.65) 0 1px, transparent 2px),
                radial-gradient(circle at 84% 38%, rgba(255,255,255,0.55) 0 1px, transparent 2px);
        }
        .era-theme-1 .galactic-era-poster-art { background: linear-gradient(to top, rgba(4,4,6,0.9), transparent 58%), radial-gradient(ellipse at 64% 26%, rgba(255,199,118,0.46), transparent 14%), linear-gradient(145deg, #6a4732, #161319 72%); }
        .era-theme-1 .galactic-era-poster-art::before { clip-path: polygon(0 76%, 12% 62%, 19% 68%, 22% 40%, 27% 68%, 34% 46%, 39% 68%, 45% 30%, 51% 68%, 58% 44%, 65% 70%, 76% 48%, 83% 70%, 91% 56%, 100% 72%, 100% 100%, 0 100%); }
        .era-theme-2 .galactic-era-poster-art { background: linear-gradient(to top, rgba(4,5,5,0.9), transparent 56%), radial-gradient(ellipse at 72% 28%, rgba(245,218,156,0.42), transparent 15%), linear-gradient(145deg, #74624a, #14191a 72%); }
        .era-theme-2 .galactic-era-poster-art::before { clip-path: polygon(0 76%, 10% 64%, 20% 70%, 30% 56%, 39% 67%, 46% 34%, 53% 66%, 62% 42%, 70% 64%, 78% 36%, 86% 66%, 100% 54%, 100% 100%, 0 100%); }
        .era-theme-3 .galactic-era-poster-art { background: linear-gradient(to top, rgba(9,3,7,0.92), transparent 58%), radial-gradient(circle at 82% 18%, rgba(205,52,67,0.55), transparent 17%), linear-gradient(145deg, #5e1724, #100911 75%); }
        .era-theme-3 .galactic-era-poster-art::before { clip-path: polygon(0 78%, 16% 58%, 30% 68%, 43% 28%, 53% 70%, 66% 44%, 78% 64%, 88% 36%, 100% 70%, 100% 100%, 0 100%); }
        .era-theme-4 .galactic-era-poster-art { background: linear-gradient(to top, rgba(5,7,10,0.92), transparent 60%), radial-gradient(ellipse at 34% 28%, rgba(189,207,222,0.32), transparent 15%), linear-gradient(145deg, #425466, #0b0d13 74%); }
        .era-theme-4 .galactic-era-poster-art::before { clip-path: polygon(0 68%, 28% 44%, 58% 54%, 100% 36%, 100% 100%, 0 100%); }
        .era-theme-5 .galactic-era-poster-art { background: linear-gradient(to top, rgba(4,8,7,0.92), transparent 60%), radial-gradient(ellipse at 55% 28%, rgba(194,212,152,0.34), transparent 16%), linear-gradient(145deg, #3b5a42, #0b1513 76%); }
        .era-theme-6 .galactic-era-poster-art { background: linear-gradient(to top, rgba(4,7,14,0.92), transparent 60%), radial-gradient(ellipse at 34% 32%, rgba(119,163,230,0.42), transparent 18%), linear-gradient(145deg, #253a67, #080b16 76%); }
        .era-theme-7 .galactic-era-poster-art { background: linear-gradient(to top, rgba(7,5,14,0.92), transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(205,128,221,0.38), transparent 18%), linear-gradient(145deg, #3d2b64, #0d0a18 76%); }
        .galactic-era-poster-title { font-size: 1.48rem; text-shadow: 0 2px 12px rgba(0,0,0,0.75); }
        .galactic-era-poster-range,
        .galactic-era-poster-count { text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
        .galactic-era-focus {
            grid-template-columns: minmax(0, 1.45fr) minmax(390px, 0.72fr);
            gap: 0.95rem;
        }
        .galactic-focus-left { min-height: 650px; padding: 1.45rem; }
        .galactic-focus-hero {
            min-height: 285px;
            padding: 0.1rem;
            align-items: flex-start;
        }
        .galactic-focus-title {
            max-width: 560px;
            font-size: clamp(2.45rem, 4.8vw, 4.4rem);
        }
        .galactic-focus-copy p { max-width: 470px; font-size: 1rem; }
        .galactic-focus-stats { grid-template-columns: repeat(3, 94px); }
        .galactic-subera-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .galactic-subera-card {
            min-height: 108px;
            background:
                linear-gradient(to top, rgba(0,0,0,0.58), transparent),
                rgba(255,255,255,0.075);
        }
        .galactic-event-detail {
            min-height: 240px;
            background:
                linear-gradient(90deg, rgba(17,28,39,0.94), rgba(16,20,26,0.44)),
                radial-gradient(circle at 78% 24%, rgba(139,216,255,0.14), transparent 28%);
        }
        .galactic-detail-title {
            font-size: 1.75rem;
            max-width: 690px;
        }
        .galactic-era-timeline {
            max-height: 720px;
            background: linear-gradient(180deg, rgba(18,18,22,0.88), rgba(4,7,12,0.96));
        }
        .galactic-timeline-title {
            font-size: 1.45rem;
            overflow-wrap: anywhere;
        }
        .galactic-focused-records {
            max-height: 535px;
            padding-top: 0.35rem;
            padding-right: 0.25rem;
        }
        .galactic-focused-card {
            min-height: 82px;
            overflow: hidden;
        }
        .galactic-focused-card strong {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            line-height: 1.25;
        }
        .galactic-focused-card span {
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        @supports selector(body:has(.galactic-console-shell)) {
            body:has(.galactic-console-shell) #app-container {
                padding: 0;
                background: #020508;
            }
            body:has(.galactic-console-shell) #main-header {
                display: none;
            }
            body:has(.galactic-console-shell) #content-stage {
                padding: 0.55rem;
                overflow: hidden;
                scrollbar-width: none;
            }
            body:has(.galactic-console-shell) #content-stage::-webkit-scrollbar {
                display: none;
            }
            body:has(.galactic-console-shell) .background-layer,
            body:has(.galactic-console-shell) #particle-canvas {
                opacity: 0;
            }
        }

        .galactic-console-shell {
            --galactic-line: rgba(117, 150, 178, 0.22);
            --galactic-soft: rgba(184, 212, 231, 0.74);
            position: relative;
            width: 100%;
            height: calc(100vh - 1.1rem);
            min-height: 720px;
            margin: 0;
            grid-template-columns: 94px minmax(0, 1fr);
            border-radius: 8px;
            border: 1px solid rgba(126, 164, 190, 0.28);
            background:
                linear-gradient(90deg, rgba(3,8,12,0.96), rgba(6,12,19,0.8) 22%, rgba(7,11,17,0.78)),
                var(--galactic-overview-bg) center / cover no-repeat;
            box-shadow: 0 0 0 1px rgba(255,255,255,0.035), 0 26px 80px rgba(0,0,0,0.85), inset 0 0 80px rgba(56, 92, 121, 0.1);
        }
        .galactic-console-shell::before {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            background:
                radial-gradient(circle at 57% 18%, rgba(217,229,225,0.18), transparent 15%),
                linear-gradient(to bottom, rgba(3,7,12,0.24), rgba(2,4,7,0.7));
            z-index: 0;
        }
        .galactic-console-shell > * {
            position: relative;
            z-index: 1;
        }
        .galactic-console-rail {
            padding: 1.55rem 1.2rem;
            gap: 1.45rem;
            border-right: 1px solid var(--galactic-line);
            background: rgba(1, 7, 12, 0.66);
        }
        .galactic-console-brand {
            align-self: stretch;
            color: #f0efe6;
            font-size: 0.95rem;
            letter-spacing: 0.1em;
            margin: 0 0 1.5rem;
            text-align: center;
        }
        .galactic-rail-btn {
            width: 56px;
            height: 56px;
            border-radius: 8px;
            color: #9aa9b6;
            font-size: 1.12rem;
        }
        .galactic-rail-btn:hover,
        .galactic-rail-btn.active {
            color: #edf7ff;
            border-color: rgba(118, 170, 215, 0.28);
            background: rgba(72, 114, 151, 0.24);
            box-shadow: inset 0 0 20px rgba(116, 178, 232, 0.12);
        }
        .galactic-console-shell .galactic-history-screen {
            min-height: 0;
            height: 100%;
            padding: 2rem 3.25rem 1.25rem 3.8rem;
            display: flex;
            flex-direction: column;
        }
        .galactic-console-top {
            grid-template-columns: minmax(0, 1fr) minmax(380px, 540px);
            margin-bottom: 3rem;
        }
        .galactic-console-top .map-hub-back-btn {
            width: 34px;
            height: 34px;
            padding: 0;
            justify-content: center;
            border: 0;
            color: #9dacb7;
            background: transparent;
            font-size: 0;
        }
        .galactic-console-top .map-hub-back-btn i {
            font-size: 0.95rem;
        }
        .galactic-console-search .timeline-search {
            height: 52px;
            padding-left: 3.2rem;
            padding-right: 4.6rem;
            border-radius: 8px;
            border-color: rgba(139, 166, 190, 0.24);
            background: rgba(23, 34, 48, 0.76);
            box-shadow: inset 0 0 18px rgba(255,255,255,0.025), 0 8px 22px rgba(0,0,0,0.22);
            color: #dfe8ee;
            font-weight: 700;
        }
        .galactic-console-search::after {
            content: "⌘K";
            position: absolute;
            right: 0.9rem;
            top: 50%;
            transform: translateY(-50%);
            padding: 0.3rem 0.45rem;
            border-radius: 6px;
            background: rgba(255,255,255,0.08);
            color: #b2b8bd;
            font-size: 0.68rem;
            font-weight: 800;
        }
        .galactic-console-search .timeline-search-icon {
            left: 1.25rem;
            color: #bac7d2;
            font-size: 1rem;
        }
        .galactic-overview-panel {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .galactic-overview-heading {
            align-items: flex-start;
            margin-bottom: 1.85rem;
        }
        .galactic-overview-heading .timeline-hub-kicker {
            color: #9daaba;
            margin-bottom: 0.65rem;
        }
        .galactic-overview-heading .galactic-history-title {
            font-size: clamp(2.35rem, 4vw, 3.25rem);
            color: #f7f3ec;
            text-shadow: 0 2px 18px rgba(0,0,0,0.65);
        }
        .galactic-overview-heading .galactic-history-subtitle {
            margin-top: 0.45rem;
            color: #ccd1d3;
            font-size: 0.88rem;
            font-weight: 700;
        }
        .galactic-view-toggle {
            margin-top: 3.5rem;
            background: rgba(6, 14, 23, 0.55);
            border-color: rgba(118, 151, 178, 0.18);
        }
        .galactic-view-toggle span {
            width: 43px;
            height: 38px;
            color: #82909b;
        }
        .galactic-view-toggle span.active {
            background: rgba(80, 116, 149, 0.36);
        }
        .galactic-era-overview-grid {
            flex: 1;
            min-height: 0;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            grid-auto-rows: minmax(260px, 1fr);
            gap: 1rem;
        }
        .galactic-era-poster {
            min-height: 0;
            padding: 1.35rem 1.45rem;
            border-color: rgba(171, 190, 203, 0.16);
            border-radius: 8px;
            background:
                linear-gradient(to top, rgba(5, 9, 14, 0.94), rgba(5, 9, 14, 0.34)),
                var(--galactic-era-image) center / cover no-repeat,
                #09111b;
            box-shadow: inset 0 0 70px rgba(0,0,0,0.24), 0 12px 24px rgba(0,0,0,0.22);
        }
        .galactic-era-poster:hover,
        .galactic-era-poster.active {
            transform: translateY(-2px);
            border-color: rgba(211, 233, 246, 0.78);
            box-shadow: 0 16px 44px rgba(0,0,0,0.38), 0 0 0 1px rgba(255,255,255,0.08), inset 0 0 70px rgba(0,0,0,0.18);
        }
        .galactic-era-poster::before {
            background:
                linear-gradient(to top, rgba(4,8,13,0.95), rgba(4,8,13,0.44) 48%, rgba(255,255,255,0.035)),
                linear-gradient(90deg, rgba(255,255,255,0.08), transparent 28%, transparent 72%, rgba(255,255,255,0.06));
        }
        .galactic-era-poster-art {
            opacity: 1;
            inset: 0.9rem;
            background-image: var(--galactic-era-image);
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
            filter: saturate(0.9) contrast(1.02);
            z-index: 0;
        }
        .galactic-era-poster-art::before,
        .galactic-era-poster-art::after {
            display: none;
        }
        .galactic-era-poster-number {
            top: 1.25rem;
            left: 1.25rem;
            padding: 0.32rem 0.48rem;
            color: #c5ced7;
            background: rgba(14, 21, 31, 0.58);
            border-color: rgba(209, 224, 236, 0.13);
            font-weight: 800;
        }
        .galactic-era-poster-body {
            gap: 0.6rem;
        }
        .galactic-era-poster-title {
            max-width: 94%;
            font-size: clamp(1.35rem, 1.9vw, 1.85rem);
            color: #f7f1e9;
        }
        .galactic-era-poster-range {
            color: #e0e4e7;
            font-weight: 700;
            font-size: 0.9rem;
        }
        .galactic-era-poster-count {
            margin-top: 2.65rem;
            color: #aebbc5;
            font-weight: 800;
        }
        .galactic-era-poster-count strong {
            font-size: 1.15rem;
        }
        .galactic-overview-hint {
            margin-top: 1rem;
            color: #9fa8b0;
            font-weight: 700;
        }
        .galactic-console-shell.is-focused .galactic-history-screen {
            padding: 0;
        }
        .galactic-era-focus {
            height: 100%;
            grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.65fr);
            gap: 0.55rem;
        }
        .galactic-focus-left,
        .galactic-era-timeline {
            border-radius: 0;
            border: 0;
            background: rgba(8, 13, 20, 0.9);
        }
        .galactic-focus-left {
            position: relative;
            display: flex;
            flex-direction: column;
            min-height: 0;
            padding: 2rem 2.65rem;
            border-right: 1px solid rgba(126, 164, 190, 0.16);
            background:
                linear-gradient(90deg, rgba(7,13,21,0.95), rgba(7,13,21,0.72) 42%, rgba(7,13,21,0.24)),
                linear-gradient(to bottom, rgba(5,9,15,0.18), rgba(5,9,15,0.92));
        }
        .galactic-focus-art {
            position: absolute;
            inset: 0;
            background-size: cover;
            background-position: center top;
            opacity: 0.78;
            pointer-events: none;
        }
        .galactic-focus-art::after {
            content: "";
            position: absolute;
            inset: 0;
            background:
                linear-gradient(90deg, rgba(7,13,21,0.94), rgba(7,13,21,0.68) 42%, rgba(7,13,21,0.22)),
                linear-gradient(to bottom, rgba(5,9,15,0.08), rgba(5,9,15,0.94));
        }
        .galactic-focus-left > :not(.galactic-focus-art) {
            position: relative;
            z-index: 1;
        }
        .galactic-focus-back {
            margin-bottom: 1.8rem;
            color: #a6b1ba;
            font-weight: 800;
        }
        .galactic-focus-hero {
            min-height: 250px;
        }
        .galactic-focus-title {
            font-size: clamp(2.25rem, 4.2vw, 4.05rem);
            color: #f8f1e7;
            text-shadow: 0 2px 18px rgba(0,0,0,0.7);
        }
        .galactic-focus-range {
            font-weight: 700;
            color: #cfdbe3;
        }
        .galactic-focus-copy p {
            max-width: 560px;
            color: #d0d9df;
            font-size: 0.92rem;
            font-weight: 650;
        }
        .galactic-focus-stats div {
            background: rgba(23, 30, 42, 0.48);
            border-color: rgba(178, 201, 219, 0.11);
        }
        .galactic-subera-heading {
            margin-top: auto;
            color: #b9c5cd;
            font-weight: 800;
        }
        .galactic-subera-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.65rem;
        }
        .galactic-subera-card {
            position: relative;
            overflow: hidden;
            min-height: 96px;
            padding: 0.85rem;
            background:
                linear-gradient(to top, rgba(7,12,18,0.72), rgba(31,42,52,0.3)),
                var(--galactic-subera-image) center / cover no-repeat,
                rgba(255,255,255,0.07);
            backdrop-filter: blur(6px);
        }
        .galactic-subera-card-art {
            position: absolute;
            inset: 0.45rem;
            background-image: var(--galactic-subera-image);
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
            opacity: 0.72;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        .galactic-subera-card::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(6,10,16,0.86), rgba(6,10,16,0.32));
            z-index: 1;
        }
        .galactic-subera-card:hover .galactic-subera-card-art,
        .galactic-subera-card.active .galactic-subera-card-art {
            opacity: 0.9;
            transform: scale(1.02);
        }
        .galactic-subera-card span:not(.galactic-subera-card-art),
        .galactic-subera-card small {
            position: relative;
            z-index: 2;
        }
        .galactic-event-detail {
            position: relative;
            overflow: hidden;
            flex: 0 0 240px;
            height: 240px;
            min-height: 220px;
            margin-top: 1rem;
            background:
                linear-gradient(90deg, rgba(14, 27, 40, 0.94), rgba(9, 13, 18, 0.72));
        }
        .galactic-event-detail::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, rgba(8,13,19,0.88), rgba(8,13,19,0.5), rgba(8,13,19,0.24));
            pointer-events: none;
        }
        .galactic-event-detail > * {
            position: relative;
            z-index: 1;
        }
        .galactic-detail-art {
            position: absolute;
            inset: 0 0 0 auto;
            width: 54%;
            background-image: var(--galactic-detail-image);
            background-size: cover;
            background-position: center;
            opacity: 0.62;
            z-index: 0;
        }
        .galactic-detail-art::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, rgba(14, 27, 40, 1) 0%, rgba(14, 27, 40, 0.8) 40%, transparent 100%);
        }
        .galactic-era-timeline {
            padding: 1.8rem 1.65rem;
            max-height: none;
            background:
                linear-gradient(180deg, rgba(46, 31, 34, 0.86), rgba(4, 10, 16, 0.96) 62%),
                var(--galactic-timeline-panel) center / cover no-repeat;
        }
        .galactic-timeline-header {
            margin-bottom: 1.35rem;
        }
        .galactic-timeline-title {
            font-size: 1.8rem;
            color: #f4efe8;
        }
        .galactic-timeline-tabs {
            margin: 1.4rem 0 1rem;
            background: rgba(8, 10, 15, 0.34);
        }
        .galactic-focused-records {
            max-height: calc(100vh - 310px);
            gap: 0.78rem;
            padding-left: 1rem;
            padding-right: 0.25rem;
        }
        .galactic-focused-record {
            grid-template-columns: 70px minmax(0, 1fr);
        }
        .galactic-focused-card {
            min-height: 86px;
            padding: 0.85rem 0.95rem;
            background: rgba(37, 39, 47, 0.72);
            border-color: rgba(213, 222, 230, 0.08);
        }

        .galactic-era-poster {
            background: var(--galactic-era-image) center / cover no-repeat #08111a;
            isolation: isolate;
        }

        .galactic-era-poster::before,
        .galactic-era-poster-art,
        .galactic-era-poster-art::before,
        .galactic-era-poster-art::after {
            display: none;
        }

        .galactic-era-poster-number,
        .galactic-era-poster-body {
            z-index: 1;
        }

        .galactic-era-poster-title,
        .galactic-era-poster-range,
        .galactic-era-poster-count {
            text-shadow: 0 2px 14px rgba(0, 0, 0, 0.88);
        }

        .galactic-focus-art {
            background-image: var(--galactic-focus-era-image);
            background-position: center;
        }

        .galactic-subera-card {
            background:
                var(--galactic-subera-image) center / cover no-repeat,
                rgba(8, 13, 20, 0.42);
            border-color: rgba(220, 238, 255, 0.18);
            backdrop-filter: blur(16px) saturate(1.25);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px rgba(0, 0, 0, 0.18);
        }

        .galactic-subera-card::before {
            display: block;
        }

        .galactic-subera-card:hover,
        .galactic-subera-card.active {
            background:
                var(--galactic-subera-image) center / cover no-repeat,
                rgba(20, 31, 44, 0.58);
            border-color: rgba(210, 235, 255, 0.74);
        }

        .galactic-subera-card:hover::before,
        .galactic-subera-card.active::before {
            background: linear-gradient(to top, rgba(6, 10, 16, 0.76), rgba(6, 10, 16, 0.2));
        }

        .galactic-subera-card span,
        .galactic-subera-card small {
            text-shadow: 0 2px 12px rgba(0, 0, 0, 0.86);
        }

        .galactic-subera-body {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            z-index: 2;
        }

        .galactic-subera-title {
            font-family: var(--font-header);
            font-size: 0.95rem;
            font-weight: 700;
            color: #ffffff;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
            line-height: 1.15;
        }

        .galactic-subera-range {
            font-size: 0.72rem;
            color: rgba(230, 238, 245, 0.76);
            text-shadow: 0 1px 6px rgba(0, 0, 0, 0.86);
            font-family: var(--font-ui);
            font-weight: 500;
        }

        .galactic-subera-count {
            font-family: var(--font-ui);
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #ffd700;
            text-shadow: 0 1px 6px rgba(0, 0, 0, 0.86);
            z-index: 2;
        }

        .galactic-timeline-range {
            font-family: var(--font-ui);
            font-size: 0.85rem;
            color: rgba(220, 235, 250, 0.8);
            margin-top: 0.25rem;
            letter-spacing: 0.05em;
        }

        body:has(.galactic-console-shell) .background-layer,
        body:has(.galactic-console-shell) #particle-canvas {
            display: block;
            opacity: 0.45;
        }

        .galactic-console-shell {
            background:
                linear-gradient(90deg, rgba(3, 8, 12, 0.92), rgba(6, 12, 19, 0.68) 30%, rgba(7, 11, 17, 0.52)),
                var(--galactic-overview-bg) center / cover no-repeat,
                rgba(3, 7, 11, 0.72);
        }

        .galactic-console-rail {
            background: rgba(1, 7, 12, 0.42);
            backdrop-filter: blur(18px);
        }

        .galactic-console-shell.is-focused {
            grid-template-columns: 70px minmax(0, 1fr);
            background: rgba(3, 7, 11, 0.42);
            backdrop-filter: blur(8px);
        }

        .galactic-console-shell.is-focused .galactic-console-brand {
            font-size: 0;
            margin-bottom: 1.2rem;
        }

        .galactic-console-shell.is-focused .galactic-console-brand::before {
            content: "A";
            font-size: 1rem;
        }

        .galactic-console-shell.is-focused .galactic-rail-btn {
            width: 42px;
            height: 42px;
            margin-inline: auto;
        }

        .galactic-console-shell.is-focused .galactic-console-top {
            display: none;
        }

        .galactic-console-shell.is-focused #galactic-focus-panel {
            height: 100%;
        }

        .galactic-console-shell.is-focused .galactic-era-focus {
            height: 100%;
            grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.72fr);
            gap: 0;
            overflow: hidden;
            border-left: 1px solid rgba(157, 190, 219, 0.14);
        }

        .galactic-console-shell.is-focused .galactic-era-focus::before {
            display: none;
        }

        .galactic-console-shell.is-focused .galactic-focus-left {
            padding: 2rem 3rem 1.75rem;
            background: 
                linear-gradient(90deg, rgba(5, 9, 15, 0.98) 0%, rgba(5, 9, 15, 0.85) 40%, rgba(5, 9, 15, 0.4) 100%),
                linear-gradient(to top, rgba(5, 9, 15, 0.95) 0%, transparent 50%);
        }

        .galactic-console-shell.is-focused .galactic-focus-art {
            background-size: cover;
            background-position: center;
            opacity: 0.92;
            transform: scale(1.02);
        }

        .galactic-console-shell.is-focused .galactic-focus-art::after {
            background:
                radial-gradient(circle at 72% 12%, rgba(232, 222, 196, 0.2), transparent 16%),
                linear-gradient(90deg, rgba(4, 10, 16, 0.95), rgba(5, 12, 18, 0.66) 42%, rgba(5, 12, 18, 0.24)),
                linear-gradient(to bottom, rgba(5, 9, 15, 0.08), rgba(5, 9, 15, 0.44) 46%, rgba(5, 9, 15, 0.96));
        }

        .galactic-console-shell.is-focused .galactic-focus-back {
            width: max-content;
            margin: 0 auto 1.1rem;
            color: #b7c8d6;
        }

        .galactic-console-shell.is-focused .galactic-focus-hero {
            min-height: 0;
            align-items: flex-start;
        }

        .galactic-console-shell.is-focused .galactic-focus-copy {
            max-width: 620px;
            padding-top: 1rem;
        }

        .galactic-console-shell.is-focused .galactic-focus-title {
            max-width: 600px;
            font-size: clamp(2.7rem, 4.4vw, 4.75rem);
            line-height: 0.94;
            align-items: flex-start;
        }

        .galactic-console-shell.is-focused .galactic-focus-title i {
            font-size: 1.45rem;
            margin-right: 0.35rem;
        }

        .galactic-console-shell.is-focused .galactic-focus-range {
            margin-top: 1.2rem;
            font-size: 1.05rem;
        }

        .galactic-console-shell.is-focused .galactic-focus-copy p {
            max-width: 520px;
            margin-top: 1rem;
            color: rgba(232, 239, 242, 0.9);
            line-height: 1.55;
        }

        .galactic-console-shell.is-focused .galactic-focus-stats {
            grid-template-columns: repeat(3, 86px);
            margin-top: 1rem;
        }

        .galactic-console-shell.is-focused .galactic-focus-stats div {
            min-height: 64px;
            background: rgba(12, 19, 29, 0.48);
            border-color: rgba(214, 231, 244, 0.12);
            backdrop-filter: blur(14px);
        }

        .galactic-console-shell.is-focused .galactic-subera-heading {
            margin-top: auto;
            margin-bottom: 0;
        }

        .galactic-console-shell.is-focused .galactic-subera-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.8rem;
            margin-top: 0.8rem;
        }

        .galactic-console-shell.is-focused .galactic-subera-card {
            border: 1px solid rgba(255, 255, 255, 0.05); /* Softer border */
            background:
                var(--galactic-subera-image) center / cover no-repeat,
                rgba(15, 20, 25, 0.4); /* Translucent fill */
            backdrop-filter: blur(12px); /* The missing glass effect */
            border-radius: 8px;
            padding: 1.2rem;
            display: flex;
            flex-direction: column;
            justify-content: center; /* Center text vertically */
        }

        /* Active sub-era card */
        .galactic-console-shell.is-focused .galactic-subera-card.active {
            border-color: rgba(124, 216, 255, 0.6); /* Cyan glow */
            box-shadow: 0 0 20px rgba(124, 216, 255, 0.15);
            background:
                var(--galactic-subera-image) center / cover no-repeat,
                rgba(25, 35, 45, 0.6);
        }

        .galactic-console-shell.is-focused .galactic-event-detail {
            position: relative;
            flex-basis: 210px;
            height: 210px;
            min-height: 210px;
            margin-top: 1rem;
            padding: 1rem 1.15rem;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background:
                linear-gradient(90deg, rgba(8, 16, 25, 0.94), rgba(8, 14, 20, 0.58)),
                rgba(5, 10, 16, 0.72);
            backdrop-filter: blur(14px);
        }

        .galactic-console-shell.is-focused .galactic-detail-title {
            max-width: 55%;
            font-size: clamp(1.35rem, 1.8vw, 1.9rem);
            line-height: 1.05;
            position: relative;
            z-index: 2;
        }

        .galactic-console-shell.is-focused .galactic-event-detail p {
            max-width: 55%;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            position: relative;
            z-index: 2;
        }

        .galactic-console-shell.is-focused .galactic-detail-tags {
            display: none;
        }

        .galactic-console-shell.is-focused .galactic-era-timeline {
            padding: 2rem 1.8rem;
            background:
                linear-gradient(180deg, rgba(57, 31, 35, 0.9), rgba(9, 13, 19, 0.96) 46%, rgba(4, 9, 15, 0.98)),
                var(--galactic-timeline-panel) center / cover no-repeat;
            border-left: 1px solid rgba(220, 233, 245, 0.1);
        }

        .galactic-console-shell.is-focused .galactic-timeline-header {
            margin-bottom: 1.15rem;
        }

        /* Main titles font letter spacing */
        .galactic-focus-title, 
        .galactic-timeline-title {
            letter-spacing: 0.05em;
        }

        .galactic-console-shell.is-focused .galactic-timeline-title {
            max-width: 100%;
            font-size: 1.1rem; /* Was clamp(1.65rem...) which is way too big */
            line-height: 1.3;
            text-transform: uppercase;
        }

        .galactic-console-shell.is-focused .galactic-timeline-meta {
            margin: 0.35rem 0 1rem;
        }

        .galactic-console-shell.is-focused .galactic-focused-records {
            max-height: calc(100vh - 255px);
            gap: 0.74rem;
            padding-left: 2.5rem; /* Create a dedicated track on the left */
        }

        /* The vertical line */
        .galactic-console-shell.is-focused .galactic-focused-records::before {
            left: 1.25rem; /* Center of the track */
            top: 10px;
            bottom: 10px;
            width: 2px;
            background: linear-gradient(to bottom, rgba(124, 216, 255, 0.1), rgba(124, 216, 255, 0.5), rgba(124, 216, 255, 0.1));
        }

        /* The dot */
        .galactic-console-shell.is-focused .galactic-focused-record::before {
            left: -1.25rem; /* Pull dot left exactly into the center of the track */
            transform: translateX(-50%); /* Perfectly center it on the line */
            top: 24px;
            width: 6px; /* Smaller, sharper dot */
            height: 6px;
            background: #7cd8ff;
            box-shadow: 0 0 10px #7cd8ff, 0 0 20px rgba(124, 216, 255, 0.4);
        }

        .galactic-console-shell.is-focused .galactic-focused-record {
            grid-template-columns: 72px minmax(0, 1fr);
            gap: 0.85rem;
        }

        .galactic-console-shell.is-focused .galactic-focused-date {
            color: rgba(219, 239, 248, 0.78);
            font-size: 0.68rem;
            line-height: 1.25;
        }

        .galactic-console-shell.is-focused .galactic-focused-card {
            min-height: 84px;
            padding: 0.85rem 0.95rem;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            background: rgba(20, 25, 30, 0.5);
            backdrop-filter: blur(8px);
        }

        .galactic-console-shell.is-focused .galactic-focused-record:hover .galactic-focused-card,
        .galactic-console-shell.is-focused .galactic-focused-record.active .galactic-focused-card {
            border-color: rgba(157, 215, 255, 0.68);
            background: rgba(55, 56, 68, 0.82);
        }

        /* --- VIEW: MAPS --- */
        .map-console-shell {
            --hud-glass-bg:       rgba(10, 15, 30, 0.65);
            --hud-glass-border:   rgba(0, 242, 254, 0.12);
            --hud-glow-color:     rgba(0, 242, 254, 0.15);
            --hud-cyan:           #00f2fe;
            --dock-width:         360px;
            --dock-transition:    0.4s cubic-bezier(0.16, 1, 0.3, 1);
            
            position: fixed;
            inset: 0;
            z-index: 9999;
            width: 100vw;
            height: 100vh;
            overflow: hidden;
            background:
                radial-gradient(circle at 30% 30%, rgba(0, 59, 92, 0.35) 0%, transparent 60%),
                radial-gradient(circle at 75% 50%, rgba(42, 8, 69, 0.28) 0%, transparent 60%),
                linear-gradient(135deg, #050811, #0c1020);
            color: #e2e8f0;
            font-family: var(--font-ui);
        }
        
        .map-console-shell::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 5;
            background:
                /* Grid Lines */
                linear-gradient(rgba(0, 242, 254, 0.015) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 242, 254, 0.015) 1px, transparent 1px),
                /* CRT Horizontal Scanlines */
                repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 3px),
                /* Vignette */
                radial-gradient(circle at center, transparent 40%, rgba(3, 5, 10, 0.85) 100%);
            background-size: 80px 80px, 80px 80px, 100% 3px, 100% 100%;
            opacity: 0.9;
        }

        .map-stage {
            position: absolute;
            inset: 0;
            overflow: hidden;
            z-index: 10;
        }

        .map-console-shell .map-viewer {
            height: 100%;
            border-radius: 0;
            position: relative;
            overflow: hidden;
            cursor: grab;
            background: transparent;
            touch-action: none;
        }
        .map-console-shell .map-viewer.is-dragging { cursor: grabbing; }
        .map-canvas { position: absolute; transform-origin: 0 0; will-change: transform; }
        .map-canvas img { display: block; max-width: none; pointer-events: none; }

        .map-console-shell .map-viewer::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 25;
            background:
                radial-gradient(circle at center, transparent 44%, rgba(1, 5, 12, 0.46) 100%),
                linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.45));
        }

        .map-hud-bar {
            position: absolute;
            top: 10px; left: 10px; right: 10px;
            height: 70px;
            z-index: 900;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2rem;
            background: rgba(10, 15, 30, 0.65);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(0, 242, 254, 0.12);
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
            transition: transform var(--dock-transition), opacity 0.3s ease;
        }
        
        .map-hud-title {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            font-family: var(--font-ui);
            font-size: 1.35rem;
            font-weight: 300;
            letter-spacing: 0.5em;
            text-transform: uppercase;
            color: #ffffff;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
        }
        
        .map-hud-back {
            font-family: var(--font-ui);
            font-size: 0.72rem;
            color: rgba(255, 255, 255, 0.75);
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 4px;
            padding: 0.45rem 1rem;
            cursor: pointer;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .map-hud-back:hover {
            color: #00f2fe;
            border-color: rgba(0, 242, 254, 0.35);
            background: rgba(0, 242, 254, 0.05);
            box-shadow: 0 0 10px rgba(0, 242, 254, 0.12);
        }
        
        .map-hud-actions {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
        }
        
        .map-hud-icon-btn {
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.65);
            font-size: 0.95rem;
            cursor: pointer;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.25s ease;
        }
        .map-hud-icon-btn:hover {
            color: #00f2fe;
            background: rgba(0, 242, 254, 0.08);
        }
        
        .map-hud-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid rgba(0, 242, 254, 0.3);
            object-fit: cover;
            background: rgba(0, 0, 0, 0.5);
            cursor: pointer;
            transition: border-color 0.25s ease;
        }
        .map-hud-avatar:hover {
            border-color: #00f2fe;
            box-shadow: 0 0 8px rgba(0, 242, 254, 0.35);
        }

        .map-chip {
            border: 1px solid rgba(255,255,255,0.15);
            background: rgba(8, 10, 16, 0.78);
            color: #d7d7d7;
            padding: 0.45rem 0.8rem;
            border-radius: 999px;
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            cursor: pointer;
            transition: 0.2s ease;
        }
        .map-chip:hover,
        .map-chip.active {
            color: #050505;
            background: var(--accent-color);
            border-color: var(--accent-color);
        }

        .map-controls {
            position: absolute;
            bottom: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            z-index: 200;
            align-items: center;
        }
        .map-control-btn {
            width: 40px; height: 40px;
            background: rgba(4, 8, 14, 0.82);
            border: 1px solid rgba(124, 216, 255, 0.15);
            color: rgba(255,255,255,0.7);
            border-radius: 50%;
            cursor: pointer;
            font-size: 0.95rem;
            transition: 0.2s;
            backdrop-filter: blur(12px);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .map-control-btn:hover {
            border-color: rgba(124,216,255,0.45);
            color: var(--hud-cyan);
            box-shadow: 0 0 12px rgba(124,216,255,0.18);
        }

/* --- NEW LORE LOADING SCREEN --- */
#lore-loading-screen {
    position: absolute;
    top: 85px; /* Sits below the header */
    left: 0;
    width: 100%;
    height: calc(100% - 85px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow-y: auto;
}
#lore-loading-screen.active {
    opacity: 1;
    pointer-events: all;
}
.lore-loading-card {
    display: flex;
    flex-direction: column;
    max-width: 700px;
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
}
.ll-img-container {
    width: 100%;
    height: 300px;
    background: #000;
    border-bottom: 1px solid var(--glass-border);
}
.ll-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}
.ll-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#ll-title {
    font-family: var(--font-header);
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}
#ll-desc {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e0e0e0;
    white-space: pre-line;
}
/* --- ARCANE SPIRAL ANIMATION --- */
.arcane-spiral-container {
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.arcane-ring-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255, 215, 0, 0.1) 30%, rgba(255, 215, 0, 0.9) 100%);
    mask-image: radial-gradient(transparent 55%, black 56%);
    -webkit-mask-image: radial-gradient(transparent 55%, black 56%);
    animation: spin 1.5s linear infinite;
}
.arcane-ring-inner {
    position: absolute;
    width: 65%;
    height: 65%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 215, 0, 0.7) 100%);
    mask-image: radial-gradient(transparent 50%, black 51%);
    -webkit-mask-image: radial-gradient(transparent 50%, black 51%);
    animation: spin-reverse 2s linear infinite;
}
.arcane-core {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color), 0 0 30px #fff;
    animation: arcane-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes spin-reverse { 
    to { transform: rotate(-360deg); } 
}
@keyframes arcane-pulse { 
    0% { transform: scale(0.7); opacity: 0.6; } 
    100% { transform: scale(1.3); opacity: 1; } 
}
@media (max-width: 768px) {
    .ll-img-container { height: 200px; }
    .ll-content { padding: 1.5rem; }
    #ll-title { font-size: 1.5rem; }
    #ll-desc { font-size: 0.95rem; }
}

        @media (max-width: 900px) {
            #app-container { padding: 0.5rem; }
            #main-header { padding: 0.5rem 1rem; height: 60px; }
            .logo { font-size: 1.2rem; }
            
            .story-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .story-card { height: auto; aspect-ratio: 2 / 3; }
            .card-info { padding: 1rem; }
            .card-title { font-size: 0.9rem; }

            .author-section {
                grid-template-columns: 1fr;
                text-align: center;
                padding: 1.5rem;
                gap: 2rem;
            }
            .author-img-wrapper { width: 140px; height: 140px; }
            .link-row { text-align: left; }
            
            .story-hub-layout { display: flex !important; flex-direction: row; align-items: flex-start; padding: 1rem !important; gap: 1rem; text-align: left; }
            .hub-cover { width: 120px; flex-shrink: 0; margin: 0; }
            .hub-details h1 { font-size: 1.4rem; }
            .hub-synopsis { font-size: 0.85rem; max-height: 120px; margin-bottom: 1rem; }
            .hub-actions { flex-wrap: wrap; gap: 0.5rem; }
            .hub-actions .btn-large { padding: 0.5rem 1rem; font-size: 0.75rem; width: auto; flex: 1; }
            
            .reader-layout { display: block; }
            .reader-sidebar { position: absolute; top: 0; left: 0; bottom: 0; width: 260px; background: rgba(10,10,10,0.98); z-index: 100; transform: translateX(-105%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-right: 1px solid var(--accent-color); box-shadow: 10px 0 30px rgba(0,0,0,0.5); height: 100%; }
            .reader-sidebar.active { transform: translateX(0); }
            .reader-content { padding: 1.5rem; font-size: 1rem !important; height: 100%; }
            .sidebar-backdrop { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index: 90; display: none; }
            .sidebar-backdrop.active { display: block; }

            .char-grid { gap: 10px; }
            .char-card { width: calc(50% - 6px); height: 240px; }
            .char-name { font-size: 0.9rem; }
            .char-info-overlay { padding: 0.8rem; transform: translateY(0); background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);}
            .char-bio-preview { display: none; }
            
            .char-profile-hero { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
            .hero-img-container { width: 140px; margin: 0 auto; }
            .hero-name { font-size: 1.8rem; text-align: center; }
            .hero-role { text-align: center; margin-bottom: 0.5rem; }
            
            .sub-gallery-grid { column-count: 2; column-gap: 8px; }
            .flex-masonry { gap: 8px; }
            .flex-masonry-col { gap: 8px; }

            .timeline-mode-grid { grid-template-columns: 1fr; }
            .timeline-mode-card { min-height: 240px; }
            .timeline-explorer-topbar,
            .story-history-hero,
            .galactic-history-hero { align-items: flex-start; flex-direction: column; }
            .story-history-stats,
            .galactic-history-metrics { width: 100%; grid-template-columns: 1fr; }
            .story-event-card { grid-template-columns: 42px minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem; }
            .story-history-list::before { left: 21px; }
            .story-event-index { width: 42px; height: 42px; font-size: 0.85rem; }
            .story-event-body h3,
            .galactic-era-title { font-size: 1.08rem; }
            .story-event-body p { font-size: 0.9rem; }
            .galactic-era-summary { grid-template-columns: 42px minmax(0, 1fr) 24px; gap: 0.75rem; padding: 0.8rem; }
            .galactic-era-number { width: 42px; height: 42px; }
            .galactic-era-detail { padding: 0 0.8rem 0.9rem; }
            .galactic-record-row { grid-template-columns: 34px minmax(0, 1fr); gap: 0.55rem; padding: 0.65rem; }
            .galactic-record-copy p { font-size: 0.88rem; }
            .galactic-console-shell { grid-template-columns: 1fr; border-radius: 8px; }
            .galactic-console-rail { display: none; }
            .galactic-console-shell .galactic-history-screen { padding: 0.9rem; }
            .galactic-console-top { grid-template-columns: 1fr; align-items: stretch; }
            .galactic-overview-heading { align-items: flex-start; flex-direction: column; }
            .galactic-era-overview-grid { grid-template-columns: 1fr; }
            .galactic-era-poster { min-height: 190px; }
            .galactic-era-focus { grid-template-columns: 1fr; }
            .galactic-focus-left { min-height: auto; padding: 0.9rem; }
            .galactic-focus-hero { flex-direction: column; min-height: auto; }
            .galactic-focus-stats { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .galactic-subera-grid { grid-template-columns: 1fr; }
            .galactic-era-timeline { max-height: none; }
            .galactic-focused-records { max-height: none; }
            .galactic-focused-record { grid-template-columns: 62px minmax(0, 1fr); }
            .galactic-focused-date { font-size: 0.66rem; }

            .lore-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .lore-card { height: 220px; }
            .lore-card-content { padding: 0.8rem; }
            .lore-card-content .desc { -webkit-line-clamp: 2; line-clamp: 2; }
            
            .lore-wiki-header { height: 180px; margin-bottom: 1rem; }
            .lore-wiki-body { padding: 1.5rem; }
            .lore-wiki-title { font-size: 1.8rem; }
        }

        /* --- AUTH & PROFILE MODALS --- */
        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
            z-index: 6000; display: none; justify-content: center; align-items: center;
            opacity: 0; transition: opacity 0.3s ease;
        }
        .modal-overlay.active { display: flex; opacity: 1; }

        .modal-box {
            background: rgba(15, 15, 15, 0.95);
            border: 1px solid var(--accent-color); border-radius: 12px;
            padding: 2.5rem; width: 100%; max-width: 400px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px rgba(255, 215, 0, 0.1);
            position: relative;
        }
        .modal-close {
            position: absolute; top: 15px; right: 20px;
            color: #888; font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
        }
        .modal-close:hover { color: var(--danger-color); }

        .modal-title { font-family: var(--font-header); color: var(--primary-color); margin-bottom: 1.5rem; text-align: center; }

        .form-group { margin-bottom: 1.2rem; }
        .form-label { display: block; font-size: 0.8rem; color: #aaa; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px; }
        .form-input {
            width: 100%; padding: 10px 15px; font-family: var(--font-ui); font-size: 0.9rem;
            background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border);
            color: #fff; border-radius: 6px; transition: border-color 0.3s;
            outline: none;
        }
        .form-input:focus { border-color: var(--accent-color); }

        .form-btn {
            width: 100%; padding: 12px; font-family: var(--font-header); font-size: 1rem;
            background: var(--accent-color); color: #000; border: none; border-radius: 6px;
            cursor: pointer; transition: all 0.3s; font-weight: bold; letter-spacing: 1px;
            margin-top: 0.5rem;
        }
        .form-btn:hover { box-shadow: 0 0 15px var(--accent-color); transform: translateY(-2px); }
        .form-btn.secondary { background: transparent; border: 1px solid var(--glass-border); color: #ccc; }
        .form-btn.secondary:hover { border-color: #fff; color: #fff; box-shadow: none; }

        .auth-switch {
            text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: #888; cursor: pointer; transition: color 0.2s;
        }
        .auth-switch:hover { color: var(--accent-color); }

        #auth-error, #profile-msg { text-align: center; margin-bottom: 1rem; font-size: 0.85rem; min-height: 1.2em; }
        #auth-error { color: var(--danger-color); }

        /* --- COMMENTS SECTION --- */
        .comments-wrapper {
            margin-top: 3rem;
            padding-top: 2rem;
            border-top: 1px solid var(--glass-border);
        }
        .comments-header {
            font-family: var(--font-header);
            font-size: 1.5rem;
            color: var(--accent-color);
            margin-bottom: 1.5rem;
        }
        .comment-input-area {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            background: rgba(0, 0, 0, 0.2);
            padding: 1.5rem;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }
        .comment-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid var(--accent-color);
            flex-shrink: 0;
        }
        .comment-textarea {
            flex: 1;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid var(--glass-border);
            color: #fff;
            padding: 10px;
            border-radius: 6px;
            font-family: var(--font-ui);
            font-size: 0.9rem;
            resize: vertical;
            min-height: 80px;
            outline: none;
            transition: border-color 0.3s;
        }
        .comment-textarea:focus {
            border-color: var(--accent-color);
        }
        .comment-submit-container {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 0.5rem;
        }
        .comment-login-prompt {
            text-align: center;
            padding: 2rem;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 8px;
            border: 1px dashed rgba(255, 255, 255, 0.1);
            margin-bottom: 2rem;
            color: #aaa;
        }

        .comment-thread {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }
        .comment-item {
            display: flex;
            gap: 1rem;
        }
        .comment-body {
            flex: 1;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 1rem;
        }
        .comment-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            gap: 1rem;
        }
        .comment-author {
            font-weight: bold;
            color: #fff;
            font-size: 0.95rem;
        }
        .comment-author.admin-badge {
            color: var(--accent-color);
        }
        .comment-date {
            font-size: 0.75rem;
            color: #666;
            flex-shrink: 0;
        }
        .comment-text {
            color: #ccc;
            font-size: 0.9rem;
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }
        /* --- COMMENTS DRAWER --- */
        #comments-drawer {
            position: fixed; top: 0; right: -450px;
            width: 400px; max-width: 100vw; height: 100vh;
            background: rgba(10, 10, 12, 0.98); border-left: 1px solid var(--accent-color);
            z-index: 8000; display: flex; flex-direction: column;
            transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: -10px 0 40px rgba(0,0,0,0.8);
        }
        #comments-drawer.open { right: 0; }
        .drawer-header {
            padding: 1.5rem; border-bottom: 1px solid var(--glass-border);
            display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.5);
        }
        .drawer-header h3 { font-family: var(--font-header); color: var(--accent-color); font-size: 1.2rem; margin: 0; }
        .drawer-close { background: transparent; border: none; color: #888; font-size: 1.5rem; cursor: pointer; transition: color 0.2s; }
        .drawer-close:hover { color: var(--danger-color); }
        .drawer-content { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 2rem; }

        /* --- PARAGRAPH ANNOTATIONS --- */
        .paragraph-block { position: relative; padding-right: 40px; margin-bottom: 1.5rem; }
        .para-comment-btn {
            position: absolute; top: 0; right: 0;
            background: rgba(255, 215, 0, 0.1); border: 1px solid var(--accent-color); color: var(--accent-color);
            width: 30px; height: 30px; border-radius: 50%;
            display: flex; justify-content: center; align-items: center;
            cursor: pointer; opacity: 0; transition: all 0.3s; transform: translateX(10px);
        }
        .paragraph-block:hover .para-comment-btn, .para-comment-btn.has-comments { opacity: 1; transform: translateX(0); }
        .para-comment-btn:hover { background: var(--accent-color); color: #000; box-shadow: 0 0 15px var(--accent-color); }

        .comment-image-preview { width: 100%; height: 120px; object-fit: contain; background: #000; border-radius: 6px; border: 1px solid var(--accent-color); margin-bottom: 1rem; opacity: 0.8; }
        .comment-attachment { width: 100%; max-height: 250px; object-fit: contain; background: #000; border-radius: 4px; margin-bottom: 0.8rem; border: 1px solid rgba(255,255,255,0.1); }
        
        /* --- IMAGE VOTING --- */
        .image-vote-container {
            position: absolute; bottom: 15px; left: 15px;
            display: flex; align-items: center; gap: 4px;
            background: rgba(0, 0, 0, 0.5); padding: 4px 12px; border-radius: 30px;
            backdrop-filter: blur(5px); border: 1px solid rgba(255, 215, 0, 0.2);
            z-index: 10; transition: all 0.3s;
        }
        .image-vote-container:hover { background: rgba(0, 0, 0, 0.8); border-color: var(--accent-color); box-shadow: 0 0 15px rgba(255,215,0,0.2); }
        .vote-btn { background: transparent; border: none; color: #ccc; cursor: pointer; transition: all 0.2s; font-size: 1.1rem; padding: 4px; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
        .vote-btn.upvote:hover { background: rgba(255, 68, 68, 0.15); color: #ff4444; transform: scale(1.1); }
        .vote-btn.upvote.active { color: #ff4444; text-shadow: 0 0 10px #ff4444; }
        .vote-btn.downvote:hover { background: rgba(68, 136, 255, 0.15); color: #4488ff; transform: scale(1.1); }
        .vote-btn.downvote.active { color: #4488ff; text-shadow: 0 0 10px #4488ff; }
        .vote-score { color: #fff; font-size: 1rem; font-family: var(--font-header); min-width: 24px; text-align: center; font-weight: bold; margin: 0 4px; }
        
        /* --- LIGHTBOX REDESIGN --- */
        #lightbox {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.95); z-index: 9000;
            display: none; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.3s;
        }
        #lightbox.active { opacity: 1; }
        #lightbox-main {
            position: relative; flex: 1; height: 100%; display: flex;
            align-items: center; justify-content: center;
        }
        #lightbox-img { max-width: 90%; max-height: 90%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,1); border: 1px solid rgba(255,215,0,0.2); }
        .lb-nav {
            position: absolute; top: 50%; transform: translateY(-50%);
            background: rgba(0,0,0,0.5); border: 1px solid rgba(255,215,0,0.3);
            color: var(--accent-color); width: 50px; height: 50px; border-radius: 50%;
            font-size: 1.5rem; cursor: pointer; transition: all 0.3s; display: none;
            align-items: center; justify-content: center; z-index: 100;
        }
        .lb-nav:hover { background: var(--accent-color); color: #000; transform: translateY(-50%) scale(1.1); }
        .lb-prev { left: 40px; }
        .lb-next { right: 40px; }
        .lightbox-sidepanel {
            width: 400px; height: 100%; border-left: 1px solid var(--accent-color);
            background: rgba(10,10,12,0.95); display: none; flex-direction: column;
            box-sizing: border-box; overflow-y: auto; padding-bottom: 2rem;
        }
        body.lightbox-open { overflow:hidden; }
        #lightbox-counter { position:absolute; top:22px; left:50%; transform:translateX(-50%); color:#ddd; font-size:.8rem; letter-spacing:.12em; }
        .lightbox-close { position:absolute; top:18px; right:24px; z-index:9999; width:42px; height:42px; border:1px solid rgba(255,255,255,.18); border-radius:50%; background:rgba(0,0,0,.55); color:#fff; font-size:1.7rem; cursor:pointer; }
        #lightbox-details { display:flex; padding:1.5rem; gap:1rem; }
        .lightbox-meta { padding-top:3rem; }
        #lightbox-character { color:var(--accent-color); font-size:.7rem; text-transform:uppercase; letter-spacing:.16em; }
        #lightbox-title { color:#fff; font:1.5rem var(--font-header); margin:.5rem 0; }
        #lightbox-caption { color:#bbb; line-height:1.6; }
        #lightbox-tags { display:flex; flex-wrap:wrap; gap:.35rem; margin:1rem 0; }
        #lightbox-tags span { padding:.3rem .55rem; border:1px solid rgba(255,255,255,.12); border-radius:999px; color:#aaa; font-size:.7rem; }
        #lightbox-discussion-toggle { width:100%; margin-top:.5rem; }
        .lightbox-comments-panel { display:none; min-height:0; border-top:1px solid rgba(255,255,255,.08); padding-top:1rem; }
        .lightbox-comments-panel.open { display:block; }
        @media (max-width: 900px) {
            #lightbox { flex-direction: column; }
            .lightbox-sidepanel { width: 100%; height: 40%; border-left: none; border-top: 1px solid var(--accent-color); }
            #lightbox-main { height: 60%; }
            .lb-nav { width: 40px; height: 40px; font-size: 1.2rem; }
            .lb-prev { left: 10px; }
            .lb-next { right: 10px; }
        }

        
        body.drawer-open #app-container { padding-right: calc(400px + 2rem); }
        @media (max-width: 900px) {
            body.drawer-open #app-container { padding-right: 0.5rem; }
        }
        /* MAP OVERLAY STYLES */
        #map-svg-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 10;
            overflow: visible;
        }
        #map-nodes-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 20;
        }
        .map-node {
            position: absolute;
            width: 18px;
            height: 18px;
            transform: translate(-50%, -50%);
            pointer-events: auto;
            cursor: pointer;
            z-index: 1;
        }
        .map-node:hover,
        .map-node.active,
        .map-node.selected {
            z-index: 30;
        }
        .map-node-pin {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background:
                radial-gradient(circle at 50% 50%, #ffffff 0 25%, var(--node-color, var(--accent-color)) 28% 52%, rgba(0,0,0,0.25) 55% 100%);
            border: 3px solid color-mix(in srgb, var(--node-color, var(--accent-color)) 78%, #ffffff);
            box-shadow: 0 0 0 3px var(--node-color-soft, color-mix(in srgb, var(--accent-color) 28%, transparent)), 0 0 14px var(--node-color, var(--accent-color));
            transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
            z-index: 2;
        }
        .map-node:hover .map-node-pin {
            transform: scale(1.18);
            box-shadow: 0 0 0 4px var(--node-color-soft, color-mix(in srgb, var(--accent-color) 34%, transparent)), 0 0 18px var(--node-color, var(--accent-color)), 0 0 8px #fff;
        }
        .map-node.active .map-node-pin {
            background:
                radial-gradient(circle at 50% 50%, #ffffff 0 25%, var(--node-color, var(--accent-color)) 28% 52%, rgba(255,255,255,0.34) 55% 100%);
            box-shadow: 0 0 0 5px var(--node-color-soft, color-mix(in srgb, var(--accent-color) 36%, transparent)), 0 0 24px var(--node-color, var(--accent-color)), 0 0 10px #fff;
            transform: scale(1.36);
        }
        .map-node.selected .map-node-pin {
            box-shadow: 0 0 0 5px rgba(143, 211, 255, 0.28), 0 0 22px var(--node-color, #8fd3ff), 0 0 8px #fff;
            transform: scale(1.28);
        }
        .map-label-connector {
            position: absolute;
            top: 50%;
            left: 50%;
            width: var(--label-line-length, 0px);
            height: 1px;
            transform: rotate(var(--label-line-angle, 90deg));
            transform-origin: left center;
            opacity: 0;
            pointer-events: none;
            z-index: 3;
            background: linear-gradient(90deg, rgba(255,255,255,0.86), rgba(255,255,255,0.18));
            filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-color) 65%, transparent));
            transition: opacity 0.2s;
        }
        .map-node-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(calc(-50% + var(--label-x, 0px)), calc(-50% + var(--label-y, 22px)));
            z-index: 5;
            background: linear-gradient(135deg, rgba(12, 15, 24, 0.84), rgba(28, 24, 10, 0.68));
            backdrop-filter: blur(8px);
            color: #fff;
            padding: 3px 7px;
            border-radius: 7px;
            border: 1px solid rgba(255,255,255,0.18);
            font-size: 0.6rem;
            white-space: nowrap;
            max-width: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 18%, transparent), 0 8px 20px rgba(0,0,0,0.55), 0 0 14px color-mix(in srgb, var(--accent-color) 20%, transparent);
        }
        .map-node:hover .map-node-label,
        .map-node.active .map-node-label,
        .map-node.selected .map-node-label {
            opacity: 1;
        }
        .map-node:hover .map-label-connector,
        .map-node.active .map-label-connector,
        .map-node.selected .map-label-connector {
            opacity: 1;
        }
        .map-node.label-pos-top { --label-x: 0px; --label-y: -58px; }
        .map-node.label-pos-bottom { --label-x: 0px; --label-y: 58px; }
        .map-node.label-pos-left { --label-x: -68px; --label-y: 0px; }
        .map-node.label-pos-right { --label-x: 68px; --label-y: 0px; }
        .map-node.label-pos-top-left { --label-x: -58px; --label-y: -44px; }
        .map-node.label-pos-top-right { --label-x: 58px; --label-y: -44px; }
        .map-node.label-pos-bottom-left { --label-x: -58px; --label-y: 44px; }
        .map-node.label-pos-bottom-right { --label-x: 58px; --label-y: 44px; }
        .map-edge {
            fill: none;
            stroke: rgba(255, 255, 255, 0.15);
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            transition: stroke 0.3s, stroke-width 0.3s;
        }
        .map-edge.route-glow {
            stroke: #fff;
            stroke-width: 5;
            filter: drop-shadow(0 0 12px var(--accent-color)) drop-shadow(0 0 4px #fff);
            stroke-dasharray: 12 12;
            animation: dash-flow 0.8s linear infinite, path-pulse 1.5s ease-in-out infinite alternate;
        }
        .map-edge.route-glow.route-glow-reverse {
            animation: dash-flow-reverse 0.8s linear infinite, path-pulse 1.5s ease-in-out infinite alternate;
        }
        @keyframes dash-flow-reverse {
            to { stroke-dashoffset: 20; } /* Positive offset reverses the flow */
        }
        .map-offlane {
            fill: none;
            stroke: #72d7ff;
            stroke-width: 4;
            stroke-linecap: round;
            stroke-dasharray: 14 10;
            filter: drop-shadow(0 0 10px rgba(114, 215, 255, 0.8));
            animation: dash-flow 1.1s linear infinite;
        }
        .map-exit-marker {
            fill: #72d7ff;
            stroke: #ffffff;
            stroke-width: 2;
            filter: drop-shadow(0 0 8px rgba(114, 215, 255, 0.95));
        }
        .map-viewer.hide-labels .map-node-label {
            display: none;
        }
        .map-viewer.hide-labels .map-label-connector {
            display: none;
        }
        .map-viewer.hide-hyperlanes .map-edge {
            opacity: 0;
        }
        .map-route-info-overlay {
            position: absolute;
            z-index: 80;
            display: none;
            max-width: calc(100% - 28px);
            max-height: calc(100% - 28px);
            overflow: auto;
            padding: 1rem;
            border-radius: 18px;
            border: 1px solid color-mix(in srgb, var(--accent-color) 32%, rgba(255,255,255,0.16));
            background:
                linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
                radial-gradient(circle at top left, color-mix(in srgb, var(--accent-color) 22%, transparent), transparent 55%),
                rgba(6, 8, 14, 0.72);
            backdrop-filter: blur(18px) saturate(1.35);
            box-shadow: 0 22px 54px rgba(0,0,0,0.54), inset 0 1px 0 rgba(255,255,255,0.16), 0 0 32px color-mix(in srgb, var(--accent-color) 24%, transparent);
            color: #fff;
            pointer-events: auto;
        }
        .map-route-info-overlay::before {
            content: '';
            position: absolute;
            inset: 1px;
            border-radius: 17px;
            pointer-events: none;
            border: 1px solid rgba(255,255,255,0.08);
        }
        .map-route-info-overlay.active {
            display: block;
        }
        .map-route-info-overlay h4 {
            margin: 0 1.7rem 0.65rem 0;
            color: var(--accent-color);
            font-size: 0.95rem;
            line-height: 1.25;
            text-shadow: 0 0 16px color-mix(in srgb, var(--accent-color) 42%, transparent);
        }
        .map-route-info-close {
            position: absolute;
            top: 0.55rem;
            right: 0.55rem;
            width: 24px;
            height: 24px;
            border: 1px solid rgba(255,255,255,0.16);
            border-radius: 50%;
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.76);
            cursor: pointer;
            line-height: 1;
            backdrop-filter: blur(8px);
        }
        .map-route-info-close:hover,
        .map-route-info-close:focus-visible {
            color: #fff;
            border-color: var(--accent-color);
            outline: none;
        }
        .map-route-info-stats {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.45rem;
            margin-bottom: 0.65rem;
        }
        .map-route-info-stats span {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
            border-radius: 10px;
            background: rgba(255,255,255,0.075);
            border: 1px solid rgba(255,255,255,0.12);
            padding: 0.55rem;
            color: rgba(255,255,255,0.58);
            font-size: 0.66rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .map-route-info-stats strong {
            color: #fff;
            font-size: 0.92rem;
            letter-spacing: 0;
            text-transform: none;
        }
        .map-route-info-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }
        .map-route-info-list li {
            display: grid;
            grid-template-columns: 58px minmax(0, 1fr);
            gap: 0.45rem;
            align-items: center;
            font-size: 0.76rem;
        }
        .map-route-info-list span {
            color: rgba(255,255,255,0.48);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-size: 0.62rem;
        }
        .map-route-info-list strong {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-weight: 600;
        }
        .map-route-info-overlay p {
            margin: 0.65rem 0 0;
            color: #d9f7ff;
            font-size: 0.72rem;
            line-height: 1.45;
        }
        @keyframes path-pulse {
            0% { filter: drop-shadow(0 0 8px var(--accent-color)); }
            100% { filter: drop-shadow(0 0 18px var(--accent-color)) drop-shadow(0 0 6px #fff); }
        }
        @keyframes dash-flow {
            to { stroke-dashoffset: -20; }
        }

        /* --- NEW DOCK LAYOUT SYSTEM & SCI-FI UI --- */
        .map-dock {
            position: absolute;
            z-index: 200;
            background: rgba(4, 8, 14, 0.86);
            backdrop-filter: blur(20px) saturate(1.35);
            -webkit-backdrop-filter: blur(20px) saturate(1.35);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: transform var(--dock-transition), opacity var(--dock-transition);
            pointer-events: none;
            opacity: 0;
        }
        .map-dock.open {
            pointer-events: auto;
            opacity: 1;
        }

        /* RIGHT DOCK (Navicomputer) */
        .dock-right {
            top: 0; right: 0; bottom: 0;
            width: var(--dock-width);
            border-left: 1px solid rgba(124, 216, 255, 0.22);
            box-shadow: -8px 0 40px rgba(0,0,0,0.6), inset 1px 0 0 rgba(124,216,255,0.08);
            transform: translateX(100%);
        }
        .dock-right.open { transform: translateX(0); }

        /* LEFT DOCK (World Intel) */
        .dock-left {
            top: 110px;
            left: 20px;
            bottom: 80px;
            width: var(--dock-width);
            border: 1px solid rgba(0, 242, 254, 0.15);
            border-radius: 8px;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
            background: rgba(10, 15, 30, 0.55);
            transform: translateX(-390px);
        }
        .dock-left.open { transform: translateX(0); }

        /* 3D PLANETARY ORB */
        .planet-orb-row {
            display: flex;
            gap: 1.25rem;
            align-items: center;
            margin-bottom: 1.25rem;
        }
        .planet-orb-container {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            position: relative;
            background: radial-gradient(circle at 30% 30%, #a05a2c 0%, #3e1900 80%);
            box-shadow: 0 0 24px rgba(0, 242, 254, 0.25), inset -12px -12px 24px rgba(0, 0, 0, 0.9), inset 8px 8px 16px rgba(255, 255, 255, 0.15);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .planet-orb-texture {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255, 255, 255, 0.05) 10px, rgba(255, 255, 255, 0.05) 20px), linear-gradient(135deg, rgba(0,0,0,0.1), rgba(255,255,255,0.05));
            animation: planet-rotate 8s linear infinite;
            opacity: 0.7;
            background-size: 200% 100%;
        }
        @keyframes planet-rotate {
            0% { background-position: 0% 0%; }
            100% { background-position: -200% 0%; }
        }
        .planet-orb-desc {
            font-size: 0.78rem;
            line-height: 1.5;
            color: #94a3b8;
            flex: 1;
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            line-clamp: 4;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* INSPECTOR TABS */
        .inspector-tabs {
            display: flex;
            border-bottom: 1px solid rgba(0, 242, 254, 0.12);
            margin-bottom: 1rem;
            padding: 0.2rem 0;
            justify-content: space-between;
        }
        .inspector-tab {
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.65rem;
            font-weight: 600;
            letter-spacing: 0.1em;
            padding: 0.5rem 0.2rem;
            cursor: pointer;
            position: relative;
            transition: color 0.3s ease;
            text-transform: uppercase;
        }
        .inspector-tab:hover {
            color: rgba(0, 242, 254, 0.8);
        }
        .inspector-tab.active {
            color: #00f2fe;
            text-shadow: 0 0 8px rgba(0, 242, 254, 0.45);
        }
        .inspector-tab.active::after {
            content: '';
            position: absolute;
            bottom: -3px;
            left: 0;
            right: 0;
            height: 2px;
            background: #00f2fe;
            box-shadow: 0 0 8px #00f2fe;
            border-radius: 2px;
        }

        /* TELEMETRY TABLE */
        .telemetry-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.75rem;
            color: #cbd5e1;
            margin-bottom: 1rem;
        }
        .telemetry-row {
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            transition: background 0.2s ease;
        }
        .telemetry-row:hover {
            background: rgba(0, 242, 254, 0.03);
        }
        .telemetry-key {
            padding: 0.6rem 0.5rem;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.4);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            width: 40%;
        }
        .telemetry-val {
            padding: 0.6rem 0.5rem;
            text-align: right;
            font-weight: 500;
        }

        .planet-notes-section {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            margin-top: 0.85rem;
        }

        .planet-note-card {
            padding: 0.7rem;
            border: 1px solid rgba(0, 242, 254, 0.12);
            border-radius: 10px;
            background: rgba(0, 242, 254, 0.045);
        }

        .planet-note-label {
            display: block;
            margin-bottom: 0.35rem;
            color: #00f2fe;
            font-size: 0.64rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .planet-note-card p {
            margin: 0;
            color: #cbd5e1;
            font-size: 0.74rem;
            line-height: 1.55;
            white-space: normal;
        }

        /* QUICK ACTIONS */
        .quick-actions-section {
            border-top: 1px solid rgba(0, 242, 254, 0.12);
            padding-top: 1rem;
            margin-top: auto;
        }
        .quick-actions-kicker {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: rgba(255, 255, 255, 0.4);
            margin-bottom: 0.75rem;
        }
        .quick-actions-row {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .quick-action-btn {
            flex: 1;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #fff;
            padding: 0.5rem;
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.3rem;
        }
        .quick-action-btn:hover {
            border-color: rgba(0, 242, 254, 0.35);
            color: #00f2fe;
            background: rgba(0, 242, 254, 0.05);
        }
        .quick-action-btn.wide {
            width: 100%;
        }
        .quick-action-btn.active {
            border-color: #00f2fe;
            color: #00f2fe;
            background: rgba(0, 242, 254, 0.08);
            box-shadow: inset 0 0 6px rgba(0, 242, 254, 0.15);
        }

        /* BOTTOM DOCK (Itinerary) */
        .dock-bottom {
            left: 0; right: 0; bottom: 0;
            height: var(--dock-bottom-height);
            border-top: 1px solid rgba(124, 216, 255, 0.22);
            box-shadow: 0 -8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(124,216,255,0.08);
            transform: translateY(100%);
        }
        .dock-bottom.open { transform: translateY(0); }

        /* Dock header row */
        .dock-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid rgba(124, 216, 255, 0.1);
            flex-shrink: 0;
            background: rgba(2, 6, 12, 0.5);
        }
        .dock-header-title {
            font-family: var(--font-ui);
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            color: var(--hud-cyan);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .dock-controls {
            display: flex;
            gap: 0.5rem;
        }
        .dock-btn {
            background: transparent;
            border: none;
            color: rgba(255,255,255,0.45);
            cursor: pointer;
            font-size: 0.85rem;
            width: 26px; height: 26px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            transition: 0.2s;
        }
        .dock-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
        .dock-btn.pinned { color: var(--accent-color); }

        /* Dock scroll body */
        .dock-body {
            flex: 1;
            overflow-y: auto;
            padding: 0.85rem;
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
            scrollbar-width: thin;
            scrollbar-color: rgba(124,216,255,0.2) transparent;
        }

        /* ASTROGATION DIAL */
        .astrogation-dial {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: rgba(4, 8, 14, 0.9);
            border: 1px solid rgba(124, 216, 255, 0.25);
            box-shadow:
                0 0 18px rgba(124, 216, 255, 0.18),
                0 0 6px rgba(124, 216, 255, 0.1),
                inset 0 0 12px rgba(0,0,0,0.6);
            cursor: pointer;
            position: relative;
            transition: box-shadow 0.3s, border-color 0.3s;
            overflow: visible;
            display: flex; align-items: center; justify-content: center;
        }
        .astrogation-dial:hover,
        .astrogation-dial.open {
            border-color: rgba(124, 216, 255, 0.55);
            box-shadow:
                0 0 28px rgba(124, 216, 255, 0.35),
                0 0 10px rgba(124, 216, 255, 0.2),
                inset 0 0 12px rgba(0,0,0,0.4);
        }
        .dial-ring {
            position: absolute;
            border-radius: 50%;
            border-style: solid;
        }
        .dial-ring.outer {
            inset: 5px;
            border-width: 1px;
            border-color: rgba(124, 216, 255, 0.35) rgba(124, 216, 255, 0.1) rgba(124, 216, 255, 0.35) rgba(124, 216, 255, 0.1);
            animation: dial-spin 10s linear infinite;
        }
        .dial-ring.inner {
            inset: 13px;
            border-width: 1px;
            border-color: var(--accent-color) transparent var(--accent-color) transparent;
            animation: dial-spin-reverse 7s linear infinite;
        }
        .dial-icon {
            font-size: 0.9rem;
            color: rgba(255,255,255,0.8);
            z-index: 2;
            transition: color 0.2s;
        }
        .astrogation-dial.open .dial-icon { color: var(--hud-cyan); }
        .astrogation-dial.open .dial-ring { animation-play-state: paused; }

        @keyframes dial-spin { to { transform: rotate(360deg); } }
        @keyframes dial-spin-reverse { to { transform: rotate(-360deg); } }

        /* CARTOGRAPHER BEACON */
        .cartographer-beacon {
            position: absolute;
            bottom: 18px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 150;
        }
        .cartographer-beacon-pill {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.45rem 1rem;
            background: rgba(4, 8, 14, 0.78);
            border: 1px solid rgba(124, 216, 255, 0.2);
            border-radius: 999px;
            backdrop-filter: blur(12px);
            cursor: pointer;
            transition: all 0.25s ease;
            color: rgba(255,255,255,0.65);
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            white-space: nowrap;
        }
        .cartographer-beacon-pill:hover {
            background: rgba(124, 216, 255, 0.1);
            border-color: rgba(124, 216, 255, 0.45);
            color: #fff;
            box-shadow: 0 0 18px rgba(124, 216, 255, 0.15);
        }
        .cartographer-beacon-pill i {
            color: var(--accent-color);
            font-size: 0.8rem;
        }
        .cartographer-beacon-card {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%);
            width: 320px;
            background: rgba(4, 8, 14, 0.92);
            border: 1px solid rgba(124, 216, 255, 0.22);
            border-radius: 16px;
            padding: 1.25rem;
            backdrop-filter: blur(20px);
            box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 0 20px rgba(124,216,255,0.08);
            display: none;
            flex-direction: column;
            gap: 0.75rem;
            text-align: center;
            animation: fadeUp 0.25s ease both;
        }
        .cartographer-beacon-card.open { display: flex; }
        .cartographer-beacon-card h4 {
            font-family: var(--font-header);
            color: var(--accent-color);
            font-size: 0.95rem;
            margin: 0;
            text-shadow: 0 0 18px color-mix(in srgb, var(--accent-color) 50%, transparent);
        }
        .cartographer-beacon-card p {
            font-size: 0.78rem;
            color: rgba(255,255,255,0.6);
            line-height: 1.55;
            margin: 0;
        }

        /* CHARTS DOCK */
        .charts-dock {
            position: absolute;
            top: 48px;
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            z-index: 250;
            background: rgba(4, 8, 14, 0.92);
            border: 1px solid rgba(124, 216, 255, 0.22);
            border-top: none;
            border-radius: 0 0 16px 16px;
            backdrop-filter: blur(20px);
            padding: 0.75rem;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            min-width: 200px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.6);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.22s, transform 0.22s;
        }
        .charts-dock.open {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0);
        }
        .charts-dock .map-selector-btn {
            width: 100%;
            text-align: left;
            border-radius: 10px;
            padding: 0.55rem 0.85rem;
            background: transparent;
            color: #888;
            border: 1px solid #333;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 0.8rem;
        }
        .charts-dock .map-selector-btn.active,
        .charts-dock .map-selector-btn:hover {
            color: #000;
            background: var(--accent-color);
            border-color: var(--accent-color);
        }

        /* EDGE TRIGGERS */
        .dock-edge-trigger {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 28px;
            height: 56px;
            background: rgba(4, 8, 14, 0.72);
            border: 1px solid rgba(124,216,255,0.18);
            color: rgba(255,255,255,0.5);
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.85rem;
            transition: 0.2s;
            z-index: 180;
            backdrop-filter: blur(8px);
        }
        .dock-edge-trigger.left {
            left: 0;
            border-radius: 0 8px 8px 0;
            border-left: none;
        }
        .dock-edge-trigger:hover {
            color: var(--hud-cyan);
            border-color: rgba(124,216,255,0.4);
            background: rgba(124,216,255,0.08);
        }

        /* Routing UI styles inside dock */
        .routing-kicker {
            margin: 0;
            font-size: 0.78rem;
            color: rgba(255,255,255,0.62);
            line-height: 1.5;
        }
        .routing-section {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding-top: 0.65rem;
            border-top: 1px solid rgba(255,255,255,0.08);
        }
        .routing-field-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
        }
        .routing-field-row label {
            min-width: 62px;
            color: rgba(255,255,255,0.72);
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .dock-body input {
            width: 100%;
            background: rgba(0,0,0,0.5);
            border: 1px solid rgba(255,255,255,0.1);
            color: #fff;
            padding: 9px 12px;
            border-radius: 10px;
            font-family: var(--font-body);
        }
        .dock-body input:focus {
            border-color: var(--accent-color);
            outline: none;
        }
        .routing-inline-actions,
        .routing-main-actions,
        .routing-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
        }
        .routing-btn {
            border: 1px solid rgba(255,255,255,0.12);
            background: rgba(255,255,255,0.04);
            color: #fff;
            border-radius: 999px;
            padding: 0.5rem 0.85rem;
            cursor: pointer;
            font-size: 0.75rem;
            transition: 0.2s ease;
        }
        .routing-btn:hover,
        .routing-btn:focus-visible {
            border-color: var(--accent-color);
            color: var(--accent-color);
            outline: none;
        }
        .routing-btn.primary {
            background: linear-gradient(135deg, var(--accent-color), #fff2b8);
            border-color: transparent;
            color: #050505;
            font-weight: 700;
        }
        .routing-status {
            border-radius: 12px;
            padding: 0.7rem 0.85rem;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            font-size: 0.8rem;
            color: rgba(255,255,255,0.78);
            line-height: 1.45;
        }
        .routing-status.is-error {
            color: #ffd4d4;
            border-color: rgba(255, 90, 90, 0.35);
            background: rgba(120, 16, 16, 0.28);
        }
        .routing-status.is-success {
            color: #dff7df;
            border-color: rgba(76, 175, 80, 0.35);
            background: rgba(28, 74, 31, 0.28);
        }
        .routing-status.is-warning {
            color: #eaf9ff;
            border-color: rgba(114, 215, 255, 0.35);
            background: rgba(10, 50, 66, 0.35);
        }
        .routing-node-card,
        .routing-summary {
            border-radius: 14px;
            border: 1px solid rgba(255,255,255,0.08);
            background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
            padding: 0.9rem;
        }
        .routing-node-card.empty,
        .routing-summary.empty {
            color: rgba(255,255,255,0.55);
        }
        .routing-node-card h4,
        .routing-summary h4 {
            margin: 0 0 0.45rem 0;
            font-size: 0.92rem;
            color: #fff;
        }
        .routing-node-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            margin: 0.5rem 0 0.7rem;
        }
        .routing-meta-pill {
            border-radius: 999px;
            padding: 0.28rem 0.55rem;
            background: rgba(255,255,255,0.07);
            color: rgba(255,255,255,0.78);
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .routing-summary-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.65rem;
            margin-bottom: 0.8rem;
        }
        .routing-stat {
            border-radius: 12px;
            padding: 0.75rem;
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.06);
        }
        .routing-stat-label {
            display: block;
            color: rgba(255,255,255,0.56);
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 0.28rem;
        }
        .routing-stat-value {
            display: block;
            color: #fff;
            font-size: 0.95rem;
            font-weight: 600;
        }
        .routing-itinerary {
            max-height: 240px;
            overflow-y: auto;
            border-top: 1px solid rgba(255,255,255,0.1);
            padding-top: 10px;
            display: none;
        }
        .routing-itinerary.active {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .itinerary-step {
            font-size: 0.82rem;
            color: #ccc;
            display: flex;
            align-items: center;
            gap: 8px;
            justify-content: space-between;
            border-radius: 10px;
            padding: 0.45rem 0.55rem;
            background: rgba(255,255,255,0.03);
        }
        .itinerary-step-name {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }
        .itinerary-step-name span:last-child {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .itinerary-step-distance {
            color: rgba(255,255,255,0.5);
            font-size: 0.72rem;
        }
        .itinerary-step::before {
            content: '';
            width: 6px;
            height: 6px;
            background: var(--accent-color);
            border-radius: 50%;
        }
        .itinerary-step.origin::before { background: #4caf50; }
        .itinerary-step.destination::before { background: #ff5252; }
        .itinerary-step.offlane::before { background: #72d7ff; }

        /* Media Queries / Responsive overrides */
        @media (max-width: 1100px) {
            .map-console-shell {
                --dock-width: 260px;
                --dock-bottom-height: 200px;
            }
        }
        @media (max-width: 720px) {
            .map-console-shell {
                --dock-width: 100%;
                --dock-bottom-height: 280px;
            }
            .dock-right, .dock-left {
                top: auto;
                left: 0;
                right: 0;
                bottom: 0;
                height: var(--dock-bottom-height);
                border: none;
                border-top: 1px solid rgba(124, 216, 255, 0.22);
                transform: translateY(100%);
            }
            .dock-right.open, .dock-left.open {
                transform: translateY(0);
            }
            .dock-edge-trigger {
                top: auto;
                bottom: 18px;
                transform: none;
            }
            .dock-edge-trigger.left {
                left: 18px;
                border-radius: 8px;
                border-left: 1px solid rgba(124,216,255,0.18);
            }
            .map-controls {
                bottom: 14px;
                right: 14px;
            }
        }
        @media (prefers-reduced-motion: reduce) {
            * {
                transition-duration: 0ms !important;
                animation-duration: 0ms !important;
            }
            .dial-ring {
                animation: none !important;
            }
        }

        /* ============================================================
           MAP HUB SCREEN
        ============================================================ */
        .map-hub-screen {
            display: flex;
            flex-direction: column;
            gap: 2rem;
            padding-bottom: 3rem;
            animation: fadeUp 0.45s ease both;
        }
        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(18px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .map-hub-header {
            text-align: center;
            padding: 2rem 1rem 0.5rem;
        }
        .map-hub-title {
            font-family: var(--font-header);
            font-size: clamp(1.6rem, 4vw, 2.4rem);
            color: var(--accent-color);
            letter-spacing: 0.04em;
            margin-bottom: 0.4rem;
            text-shadow: 0 0 30px color-mix(in srgb, var(--accent-color) 50%, transparent);
        }
        .map-hub-subtitle {
            font-family: var(--font-body);
            color: rgba(255,255,255,0.45);
            font-size: 0.9rem;
            letter-spacing: 0.06em;
        }

        .map-hub-search-wrapper {
            position: relative;
            max-width: 520px;
            margin: 0 auto;
            width: 100%;
            padding: 0 1rem;
        }
        .map-hub-search {
            width: 100%;
            background: rgba(15, 15, 20, 0.75);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 40px;
            padding: 0.65rem 1.2rem 0.65rem 3rem;
            color: #fff;
            font-family: var(--font-ui);
            font-size: 0.9rem;
            outline: none;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            transition: border-color 0.2s, box-shadow 0.2s;
            box-sizing: border-box;
        }
        .map-hub-search::placeholder { color: rgba(255,255,255,0.3); }
        .map-hub-search:focus {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 18%, transparent);
        }
        .map-hub-search-icon {
            position: absolute;
            left: calc(1rem + 14px);
            top: 50%;
            transform: translateY(-50%);
            color: rgba(255,255,255,0.35);
            font-size: 0.85rem;
            pointer-events: none;
        }

        .map-hub-section {
            padding: 0 0.5rem;
        }
        .map-hub-section-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
            padding: 0 0.5rem;
        }
        .map-hub-section-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            flex-shrink: 0;
        }
        .hub-section-galactic .map-hub-section-icon { background: rgba(120,80,255,0.25); color: #a78bfa; }
        .hub-section-regional .map-hub-section-icon { background: rgba(56,189,248,0.2); color: #38bdf8; }
        .hub-section-local    .map-hub-section-icon { background: rgba(52,211,153,0.2); color: #34d399; }

        .map-hub-section-title {
            font-family: var(--font-header);
            font-size: 1rem;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            opacity: 0.85;
        }
        .hub-section-galactic .map-hub-section-title { color: #a78bfa; }
        .hub-section-regional .map-hub-section-title { color: #38bdf8; }
        .hub-section-local    .map-hub-section-title { color: #34d399; }

        .map-hub-section-line {
            flex: 1;
            height: 1px;
            background: rgba(255,255,255,0.07);
        }
        .map-hub-count-pill {
            font-family: var(--font-ui);
            font-size: 0.72rem;
            padding: 2px 8px;
            border-radius: 10px;
            background: rgba(255,255,255,0.07);
            color: rgba(255,255,255,0.4);
        }

        .map-hub-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 1.25rem;
            padding: 0 0.5rem;
        }

        .map-hub-card {
            position: relative;
            border-radius: 16px;
            overflow: hidden;
            background: rgba(15, 15, 20, 0.75);
            border: 1px solid rgba(255,255,255,0.08);
            cursor: pointer;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            transition: transform 0.28s cubic-bezier(.2,.8,.3,1.1), box-shadow 0.28s ease, border-color 0.25s;
            will-change: transform;
        }
        .map-hub-card:hover {
            transform: translateY(-5px) scale(1.015);
            border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
            box-shadow: 0 16px 48px rgba(0,0,0,0.45),
                        0 0 0 1px color-mix(in srgb, var(--accent-color) 30%, transparent),
                        0 0 28px color-mix(in srgb, var(--accent-color) 15%, transparent);
        }
        .map-hub-card:active { transform: scale(0.98); }

        .map-hub-thumb {
            width: 100%;
            aspect-ratio: 16/9;
            object-fit: cover;
            display: block;
            background: #0a0a0e;
            transition: filter 0.3s;
        }
        .map-hub-card:hover .map-hub-thumb { filter: brightness(1.1) saturate(1.1); }
        .map-hub-thumb-placeholder {
            width: 100%;
            aspect-ratio: 16/9;
            background: radial-gradient(ellipse at center, rgba(255,255,255,0.04) 0%, #0a0a0e 70%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.12);
            font-size: 2.5rem;
        }

        .map-hub-card-body {
            padding: 0.9rem 1rem 1rem;
        }
        .map-hub-card-name {
            font-family: var(--font-header);
            font-size: 1.05rem;
            color: #fff;
            margin-bottom: 0.5rem;
            line-height: 1.3;
        }
        .map-hub-card-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            align-items: center;
        }
        .map-hub-badge {
            font-family: var(--font-ui);
            font-size: 0.68rem;
            letter-spacing: 0.06em;
            padding: 3px 9px;
            border-radius: 10px;
            text-transform: uppercase;
            font-weight: 600;
        }
        .map-hub-badge.type-galactic { background: rgba(167,139,250,0.15); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.25); }
        .map-hub-badge.type-regional { background: rgba(56,189,248,0.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,0.22); }
        .map-hub-badge.type-local    { background: rgba(52,211,153,0.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.22); }
        .map-hub-badge.primary       { background: color-mix(in srgb, var(--accent-color) 15%, transparent); color: var(--accent-color); border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent); }
        .map-hub-badge.stat          { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.1); }

        .map-hub-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
            pointer-events: none;
        }
        .map-hub-empty {
            grid-column: 1 / -1;
            padding: 2.5rem;
            text-align: center;
            color: rgba(255,255,255,0.3);
            font-family: var(--font-body);
            font-size: 0.9rem;
        }
        .map-hub-no-results {
            text-align: center;
            padding: 3rem 1rem;
            color: rgba(255,255,255,0.3);
            font-family: var(--font-body);
            display: none;
        }
        .map-hub-no-results i { font-size: 2rem; margin-bottom: 0.75rem; display: block; }

        /* Cross-map search hint in navicomputer */
        .routing-cross-map-hint {
            margin-top: 0.6rem;
            padding: 0.6rem 0.8rem;
            background: rgba(56,189,248,0.08);
            border: 1px solid rgba(56,189,248,0.22);
            border-radius: 8px;
            font-family: var(--font-ui);
            font-size: 0.78rem;
            color: #7dd3fc;
            display: none;
        }
        .routing-cross-map-hint.visible { display: block; }
        .routing-cross-map-hint strong { display: block; margin-bottom: 0.3rem; color: #bae6fd; }
        .routing-cross-map-hint .cross-map-links { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
        .routing-cross-map-link {
            background: rgba(56,189,248,0.12);
            border: 1px solid rgba(56,189,248,0.25);
            border-radius: 6px;
            padding: 3px 9px;
            font-size: 0.73rem;
            color: #7dd3fc;
            cursor: pointer;
            transition: background 0.15s;
            font-family: var(--font-ui);
        }
        .routing-cross-map-link:hover { background: rgba(56,189,248,0.22); }

        /* Map viewer back-to-hub bar */
        .map-hub-backbar {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0;
            flex-shrink: 0;
        }
        .map-hub-back-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 8px;
            padding: 0.4rem 0.85rem;
            color: rgba(255,255,255,0.7);
            font-family: var(--font-ui);
            font-size: 0.82rem;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .map-hub-back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

        @media (max-width: 720px) {
            .map-hub-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
                gap: 0.85rem;
            }
        }

        /* --- INTERACTIVE 3D SCROLLING DECK VIEW --- */
        .decks-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 5rem 3.5rem; /* Increased horizontal gap to fully clear the wider fan */
            max-width: 1100px;
            margin: 3rem auto 5rem;
            padding: 0 1.5rem;
        }

        .card-deck {
            position: relative;
            aspect-ratio: 3 / 4; 
            cursor: pointer;
            perspective: 1500px;
            transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        .card-deck:hover {
            z-index: 100; /* Pop cleanly above adjacent rows */
            transform: translateY(-5px);
        }

        .deck-card {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            background: #0f0f0f;
            transform-origin: bottom center; 
            /* Smooth transition for when we dynamically re-index cards via JavaScript */
            transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, box-shadow 0.3s ease;
        }

        .deck-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center top;
            transition: filter 0.3s ease;
        }

        /* --- INDICATOR PILLS (TOP-RIGHT CORNER) --- */
        .deck-scroll-indicator {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--accent-color);
            font-family: var(--font-header);
            font-size: 0.75rem;
            padding: 4px 10px;
            border-radius: 20px;
            letter-spacing: 0.5px;
            z-index: 110;
            opacity: 0;
            transform: translateY(-5px);
            transition: opacity 0.3s ease, transform 0.3s ease;
            pointer-events: none;
        }

        .card-deck:hover .deck-scroll-indicator {
            opacity: 1;
            transform: translateY(0);
        }

        /* --- TITLES --- */
        .card-deck-title {
            position: absolute;
            bottom: -45px;
            left: 50%;
            transform: translateX(-50%);
            width: 85%;
            text-align: center;
            font-family: var(--font-header);
            color: #fff;
            font-size: 0.95rem;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            background: rgba(15, 15, 15, 0.9);
            backdrop-filter: blur(10px);
            padding: 10px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            z-index: 110;
            transition: all 0.3s ease;
            pointer-events: none;
        }

        .card-deck:hover .card-deck-title {
            color: var(--accent-color);
            border-color: rgba(255, 215, 0, 0.3);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        }
        @media (max-width: 760px) {
            .gallery-archive-header,.gallery-section-heading { align-items:flex-start; flex-direction:column; }
            .gallery-controls { position:relative; top:auto; flex-wrap:wrap; }
            .gallery-search { flex-basis:100%; }
            .gallery-result-count { margin-left:auto; }
            .gallery-character-masthead { grid-template-columns:100px 1fr; flex-direction:row; }
            .gallery-character-masthead .hero-img-container { width:100px; }
            .gallery-character-masthead .hero-bio { display:none; }
            .decks-grid { grid-template-columns:minmax(0,1fr); padding:0 2rem; }
            .deck-scroll-indicator { opacity:1; transform:none; }
            .archive-titlebar { padding:.65rem .8rem; }
            .archive-titlebar h1 { font-size:1.3rem; }
            .archive-feature { grid-template-columns:105px 1fr; height:auto; min-height:300px; }
            .archive-feature-portrait { min-height:0; }
            .archive-feature-copy { padding:1.2rem; border-right:0; }
            .archive-feature-copy h2 { font-size:2rem; }
            .archive-feature-copy p { -webkit-line-clamp:3; line-clamp:3; font-size:.85rem; margin:.8rem 0; }
            .archive-feature-facts { gap:.5rem; }
            .archive-browser-panel { grid-column:1/-1; min-height:360px; border-left:0; border-top:1px solid rgba(255,255,255,.08); }
            .archive-deck-grid { grid-template-columns:repeat(3,minmax(0,1fr)); max-height:330px; padding-inline:0; }
            .archive-deck-copy em { display:none; }
        }
        @media (prefers-reduced-motion: reduce) {
            .deck-card,.card-deck,.gallery-item,.gallery-card-caption { transition-duration:.01ms !important; }
            .card-deck:hover { transform:none; }
        }

        /* ============================================================
           LOADER-THEMED LANDING PAGE ADJUSTMENTS
           ============================================================ */
        body.home-active {
            --accent-color: #00f2fe; /* Matches the cyan glow */
            background-color: #050508;
        }

        /* Update default particle container to feel deeper and moodier */
        body.home-active #particle-canvas {
            opacity: 0.45;
        }

        /* Story cards visual upgrade */
        body.home-active .story-card {
            border-color: rgba(0, 242, 254, 0.12);
            background: rgba(10, 10, 15, 0.65);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 
                        inset 0 0 15px rgba(0, 242, 254, 0.03);
            border-radius: 12px;
        }

        body.home-active .story-card:hover {
            border-color: #00f2fe;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 
                        0 0 15px rgba(0, 242, 254, 0.2),
                        inset 0 0 20px rgba(123, 47, 247, 0.08);
        }

        body.home-active .story-card:hover .card-title {
            /* Subtle gradient effect on card titles during hover */
            background: linear-gradient(135deg, #ffffff, #00f2fe);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        /* Author block visual upgrade */
        body.home-active .author-section {
            border-color: rgba(123, 47, 247, 0.2);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 
                        0 0 25px rgba(123, 47, 247, 0.05);
            background: linear-gradient(180deg, rgba(15, 15, 25, 0.8) 0%, rgba(5, 5, 8, 0.95) 100%);
            border-radius: 16px;
        }

        body.home-active .author-info h2 {
            color: #00f2fe;
            text-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
        }

        body.home-active .link-row {
            border-color: rgba(255, 255, 255, 0.05);
        }

        body.home-active .link-row:hover {
            border-color: #00f2fe;
            background: rgba(0, 242, 254, 0.04);
            box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
        }

        body.home-active .link-note {
            color: #7b2ff7; /* Purple accent for internal labels */
        }

        /* Galactic History: sub-era timebar and eventful-year navigator */
        .galactic-console-shell.is-focused .galactic-era-focus,
        .galactic-era-focus {
            display: flex;
            flex-direction: column;
            min-height: 100%;
            gap: 1rem;
            overflow: visible;
        }

        .galactic-era-focus > .galactic-focus-art {
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(4, 8, 13, 0.78), rgba(4, 8, 13, 0.96)), var(--galactic-focus-era-image) center / cover no-repeat;
            opacity: 0.72;
            pointer-events: none;
        }

        .galactic-era-overview-strip,
        .galactic-year-navigator {
            position: relative;
            z-index: 1;
            border: 1px solid rgba(220, 238, 255, 0.13);
            border-radius: 8px;
            background: rgba(7, 12, 18, 0.86);
            backdrop-filter: blur(18px) saturate(1.18);
            box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
        }

        .galactic-era-overview-strip {
            display: grid;
            grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
            gap: 1.2rem;
            padding: 1.25rem;
        }

        .galactic-era-overview-copy {
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 0.55rem;
            min-width: 0;
        }

        .galactic-era-overview-copy p {
            max-width: 440px;
            margin: 0.4rem 0 0;
            color: rgba(225, 235, 240, 0.78);
            line-height: 1.55;
        }

        .galactic-frequency-panel {
            min-width: 0;
            padding: 0.9rem;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            background: linear-gradient(180deg, rgba(14, 21, 30, 0.88), rgba(6, 10, 15, 0.9));
        }

        .galactic-frequency-header,
        .galactic-year-nav-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
        }

        .galactic-frequency-title {
            color: #f4efe8;
            font-family: var(--font-header);
            font-size: 1rem;
            line-height: 1.2;
            text-transform: uppercase;
        }

        .galactic-frequency-meta {
            flex: 0 0 auto;
            padding: 0.35rem 0.55rem;
            border: 1px solid rgba(157, 215, 255, 0.22);
            border-radius: 6px;
            color: #cdefff;
            font-size: 0.68rem;
            text-transform: uppercase;
        }

        .galactic-timebar {
            position: relative;
            display: flex;
            align-items: stretch;
            min-height: 190px;
            margin-top: 1rem;
            padding: 0.65rem 0.25rem 0;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }

        .galactic-timebar::before {
            content: "";
            position: absolute;
            left: 0.25rem;
            right: 0.25rem;
            bottom: 72px;
            height: 1px;
            background: linear-gradient(90deg, rgba(157, 215, 255, 0.12), rgba(239, 212, 170, 0.58), rgba(157, 215, 255, 0.12));
        }

        .galactic-timebar-subera {
            position: relative;
            flex: 1 1 var(--subera-width);
            min-width: 92px;
            min-height: 176px;
            border: 0;
            border-left: 1px solid rgba(255, 255, 255, 0.08);
            background: linear-gradient(to top, rgba(5, 8, 12, 0.92), rgba(5, 8, 12, 0.42)), var(--galactic-subera-image) center / cover no-repeat;
            color: #eef7fb;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            gap: 0.24rem;
            padding: 0.75rem 0.65rem;
            text-align: left;
            transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
        }

        .galactic-timebar-subera:first-child { border-left: 0; border-radius: 8px 0 0 8px; }
        .galactic-timebar-subera:last-child { border-radius: 0 8px 8px 0; }
        .galactic-timebar-subera:hover,
        .galactic-timebar-subera.active {
            z-index: 2;
            transform: translateY(-3px);
            box-shadow: inset 0 0 0 1px rgba(157, 215, 255, 0.66), 0 14px 34px rgba(0, 0, 0, 0.28);
            filter: saturate(1.12);
        }

        .galactic-timebar-bar {
            position: absolute;
            left: 50%;
            bottom: 72px;
            width: min(42px, calc(100% - 18px));
            height: var(--subera-height);
            transform: translateX(-50%);
            border-radius: 999px 999px 0 0;
            background: linear-gradient(180deg, rgba(255, 221, 177, 0.88), rgba(111, 188, 255, 0.25));
            box-shadow: 0 0 24px rgba(255, 218, 171, 0.18);
        }

        .galactic-timebar-label,
        .galactic-timebar-subera strong,
        .galactic-timebar-subera small {
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
        }

        .galactic-timebar-label {
            width: fit-content;
            padding: 0.16rem 0.32rem;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 4px;
            color: #cdefff;
            font-size: 0.62rem;
        }

        .galactic-timebar-subera strong {
            font-family: var(--font-header);
            font-size: 0.82rem;
            line-height: 1.12;
            overflow-wrap: anywhere;
        }

        .galactic-timebar-subera small {
            color: rgba(232, 241, 247, 0.74);
            font-size: 0.66rem;
        }

        .galactic-year-navigator {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
            gap: 1rem;
            padding: 1.25rem;
        }

        .galactic-year-nav-header {
            grid-column: 1 / -1;
        }

        .galactic-year-controls {
            display: flex;
            align-items: center;
            gap: 0.45rem;
        }

        .galactic-year-controls button {
            width: 36px;
            height: 36px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.08);
            color: #eff8ff;
            cursor: pointer;
        }

        .galactic-year-controls button:hover { background: rgba(157, 215, 255, 0.16); }

        #galactic-year-counter {
            min-width: 64px;
            color: #cbd6db;
            font-size: 0.78rem;
            text-align: center;
        }

        .galactic-year-stage {
            position: relative;
            min-height: 360px;
            padding: 1rem 0 1rem 1rem;
        }

        .galactic-year-stage::before {
            content: "";
            position: absolute;
            left: 7.25rem;
            top: 1rem;
            bottom: 1rem;
            width: 2px;
            background: linear-gradient(180deg, rgba(157, 215, 255, 0.05), rgba(239, 212, 170, 0.62), rgba(157, 215, 255, 0.05));
        }

        .galactic-year-event-group {
            display: none;
            grid-template-columns: 6.5rem minmax(0, 1fr);
            gap: 2.1rem;
            align-items: start;
        }

        .galactic-year-event-group.active { display: grid; }

        .galactic-year-node {
            position: sticky;
            top: 0;
            display: grid;
            gap: 0.25rem;
            padding: 0.7rem 0.6rem;
            border: 1px solid rgba(239, 212, 170, 0.3);
            border-radius: 8px;
            background: rgba(18, 21, 27, 0.88);
            color: #ffe3bc;
            text-align: center;
        }

        .galactic-year-node span {
            font-family: var(--font-header);
            font-size: 1rem;
        }

        .galactic-year-node small {
            color: rgba(240, 235, 225, 0.66);
            font-size: 0.66rem;
            text-transform: uppercase;
        }

        .galactic-year-branches {
            display: grid;
            gap: 0.8rem;
        }

        .galactic-year-event {
            position: relative;
            display: grid;
            gap: 0.35rem;
            min-height: 86px;
            padding: 0.85rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.065);
            color: #eff8ff;
            text-align: left;
            cursor: pointer;
        }

        .galactic-year-event::before {
            content: "";
            position: absolute;
            left: -2.1rem;
            top: 1.6rem;
            width: 2.1rem;
            height: 1px;
            background: rgba(239, 212, 170, 0.44);
        }

        .galactic-year-branch-dot {
            position: absolute;
            left: -2.35rem;
            top: calc(1.6rem - 4px);
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: #ffe0ad;
            box-shadow: 0 0 14px rgba(255, 224, 173, 0.72);
        }

        .galactic-year-event:hover,
        .galactic-year-event.active {
            border-color: rgba(157, 215, 255, 0.68);
            background: rgba(38, 48, 61, 0.78);
        }

        .galactic-year-event strong {
            font-size: 0.92rem;
            color: #fff;
        }

        .galactic-year-event span:not(.galactic-year-branch-dot) {
            color: rgba(220, 229, 235, 0.76);
            font-size: 0.78rem;
            line-height: 1.45;
        }

        .galactic-year-navigator .galactic-event-detail {
            margin-top: 0;
            min-height: 360px;
            height: auto;
            flex-basis: auto;
            background: linear-gradient(90deg, rgba(8, 13, 19, 0.9), rgba(8, 13, 19, 0.62)), var(--galactic-detail-image) center / cover no-repeat;
        }

        .galactic-year-navigator .galactic-event-detail p {
            max-width: 100%;
            display: block;
            -webkit-line-clamp: unset;
        }

        @media (max-width: 900px) {
            .galactic-era-overview-strip,
            .galactic-year-navigator {
                grid-template-columns: 1fr;
            }

            .galactic-timebar {
                overflow-x: auto;
                padding-bottom: 0.5rem;
            }

            .galactic-timebar-subera {
                flex-basis: 170px;
            }

            .galactic-year-stage {
                padding-left: 0;
            }

            .galactic-year-stage::before {
                left: 5.75rem;
            }

            .galactic-year-event-group {
                grid-template-columns: 5.25rem minmax(0, 1fr);
                gap: 1.5rem;
            }
        }

        /* Galactic History technical-spec implementation - AAA Codex Rebuild */
        @keyframes aaaFadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes aaaFadeInLeft {
            from { opacity: 0; transform: translateX(-40px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes aaaFadeInRight {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes aaaPulseGlow {
            0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.4)); }
            50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8)); }
        }

        @keyframes aaaScanlineMove {
            0% { top: -100px; }
            100% { top: 100%; }
        }

        @keyframes drawTimeline {
            to { stroke-dashoffset: 0; }
        }

        .aaa-codex-shell {
            position: relative;
            min-height: 100vh;
            margin: -1rem;
            color: #E2E8F0;
            background: transparent;
            overflow-x: hidden;
            font-family: var(--font-body);
            z-index: 1;
        }

        .aaa-codex-bg {
            position: fixed;
            inset: 0;
            background-color: #020408;
            background-image: var(--bg-image);
            background-position: center;
            background-size: cover;
            filter: blur(8px) brightness(0.38);
            transition: background-image 1s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 0;
            pointer-events: none;
        }

        .aaa-codex-bg::after {
            content: "";
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 50%, rgba(2, 4, 8, 0.15) 0%, rgba(2, 4, 8, 0.75) 90%);
        }

        .aaa-codex-scanline {
            pointer-events: none;
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
            background-size: 100% 4px;
            z-index: 999;
            opacity: 0.15;
        }

        .aaa-codex-scanline-beam {
            position: fixed;
            left: 0;
            width: 100%;
            height: 120px;
            background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.02) 50%, transparent);
            z-index: 998;
            pointer-events: none;
            animation: aaaScanlineMove 10s linear infinite;
        }

        .aaa-codex-ambient-glow {
            position: fixed;
            pointer-events: none;
            inset: 0;
            background: radial-gradient(circle 600px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(212, 175, 55, 0.05) 0%, rgba(6, 182, 212, 0.02) 50%, transparent 100%);
            z-index: 1;
            transition: background 0.1s ease;
        }

        .aaa-codex-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: transparent;
            border: 0;
            color: #94A3B8;
            font-family: var(--font-mono, monospace);
            font-size: 0.72rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            cursor: pointer;
            transition: color 0.3s;
            margin-bottom: 1.5rem;
            text-align: left;
        }

        .aaa-codex-back-btn:hover {
            color: #FFE4B5;
        }

        .aaa-codex-topbar {
            position: relative;
            z-index: 10;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            max-width: 1400px;
            margin: 0 auto;
            padding: 1.5rem 2rem 0;
        }

        .aaa-codex-search-wrapper {
            position: relative;
            width: 320px;
            align-self: flex-end;
        }

        .aaa-codex-search-wrapper i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.3);
            font-size: 0.85rem;
        }

        .aaa-codex-search {
            width: 100%;
            background: rgba(10, 15, 30, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 2px;
            padding: 0.65rem 1rem 0.65rem 2.5rem;
            color: #FFFFFF;
            font-size: 0.85rem;
            outline: none;
            transition: border-color 0.3s, background-color 0.3s;
        }

        .aaa-codex-search:focus {
            border-color: rgba(212, 175, 55, 0.5);
            background: rgba(10, 15, 30, 0.8);
        }

        /* View 1: Era Grid matching screenshot 1 */
        .aaa-codex-header-row {
            position: relative;
            z-index: 2;
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            max-width: 1400px;
            margin: 2rem auto 0;
            padding: 2rem 2rem 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            text-align: left;
        }

        .aaa-codex-header-row h2 {
            font-family: var(--font-header);
            font-size: 3rem;
            font-weight: 300;
            color: #FFFFFF;
            margin: 0.25rem 0 0.5rem;
            letter-spacing: 0.03em;
            line-height: 1;
            text-transform: uppercase;
        }

        .aaa-codex-header-row .viewport-kicker {
            font-family: var(--font-mono, monospace);
            font-size: 0.72rem;
            color: rgba(255, 255, 255, 0.4);
            letter-spacing: 0.25em;
            text-transform: uppercase;
        }

        .aaa-codex-subtitle {
            margin: 0;
            font-size: 0.95rem;
            color: #94A3B8;
        }

        .aaa-codex-era-grid {
            position: relative;
            z-index: 2;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1.5rem;
            max-width: 1400px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        @media (max-width: 1200px) {
            .aaa-codex-era-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .aaa-codex-era-grid {
                grid-template-columns: 1fr;
            }
        }

        .aaa-codex-era-card {
            position: relative;
            background: 
                linear-gradient(to top, rgba(2, 4, 8, 0.95) 0%, rgba(2, 4, 8, 0.3) 60%, rgba(2, 4, 8, 0.5) 100%),
                var(--card-bg) center / cover no-repeat;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
            transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            cursor: pointer;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            min-height: 250px;
            padding: 1.5rem;
            overflow: hidden;
            text-align: left;
        }

        .aaa-codex-era-card:hover {
            border-color: rgba(212, 175, 55, 0.45);
            box-shadow: 0 12px 35px rgba(212, 175, 55, 0.12);
            transform: translateY(-4px);
        }

        .aaa-codex-era-card .card-index-box {
            position: relative;
            z-index: 2;
            align-self: flex-start;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 3px;
            padding: 2px 6px;
            font-family: var(--font-mono, monospace);
            font-size: 0.72rem;
            color: rgba(255, 255, 255, 0.5);
            background: rgba(2, 4, 8, 0.4);
        }

        .aaa-codex-era-card h3 {
            position: relative;
            z-index: 2;
            font-family: var(--font-header);
            font-size: 1.45rem;
            color: #FFFFFF;
            margin: 0.75rem 0 0.25rem;
            font-weight: 300;
            line-height: 1.2;
            text-transform: uppercase;
            letter-spacing: 0.02em;
        }

        .aaa-codex-era-card .card-range {
            position: relative;
            z-index: 2;
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            letter-spacing: 0.02em;
        }

        .aaa-codex-era-card .card-records {
            position: relative;
            z-index: 2;
            font-family: var(--font-mono, monospace);
            font-size: 0.7rem;
            color: rgba(212, 175, 55, 0.85);
            letter-spacing: 0.08em;
            margin-top: 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding-top: 0.5rem;
            text-transform: uppercase;
        }

        /* View 2: Sub-Era Selection Split Pane */
        .aaa-codex-split-pane {
            position: relative;
            z-index: 2;
            display: grid;
            grid-template-columns: minmax(360px, 35%) 1fr;
            min-height: calc(100vh - 86px);
            gap: 0;
            max-width: 1600px;
            margin: 0 auto;
            padding: 0 2rem 2rem;
        }

        .aaa-codex-left-index {
            overflow-y: auto;
            max-height: calc(100vh - 120px);
            padding-right: 1.5rem;
            border-right: 1px solid rgba(255, 255, 255, 0.05);
        }

        .aaa-codex-left-index::-webkit-scrollbar {
            width: 4px;
        }

        .aaa-codex-left-index::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.01);
        }

        .aaa-codex-left-index::-webkit-scrollbar-thumb {
            background: rgba(212, 175, 55, 0.2);
            border-radius: 99px;
        }

        .aaa-codex-left-index::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 175, 55, 0.6);
        }

        .aaa-codex-index-row {
            position: relative;
            display: flex;
            flex-direction: column;
            width: 100%;
            padding: 1.25rem 1.5rem;
            background: rgba(10, 15, 30, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.05);
            margin-bottom: 0.75rem;
            cursor: pointer;
            text-align: left;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
            animation: aaaFadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
        }

        .aaa-codex-index-row:hover,
        .aaa-codex-index-row.active {
            background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, rgba(10, 15, 30, 0.6) 100%);
            border-color: rgba(212, 175, 55, 0.4);
            padding-left: 2rem;
        }

        .aaa-codex-index-row::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: rgba(212, 175, 55, 0.8);
            transform: scaleY(0);
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .aaa-codex-index-row:hover::before,
        .aaa-codex-index-row.active::before {
            transform: scaleY(1);
        }

        .aaa-codex-index-row .row-num {
            font-family: var(--font-mono, monospace);
            font-size: 0.7rem;
            color: rgba(212, 175, 55, 0.6);
            margin-bottom: 0.25rem;
        }

        .aaa-codex-index-row strong {
            font-family: var(--font-header);
            font-size: 1.15rem;
            color: #FFFFFF;
            font-weight: 300;
        }

        .aaa-codex-index-row .row-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            color: #94A3B8;
            margin-top: 0.5rem;
        }

        .aaa-codex-right-viewport {
            padding-left: 3rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .aaa-codex-viewport-frame {
            position: relative;
            width: 100%;
            min-height: 480px;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.3) 65%, transparent 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 3rem;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
            animation: aaaFadeInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
        }

        .aaa-codex-viewport-img {
            position: absolute;
            inset: 0;
            background-image: var(--preview-img);
            background-position: center;
            background-size: cover;
            z-index: 0;
            filter: brightness(0.65);
            transition: background-image 0.5s ease-in-out;
        }

        .aaa-codex-viewport-frame::before {
            content: "";
            position: absolute;
            inset: 15px;
            border: 1px solid rgba(255, 255, 255, 0.03);
            border-top: 0;
            border-bottom: 0;
            pointer-events: none;
            z-index: 1;
        }

        .aaa-codex-hud-corner {
            position: absolute;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(212, 175, 55, 0.4);
            pointer-events: none;
            z-index: 2;
        }

        .aaa-codex-hud-corner.tl { top: 15px; left: 15px; border-right: 0; border-bottom: 0; }
        .aaa-codex-hud-corner.tr { top: 15px; right: 15px; border-left: 0; border-bottom: 0; }
        .aaa-codex-hud-corner.bl { bottom: 15px; left: 15px; border-right: 0; border-top: 0; }
        .aaa-codex-hud-corner.br { bottom: 15px; right: 15px; border-left: 0; border-top: 0; }

        .aaa-codex-viewport-content {
            position: relative;
            z-index: 2;
            max-width: 600px;
        }

        .aaa-codex-viewport-content .viewport-kicker {
            font-family: var(--font-mono, monospace);
            font-size: 0.72rem;
            color: rgba(212, 175, 55, 0.8);
            letter-spacing: 0.2em;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .aaa-codex-viewport-content h2 {
            font-family: var(--font-header);
            font-size: 2.8rem;
            font-weight: 300;
            color: #FFFFFF;
            margin: 0 0 0.5rem;
            line-height: 1.1;
            letter-spacing: -0.02em;
        }

        .aaa-codex-viewport-content .viewport-range {
            font-size: 0.95rem;
            color: #94A3B8;
            margin-bottom: 1.5rem;
        }

        .aaa-codex-viewport-content p {
            font-size: 0.95rem;
            color: #CBD5E1;
            line-height: 1.6;
            margin-bottom: 2rem;
        }

        .aaa-codex-terminal-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            background: rgba(212, 175, 55, 0.12);
            border: 1px solid rgba(212, 175, 55, 0.6);
            color: #FFFFFF;
            padding: 0.85rem 1.75rem;
            font-family: var(--font-mono, monospace);
            font-size: 0.75rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            cursor: pointer;
            clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
            transition: all 0.3s ease;
        }

        .aaa-codex-terminal-btn:hover {
            background: rgba(212, 175, 55, 0.25);
            border-color: rgba(212, 175, 55, 1);
            box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
            transform: translateY(-2px);
        }

        /* View 3: Detailed Timeline Page */
        .aaa-codex-timeline-page {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 2rem 6rem;
            position: relative;
            z-index: 2;
            animation: aaaFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
        }

        .aaa-codex-detail-header {
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 2rem;
            margin-bottom: 3rem;
            position: relative;
            text-align: left;
        }

        .aaa-codex-detail-header::after {
            content: "";
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 60px;
            height: 1px;
            background: rgba(212, 175, 55, 0.8);
        }

        .aaa-codex-detail-header .viewport-kicker {
            font-family: var(--font-mono, monospace);
            font-size: 0.72rem;
            color: rgba(212, 175, 55, 0.8);
            letter-spacing: 0.2em;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .aaa-codex-detail-header h2 {
            font-family: var(--font-header);
            font-size: 2.8rem;
            font-weight: 300;
            color: #FFFFFF;
            margin: 0 0 0.5rem;
            line-height: 1.1;
        }

        .aaa-codex-detail-header p {
            margin: 0;
            font-size: 0.95rem;
            color: #94A3B8;
        }

        .aaa-codex-telemetry-panel {
            position: sticky;
            top: 1rem;
            z-index: 10;
            background: linear-gradient(180deg, rgba(8, 12, 24, 0.85), rgba(4, 6, 12, 0.95));
            border: 1px solid rgba(212, 175, 55, 0.25);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.01);
            border-radius: 4px;
            padding: 1.25rem;
            margin-bottom: 4rem;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }

        .aaa-codex-telemetry-labels {
            display: flex;
            justify-content: space-between;
            font-family: var(--font-mono, monospace);
            font-size: 0.7rem;
            color: #94A3B8;
            letter-spacing: 0.1em;
            text-transform: uppercase;
        }

        .aaa-codex-telemetry-labels strong {
            color: #FFFFFF;
            font-family: var(--font-header);
            font-size: 0.9rem;
            letter-spacing: 0;
        }

        .aaa-codex-telemetry-chart {
            height: 60px;
            margin: 0.75rem 0;
        }

        .aaa-codex-telemetry-chart path {
            fill: rgba(6, 182, 212, 0.06);
            stroke: rgba(6, 182, 212, 0.6);
            stroke-width: 1.5;
            stroke-dasharray: 1000;
            stroke-dashoffset: 1000;
            animation: drawTimeline 1.5s ease-out forwards;
            filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.4));
        }

        .aaa-codex-scrubber-track {
            position: relative;
            height: 8px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 99px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            margin-top: 0.5rem;
        }

        .aaa-codex-scrubber-handle {
            position: absolute;
            top: -6px;
            left: 0;
            width: 24px;
            height: 18px;
            background: #020408;
            border: 1.5px solid rgba(212, 175, 55, 0.8);
            border-radius: 2px;
            box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
            cursor: pointer;
            transition: left 0.15s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .aaa-codex-scrubber-handle::after {
            content: "";
            position: absolute;
            top: 4px;
            left: 10px;
            width: 2px;
            height: 8px;
            background: rgba(212, 175, 55, 0.6);
        }

        .aaa-codex-timeline-stream {
            position: relative;
            padding: 2rem 0;
        }

        .aaa-codex-timeline-stream::before {
            content: "";
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 1px;
            transform: translateX(-50%);
            background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.3) 10%, rgba(212, 175, 55, 0.3) 90%, transparent 100%);
        }

        .aaa-codex-year-group {
            position: relative;
            margin-bottom: 5rem;
            scroll-margin-top: 180px;
        }

        .aaa-codex-year-node {
            position: absolute;
            left: 50%;
            top: 0;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            z-index: 2;
        }

        .aaa-codex-node-ring {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(212, 175, 55, 1);
            background: #020408;
            border-radius: 50%;
            box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
            position: relative;
        }

        .aaa-codex-node-ring::after {
            content: "";
            position: absolute;
            inset: 3px;
            background: rgba(212, 175, 55, 0.8);
            border-radius: 50%;
            animation: aaaPulseGlow 2s infinite ease-in-out;
        }

        .aaa-codex-year-node strong {
            margin-top: 0.5rem;
            font-family: var(--font-mono, monospace);
            font-size: 0.78rem;
            color: rgba(212, 175, 55, 0.9);
            letter-spacing: 0.05em;
            background: #020408;
            padding: 2px 6px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 2px;
        }

        .aaa-codex-event-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
            gap: 1rem;
        }

        .aaa-codex-event-card {
            position: relative;
            background: linear-gradient(180deg, rgba(12, 18, 30, 0.75), rgba(6, 9, 16, 0.85));
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-top: 2px solid rgba(212, 175, 55, 0.4);
            padding: 1.5rem;
            border-radius: 3px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            opacity: 0;
            transform: translateY(30px);
            transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
            text-align: left;
        }

        .aaa-codex-event-card.is-visible {
            opacity: 1;
            transform: translateY(0);
        }

        .aaa-codex-event-card:hover {
            border-color: rgba(212, 175, 55, 0.3);
            border-top-color: rgba(212, 175, 55, 0.8);
            box-shadow: 0 15px 40px rgba(212, 175, 55, 0.05), 0 10px 30px rgba(0, 0, 0, 0.6);
        }

        .aaa-codex-event-card .card-header {
            font-family: var(--font-mono, monospace);
            font-size: 0.68rem;
            color: rgba(255, 255, 255, 0.3);
            display: flex;
            justify-content: space-between;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .aaa-codex-event-card .card-header span {
            color: rgba(212, 175, 55, 0.6);
        }

        .aaa-codex-event-card p {
            margin: 0;
            color: #E2E8F0;
            font-size: 0.9rem;
            line-height: 1.6;
            user-select: text;
        }

        .aaa-codex-event-card.left,
        .aaa-codex-event-wrapper.left {
            grid-column: 1;
            justify-self: end;
            width: min(100%, 460px);
        }

        .aaa-codex-event-card.right,
        .aaa-codex-event-wrapper.right {
            grid-column: 3;
            justify-self: start;
            width: min(100%, 460px);
        }

        .aaa-codex-event-wrapper {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .aaa-codex-event-wrapper .aaa-codex-event-card {
            width: 100%;
            grid-column: auto;
            justify-self: auto;
        }

        .aaa-codex-event-card::before {
            content: "";
            position: absolute;
            top: 24px;
            width: 20px;
            height: 1px;
            background: rgba(212, 175, 55, 0.25);
        }

        .aaa-codex-event-card.left::before {
            right: -20px;
        }

        .aaa-codex-event-card.right::before {
            left: -20px;
        }

        /* Borderless Tiled Timeline Images */
        .timeline-event-images-tiled {
            width: 100%;
        }

        .timeline-event-images-tiled.opposite.left {
            grid-column: 1;
            justify-self: end;
            width: min(100%, 580px); /* Expanded max-width to make images bigger when space is available */
            margin-top: 1rem;
        }

        .timeline-event-images-tiled.opposite.right {
            grid-column: 3;
            justify-self: start;
            width: min(100%, 580px); /* Expanded max-width to make images bigger when space is available */
            margin-top: 1rem;
        }

        .timeline-event-images-tiled.opposite {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }

        .timeline-event-images-tiled.opposite .timeline-event-img-tile {
            width: 100%;
            height: auto;
        }

        /* If there's only a single image in opposite layout, span both columns to make it big */
        .timeline-event-images-tiled.opposite .timeline-event-img-tile:only-child {
            grid-column: span 2;
        }

        .timeline-event-images-tiled.below {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.75rem;
        }

        .timeline-event-images-tiled.below .timeline-event-img-tile {
            flex: 1;
            max-width: calc(50% - 0.375rem); /* Keeps them small to fit when multiple */
            height: auto;
        }

        /* If there's only a single image in below layout, make it span full width (big) */
        .timeline-event-images-tiled.below .timeline-event-img-tile:only-child {
            max-width: 100%;
        }

        .timeline-event-img-tile {
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            cursor: pointer;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
            position: relative;
            background: rgba(0, 0, 0, 0.15); /* Soft transparent background */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .timeline-event-img-tile:hover {
            transform: translateY(-2px) scale(1.01);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
        }

        .timeline-event-img-tile img {
            width: 100%;
            height: auto;
            max-height: 380px; /* Clamps max vertical height for extremely tall images */
            object-fit: contain; /* Full image is visible and not cropped to fix size */
            filter: grayscale(0.25) brightness(0.85);
            transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
            display: block;
        }

        .timeline-event-img-tile:hover img {
            transform: scale(1.03);
            filter: grayscale(0) brightness(1.05);
        }

        /* Scroll Reveal transition for images in Galactic History detailed view */
        .aaa-codex-timeline-stream .timeline-event-images-tiled {
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .aaa-codex-timeline-stream .timeline-event-images-tiled.is-visible {
            opacity: 1;
            transform: translateY(0);
        }

        .aaa-codex-watermark {
            position: absolute;
            bottom: 1.5rem;
            left: 2rem;
            font-size: 5rem;
            font-family: var(--font-header);
            color: transparent;
            -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
            pointer-events: none;
            line-height: 1;
        }

        @media (max-width: 960px) {
            .aaa-codex-topbar {
                flex-direction: column;
                gap: 1rem;
                align-items: stretch;
            }

            .aaa-codex-search-wrapper {
                width: 100%;
            }

            .aaa-codex-split-pane {
                grid-template-columns: 1fr;
                padding: 0 1rem 2rem;
            }

            .aaa-codex-left-index {
                border-right: 0;
                border-bottom: 1px solid rgba(255, 255, 255, 0.05);
                padding-right: 0;
                padding-bottom: 1.5rem;
                max-height: 300px;
            }

            .aaa-codex-right-viewport {
                padding-left: 0;
                padding-top: 1.5rem;
            }

            .aaa-codex-viewport-frame {
                min-height: auto;
                padding: 1.5rem;
            }

            .aaa-codex-timeline-stream::before,
            .aaa-codex-year-node {
                left: 20px;
                transform: none;
            }

            .aaa-codex-year-node {
                align-items: flex-start;
            }

            .aaa-codex-year-node strong {
                margin-top: 0.25rem;
            }

            .aaa-codex-event-row {
                grid-template-columns: 35px minmax(0, 1fr);
                gap: 0.5rem;
            }

            .aaa-codex-event-card.left,
            .aaa-codex-event-card.right,
            .aaa-codex-event-wrapper.left,
            .aaa-codex-event-wrapper.right,
            .timeline-event-images-tiled.opposite.left,
            .timeline-event-images-tiled.opposite.right {
                grid-column: 2;
                justify-self: stretch;
                width: 100%;
            }

            .aaa-codex-event-card::before {
                left: -15px;
                right: auto;
                width: 15px;
            }
        }
/* Location History Overlay */
.map-location-history-overlay {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 35;
    display: none;
    width: min(380px, calc(100% - 32px));
    max-height: min(58vh, 460px);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: linear-gradient(150deg, rgba(8, 13, 24, 0.94), rgba(18, 23, 38, 0.9));
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(14px);
    color: #edf4ff;
    pointer-events: auto;
}

.map-location-history-overlay.active {
    display: block;
}

.map-location-history-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
}

.map-location-history-kicker {
    margin: 0 2rem 0.25rem 0;
    color: var(--accent-color);
    font-family: var(--font-header);
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.map-location-history-overlay h4 {
    margin: 0 2rem 0.65rem 0;
    color: #fff;
    font-family: var(--font-header);
    font-size: 1.15rem;
    line-height: 1.15;
}

.map-location-history-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

.map-location-history-stats span {
    padding: 0.18rem 0.48rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #d7deeb;
    font-size: 0.68rem;
}

.map-location-history-list {
    max-height: min(36vh, 260px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.map-location-history-event {
    margin-bottom: 0.55rem;
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.map-location-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
    color: #9fb1c9;
    font-size: 0.64rem;
    text-transform: uppercase;
}

.map-location-history-event strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #fff;
    font-size: 0.82rem;
}

.map-location-history-event p,
.map-location-history-empty,
.map-location-history-loading {
    margin: 0;
    color: #dce5f4;
    font-size: 0.78rem;
    line-height: 1.5;
}

.map-location-history-expand {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    background: rgba(255, 215, 0, 0.08);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-header);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .map-location-history-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: 46vh;
    }

    .map-location-history-list {
        max-height: 25vh;
    }
}

.location-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(16px);
}

.location-history-overlay.active {
    display: flex;
}

.location-history-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(7, 12, 22, 0.96), rgba(18, 23, 38, 0.94));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58), 0 0 36px rgba(255, 215, 0, 0.1);
}

.location-history-close {
    position: sticky;
    top: 0;
    float: right;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    z-index: 1;
}

.location-history-kicker {
    margin-bottom: 0.35rem;
    color: var(--accent-color);
    font-family: var(--font-header);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.location-history-panel h2 {
    margin: 0 2.5rem 0.8rem 0;
    color: #fff;
    font-family: var(--font-header);
    font-size: clamp(1.65rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.location-history-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.location-history-stats span,
.location-history-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #d7deeb;
    font-size: 0.78rem;
}

.location-history-era {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.location-history-era h3 {
    margin: 0 0 0.85rem;
    color: var(--accent-color);
    font-family: var(--font-header);
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.location-history-event {
    margin-bottom: 0.85rem;
    padding: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.location-history-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    color: #9fb1c9;
    font-size: 0.74rem;
    text-transform: uppercase;
}

.location-history-event-meta span {
    padding-right: 0.45rem;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.location-history-event-meta span:last-child {
    border-right: 0;
}

.location-history-event strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #fff;
}

.location-history-event p,
.location-history-empty,
.location-history-loading {
    margin: 0;
    color: #dce5f4;
    line-height: 1.65;
}

.location-history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

@media (max-width: 640px) {
    .location-history-panel {
        max-height: 88vh;
        padding: 1rem;
    }

    .location-history-event {
        padding: 0.8rem;
    }
}

/* ============================================================
   READER MAPS — GALACTIC OPERATIONS DECK (2026 REFRESH)
   Final overrides intentionally live at EOF to replace the
   earlier experimental map rules without affecting other views.
============================================================ */
body.fullscreen-map-active {
    overflow: hidden;
}

body.fullscreen-map-active #main-header,
body.fullscreen-map-active #global-comment-btn {
    display: none !important;
}

.map-console-shell {
    --hud-cyan: #78ddff;
    --hud-blue: #278dff;
    --hud-magenta: #ff5bbd;
    --hud-red: #ff365f;
    --hud-ink: #050914;
    --hud-panel: rgba(7, 14, 27, 0.72);
    --hud-panel-strong: rgba(6, 13, 25, 0.92);
    --hud-line: rgba(139, 222, 255, 0.2);
    --hud-soft-line: rgba(255, 255, 255, 0.08);
    --hud-radius: 16px;
    --dock-width: clamp(310px, 22vw, 370px);
    --hud-footer-height: 72px;
    background:
        radial-gradient(circle at 24% 38%, rgba(0, 123, 181, 0.25), transparent 31%),
        radial-gradient(circle at 72% 45%, rgba(118, 17, 126, 0.24), transparent 35%),
        linear-gradient(145deg, #030711 0%, #07111f 42%, #10071a 100%);
    isolation: isolate;
}

.map-console-shell::before,
.map-console-ambience {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-console-shell::before {
    z-index: 3;
    background:
        radial-gradient(circle at 18% 30%, rgba(92, 206, 255, 0.1) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 62%, rgba(255, 147, 225, 0.1) 0 1px, transparent 2px);
    background-size: 83px 83px, 119px 119px;
    opacity: 0.7;
}

.map-console-ambience {
    z-index: 4;
    background:
        linear-gradient(rgba(119, 222, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(119, 222, 255, 0.018) 1px, transparent 1px),
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.12) 3px 4px),
        radial-gradient(ellipse at center, transparent 35%, rgba(1, 4, 12, 0.72) 100%);
    background-size: 72px 72px, 72px 72px, auto, auto;
}

.map-console-shell.map-console-warm {
    --hud-cyan: #ffc56f;
    --hud-blue: #ff8e3c;
    --hud-line: rgba(255, 194, 107, 0.25);
}

.map-console-shell .map-stage {
    inset: 0;
}

.map-console-shell .map-viewer,
.map-console-shell .map-canvas,
.map-console-shell #map-svg-layer,
.map-console-shell #map-nodes-layer {
    z-index: 10;
}

.map-console-shell .map-viewer::after {
    background:
        linear-gradient(180deg, rgba(2, 6, 14, 0.42), transparent 18%, transparent 67%, rgba(2, 5, 12, 0.6)),
        radial-gradient(ellipse at center, transparent 46%, rgba(0, 3, 10, 0.7) 100%);
}

.map-hud-bar {
    top: 16px;
    left: 16px;
    right: 16px;
    height: 74px;
    z-index: 950;
    padding: 0 22px;
    border: 1px solid var(--hud-line);
    border-radius: var(--hud-radius);
    background: linear-gradient(110deg, rgba(8, 15, 28, 0.8), rgba(10, 15, 28, 0.56));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.04);
}

.map-hud-title-group {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.map-hud-title {
    position: static;
    transform: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    letter-spacing: 0.55em;
    padding-left: 0.55em;
}

.map-hud-subtitle {
    margin-top: 5px;
    color: rgba(201, 221, 239, 0.5);
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.map-hud-back,
.map-hud-icon-btn,
.map-hud-avatar-btn,
.minimize-panels-btn,
.map-pill-btn,
.map-control-icon,
.map-footer-btn,
.map-footer-close {
    font: inherit;
}

.map-hud-back {
    border: 0;
    padding: 10px 8px;
}

.map-hud-icon-btn,
.map-hud-avatar-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: rgba(228, 240, 250, 0.7);
    background: transparent;
    cursor: pointer;
}

.map-hud-icon-btn:hover,
.map-hud-icon-btn[aria-pressed="true"],
.map-hud-avatar-btn:hover {
    color: var(--hud-cyan);
    border-color: var(--hud-line);
    background: rgba(117, 221, 255, 0.08);
    box-shadow: 0 0 22px rgba(71, 193, 255, 0.13);
}

.map-hud-avatar-btn {
    padding: 2px;
}

.map-hud-avatar {
    width: 30px;
    height: 30px;
}

.active-map-chip {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 10px;
    border: 1px solid var(--hud-soft-line);
    border-radius: 999px;
    color: rgba(219, 234, 247, 0.7);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.minimize-panels-btn {
    position: absolute;
    z-index: 910;
    top: 100px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid var(--hud-line);
    border-radius: 9px;
    color: rgba(232, 241, 250, 0.86);
    background: rgba(7, 13, 24, 0.72);
    backdrop-filter: blur(16px);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.minimize-panels-btn:hover {
    color: var(--hud-cyan);
    border-color: rgba(120, 221, 255, 0.5);
}

.map-dock,
.map-floating-panel,
.map-status-card,
.map-console-legend,
.map-console-footer {
    border: 1px solid var(--hud-line);
    background: linear-gradient(145deg, rgba(7, 15, 29, 0.87), rgba(5, 11, 22, 0.69));
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(22px) saturate(1.28);
    -webkit-backdrop-filter: blur(22px) saturate(1.28);
}

.map-dock {
    z-index: 600;
    border-radius: 14px;
}

.dock-left {
    top: 108px;
    left: 16px;
    bottom: 90px;
    width: var(--dock-width);
    transform: translateX(calc(-100% - 28px));
}

.dock-right {
    top: 158px;
    right: 16px;
    bottom: 248px;
    width: var(--dock-width);
    border: 1px solid var(--hud-line);
    transform: translateX(calc(100% + 28px));
}

.dock-bottom {
    left: 50%;
    right: auto;
    bottom: 82px;
    width: min(760px, calc(100vw - 40px));
    height: min(42vh, 360px);
    transform: translate(-50%, calc(100% + 100px));
}

.dock-bottom.open {
    transform: translate(-50%, 0);
}

.dock-header {
    min-height: 50px;
    padding: 11px 14px;
    background: rgba(2, 7, 16, 0.42);
}

.dock-header-title {
    color: rgba(231, 242, 251, 0.9);
    font-size: 0.7rem;
}

.dock-header-title i {
    color: var(--hud-cyan);
}

.dock-body {
    padding: 13px;
    gap: 12px;
}

.dock-body-nav {
    padding-bottom: 20px;
}

.map-empty-panel {
    min-height: 100%;
    display: grid;
    place-content: center;
    gap: 10px;
    text-align: center;
    color: rgba(211, 227, 241, 0.58);
}

.map-empty-panel-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--hud-line);
    border-radius: 50%;
    color: var(--hud-cyan);
    background: radial-gradient(circle, rgba(91, 205, 255, 0.12), transparent 70%);
    font-size: 1.5rem;
}

.map-empty-panel h3,
.map-empty-panel p {
    margin: 0;
}

.map-empty-panel p {
    max-width: 250px;
    font-size: 0.78rem;
    line-height: 1.6;
}

.planet-orb-container {
    width: 104px;
    height: 104px;
    border: 1px solid rgba(139, 222, 255, 0.3);
    box-shadow:
        0 0 0 8px rgba(86, 190, 239, 0.035),
        0 0 36px rgba(79, 194, 255, 0.18),
        inset -23px -16px 30px rgba(0, 0, 0, 0.75),
        inset 10px 9px 18px rgba(255, 255, 255, 0.13);
}

.planet-orb-container::before,
.planet-orb-container::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.planet-orb-container::before {
    inset: -9px;
    border: 1px solid rgba(111, 213, 255, 0.13);
    border-left-color: rgba(111, 213, 255, 0.42);
    animation: map-orbit-spin 13s linear infinite;
}

.planet-orb-container::after {
    inset: 0;
    background: radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.2), transparent 25%, transparent 55%, rgba(0, 0, 0, 0.45));
}

@keyframes map-orbit-spin {
    to { transform: rotate(360deg); }
}

.inspector-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 8px;
    justify-content: flex-start;
    border-bottom: 0;
}

.inspector-tab {
    min-width: 0;
    border: 1px solid rgba(0, 242, 254, 0.12);
    border-radius: 999px;
    padding: 0.45rem 0.35rem;
    background: rgba(1, 8, 18, 0.45);
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

.inspector-tab.active {
    border-color: rgba(0, 242, 254, 0.4);
    background: rgba(0, 242, 254, 0.12);
}

.inspector-tab.active::after {
    display: none;
}

.routing-section,
.routing-node-card,
.routing-summary,
.routing-analysis-panel {
    border: 1px solid var(--hud-soft-line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.018);
}

.routing-section {
    padding: 11px;
}

.routing-field-row {
    display: grid;
    grid-template-columns: 78px 1fr;
}

.dock-body input {
    border-radius: 7px;
    background: rgba(1, 5, 12, 0.55);
}

.routing-btn {
    border-radius: 7px;
}

.routing-btn.primary {
    color: #031019;
    background: linear-gradient(135deg, #ecfbff, var(--hud-cyan));
}

.routing-analysis-panel {
    padding: 11px;
}

.routing-analysis-header h4 {
    margin: 3px 0 8px;
    color: #eef8ff;
    font-size: 0.86rem;
}

.map-floating-kicker {
    color: rgba(173, 211, 240, 0.58);
    font-size: 0.59rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.routing-accordion {
    border-top: 1px solid var(--hud-soft-line);
}

.routing-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 2px;
    border: 0;
    color: rgba(225, 237, 247, 0.78);
    background: transparent;
    cursor: pointer;
}

.routing-accordion-trigger span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.routing-accordion-trigger > i {
    transition: transform 0.2s ease;
}

.routing-accordion-trigger[aria-expanded="true"] > i {
    transform: rotate(90deg);
}

.routing-accordion-panel {
    max-height: 0;
    overflow: hidden;
    color: rgba(203, 221, 236, 0.68);
    font-size: 0.72rem;
    line-height: 1.55;
    transition: max-height 0.25s ease, padding 0.25s ease;
}

.routing-accordion-panel.is-open {
    max-height: 220px;
    overflow-y: auto;
    padding: 0 3px 10px;
}

.routing-accordion-panel p,
.routing-accordion-panel ol {
    margin: 0;
}

.routing-accordion-panel ol {
    list-style: none;
    padding: 0;
}

.routing-accordion-panel li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hazard-low strong { color: var(--hud-cyan); }
.hazard-medium strong { color: #ffbd55; }
.hazard-high strong { color: #ff5a71; }

.map-floating-panel {
    position: absolute;
    z-index: 720;
    width: min(420px, calc(100vw - 32px));
    padding: 14px;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.3s ease;
}

.charts-dock {
    top: 100px;
    right: 18px;
    left: auto;
    min-width: 0;
    transform: translateY(-10px);
}

.charts-dock.open {
    transform: translateY(0);
}

.layers-dock {
    top: 100px;
    right: 18px;
    transform: translateY(-10px);
}

.layers-dock.open,
.map-floating-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.map-floating-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
}

.map-floating-panel-header h3 {
    margin: 3px 0 0;
    color: #f4f9ff;
    font-size: 1rem;
}

.map-floating-panel-copy {
    margin: 8px 0 12px;
    color: rgba(202, 220, 235, 0.58);
    font-size: 0.75rem;
    line-height: 1.5;
}

.charts-dock-grid {
    display: grid;
    gap: 7px;
    max-height: min(52vh, 440px);
    overflow-y: auto;
}

.charts-dock .map-selector-btn {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border-color: var(--hud-soft-line);
    color: #d8e5f0;
    background: rgba(255, 255, 255, 0.02);
}

.charts-dock .map-selector-btn:hover,
.charts-dock .map-selector-btn.active {
    color: #eefaff;
    border-color: var(--hud-line);
    background: rgba(91, 201, 255, 0.09);
}

.map-selector-btn-eyebrow,
.map-selector-btn-meta {
    color: rgba(186, 207, 224, 0.5);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.layers-dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.map-controls {
    z-index: 650;
    right: calc(var(--dock-width) + 28px);
    bottom: 88px;
    flex-direction: row;
    align-items: flex-end;
    gap: 9px;
}

.map-viewport-rail,
.map-hud-stack {
    display: grid;
    gap: 7px;
}

.map-control-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hud-line);
    border-radius: 9px;
    color: rgba(223, 237, 248, 0.72);
    background: rgba(6, 13, 24, 0.72);
    backdrop-filter: blur(14px);
    cursor: pointer;
}

.map-pill-btn {
    min-width: 122px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--hud-line);
    border-radius: 10px;
    color: rgba(225, 237, 247, 0.78);
    background: rgba(6, 13, 24, 0.76);
    backdrop-filter: blur(16px);
    cursor: pointer;
}

.map-pill-btn:hover,
.map-pill-btn.open {
    color: #fff;
    border-color: rgba(123, 220, 255, 0.48);
    background: rgba(67, 177, 226, 0.13);
}

.map-status-card {
    position: absolute;
    z-index: 640;
    right: 16px;
    bottom: 88px;
    width: var(--dock-width);
    min-height: 142px;
    display: grid;
    grid-template-columns: 1fr 104px;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
}

.map-status-card h3 {
    margin: 5px 0 8px;
    color: #f3f9ff;
    font-size: 0.96rem;
}

.map-status-card p {
    margin: 0;
    color: rgba(198, 217, 233, 0.58);
    font-size: 0.72rem;
    line-height: 1.45;
}

.map-status-card-meta {
    margin-top: 9px;
    color: rgba(227, 239, 249, 0.82);
    font-size: 0.71rem;
}

.map-status-radar {
    display: grid;
    place-items: center;
}

.radar-scope {
    position: relative;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border: 1px solid rgba(112, 218, 255, 0.38);
    border-radius: 50%;
    background:
        linear-gradient(transparent 49%, rgba(106, 213, 255, 0.18) 50%, transparent 51%),
        linear-gradient(90deg, transparent 49%, rgba(106, 213, 255, 0.18) 50%, transparent 51%),
        radial-gradient(circle, rgba(61, 187, 247, 0.12), rgba(3, 12, 24, 0.75) 70%);
    box-shadow: inset 0 0 20px rgba(65, 198, 255, 0.12), 0 0 22px rgba(65, 198, 255, 0.1);
}

.radar-ring {
    position: absolute;
    border: 1px solid rgba(99, 210, 255, 0.18);
    border-radius: 50%;
}

.radar-ring-a { inset: 14px; }
.radar-ring-b { inset: 27px; }
.radar-ring-c { inset: 39px; }

.radar-sweep {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent 0 72%, rgba(91, 211, 255, 0.32) 92%, transparent 100%);
    animation: radar-spin 3.8s linear infinite;
}

.radar-blip {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #a8edff;
    box-shadow: 0 0 8px #55d7ff;
    animation: radar-blink 2.2s ease-in-out infinite;
}

.radar-blip-a { top: 22%; left: 61%; }
.radar-blip-b { top: 66%; left: 29%; animation-delay: -0.8s; }
.radar-blip-c { top: 55%; left: 72%; animation-delay: -1.4s; }

@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes radar-blink { 50% { opacity: 0.2; } }

.map-console-legend {
    position: absolute;
    z-index: 625;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 18px;
    border-radius: 12px;
    color: rgba(216, 230, 241, 0.67);
    font-size: 0.68rem;
    white-space: nowrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-legend-swatch {
    width: 12px;
    height: 12px;
    border: 2px solid var(--hud-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.map-legend-swatch.botian { border-color: var(--hud-magenta); }
.map-legend-swatch.disputed { border-color: var(--hud-red); }

.map-legend-line {
    width: 22px;
    border-top: 2px dashed rgba(230, 239, 247, 0.72);
}

.map-console-footer {
    position: absolute;
    z-index: 700;
    left: 16px;
    right: 16px;
    bottom: 12px;
    min-height: 60px;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-radius: 14px;
}

.map-footer-actions {
    display: flex;
    gap: 8px;
}

.map-footer-btn {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    border: 1px solid var(--hud-soft-line);
    border-radius: 8px;
    color: rgba(226, 237, 246, 0.78);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.map-footer-btn:hover {
    color: var(--hud-cyan);
    border-color: var(--hud-line);
}

.map-footer-ticker {
    min-width: 0;
    height: 42px;
    display: grid;
    grid-template-columns: 1fr 30px;
    align-items: center;
    overflow: hidden;
    border-left: 1px solid var(--hud-soft-line);
    border-right: 1px solid var(--hud-soft-line);
    transition: opacity 0.2s ease;
}

.map-footer-ticker.is-dismissed {
    opacity: 0.18;
}

.map-footer-ticker-track {
    min-width: 0;
    overflow: hidden;
}

.map-footer-ticker-track span {
    display: inline-block;
    min-width: max-content;
    padding-left: 100%;
    color: rgba(213, 229, 241, 0.7);
    font-size: 0.72rem;
    animation: map-ticker 24s linear infinite;
}

@keyframes map-ticker {
    to { transform: translateX(-100%); }
}

.map-footer-close {
    width: 28px;
    height: 28px;
    border: 0;
    color: rgba(219, 232, 241, 0.5);
    background: transparent;
    cursor: pointer;
}

.map-footer-clock {
    display: grid;
    grid-template-columns: auto 30px;
    grid-template-areas: "label spinner" "time spinner";
    column-gap: 10px;
    align-items: center;
    min-width: 110px;
}

.map-footer-clock-label {
    grid-area: label;
    color: rgba(194, 216, 233, 0.58);
    font-size: 0.61rem;
}

.map-footer-clock strong {
    grid-area: time;
    color: var(--hud-cyan);
    font-size: 0.75rem;
}

.map-footer-clock-spinner {
    grid-area: spinner;
    width: 26px;
    height: 26px;
    border: 1px dashed rgba(117, 220, 255, 0.6);
    border-radius: 50%;
    animation: map-orbit-spin 8s linear infinite;
}

.cartographer-beacon {
    z-index: 710;
    left: 50%;
    bottom: 83px;
    transform: translateX(-50%);
}

.cartographer-beacon-pill {
    display: none;
}

.cartographer-beacon-card {
    bottom: 0;
}

.map-console-shell.panels-minimized .map-dock,
.map-console-shell.panels-minimized .map-floating-panel,
.map-console-shell.panels-minimized .map-status-card,
.map-console-shell.panels-minimized .map-controls,
.map-console-shell.panels-minimized .map-console-legend,
.map-console-shell.panels-minimized .map-console-footer,
.map-console-shell.panels-minimized .cartographer-beacon {
    opacity: 0 !important;
    pointer-events: none !important;
}

.map-console-shell.panels-minimized .map-status-card,
.map-console-shell.panels-minimized .map-controls {
    transform: translateX(120%);
}

.map-console-shell.panels-minimized .map-console-footer,
.map-console-shell.panels-minimized .map-console-legend {
    transform: translate(-50%, 140%);
}

.map-console-shell.panels-minimized .minimize-panels-btn {
    color: var(--hud-cyan);
}

.map-hub-screen {
    --map-hub-accent: var(--accent-color);
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(25px, 4vw, 56px);
    gap: 22px;
    border: 1px solid rgba(146, 221, 255, 0.12);
    border-radius: 24px;
    overflow: visible;
    background:
        radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--map-hub-accent) 18%, transparent), transparent 30%),
        radial-gradient(circle at 88% 40%, rgba(139, 63, 190, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(4, 10, 20, 0.5), rgba(9, 13, 25, 0.35));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
}

.map-hub-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(rgba(127, 216, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 216, 255, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
}

.map-hub-header,
.map-hub-search-wrapper,
.map-hub-section,
.map-hub-no-results {
    position: relative;
    z-index: 1;
}

.map-hub-header {
    text-align: left;
    padding: 0;
}

.map-hub-eyebrow {
    color: color-mix(in srgb, var(--map-hub-accent) 70%, #d9efff);
    font-size: 0.67rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.map-hub-title {
    margin-top: 8px;
    color: #f2f8ff;
    font-size: clamp(2rem, 5vw, 4.2rem);
    letter-spacing: -0.035em;
}

.map-hub-title i {
    margin-right: 0.3em;
    color: var(--map-hub-accent);
    opacity: 0.7;
}

.map-hub-subtitle {
    max-width: 680px;
    margin-top: 9px;
    line-height: 1.65;
}

.map-hub-search-wrapper {
    width: min(620px, 100%);
    margin: 0;
}

.map-hub-search {
    min-height: 48px;
    border-radius: 12px;
    background: rgba(2, 7, 15, 0.58);
}

.map-hub-section-header {
    margin-bottom: 12px;
}

.map-hub-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.map-hub-card {
    position: relative;
    min-height: 230px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(145, 220, 255, 0.13);
    border-radius: 15px;
    color: inherit;
    background: rgba(3, 8, 17, 0.75);
    text-align: left;
    cursor: pointer;
    appearance: none;
}

.map-hub-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 0.25s ease;
    pointer-events: none;
}

.map-hub-card:hover,
.map-hub-card:focus-visible {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--map-hub-accent) 55%, transparent);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.38), 0 0 28px color-mix(in srgb, var(--map-hub-accent) 12%, transparent);
    outline: none;
}

.map-hub-thumb,
.map-hub-thumb-placeholder {
    width: 100%;
    height: 100%;
    min-height: 230px;
    object-fit: cover;
}

.map-hub-card-overlay {
    z-index: 1;
    background: linear-gradient(180deg, rgba(4, 8, 15, 0.02) 20%, rgba(3, 8, 17, 0.94) 92%);
}

.map-hub-card-body {
    z-index: 2;
}

.map-hub-card-name {
    font-size: 1.1rem;
}

@supports not (backdrop-filter: blur(2px)) {
    .map-dock,
    .map-floating-panel,
    .map-status-card,
    .map-console-legend,
    .map-console-footer,
    .map-hud-bar {
        background: rgba(5, 11, 22, 0.96);
    }
}

@media (max-width: 1180px) {
    .map-console-shell {
        --dock-width: 300px;
    }

    .map-console-legend {
        gap: 10px;
    }

    .map-controls {
        right: 326px;
    }

    .map-status-card {
        grid-template-columns: 1fr 78px;
    }

    .radar-scope {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 920px) {
    .map-hud-subtitle,
    .active-map-chip,
    .map-console-legend,
    .map-status-radar,
    .map-footer-ticker {
        display: none;
    }

    .map-status-card {
        width: 270px;
        min-height: 105px;
        grid-template-columns: 1fr;
    }

    .map-controls {
        right: 296px;
    }

    .map-console-footer {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 720px) {
    .map-console-shell {
        --dock-width: 100%;
        --hud-footer-height: 58px;
    }

    .map-hud-bar {
        top: 8px;
        left: 8px;
        right: 8px;
        height: 58px;
        padding: 0 10px;
    }

    .map-hud-title {
        font-size: 0.85rem;
        letter-spacing: 0.36em;
    }

    .map-hud-actions {
        gap: 1px;
    }

    .map-hud-icon-btn:nth-child(1),
    .map-hud-icon-btn:nth-child(2),
    .map-hud-avatar-btn {
        display: none;
    }

    .minimize-panels-btn {
        top: 74px;
        right: 8px;
        padding: 9px;
    }

    .minimize-panels-label {
        display: none;
    }

    .dock-left,
    .dock-right {
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 68px;
        width: auto;
        height: min(72vh, 560px);
        border: 1px solid var(--hud-line);
        border-radius: 16px 16px 0 0;
        transform: translateY(calc(100% + 80px));
    }

    .dock-left.open,
    .dock-right.open {
        transform: translateY(0);
    }

    .dock-bottom {
        bottom: 68px;
        width: calc(100vw - 16px);
        height: min(64vh, 440px);
    }

    .map-status-card {
        left: 8px;
        right: auto;
        bottom: 72px;
        width: min(245px, calc(100vw - 84px));
        min-height: 88px;
        padding: 10px 12px;
    }

    .map-status-card p {
        display: none;
    }

    .map-controls {
        right: 8px;
        bottom: 72px;
        flex-direction: column-reverse;
    }

    .map-viewport-rail {
        grid-template-columns: repeat(4, 36px);
    }

    .map-control-icon {
        width: 36px;
        height: 36px;
    }

    .map-hud-stack {
        justify-items: end;
    }

    .map-pill-btn {
        min-width: 42px;
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .map-pill-btn span {
        display: none;
    }

    .map-console-footer {
        left: 8px;
        right: 8px;
        bottom: 7px;
        min-height: 52px;
        padding: 5px 8px;
    }

    .map-footer-btn {
        min-height: 36px;
        padding: 7px 9px;
    }

    .map-footer-btn span {
        font-size: 0.64rem;
    }

    .map-footer-clock {
        min-width: 70px;
        grid-template-columns: 1fr;
        grid-template-areas: "label" "time";
    }

    .map-footer-clock-spinner {
        display: none;
    }

    .charts-dock,
    .layers-dock {
        top: 74px;
        left: 8px;
        right: 8px;
        width: auto;
    }

    .cartographer-beacon {
        display: none;
    }

    .map-hub-screen {
        padding: 22px 14px;
        border-radius: 15px;
    }

    .map-hub-title {
        font-size: 2rem;
    }

    .map-hub-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-console-shell *,
    .map-hub-screen * {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Reader map HUD restructure and astrogation polish */
.map-console-shell {
    --map-content-top: 100px;
}

.map-console-ambience {
    background:
        linear-gradient(90deg, rgba(120, 221, 255, 0.12), transparent 8%, transparent 92%, rgba(120, 221, 255, 0.12)),
        linear-gradient(rgba(119, 222, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(119, 222, 255, 0.022) 1px, transparent 1px),
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.12) 3px 4px),
        radial-gradient(ellipse at center, transparent 35%, rgba(1, 4, 12, 0.72) 100%);
    background-size: auto, 72px 72px, 72px 72px, auto, auto;
}

.map-console-shell .map-stage::before,
.map-console-shell .map-stage::after {
    content: "";
    position: absolute;
    z-index: 12;
    width: 38px;
    height: 38px;
    pointer-events: none;
    opacity: 0.48;
}

.map-console-shell .map-stage::before {
    top: var(--map-content-top);
    left: 16px;
    border-top: 1px solid var(--hud-cyan);
    border-left: 1px solid var(--hud-cyan);
    background: linear-gradient(90deg, transparent 18px, rgba(120, 221, 255, 0.55) 18px 19px, transparent 19px);
}

.map-console-shell .map-stage::after {
    right: 16px;
    bottom: 82px;
    border-right: 1px solid var(--hud-cyan);
    border-bottom: 1px solid var(--hud-cyan);
    background: linear-gradient(0deg, transparent 18px, rgba(120, 221, 255, 0.55) 18px 19px, transparent 19px);
}

.map-hud-bar {
    overflow: hidden;
    border-bottom-color: rgba(120, 221, 255, 0.42);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 4px),
        linear-gradient(110deg, rgba(8, 15, 28, 0.78), rgba(10, 15, 28, 0.5));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 1px 14px rgba(0, 242, 254, 0.2), inset 0 1px rgba(255, 255, 255, 0.04);
}

.map-hud-actions {
    gap: 6px;
}

.map-hud-action-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--hud-soft-line);
    border-radius: 9px;
    color: rgba(225, 238, 248, 0.76);
    background: rgba(3, 10, 20, 0.32);
    font: inherit;
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.map-hud-action-btn:hover,
.map-hud-action-btn.open,
.map-hud-action-btn[aria-expanded="true"] {
    color: #fff;
    border-color: rgba(120, 221, 255, 0.48);
    background: rgba(66, 185, 234, 0.13);
    box-shadow: 0 0 20px rgba(72, 197, 255, 0.12);
}

.dock-left {
    top: var(--map-content-top);
    bottom: 82px;
}

.dock-left[data-planet-class] {
    border-top-width: 4px;
    border-top-color: var(--planet-class-accent, var(--hud-cyan));
    box-shadow: 0 -8px 24px color-mix(in srgb, var(--planet-class-accent, var(--hud-cyan)) 18%, transparent), 0 24px 65px rgba(0, 0, 0, 0.42);
}

.dock-left[data-planet-class="terrestrial"],
.dock-left[data-planet-class="forest"] { --planet-class-accent: #62d47c; }
.dock-left[data-planet-class="desert"],
.dock-left[data-planet-class="barren"] { --planet-class-accent: #e5ad63; }
.dock-left[data-planet-class="ice-world"],
.dock-left[data-planet-class="oceanic"] { --planet-class-accent: #55d9ff; }
.dock-left[data-planet-class="gas-giant"] { --planet-class-accent: #ff9f5a; }
.dock-left[data-planet-class="volcanic"] { --planet-class-accent: #ff5a4f; }
.dock-left[data-planet-class="swamp"] { --planet-class-accent: #8fcf65; }
.dock-left[data-planet-class="ecumenopolis"] { --planet-class-accent: #c579ff; }

.plot-course-action {
    position: relative;
    overflow: hidden;
    justify-content: center;
    min-height: 42px;
    color: #eefdff;
    border-color: rgba(120, 221, 255, 0.42);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(0, 120, 255, 0.42));
    box-shadow: inset 0 1px rgba(255,255,255,0.1), 0 0 22px rgba(0, 198, 255, 0.12);
}

.plot-course-action:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px rgba(255,255,255,0.14), 0 0 28px rgba(0, 210, 255, 0.25);
}

.plot-course-action.pulse-glow {
    animation: plot-course-pulse 0.85s ease-out;
}

@keyframes plot-course-pulse {
    0% { box-shadow: 0 0 0 0 rgba(100, 225, 255, 0.65); }
    100% { box-shadow: 0 0 0 18px rgba(100, 225, 255, 0), 0 0 30px rgba(0, 210, 255, 0.2); }
}

.inspector-course-picker {
    margin-top: 9px;
    padding: 10px;
    border: 1px solid var(--hud-soft-line);
    border-radius: 10px;
    background: rgba(1, 6, 14, 0.48);
}

.inspector-course-picker[hidden] {
    display: none;
}

.inspector-course-picker label {
    display: block;
    margin-bottom: 7px;
    color: rgba(220, 237, 249, 0.68);
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.inspector-course-picker-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
}

.inspector-course-picker-row input {
    min-width: 0;
}

.inspector-course-picker p {
    margin: 7px 0 0;
    color: rgba(205, 225, 240, 0.62);
    font-size: 0.69rem;
}

.map-status-card {
    left: 16px;
    right: auto;
    width: min(390px, calc(100vw - 32px));
    min-height: 154px;
    grid-template-columns: minmax(0, 1fr) 104px;
    border-left: 3px solid var(--hud-cyan);
    background: linear-gradient(145deg, rgba(7, 15, 29, 0.68), rgba(5, 11, 22, 0.48));
    box-shadow: -4px 0 18px rgba(0, 242, 254, 0.16), 0 24px 65px rgba(0, 0, 0, 0.42);
}

.map-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.map-status-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(120, 221, 255, 0.2);
    border-radius: 999px;
    color: rgba(224, 239, 249, 0.76);
    background: rgba(0, 242, 254, 0.045);
    backdrop-filter: blur(12px);
    font: inherit;
    font-size: 0.66rem;
    cursor: pointer;
}

.map-status-btn::after {
    content: "";
    position: absolute;
    right: 9px;
    bottom: 4px;
    left: 9px;
    height: 1px;
    background: var(--hud-cyan);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.map-status-btn:hover,
.map-status-btn[aria-expanded="true"] {
    color: #fff;
    border-color: rgba(120, 221, 255, 0.46);
}

.map-status-btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.map-status-card.has-active-route .radar-sweep {
    animation-duration: 1.85s;
    filter: drop-shadow(0 0 5px var(--hud-cyan));
}

.map-status-card.has-active-route .radar-ring {
    animation: active-radar-ring 1.8s ease-in-out infinite alternate;
}

@keyframes active-radar-ring {
    to { border-color: rgba(112, 218, 255, 0.58); box-shadow: 0 0 10px rgba(80, 205, 255, 0.28); }
}

.map-controls {
    right: 16px;
    bottom: 88px;
}

.map-controls .map-hud-stack {
    display: none;
}

.charts-dock .map-selector-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 68px;
}

.charts-dock .map-selector-thumb {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.08);
    filter: brightness(0.42) saturate(0.75);
    transition: opacity 0.25s ease, transform 0.35s ease;
    pointer-events: none;
}

.charts-dock .map-selector-btn:hover .map-selector-thumb,
.charts-dock .map-selector-btn:focus-visible .map-selector-thumb,
.charts-dock .map-selector-btn.active .map-selector-thumb {
    opacity: 0.58;
    transform: scale(1);
}

.map-route-info-overlay {
    z-index: 680 !important;
    border-left: 3px solid var(--hud-cyan) !important;
    background: linear-gradient(145deg, rgba(6, 15, 28, 0.78), rgba(4, 10, 20, 0.58)) !important;
    box-shadow: -5px 0 20px rgba(0, 242, 254, 0.16), 0 22px 54px rgba(0,0,0,0.54) !important;
}

.map-route-info-list li {
    position: relative;
    grid-template-columns: 24px 54px minmax(0, 1fr) !important;
    min-height: 28px;
}

.map-route-info-list li:not(:last-child)::after {
    content: "›";
    position: absolute;
    left: 7px;
    bottom: -10px;
    color: var(--hud-cyan);
    animation: route-flow-arrow 1.25s ease-in-out infinite;
}

.map-route-hop-number {
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(120, 221, 255, 0.48);
    border-radius: 50%;
    color: #dff8ff !important;
    background: rgba(0, 196, 255, 0.12);
    font-size: 0.62rem !important;
}

.map-route-hop-label {
    color: rgba(255,255,255,0.48);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.6rem;
}

@keyframes route-flow-arrow {
    50% { transform: translateY(3px); opacity: 0.35; }
}

.map-console-footer {
    border-top-color: rgba(120, 221, 255, 0.42);
    background: linear-gradient(145deg, rgba(7, 15, 29, 0.68), rgba(5, 11, 22, 0.5));
    box-shadow: 0 -1px 14px rgba(0, 242, 254, 0.16), 0 24px 65px rgba(0, 0, 0, 0.42);
}

.map-footer-btn i {
    transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.map-footer-btn:hover {
    transform: translateY(-1px);
    text-shadow: 0 0 12px rgba(120, 221, 255, 0.45);
}

#footer-history-btn:hover i {
    animation: history-book-flip 0.55s ease;
}

@keyframes history-book-flip {
    50% { transform: perspective(80px) rotateY(-28deg) scale(1.08); }
}

.minimize-panels-btn {
    overflow: visible;
}

.minimize-panels-btn i {
    transition: transform 0.3s ease;
}

.map-console-shell.panels-minimized .minimize-panels-btn i {
    transform: rotate(180deg) scale(1.08);
}

.map-console-shell.panels-minimized .minimize-panels-btn::after {
    content: "";
    width: 7px;
    height: 7px;
    position: absolute;
    top: -3px;
    right: -3px;
    border-radius: 50%;
    background: #ff516b;
    box-shadow: 0 0 10px #ff365f;
    animation: minimized-badge 1.4s ease-in-out infinite;
}

@keyframes minimized-badge {
    50% { opacity: 0.35; transform: scale(0.78); }
}

.map-console-shell.panels-minimized .map-status-card {
    transform: translateX(-120%);
}

.map-console-shell.panels-minimized .map-route-info-overlay {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1180px) {
    .map-hud-icon-btn,
    .map-hud-avatar-btn,
    .active-map-chip {
        display: none;
    }

    .map-status-card {
        width: 350px;
    }
}

@media (max-width: 920px) {
    .map-hud-action-btn span {
        display: none;
    }

    .map-hud-action-btn {
        width: 36px;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
    }

    .map-status-card {
        width: 300px;
        grid-template-columns: 1fr;
    }

    .map-status-actions {
        flex-wrap: nowrap;
    }
}

@media (max-width: 720px) {
    .map-console-shell {
        --map-content-top: 74px;
    }

    .map-hud-action-btn {
        display: inline-flex;
    }

    .dock-left {
        top: auto;
        bottom: 68px;
    }

    .map-status-card {
        left: 8px;
        width: min(270px, calc(100vw - 68px));
        min-height: 104px;
        border-left-width: 2px;
    }

    .map-status-actions {
        margin-top: 7px;
    }

    .map-status-btn {
        width: 36px;
        height: 36px;
        justify-content: center;
        padding: 0;
    }

    .map-status-btn span {
        display: none;
    }

    .map-controls {
        right: 8px;
    }

    .map-console-shell .map-stage::before {
        top: 74px;
        left: 8px;
    }

    .map-console-shell .map-stage::after {
        right: 8px;
        bottom: 68px;
    }

    .map-route-info-overlay {
        z-index: 590 !important;
    }
}

/* Reader map control placement corrections */
.map-status-card {
    left: auto;
    right: 16px;
    border-left: 1px solid var(--hud-line);
    border-right: 3px solid var(--hud-cyan);
    box-shadow: 4px 0 18px rgba(0, 242, 254, 0.16), 0 24px 65px rgba(0, 0, 0, 0.42);
}

.map-panel-tools {
    position: absolute;
    z-index: 910;
    top: 100px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-panel-tools .map-controls,
.map-panel-tools .minimize-panels-btn {
    position: static;
    inset: auto;
    transform: none;
}

.map-panel-tools .map-controls {
    display: block;
}

.map-panel-tools .map-viewport-rail {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--hud-line);
    border-radius: 10px;
    background: rgba(7, 13, 24, 0.72);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
}

.map-panel-tools .map-control-icon {
    width: 34px;
    height: 34px;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.025);
}

.map-panel-tools .map-control-icon:hover {
    color: var(--hud-cyan);
    border-color: rgba(120, 221, 255, 0.38);
    background: rgba(70, 190, 238, 0.12);
}

.map-console-shell.panels-minimized .map-panel-tools .map-controls {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-10px);
}

.map-console-shell.panels-minimized .map-status-card {
    transform: translateX(120%);
}

.map-footer-clock-spinner {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    color: var(--hud-cyan);
    background: radial-gradient(circle, rgba(120, 221, 255, 0.14), transparent 62%);
    filter: drop-shadow(0 0 7px rgba(120, 221, 255, 0.4));
    animation: clock-emblem-float 3.4s ease-in-out infinite;
}

.map-footer-clock-spinner::before,
.map-footer-clock-spinner::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.map-footer-clock-spinner::before {
    inset: 1px;
    border: 1px solid rgba(120, 221, 255, 0.42);
    border-top-color: transparent;
    border-bottom-color: rgba(255, 91, 189, 0.56);
    animation: clock-emblem-orbit 4.5s linear infinite;
}

.map-footer-clock-spinner::after {
    inset: 6px;
    border: 1px dashed rgba(120, 221, 255, 0.34);
    animation: clock-emblem-orbit 3s linear infinite reverse;
}

.map-footer-clock-spinner i {
    position: relative;
    z-index: 1;
    font-size: 0.84rem;
    text-shadow: 0 0 9px currentColor;
    animation: clock-emblem-core 2.2s ease-in-out infinite alternate;
}

@keyframes clock-emblem-orbit {
    to { transform: rotate(360deg); }
}

@keyframes clock-emblem-float {
    50% { transform: translateY(-2px); filter: drop-shadow(0 0 11px rgba(120, 221, 255, 0.65)); }
}

@keyframes clock-emblem-core {
    to { transform: scale(1.12) rotate(8deg); color: #f2fdff; }
}

@media (max-width: 920px) {
    .map-status-card {
        right: 8px;
        left: auto;
    }

    .map-panel-tools {
        right: 8px;
    }
}

@media (max-width: 720px) {
    .map-panel-tools {
        top: 74px;
        gap: 5px;
    }

    .map-panel-tools .map-viewport-rail {
        gap: 2px;
        padding: 3px;
    }

    .map-panel-tools .map-control-icon {
        width: 32px;
        height: 32px;
    }

    .map-status-card {
        right: 8px;
        left: auto;
    }

    .map-footer-clock {
        min-width: 104px;
        grid-template-columns: auto 28px;
        grid-template-areas: "label spinner" "time spinner";
    }

    .map-footer-clock-spinner {
        display: grid;
        width: 28px;
        height: 28px;
    }
}

/* --- SUBSCRIPTION READER SPA STYLES RELOCATED TO subscription.css --- */


/* The World Inspector uses the dock body as its single scroll container. */
#world-intel-tab-content {
    flex: 0 0 auto;
    overflow: visible;
}

.planet-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.planet-related-card {
    display: flex;
    min-height: 145px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #e2f7ff;
    background: rgba(3, 12, 26, 0.58);
    text-decoration: none;
}

.planet-related-card:hover {
    border-color: rgba(34, 211, 238, 0.7);
    color: #fff;
}

.planet-related-card img,
.planet-related-placeholder {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.planet-related-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.45);
}

.planet-related-card > span:not(.planet-related-placeholder),
.planet-related-card small {
    padding: 0.35rem 0.45rem 0;
    font-size: 0.72rem;
    line-height: 1.25;
}

﻿.planetary-index-search-label,
.planetary-index-count {
    display: block;
    margin: 0.45rem 0;
    color: rgba(218, 238, 255, 0.62);
    font-size: 0.72rem;
}

.planetary-index-panel {
    width: min(1280px, 100%);
    max-height: min(92vh, 900px);
    border-color: rgba(103, 232, 249, 0.24);
    background: radial-gradient(circle at 12% 0%, rgba(103, 232, 249, 0.15), transparent 32%), radial-gradient(circle at 85% 12%, rgba(250, 204, 21, 0.10), transparent 26%), rgba(1, 6, 16, 0.94);
}

.planetary-index-shell { display: flex; flex-direction: column; gap: 1rem; }

.planetary-index-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 2.8rem 0.85rem 0;
    border-bottom: 1px solid rgba(103, 232, 249, 0.14);
}

.planetary-index-header h2 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.7rem, 3vw, 3rem);
    letter-spacing: 0.03em;
}

.planetary-index-subtitle {
    max-width: 820px;
    margin: 0;
    color: rgba(220, 236, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.6;
}

.planetary-index-continuity {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.35rem;
    padding: 0.28rem;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 0 18px rgba(103, 232, 249, 0.06);
}

.planetary-index-continuity-btn {
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 0.85rem;
    color: rgba(220, 236, 255, 0.72);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-header);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.planetary-index-continuity-btn.active {
    color: #02111b;
    background: linear-gradient(135deg, #67e8f9, #facc15);
    box-shadow: 0 0 20px rgba(103, 232, 249, 0.24);
}

.planetary-index-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    align-items: end;
}

.planetary-index-toolbar .planetary-index-search-label {
    grid-column: 1 / -1;
    margin-bottom: 0;
    color: rgba(103, 232, 249, 0.85);
    font-family: var(--font-header);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.planetary-index-search {
    box-sizing: border-box;
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: 1px solid rgba(103, 232, 249, 0.26);
    border-radius: 14px;
    color: #fff;
    background: rgba(2, 12, 28, 0.78);
    outline: none;
}

.planetary-index-search:focus {
    border-color: rgba(250, 204, 21, 0.65);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08), 0 0 24px rgba(103, 232, 249, 0.12);
}

.planetary-index-layout {
    display: grid;
    grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.8fr);
    gap: 1rem;
    min-height: 0;
}

.planetary-index-grid {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0.45rem;
    max-height: min(61vh, 610px);
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.18);
}

.planetary-index-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 0.62rem;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 0.58rem 0.62rem;
    color: #dcecff;
    background: linear-gradient(135deg, rgba(3, 12, 26, 0.72), rgba(12, 22, 43, 0.5));
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.planetary-index-card.active,
.planetary-index-card:hover {
    transform: translateX(2px);
    border-color: rgba(103, 232, 249, 0.72);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(250, 204, 21, 0.055));
}

.planetary-index-card-orb {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 50%;
    color: rgba(103, 232, 249, 0.9);
    background: radial-gradient(circle, rgba(103, 232, 249, 0.18), rgba(0, 0, 0, 0.15));
}

.planetary-index-card-copy { min-width: 0; }

.planetary-index-card-copy strong {
    display: block;
    overflow: hidden;
    color: #f8fbff;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planetary-index-card-copy small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.25rem;
}

.planetary-index-card-copy small span {
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    color: rgba(220, 236, 255, 0.64);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.planetary-index-detail {
    min-width: 0;
    max-height: min(61vh, 610px);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid rgba(103, 232, 249, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(1, 8, 18, 0.62), rgba(1, 8, 18, 0.38));
}

.planetary-index-detail-hero {
    display: grid;
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.25fr);
    gap: 1rem;
    min-height: 220px;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: radial-gradient(circle at 20% 20%, rgba(103, 232, 249, 0.20), transparent 36%), linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
}

.planetary-index-visual-wrap {
    position: relative;
    display: grid;
    min-height: 210px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 16px;
    background: radial-gradient(circle, rgba(103, 232, 249, 0.08), rgba(0, 0, 0, 0.42));
}

.planetary-index-visual-wrap::before {
    content: '';
    position: absolute;
    inset: 13%;
    border: 1px dashed rgba(103, 232, 249, 0.18);
    border-radius: 50%;
    pointer-events: none;
}

.planetary-index-visual-wrap img,
.planetary-index-detail-placeholder {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    height: 210px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.planetary-index-detail-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2.4rem;
}

.planetary-index-title-card { align-self: end; min-width: 0; }

.planetary-index-detail h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    line-height: 1.05;
}

.planetary-index-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }

.planetary-index-source,
.planetary-index-hero-actions span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    color: rgba(220, 236, 255, 0.78);
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.72rem;
    text-decoration: none;
}

.planetary-index-source:hover { border-color: rgba(250, 204, 21, 0.55); color: #fff; }

.planetary-index-overview p { font-size: 0.9rem; line-height: 1.75; }

.planetary-index-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }

.planetary-index-field {
    padding: 0.72rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.planetary-index-field span {
    display: block;
    margin-bottom: 0.25rem;
    color: rgba(103, 232, 249, 0.72);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.planetary-index-field strong { display: block; color: #f8fbff; font-size: 0.79rem; line-height: 1.45; }

.planetary-index-history,
.planetary-index-related,
.planetary-index-notes,
.planetary-index-infobox { margin-top: 1.25rem; }

@media (max-width: 720px) {
    .planetary-index-header,
    .planetary-index-toolbar { grid-template-columns: 1fr; }
    .planetary-index-header { flex-direction: column; padding-right: 0; }
    .planetary-index-layout { grid-template-columns: 1fr; }
    .planetary-index-grid { max-height: 260px; }
    .planetary-index-detail { max-height: none; }
    .planetary-index-field-grid { grid-template-columns: 1fr; }
    .planetary-index-detail-hero { grid-template-columns: 1fr; min-height: 0; }
    .planetary-index-visual-wrap img,
    .planetary-index-detail-placeholder { width: 100%; height: 190px; }
}

.planet-related-card small {
    margin-top: auto;
    padding-bottom: 0.45rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.6rem;
}
