/* --- FUNDAMENTAL RESET & THEME --- */
:root {
    --bg-color: #050505;
    --panel-bg: rgba(10, 10, 10, 0.75); /* Reduced from 0.95 for better graph visibility */
    --border-color: #222;
    --text-main: #00f2ff; /* CIA Cyan */
    --text-bright: #e0e0e0;
    --text-dim: #888;
    --accent-red: #ff3e3e;
    --accent-gold: #ffcc00;
    --accent-purple: #6C5CE7;
    --font-mono: 'Courier New', Courier, monospace;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-bright);
    font-family: var(--font-mono);
    overflow: hidden;
}

/* --- CRT / NOISE OVERLAYS --- */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 100;
}

.scanline {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 101;
    animation: scanlineScroll 10s linear infinite;
}

.noise {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('media/1k_Grain.webp');
    opacity: 0.05;
    pointer-events: none;
    z-index: 102;
}

@keyframes scanlineScroll {
    from { background-position: 0 0; }
    to { background-position: 0 100%; }
}

/* --- HEADER --- */
header {
    position: absolute;
    top: 0; width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    text-shadow: 0 0 5px var(--text-main);
}

.logo { font-weight: bold; font-size: 1.2rem; letter-spacing: 2px; }
.logo span.highlight { color: var(--accent-red); text-shadow: 0 0 5px var(--accent-red); }
.sub-logo { font-size: 0.7rem; color: var(--accent-red); text-shadow: 0 0 5px var(--accent-red); margin-left: 10px; }
.status-container { display: flex; flex-direction: column; align-items: flex-end; }
.status { color: var(--text-main); font-size: 0.8rem; }
.blink { animation: blinker 1s linear infinite; color: var(--accent-gold); text-shadow: 0 0 5px var(--accent-gold); }

.framing-line {
    font-size: 0.6rem;
    color: #555;
    margin-top: 5px;
    letter-spacing: 1px;
    font-style: italic;
}

@keyframes blinker { 50% { opacity: 0; } }

/* --- SEARCH BAR --- */
.header-search {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 1;
    min-width: 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #333;
    border-radius: 2px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    transition: border-color 0.2s;
}

.search-wrapper:focus-within {
    border-color: var(--text-main);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.15);
}

.search-prompt {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1px;
    white-space: nowrap;
    user-select: none;
}

.search-input-container {
    position: relative;
    min-width: 160px;
}

#node-search {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 2px 0;
    position: relative;
    z-index: 2;
}

#node-search::placeholder {
    color: #444;
    font-size: 9px;
    letter-spacing: 1px;
}

.search-ghost {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: #333;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}

.search-clear {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 9px;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.search-clear:hover {
    opacity: 1;
    color: var(--accent-red);
}

.search-results-count {
    font-size: 8px;
    letter-spacing: 1px;
    color: var(--accent-gold);
    margin-top: 2px;
    height: 12px;
    padding-left: 2px;
}

/* --- METHODOLOGICAL RIGOR ANIMATIONS --- */
@keyframes flicker-low {
    0% { opacity: 1; }
    5% { opacity: 0.4; }
    10% { opacity: 1; }
    15% { opacity: 0.2; }
    20% { opacity: 1; }
    55% { opacity: 1; }
    60% { opacity: 0.3; }
    65% { opacity: 1; }
}

@keyframes flicker-medium {
    0% { opacity: 1; }
    50% { opacity: 1; }
    52% { opacity: 0.7; }
    54% { opacity: 1; }
}

.rigor-LOW {
    animation: flicker-low 4s linear infinite;
}

.rigor-MEDIUM {
    animation: flicker-medium 8s linear infinite;
}

.rigor-HIGH {
    /* Stable, no animation needed */
}

/* --- FILTER PANEL (Left Sidebar) --- */
#filter-panel {
    position: absolute;
    left: 20px; top: 100px; bottom: 100px;
    width: 280px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    overflow-y: auto;
    z-index: 50;
    font-size: 0.75rem;
    backdrop-filter: blur(10px);
}

.filter-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px; margin-bottom: 15px;
    font-weight: bold; color: var(--text-dim);
}

.view-mode-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.view-mode-btn {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    padding: 8px;
    font-family: inherit;
    font-size: 0.65rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.view-mode-btn:hover {
    border-color: var(--text-main);
    color: #fff;
    background: rgba(0, 242, 255, 0.05);
}

.view-mode-btn.active {
    border-color: var(--text-main);
    color: var(--text-main);
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    font-weight: bold;
}

.view-mode-btn.active::before {
    content: "> ";
}

.parent-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 5px;
    background: rgba(255,255,255,0.03);
}

.parent-label { cursor: pointer; display: flex; align-items: center; color: var(--text-bright); }
.parent-label input { margin-right: 8px; }

.sub-filter-box {
    display: none; 
    flex-direction: column;
    padding-left: 15px;
    margin-top: 5px;
    border-left: 1px solid #333;
}

.sub-filter-box label {
    margin: 3px 0;
    color: var(--text-dim);
    transition: color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.sub-filter-box label input { margin-right: 8px; }
.sub-filter-box label:hover { color: var(--text-main); }
.toggle-icon { cursor: pointer; color: #555; padding: 5px; }

/* --- THE VIZ CONTAINER --- */
#viz-container {
    width: 100vw;
    height: 100vh;
}

#wizmap-root svg {
    touch-action: none; /* Prevent browser handling of touch events for smoother zoom */
    -webkit-user-select: none;
    user-select: none;
}

/* --- GOTHAM-STYLE MAP LAYER --- */

.map-layer path {
    transition: fill 0.4s, stroke 0.4s;
}

/* Ocean and atmosphere base layers */
.map-view-active .ocean-fill {
    fill: #060b14;
}

.map-view-active .atmosphere-layer {
    opacity: 1;
}

/* Graticule grid (Gotham tactical grid) */
.map-view-active .graticule {
    stroke: #1a2a3a;
    stroke-width: 0.3px;
    stroke-opacity: 0.35;
    stroke-dasharray: 2, 6;
}

.map-view-active .graticule-outline {
    stroke: #1e3048;
    stroke-width: 0.8px;
    stroke-opacity: 0.5;
}

/* Country fills — dark navy with subtle blue tint (Gotham palette) */
.map-view-active .map-layer path.country {
    fill: #0d1520;
    stroke: #1a2a3a;
    stroke-width: 0.5px;
}

.map-view-active .map-layer path.country:hover {
    fill: #111d2e;
    stroke: #2a4060;
    stroke-width: 0.8px;
}

/* Vignette overlay — darken edges for atmospheric depth */
.map-view-active .vignette-overlay {
    opacity: 1;
    pointer-events: none;
}

/* Fallback for old path elements (non-country) */
.map-view-active .map-layer path:not(.country):not(.graticule):not(.graticule-outline) {
    fill: #0d1520;
    stroke: #1a2a3a;
    stroke-width: 0.5px;
}

.map-view-active .artifact-node {
    transform: scale(2);
}

.map-view-active .node-halo {
    transform: scale(2.5);
    opacity: 0.6;
}

.map-view-active .node-group:hover .artifact-node {
    transform: scale(3);
}

/* Leader lines connecting labels to nodes */
.leader-line {
    fill: none;
    stroke: #555;
    stroke-width: 1px;
    stroke-dasharray: 2, 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.map-view-active .leader-line {
    opacity: 0.6;
}

/* Ensure labels and nodes have smooth transitions for scaling */
.node-label {
    fill: #aaa;
    font-size: 10px;
    pointer-events: all;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000, 0 0 4px #000, -1px -1px 2px #000;
    transition: font-size 0.2s, transform 0.4s, fill 0.2s;
}

.node-label:hover {
    fill: #fff;
}

/* Map view label styling - more readable */
.map-view-active .node-label {
    fill: #ddd;
    font-size: 9px;
    text-shadow: 0 0 3px #000, 0 0 6px #000, 1px 1px 2px #000, -1px -1px 2px #000;
    paint-order: stroke fill;
    stroke: #000;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.map-view-active .node-label:hover {
    fill: #00f2ff;
    text-decoration: underline;
}

.map-view-active .anchor-group .node-label {
    fill: #fff;
    font-size: 11px;
    font-weight: bold;
}

.map-view-active .anchor-group .node-label:hover {
    fill: #ffcc00;
}

/* Map view link styles - show connections when node selected */
.map-view-active .link.highlighted {
    stroke: var(--text-main);
    stroke-opacity: 0.7 !important;
    stroke-width: 2px;
}

.map-view-active .link.implicit-link.highlighted {
    stroke: var(--accent-gold);
    stroke-opacity: 0.5 !important;
    stroke-dasharray: 2, 4;
    stroke-width: 1.5px;
}

.map-view-active .link.temporarily-revealed {
    stroke-opacity: 0.6 !important;
}

.map-view-active .link.implicit-link.temporarily-revealed {
    stroke: var(--accent-gold);
    stroke-opacity: 0.4 !important;
    stroke-dasharray: 2, 4;
}

/* --- GLOBE PROJECTION TOGGLE --- */
.map-projection-toggle {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px 32px;
    margin-bottom: 4px;
}

.projection-btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.projection-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 204, 0, 0.08);
}

.projection-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Globe ocean sphere */
.globe-ocean {
    fill: #060b14;
    stroke: #1e3048;
    stroke-width: 1.2px;
}

/* Back-face nodes in globe mode */
.globe-backface {
    display: none !important;
}

/* Hide flat-map-only elements in globe mode */
body.globe-mode .ocean-fill,
body.globe-mode .atmosphere-layer,
body.globe-mode .vignette-overlay {
    display: none;
}

.node-group circle, .node-group path {
    transition: transform 0.2s, r 0.2s;
}

/* --- D3 GRAPH STYLING --- */
.node-group {
    cursor: pointer;
    will-change: transform; /* Optimize for force simulation transform updates */
}

.node-group circle.artifact-node {
    stroke: #000;
    stroke-width: 1px;
}

.node-group path.artifact-node {
    stroke: #000;
    stroke-width: 0.5px;
}

.node-group circle.anchor-node {
    stroke: #fff;
    stroke-width: 2px;
}

.node-group:hover circle,
.node-group:hover path {
    filter: brightness(1.5) drop-shadow(0 0 8px currentColor);
}

.anchor-group .node-label {
    fill: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Expand/Collapse Indicators for Anchor Nodes */
.expand-indicator {
    fill: var(--text-main);
    font-family: 'Courier New', monospace;
    cursor: pointer;
    user-select: none;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    text-anchor: middle;
    dominant-baseline: central;
}

.expand-indicator:hover {
    opacity: 1;
    transform: scale(1.2);
}

.expand-indicator.expanded {
    fill: var(--accent-gold);
}

/* Anchor expansion state styling */
.anchor-group.anchor-expanded circle.anchor-node {
    stroke: var(--accent-gold);
    stroke-width: 3px;
    filter: drop-shadow(0 0 6px var(--accent-gold));
}

/* Animation for expanding nodes */
.node-group.expanding {
    animation: nodeExpand 0.4s ease-out;
}

@keyframes nodeExpand {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation for collapsing nodes */
.node-group.collapsing {
    animation: nodeCollapse 0.3s ease-in forwards;
}

@keyframes nodeCollapse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.3);
        opacity: 0;
    }
}

/* Tooltip for click-to-expand hint */
.anchor-group::after {
    content: 'Click to expand';
    position: absolute;
    background: var(--bg-color);
    border: 1px solid var(--text-main);
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text-main);
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.anchor-group:hover::after {
    opacity: 0.9;
}

.anchor-group.anchor-expanded::after {
    content: 'Click to collapse';
}

/* Edges / Links */
.link {
    stroke: #444;
    stroke-opacity: 0.2;
    stroke-width: 1px;
    pointer-events: none;
    transition: stroke-opacity 0.4s, stroke 0.4s, stroke-width 0.4s;
    will-change: transform; /* Optimize for force simulation position updates */
}

/* Implicit links - derived from description/archive connection mentions */
.link.implicit-link {
    stroke: #888;
    stroke-opacity: 0.15;
    stroke-dasharray: 1, 3;
    stroke-width: 1px;
    stroke-linecap: round;
}

.link.implicit-link.highlighted {
    stroke: var(--accent-gold);
    stroke-opacity: 0.6;
    stroke-dasharray: 2, 4;
    stroke-width: 1.5px;
    stroke-linecap: round;
}

.link.highlighted {
    stroke: var(--text-main);
    stroke-opacity: 0.8;
    stroke-width: 2px;
}

/* Tour edge highlighting */
.link.tour-edge-highlight {
    stroke: #6aa9ff;
    stroke-opacity: 0.9;
    stroke-width: 3px;
    stroke-dasharray: 5, 5;
    animation: tourEdgePulse 2s ease-in-out infinite;
}

@keyframes tourEdgePulse {
    0%, 100% {
        stroke-opacity: 0.7;
        stroke-width: 3px;
    }
    50% {
        stroke-opacity: 1;
        stroke-width: 3.5px;
    }
}

/* Sonar Effect */
.sonar-wave {
    fill: none;
    stroke-width: 2px;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
    animation: sonar-ripple 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes sonar-ripple {
    0% { transform: scale(1); opacity: 0.8; stroke-width: 2px; }
    100% { transform: scale(4); opacity: 0; stroke-width: 0px; }
}

/* Node Halos based on Substantiation */
.node-halo {
    fill: none;
    stroke-width: 1px;
    opacity: 0.3;
    pointer-events: none;
}

.halo-SUBSTANTIATED { stroke: #00ff88; stroke-width: 2px; opacity: 0.5; }
.halo-PARTIAL { stroke: #ffd000; stroke-dasharray: 2,2; opacity: 0.4; }
.halo-UNSUBSTANTIATED { stroke: #ff3e3e; stroke-dasharray: 4,4; opacity: 0.3; }
.halo-MYTHOLOGIZED { stroke: var(--accent-gold); stroke-width: 1px; opacity: 0.4; filter: blur(1px); }

/* Substantiation Badges in Info Panel */
.substantiation-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: bold;
    margin-bottom: 12px;
    margin-right: 20px; /* Added spacing to the right */
    letter-spacing: 1px;
    border: 1px solid transparent;
}

.badge-SUBSTANTIATED { background: rgba(0, 255, 136, 0.1); color: #00ff88; border-color: #00ff88; }
.badge-PARTIAL { background: rgba(255, 208, 0, 0.1); color: #ffd000; border-color: #ffd000; }
.badge-UNSUBSTANTIATED { background: rgba(255, 62, 62, 0.1); color: #ff3e3e; border-color: #ff3e3e; }
.badge-MYTHOLOGIZED { background: rgba(255, 204, 0, 0.1); color: var(--accent-gold); border-color: var(--accent-gold); animation: blinker 2s infinite; }

/* Rigor Badges */
.rigor-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: bold;
    margin-bottom: 12px;
    margin-right: 10px;
    letter-spacing: 1px;
    border: 1px solid transparent;
}

.badge-HIGH { background: rgba(0, 242, 255, 0.1); color: var(--text-main); border-color: var(--text-main); }
.badge-MEDIUM { background: rgba(255, 204, 0, 0.1); color: var(--accent-gold); border-color: var(--accent-gold); }
.badge-LOW { background: rgba(255, 62, 62, 0.1); color: var(--accent-red); border-color: var(--accent-red); font-style: italic; }

/* Category Colors */
.CIA circle, .CIA path { fill: var(--text-main); color: var(--text-main); }
.SOVIET circle, .SOVIET path { fill: var(--accent-red); color: var(--accent-red); }
.DREAM circle, .DREAM path { fill: #a29bfe; color: #a29bfe; }
.CONSPIRACY circle, .CONSPIRACY path { fill: #e17055; color: #e17055; }
.PARAPSYCHOLOGY circle, .PARAPSYCHOLOGY path { fill: var(--accent-purple); color: var(--accent-purple); }
.POP_CULTURE circle, .POP_CULTURE path { fill: var(--accent-gold); color: var(--accent-gold); }
.THREAT circle, .THREAT path { fill: #ff7f50; color: #ff7f50; }
.PSI circle, .PSI path { fill: #e0ffff; color: #e0ffff; }
.PHENOMENON circle, .PHENOMENON path { fill: #e0ffff; color: #e0ffff; }
.NORMAL circle, .NORMAL path { fill: #708090; color: #708090; }
.NORMALIZED_RESEARCH circle, .NORMALIZED_RESEARCH path { fill: #708090; color: #708090; }
.INTERNATIONAL circle, .INTERNATIONAL path { fill: #55efc4; color: #55efc4; }
.LITERATURE circle, .LITERATURE path { fill: #55efc4; color: #55efc4; }
.INCIDENT circle, .INCIDENT path { fill: #ff6b6b; color: #ff6b6b; }

/* Visibility Control */
.hidden { display: none !important; }
.hidden-element { visibility: hidden !important; opacity: 0 !important; }

/* Temporarily revealed nodes override hidden-element */
.temporarily-revealed.hidden-element {
    visibility: visible !important;
    opacity: 1 !important;
}
.link.temporarily-revealed.hidden-element {
    visibility: visible !important;
    opacity: 1 !important;
}

/* --- INFO PANEL (Right Aside) --- */
#info-panel {
    position: absolute;
    right: 20px; top: 100px;
    width: 320px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    z-index: 55;
    transition: transform 0.4s ease, opacity 0.4s ease;
    backdrop-filter: blur(10px);
}

#info-panel.hidden {
    transform: translateX(400px);
    opacity: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.panel-header h3 { margin: 0; font-size: 0.9rem; color: var(--accent-gold); text-shadow: 0 0 5px var(--accent-gold); }
.panel-header button { 
    background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.8rem; font-family: inherit;
}
.panel-header button:hover { color: #fff; }

.panel-content {
    color: var(--text-bright);
    line-height: 1.4;
    font-size: 0.85rem;
}

#node-description {
    margin-bottom: 20px;
    color: var(--text-bright);
}

.connection-box {
    margin-top: 20px;
    padding: 10px;
    background: rgba(0, 242, 255, 0.05);
    border-left: 2px solid var(--text-main);
}

.connection-box strong {
    display: block;
    font-size: 0.7rem;
    color: var(--text-main);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

#node-connection {
    margin: 0;
    color: var(--text-bright);
}

.metadata { 
    margin-top: 20px; 
    font-size: 0.7rem; 
    color: var(--text-dim); 
    border-top: 1px solid #222;
    padding-top: 10px;
}

.metadata strong { color: #666; }

/* --- SIGNIFICANCE STYLES (Anchors) --- */
.significance-box {
    margin-top: 20px;
    padding: 12px;
    background: rgba(108, 92, 231, 0.05); /* Subtle purple glow */
    border-left: 3px solid var(--accent-purple);
    border-radius: 0 4px 4px 0;
}

.significance-header {
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--accent-purple);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(108, 92, 231, 0.3);
}

.significance-text {
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
    color: #bbb;
    font-style: italic;
}

/* --- GOVERNMENT POSTURE STYLES --- */
.posture-box {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 4px;
}

.posture-header {
    font-size: 0.65rem;
    font-weight: bold;
    color: #888;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
    letter-spacing: 1px;
}

.posture-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.posture-label { color: #aaa; }
.posture-value { font-weight: bold; }

/* Conclusion Status Colors */
.posture-value.PROMISING { color: #00ff88; }
.posture-value.INCONCLUSIVE { color: #ffd000; }
.posture-value.DISPROVEN { color: #ff3e3e; text-decoration: line-through; }
.posture-value.TERMINATED { color: #ff3e3e; }
.posture-value.TRANSITIONED { color: var(--text-main); }
.posture-value.MIXED { color: #ffd000; }
.posture-value.UNKNOWN { color: #888; font-style: italic; }

/* --- LIFECYCLE VISUALIZATION --- */
.lifecycle-container {
    margin-top: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.lifecycle-header {
    font-size: 0.6rem;
    color: #555;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.lifecycle-track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 4px;
    background: #222;
    margin: 10px 0;
}

.lifecycle-step {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 2px;
    z-index: 2;
    transition: all 0.4s;
    position: relative; /* Added for tooltip positioning */
}

.lifecycle-step.active {
    background: var(--text-main);
    box-shadow: 0 0 8px var(--text-main);
    transform: scale(1.2);
}

.lifecycle-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    color: var(--text-main);
    padding: 4px 8px;
    font-size: 0.5rem;
    white-space: nowrap;
    border: 1px solid var(--text-main);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.lifecycle-step:hover .lifecycle-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.lifecycle-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.5rem;
    color: #444;
    letter-spacing: 1px;
}

/* --- LEGEND --- */
#legend {
    position: absolute;
    bottom: 20px; right: 20px; left: auto;
    display: flex;
    gap: 40px;
    font-size: 0.6rem;
    z-index: 50;
    background: rgba(0,0,0,0.65); /* Reduced from 0.9 for better graph visibility */
    padding: 15px 25px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    backdrop-filter: blur(8px); /* Increased blur to maintain text contrast */
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: transform 0.4s, opacity 0.4s;
}

#legend.hidden {
    transform: translateY(200px);
    opacity: 0;
    pointer-events: none;
}

.close-legend {
    position: absolute;
    top: 5px; right: 5px;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.6rem;
}

.close-legend:hover { color: #fff; }

.legend-toggle {
    display: none; /* Desktop hidden */
}

/* ... existing legend styles ... */

.legend-column { display: flex; flex-direction: column; gap: 8px; }
.legend-header { color: #555; margin-bottom: 5px; font-weight: bold; letter-spacing: 1px; }
.legend-item { display: flex; align-items: center; gap: 10px; color: var(--text-dim); }

.dot { width: 8px; height: 8px; border-radius: 50%; }
.shape { width: 10px; height: 10px; background: #fff; }
.shape.square { border-radius: 0; }
.shape.diamond { transform: rotate(45deg); width: 8px; height: 8px; }
.shape.triangle { 
    width: 0; height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid #fff;
    background: transparent;
}
.shape.circle { border-radius: 50%; }
.shape.hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.shape.wye {
    /* Y-shape / Mercedes-style three-prong */
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 75% 100%, 50% 70%, 25% 100%, 40% 60%, 0% 50%, 40% 40%);
}
.shape.star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.dot.cia { background: var(--text-main); box-shadow: 0 0 5px var(--text-main); }
.dot.soviet { background: var(--accent-red); box-shadow: 0 0 5px var(--accent-red); }
.dot.dream { background: #a29bfe; box-shadow: 0 0 5px #a29bfe; }
.dot.conspiracy { background: #e17055; box-shadow: 0 0 5px #e17055; }
.dot.parapsychology { background: var(--accent-purple); box-shadow: 0 0 5px var(--accent-purple); }
.dot.pop-culture { background: var(--accent-gold); box-shadow: 0 0 5px var(--accent-gold); }
.dot.threat { background: #ff7f50; box-shadow: 0 0 5px #ff7f50; }
.dot.psi { background: #e0ffff; box-shadow: 0 0 5px #e0ffff; }
.dot.normal { background: #708090; box-shadow: 0 0 5px #708090; }
.dot.literature { background: #55efc4; box-shadow: 0 0 5px #55efc4; }
.dot.incident { background: #ff6b6b; box-shadow: 0 0 5px #ff6b6b; }

/* --- CE RATING BADGES --- */
.ce-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    margin-left: 8px;
    vertical-align: middle;
}
.ce-badge.ce1 { background: rgba(78, 205, 196, 0.2); border: 1px solid #4ecdc4; color: #4ecdc4; }
.ce-badge.ce2 { background: rgba(243, 156, 18, 0.2); border: 1px solid #f39c12; color: #f39c12; }
.ce-badge.ce3 { background: rgba(231, 76, 60, 0.2); border: 1px solid #e74c3c; color: #e74c3c; }
.ce-badge.ce4 { background: rgba(155, 89, 182, 0.2); border: 1px solid #9b59b6; color: #9b59b6; }
.ce-badge.ce5 { background: rgba(233, 30, 99, 0.2); border: 1px solid #e91e63; color: #e91e63; }

/* Observable tags in info panel */
.observable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.observable-tag {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 2px;
    font-size: 0.55rem;
    color: var(--text-main);
    background: rgba(0, 242, 255, 0.05);
    letter-spacing: 0.5px;
}

/* CE Rating legend dots */
.ce-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.ce-dot.ce1 { background: #4ecdc4; box-shadow: 0 0 4px #4ecdc4; }
.ce-dot.ce2 { background: #f39c12; box-shadow: 0 0 4px #f39c12; }
.ce-dot.ce3 { background: #e74c3c; box-shadow: 0 0 4px #e74c3c; }
.ce-dot.ce4 { background: #9b59b6; box-shadow: 0 0 4px #9b59b6; }
.ce-dot.ce5 { background: #e91e63; box-shadow: 0 0 4px #e91e63; }

/* Incident node pulsing on map */
.INCIDENT .artifact-node {
    filter: drop-shadow(0 0 4px #ff6b6b);
}
.map-view-active .INCIDENT .artifact-node {
    animation: incident-pulse 2s ease-in-out infinite;
}
@keyframes incident-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px #ff6b6b); }
    50% { filter: drop-shadow(0 0 12px #ff6b6b); }
}

/* --- ZOOM CONTROLS --- */
#zoom-controls {
    position: absolute;
    bottom: 120px;
    left: 320px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 80;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--text-main);
    color: var(--text-main);
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

.zoom-btn:hover {
    background: rgba(0, 242, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
    background: rgba(0, 242, 255, 0.25);
}

.zoom-btn.zoom-reset {
    font-size: 1rem;
    margin-top: 4px;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.1);
}

.zoom-btn.zoom-reset:hover {
    background: rgba(255, 204, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

/* --- TIMELINE --- */
#timeline-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: rgba(10, 10, 10, 0.75); /* Reduced from 0.95 for better graph visibility */
    border: 1px solid var(--text-main); /* Highlighting border */
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 70;
    backdrop-filter: blur(12px); /* Increased blur to maintain text contrast */
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.1); /* Subtle glow */
}

.timeline-label {
    font-size: 0.9rem; /* Larger font */
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-main);
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
}

/* Timeline close button — red [X] on right side */
.timeline-close {
    position: absolute;
    top: 8px;
    right: 14px;
    background: none;
    border: none;
    color: #ff3e3e;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 8px;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.timeline-close:hover {
    opacity: 1;
    color: #ff6b6b;
}

/* Timeline reopen button */
.timeline-reopen {
    display: none; /* Hidden by default, shown when collapsed */
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    border: 1px solid var(--text-main);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 70;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    transition: background 0.2s;
}

.timeline-reopen:hover {
    background: rgba(0, 242, 255, 0.1);
}

/* Collapsed state */
#timeline-container.collapsed {
    transform: translateX(-50%) translateY(200px);
    opacity: 0;
    pointer-events: none;
}

#timeline-container.collapsed ~ .timeline-reopen {
    display: block;
}

#year-slider {
    width: 100%;
    appearance: none;
    background: #222;
    height: 4px;
    border-radius: 2px;
    outline: none;
}

#year-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-main);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--text-main);
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.75rem; /* Increased from 0.5rem */
    color: var(--text-dim); /* Brighter than #444 */
    font-weight: bold;
}

/* Tour Launch Button */
.tour-launch-btn {
    margin-top: 12px;
    width: 100%;
    background: linear-gradient(135deg, #6aa9ff 0%, #4a8fe7 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.tour-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 169, 255, 0.4);
    background: linear-gradient(135deg, #5294e8 0%, #3a7fd6 100%);
}

.tour-launch-btn:active {
    transform: translateY(0);
}

/* Architecture Tour Button Variant */
.arch-tour-btn {
    background: linear-gradient(135deg, #d4af37 0%, #c4991f 100%);
}

.arch-tour-btn:hover {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #c4991f 0%, #b48910 100%);
}

/* --- TOUR PROGRESS TRACKING --- */
#tour-progress-container {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 4px;
}

.tour-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--text-main);
    letter-spacing: 0.1em;
}

.progress-percentage {
    background: rgba(0, 242, 255, 0.15);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

.tour-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tour-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #666;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
}

.tour-progress-item.completed {
    background: rgba(85, 239, 196, 0.08);
}

.tour-progress-item.in-progress {
    background: rgba(255, 204, 0, 0.08);
}

.tour-progress-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tour-status-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.tour-progress-item.completed .tour-status-icon {
    color: #55efc4;
}

.tour-progress-item.in-progress .tour-status-icon {
    color: #ffcc00;
}

.tour-progress-item.not-started .tour-status-icon {
    color: #666;
}

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

.tour-name {
    font-size: 0.7rem;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tour-status {
    font-size: 0.6rem;
    color: #888;
}

.reset-progress-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255, 62, 62, 0.3);
    color: #ff3e3e;
    font-family: inherit;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.reset-progress-btn:hover {
    background: rgba(255, 62, 62, 0.1);
    border-color: rgba(255, 62, 62, 0.5);
}

/* Resume button styling */
.resume-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    margin-left: 8px;
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.4);
    color: #ffcc00;
    font-family: inherit;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.resume-tour-btn:hover {
    background: rgba(255, 204, 0, 0.25);
    border-color: rgba(255, 204, 0, 0.6);
}

/* --- EDUCATIONAL TOUR ENHANCEMENTS (LA-285) --- */

/* Year badge in tour title */
.tour-year-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffcc00 0%, #ff9500 100%);
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 4px 12px;
    margin-right: 12px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(255, 204, 0, 0.3);
}

/* Tour progress bar styling */
.tour-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(0, 242, 255, 0.15);
}

.tour-step-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tour-step-counter {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
}

.tour-year-range {
    font-size: 0.7rem;
    color: #ffcc00;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.tour-countdown-badge {
    background: rgba(106, 169, 255, 0.2);
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #6aa9ff;
}

/* "Why This Matters" lesson box */
.tour-lesson-box {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.12) 0%, rgba(106, 169, 255, 0.08) 100%);
    border: 1px solid rgba(162, 155, 254, 0.3);
    border-left: 4px solid #a29bfe;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    margin: 16px 0;
}

.tour-lesson-header {
    font-weight: 700;
    color: #a29bfe;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.tour-lesson-text {
    color: #e0e0e0;
    font-size: 0.8rem;
    line-height: 1.6;
    font-style: italic;
}

/* Citation styling */
.tour-citation {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.75rem;
}

.tour-citation a {
    color: #6aa9ff;
    text-decoration: none;
    margin-left: 6px;
}

.tour-citation a:hover {
    text-decoration: underline;
    color: #8fc4ff;
}

/* Custom Scrollbar for Panel */
#filter-panel::-webkit-scrollbar { width: 4px; }
#filter-panel::-webkit-scrollbar-track { background: transparent; }
#filter-panel::-webkit-scrollbar-thumb { background: #333; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* --- HEADER: compact single-line layout --- */
    header {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .logo { font-size: 1rem; }
    .sub-logo { display: none; } /* Hide subtitle on mobile — save space */

    .status-container { display: none; } /* Hide status + framing line on mobile */

    /* --- SEARCH: full-width below title --- */
    .header-search {
        width: 100%;
    }

    .search-prompt { display: none; } /* Hide QUERY:// prefix on mobile */

    .search-wrapper {
        width: 100%;
        padding: 6px 10px;
    }

    .search-input-container {
        min-width: 0;
        flex: 1;
    }

    #node-search {
        font-size: 16px; /* 16px minimum prevents iOS Safari auto-zoom on focus */
        padding: 4px 0;
    }

    #node-search::placeholder {
        font-size: 14px;
        color: #888;
    }

    .search-clear {
        font-size: 12px;
        padding: 4px 6px;
    }

    .search-results-count {
        font-size: 0.6rem;
    }

    /* --- TIMELINE: below header, compact, closeable --- */
    #timeline-container {
        bottom: auto;
        top: 95px;
        width: 92%;
        padding: 8px 14px;
        border-radius: 25px;
        transition: transform 0.3s, opacity 0.3s;
    }

    #timeline-container .timeline-ticks {
        font-size: 0.6rem;
    }

    .timeline-reopen {
        position: fixed;
        bottom: auto;
        top: 95px;
    }

    /* --- FILTER PANEL: bottom sheet --- */
    #filter-panel {
        left: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: 60vh;
        border-left: none;
        border-right: none;
        border-bottom: none;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        z-index: 200;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #filter-panel.mobile-active {
        transform: translateY(0);
    }

    /* --- INFO PANEL: bottom sheet --- */
    #info-panel {
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 210;
    }

    #info-panel.hidden {
        transform: translateY(100%);
    }

    /* Larger text for panel readability */
    #info-panel .node-desc-text,
    #info-panel .dossier-sitrep {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    /* --- LEGEND: hidden by default on mobile --- */
    #legend {
        left: 50%;
        transform: translateX(-50%) translateY(200px);
        opacity: 0;
        pointer-events: none;
        right: auto;
        bottom: 75px;
        width: 95%;
        flex-wrap: wrap;
        justify-content: center;
        padding: 16px 12px 12px;
        font-size: 0.6rem;
        gap: 12px;
    }

    #legend:not(.hidden) {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    #legend.hidden {
        transform: translateX(-50%) translateY(200px);
        opacity: 0;
        pointer-events: none;
    }

    /* Bigger close button for touch */
    #legend .close-legend {
        top: 6px;
        right: 8px;
        font-size: 0.85rem;
        color: var(--accent-red);
        padding: 6px 10px;
    }

    /* --- ZOOM CONTROLS: compact, aligned with title row --- */
    #zoom-controls {
        bottom: auto;
        top: 60px;
        right: 10px;
        left: auto;
        flex-direction: row;
        gap: 4px;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .zoom-btn.zoom-reset {
        margin-top: 0;
        margin-left: 2px;
    }

    /* --- MOBILE TOGGLE BUTTONS --- */
    .legend-toggle {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 60;
        background: var(--panel-bg);
        border: 1px solid var(--accent-gold);
        color: var(--accent-gold);
        padding: 12px 20px;
        border-radius: 30px;
        font-family: inherit;
        font-size: 0.75rem;
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
    }

    .mobile-toggle {
        display: block !important;
        position: fixed;
        bottom: 20px;
        left: 20px;
        transform: none;
        z-index: 220;
        background: var(--panel-bg);
        border: 1px solid var(--text-main);
        color: var(--text-main);
        padding: 12px 20px;
        border-radius: 30px;
        font-family: inherit;
        font-size: 0.75rem;
        box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
    }

    /* --- NODE LABELS: larger for touch targets --- */
    .node-label {
        font-size: 12px !important;
    }

    /* --- DOCUMENTARY BADGES: larger touch targets --- */
    .doc-platform-badge {
        font-size: 0.55rem;
        padding: 4px 10px;
    }

    /* --- TOUCH HINTS: better sizing --- */
    #touch-hints {
        width: 85%;
        max-width: 320px;
    }
}

.mobile-toggle { display: none; }

/* --- NARRATIVE OVERLAY --- */
#narrative-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.70); /* Reduced from 0.85 for better graph visibility */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s;
    backdrop-filter: blur(12px); /* Increased blur to maintain focus on narrative */
}

#narrative-overlay.hidden {
    display: none;
}

.narrative-content {
    background: var(--panel-bg);
    border: 1px solid var(--accent-gold);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.15);
    border-radius: 4px;
    position: relative;
}

.narrative-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: 1px solid #ff4757;
    color: #ff4757;
    padding: 6px 12px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 3px;
}

.narrative-close-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

#narrative-title {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

#narrative-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #eee;
    margin-bottom: 30px;
}

.narrative-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.narrative-controls button {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 12px 24px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    letter-spacing: 2px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .narrative-controls {
        flex-direction: column;
        gap: 12px;
    }

    .narrative-controls button {
        width: 100%;
        font-size: 0.7rem;
        padding: 10px 16px;
        letter-spacing: 1px;
        white-space: normal;
        text-overflow: clip;
    }
}

.narrative-controls button:hover {
    border-color: #fff;
    color: #fff;
}

.narrative-controls button:last-child {
    border-color: var(--text-main);
    color: var(--text-main);
}

.narrative-controls button:last-child:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

/* --- OVERSIGHT EVENT NODES --- */
/* Dashed border for unverified claims */
.node.oversight-event {
    stroke: #fdcb6e !important;
    stroke-width: 2px !important;
    stroke-dasharray: 5,3 !important;
    fill: rgba(253, 203, 110, 0.15) !important;
}

.node.oversight-event:hover {
    stroke: #f39c12 !important;
    fill: rgba(253, 203, 110, 0.3) !important;
}

/* Epistemic warning badge */
.epistemic-warning-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.epistemic-warning-panel {
    margin: 15px 0;
    padding: 12px;
    background: rgba(255, 71, 87, 0.1);
    border-left: 3px solid #ff4757;
    border-radius: 3px;
}

.epistemic-warning-panel strong {
    color: #ff4757;
    display: block;
    margin-bottom: 8px;
}

.epistemic-warning-panel p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- CITATION LINKS --- */
.citation-link {
    display: inline-block;
    margin-top: 15px;
    margin-bottom: 25px;
    padding: 8px 16px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 1px;
    transition: all 0.3s;
    border-radius: 3px;
}

.citation-link:hover {
    background: rgba(255, 204, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    transform: translateY(-2px);
}

.citation-link:visited {
    color: #cca300;
}

/* --- TOOLTIP MODE SELECTOR --- */
.tooltip-mode-selector {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-mode-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    font-size: 0.65rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.tooltip-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.tooltip-mode-btn.active {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.3);
}

.tooltip-mode-btn[data-mode="research"].active {
    background: rgba(255, 204, 0, 0.15);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}

.tooltip-mode-btn[data-mode="howto"].active {
    background: rgba(162, 155, 254, 0.15);
    border-color: #a29bfe;
    color: #a29bfe;
    box-shadow: 0 0 8px rgba(162, 155, 254, 0.3);
}

/* --- ENHANCED TOOLTIPS --- */
.enhanced-tooltip {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.6;
    border-left: 3px solid;
}

.enhanced-tooltip.research-mode {
    background: rgba(255, 204, 0, 0.08);
    border-left-color: var(--accent-gold);
    color: #e0e0e0;
}

.enhanced-tooltip.howto-mode {
    background: rgba(162, 155, 254, 0.08);
    border-left-color: #a29bfe;
    color: #e0e0e0;
}

/* --- PERSISTENT FOOTER --- */
.persistent-footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 1px;
    font-style: italic;
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    width: 100%;
}

/* --- SCHOLARLY MODE (DEFAULT) --- */
/* Default: Clean, academic presentation without visual effects */
/* Disable animations only on specific animated elements, not all elements */
body:not(.media-mode) .blink,
body:not(.media-mode) .rigor-LOW,
body:not(.media-mode) .rigor-MEDIUM,
body:not(.media-mode) .sonar-wave,
body:not(.media-mode) .badge-MYTHOLOGIZED {
    animation: none !important;
}

/* Remove text shadows and box shadows from visual elements only */
body:not(.media-mode) .logo,
body:not(.media-mode) .status,
body:not(.media-mode) .blink,
body:not(.media-mode) .panel-header h3,
body:not(.media-mode) #narrative-title,
body:not(.media-mode) .significance-header,
body:not(.media-mode) .dot {
    text-shadow: none !important;
    box-shadow: none !important;
}

body:not(.media-mode) .node-group:hover circle {
    filter: none !important;
}

body:not(.media-mode) .noise,
body:not(.media-mode) .scanline,
body:not(.media-mode) .noise-overlay {
    display: none !important;
}

body:not(.media-mode) .lifecycle-step.active {
    background: #fff;
    box-shadow: none;
}

body:not(.media-mode) {
    background-image: none !important;
}

/* --- MEDIA MODE (OPTIONAL) --- */
/* Enable cinematic effects: noise, scanlines, animations, glows */
body.media-mode .noise,
body.media-mode .scanline,
body.media-mode .noise-overlay {
    display: block;
}

body.media-mode .blink {
    animation: blinker 1s linear infinite;
}

body.media-mode .badge-MYTHOLOGIZED {
    animation: blinker 2s infinite;
}

/* --- ACCESSIBILITY STYLES --- */

/* Skip link - visible only on focus for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bg-color);
    color: var(--text-main);
    padding: 8px 16px;
    z-index: 1000;
    border: 2px solid var(--text-main);
    font-family: 'Courier New', monospace;
    text-decoration: none;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* High contrast focus for interactive elements */
.view-mode-btn:focus-visible,
.zoom-btn:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
    box-shadow: 0 0 10px var(--accent-gold);
}

/* Keyboard-focused node highlight */
.node-group.keyboard-focused circle,
.node-group.keyboard-focused path {
    stroke: var(--accent-gold);
    stroke-width: 3px;
}

/* --- MOBILE TOUCH HINTS --- */

#touch-hints {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#touch-hints.hidden {
    display: none;
}

.touch-hints-content {
    background: var(--bg-color);
    border: 2px solid var(--text-main);
    padding: 30px;
    max-width: 320px;
    text-align: center;
}

.touch-hints-content h3 {
    color: var(--text-main);
    margin-bottom: 20px;
    font-size: 1rem;
}

.gesture-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    text-align: left;
}

.gesture-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.gesture-item span:last-child {
    color: #aaa;
    font-size: 0.85rem;
}

.dismiss-hints-btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.dismiss-hints-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

/* --- COLOR CONTRAST IMPROVEMENTS (WCAG AA) --- */

/* Ensure text meets 4.5:1 contrast ratio against backgrounds */
body:not(.media-mode) .framing-line {
    color: #b0b0b0; /* Improved from #aaa for better contrast */
}

body:not(.media-mode) .node-label {
    fill: #b8b8b8; /* Improved contrast */
}

body:not(.media-mode) .legend-item {
    color: #c0c0c0; /* Improved contrast */
}

/* Timeline label contrast */
.timeline-label {
    color: #c8c8c8;
}

/* Filter panel text contrast */
.parent-label {
    color: #d0d0d0;
}

/* ============================================================================
   TIMELINE TOUR STYLING
   ============================================================================
   Visual highlighting for nodes and panel during guided tour.
   ============================================================================ */

/* Tour node highlighting */
.node.tour-highlight {
    stroke: #ffd700 !important;
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 8px #ffd700);
    animation: none !important; /* Disable rigor flickering during tours to prevent animation stacking */
    opacity: 1 !important; /* Ensure full opacity when highlighted */
}

/* CRITICAL FIX: Disable parent group animations when child node is tour-highlighted */
.node-group:has(.node.tour-highlight) {
    animation: none !important; /* Stop rigor-based flickering on parent group */
    opacity: 1 !important; /* Ensure full opacity for entire group */
}

/* Tour panel glow effect */
#info-panel.tour-active {
    box-shadow:
        inset 0 0 20px rgba(106, 169, 255, 0.2),
        0 0 15px rgba(106, 169, 255, 0.3);
    border-left: 3px solid #6aa9ff;
    animation: tourPulse 2s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 20px rgba(106, 169, 255, 0.2),
            0 0 15px rgba(106, 169, 255, 0.3);
    }
    50% {
        box-shadow:
            inset 0 0 25px rgba(106, 169, 255, 0.3),
            0 0 20px rgba(106, 169, 255, 0.4);
    }
}

/* --- ACCESSIBILITY: MOTION SENSITIVITY SUPPORT --- */
/* Respect user motion preferences (WCAG 2.1 Guideline 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations and transitions */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable CRT visual effects */
    .scanline,
    .noise,
    .noise-overlay {
        display: none !important;
        opacity: 0 !important;
    }

    /* Disable flicker animations for low-rigor nodes */
    .flicker-low {
        animation: none !important;
        opacity: 0.7 !important;
    }

    /* Disable sonar ripple effects on hub nodes */
    .sonar-ripple,
    .node-halo.sonar {
        animation: none !important;
    }

    /* Disable scramble text animation */
    .scramble-text {
        animation: none !important;
    }

    /* Disable pulsing tour highlights */
    .tour-highlight {
        animation: none !important;
    }

    /* Disable blinking status indicators */
    .blink {
        animation: none !important;
        opacity: 1 !important;
    }

    /* Keep zoom/pan transforms but remove animation */
    svg {
        transition: none !important;
    }
}

/* ============================================================================
   MAP ENHANCEMENTS - Dynamic Visualization Features
   ============================================================================ */

/* --- Connection Arcs (Gotham-style animated) --- */
.connection-arc {
    fill: none;
    stroke-width: 1.2px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 8px currentColor);
}

/* --- Density Overlay (Gotham heat signature) --- */
.density-circle {
    mix-blend-mode: screen;
    filter: url(#density-blur);
}

.density-core {
    mix-blend-mode: screen;
}

/* --- Map Hover Tooltip --- */
.map-tooltip {
    position: fixed;
    z-index: 1000;
    max-width: 300px;
    padding: 12px 16px;
    background: rgba(5, 5, 15, 0.95);
    border: 1px solid var(--text-main, #00f2ff);
    border-left: 3px solid var(--text-main, #00f2ff);
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 11px;
    color: var(--text-main, #00f2ff);
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.map-tooltip .tooltip-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.map-tooltip .tooltip-year {
    display: inline-block;
    background: rgba(0, 242, 255, 0.15);
    border: 1px solid var(--text-main, #00f2ff);
    padding: 1px 6px;
    font-size: 10px;
    margin-bottom: 6px;
}

.map-tooltip .tooltip-ce {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    margin-left: 4px;
    margin-bottom: 6px;
    border: 1px solid;
}
.map-tooltip .tooltip-ce.ce1 { color: #4ecdc4; border-color: #4ecdc4; }
.map-tooltip .tooltip-ce.ce2 { color: #f39c12; border-color: #f39c12; }
.map-tooltip .tooltip-ce.ce3 { color: #e74c3c; border-color: #e74c3c; }
.map-tooltip .tooltip-ce.ce4 { color: #9b59b6; border-color: #9b59b6; }
.map-tooltip .tooltip-ce.ce5 { color: #e91e63; border-color: #e91e63; }

.map-tooltip .tooltip-location {
    color: #888;
    font-size: 10px;
    margin-bottom: 6px;
}

.map-tooltip .tooltip-desc {
    color: #aaa;
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.map-tooltip .tooltip-observables {
    color: #ffcc00;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 204, 0, 0.2);
    padding-top: 4px;
}

/* --- Nuclear Node Pulse --- */
@keyframes nuclear-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px #ffcc00); }
    50% { filter: drop-shadow(0 0 16px #ffcc00) drop-shadow(0 0 24px rgba(255, 204, 0, 0.3)); }
}

.map-view-active .node-group.nuclear-incident circle,
.map-view-active .node-group.nuclear-incident path {
    animation: nuclear-pulse 2.5s ease-in-out infinite;
}

/* --- Enhanced Incident Pulse (scale with CE rating) --- */
@keyframes incident-ripple {
    0% { r: 8; opacity: 0.6; }
    100% { r: 30; opacity: 0; }
}

/* --- Timeline Playback Button --- */
#timeline-play-btn {
    transition: all 0.3s ease;
    font-size: 10px;
    letter-spacing: 1px;
}

#timeline-play-btn:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

/* --- Patterns Tour Highlight --- */
.patterns-tour-active .node-group.highlighted circle,
.patterns-tour-active .node-group.highlighted path {
    filter: drop-shadow(0 0 12px #ff6b6b) drop-shadow(0 0 24px rgba(255, 107, 107, 0.4));
}

/* ============================================================================
   STRIKE COORDINATES DOSSIER - Military Intelligence Briefing View
   ============================================================================ */

/* --- Dossier Panel Mode (wider info panel) --- */
#info-panel.dossier-mode {
    width: 440px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

#info-panel.dossier-mode::-webkit-scrollbar {
    width: 4px;
}

#info-panel.dossier-mode::-webkit-scrollbar-track {
    background: transparent;
}

#info-panel.dossier-mode::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

#info-panel.dossier-mode .panel-header h3 {
    color: #ff3e3e;
    text-shadow: 0 0 8px rgba(255, 62, 62, 0.5);
}

/* --- Strike Dossier Container --- */
.strike-dossier {
    font-size: 0.8rem;
}

/* --- Classification Header --- */
.dossier-classification {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 62, 62, 0.1);
    border: 1px solid rgba(255, 62, 62, 0.4);
    color: #ff3e3e;
    font-size: 0.6rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* --- Strike Coordinates Block --- */
.strike-coordinates {
    margin: 12px 0;
    padding: 12px;
    background: rgba(255, 62, 62, 0.04);
    border: 1px solid rgba(255, 62, 62, 0.2);
    border-left: 3px solid #ff3e3e;
    position: relative;
}

.strike-coordinates::before {
    content: "◎";
    position: absolute;
    top: 8px;
    right: 10px;
    color: #ff3e3e;
    font-size: 16px;
    opacity: 0.5;
    animation: reticle-spin 4s linear infinite;
}

@keyframes reticle-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.strike-coord-header {
    font-size: 0.55rem;
    color: #ff3e3e;
    letter-spacing: 3px;
    margin-bottom: 6px;
    font-weight: bold;
}

.strike-coord-value {
    font-size: 1.1rem;
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255, 62, 62, 0.3);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.strike-coord-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #aaa;
}

.strike-coord-sep {
    color: #444;
    font-size: 0.5rem;
}

.strike-coord-unit {
    margin-top: 6px;
    font-size: 0.6rem;
    color: #666;
    letter-spacing: 1px;
}

/* --- Dossier Sections --- */
.dossier-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #222;
}

.dossier-section-header {
    font-size: 0.6rem;
    font-weight: bold;
    color: #ff3e3e;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 4px rgba(255, 62, 62, 0.2);
}

/* --- Photo Gallery --- */
.dossier-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dossier-photo-cell {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.dossier-photo-cell:hover {
    transform: scale(1.02);
}

.dossier-photo-frame {
    position: relative;
    border: 1px solid #333;
    overflow: hidden;
    background: #0a0a0a;
}

.dossier-photo-frame img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(30%) contrast(1.1);
    transition: filter 0.3s ease;
}

.dossier-photo-cell:hover .dossier-photo-frame img {
    filter: grayscale(0%) contrast(1.2);
}

.dossier-photo-stamp {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(255, 62, 62, 0.8);
    color: #fff;
    font-size: 7px;
    padding: 1px 5px;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.dossier-photo-caption {
    font-size: 0.6rem;
    color: #aaa;
    margin-top: 4px;
    line-height: 1.3;
}

.dossier-photo-credit {
    font-size: 0.5rem;
    color: #555;
    margin-top: 2px;
    font-style: italic;
}

/* --- Situation Report --- */
.dossier-sitrep {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.5;
}

/* --- Personnel --- */
.dossier-personnel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dossier-person {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid #444;
    transition: border-color 0.2s ease;
}

.dossier-person:hover {
    border-left-color: #ff3e3e;
}

.dossier-person-name {
    font-size: 0.75rem;
    color: #fff;
    font-weight: bold;
    font-family: var(--font-mono);
}

.dossier-person-role {
    font-size: 0.6rem;
    color: #00f2ff;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.dossier-person-action {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
}

/* --- Evidence Chain Timeline --- */
.dossier-timeline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dossier-timeline-entry {
    display: grid;
    grid-template-columns: 80px 24px 1fr;
    align-items: start;
    gap: 0;
    font-size: 0.65rem;
}

.dossier-timeline-date {
    color: #ffcc00;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    text-align: right;
    padding-right: 4px;
}

.dossier-timeline-connector {
    color: #444;
    font-family: var(--font-mono);
    text-align: center;
}

.dossier-timeline-event {
    color: #bbb;
    line-height: 1.4;
    padding-bottom: 4px;
}

/* --- Operational Locations --- */
.dossier-locations {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dossier-location {
    font-size: 0.65rem;
}

.dossier-loc-marker {
    color: #ffcc00;
    margin-right: 4px;
    font-size: 0.5rem;
}

.dossier-loc-name {
    color: #fff;
    font-weight: bold;
}

.dossier-loc-coords {
    color: #555;
    font-size: 0.55rem;
    margin-left: 8px;
    font-family: var(--font-mono);
}

.dossier-loc-desc {
    color: #777;
    font-size: 0.6rem;
    margin-top: 2px;
    padding-left: 14px;
}

/* --- Documentary Recommendations --- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-entry {
    border-left: 2px solid var(--accent-gold);
    padding: 6px 0 6px 10px;
}

.doc-title-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.doc-title {
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.doc-meta {
    color: var(--text-dim);
    font-size: 0.55rem;
    letter-spacing: 0.3px;
}

.doc-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.doc-platform-badge {
    display: inline-block;
    font-size: 0.5rem;
    font-weight: bold;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.doc-platform-badge:hover {
    filter: brightness(1.4);
    box-shadow: 0 0 6px currentColor;
    transform: translateY(-1px);
}

/* --- Targeting Reticle (SVG overlay on map) --- */
.targeting-reticle line,
.targeting-reticle path {
    filter: drop-shadow(0 0 2px rgba(255, 62, 62, 0.5));
}

.targeting-reticle circle {
    filter: drop-shadow(0 0 4px rgba(255, 62, 62, 0.3));
}

.targeting-reticle text {
    filter: drop-shadow(0 0 2px rgba(255, 62, 62, 0.4));
}

/* --- Photo Lightbox --- */
.dossier-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dossier-lightbox.active {
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    z-index: 201;
    border: 1px solid #333;
    background: #0a0a0a;
    padding: 0;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    background: rgba(255, 62, 62, 0.08);
}

.lightbox-exhibit {
    font-size: 0.7rem;
    color: #ff3e3e;
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

.lightbox-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    display: block;
}

.lightbox-caption {
    padding: 10px 12px 4px;
    font-size: 0.75rem;
    color: #ccc;
    font-family: var(--font-mono);
}

.lightbox-credit {
    padding: 0 12px 10px;
    font-size: 0.6rem;
    color: #555;
    font-style: italic;
    font-family: var(--font-mono);
}

/* --- Dossier Mode Mobile --- */
@media (max-width: 768px) {
    #info-panel.dossier-mode {
        width: 100%;
        right: 0;
        top: auto;
        bottom: 0;
        max-height: 70vh;
    }

    .dossier-photo-grid {
        grid-template-columns: 1fr;
    }

    .strike-coord-value {
        font-size: 0.9rem;
    }
}