/* ===================================
   FARTMART RESEARCH DOSSIER
   Medieval Cyberpunk — Standalone Styles
   =================================== */

:root {
    --neon-cyan: #0a8a8a;
    --neon-cyan-bright: #00c8d4;
    --forge-amber: #a67c1a;
    --forge-amber-bright: #d4a830;
    --forge-ember: #8b4a10;
    --neon-green: #1a6b1a;
    --neon-green-text: #4aaa4a;
    --neon-purple: #4a1a5e;
    --neon-orange: #8b4513;
    --neon-yellow: #8b8b00;
    --neon-red: #6b1a1a;
    --accent: #c0392b;
    --dark-bg: #050507;
    --dark-card: #0a0a10;
    --dark-card-hover: #0e0e18;
    --dark-border: #252530;
    --text-primary: #d0d0d0;
    --text-secondary: #a0a0a0;
    --text-dim: #707070;
    --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier New', monospace;

    /* Node type colors */
    --node-contaminant: #8b2020;
    --node-contaminant-bright: #c03030;
    --node-health: #a67c1a;
    --node-health-bright: #d4a830;
    --node-solution: #1a6b1a;
    --node-solution-bright: #2a9b2a;
    --node-product: #0a8a8a;
    --node-product-bright: #00c8d4;
    --node-context: #505050;
    --node-context-bright: #707070;
    --node-domain: #d4a830;
    --node-domain-bright: #f0c040;
}

/* ===================================
   RESET & BASE
   =================================== */

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

::selection {
    background: rgba(166, 124, 26, 0.3);
    color: var(--text-primary);
}

:focus-visible {
    outline: 1px solid var(--forge-amber);
    outline-offset: 2px;
}

body {
    font-family: var(--font-mono);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Noise overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}

/* Vignette */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 80%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 9998;
}

/* ===================================
   GRID BACKGROUND
   =================================== */

.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(10, 138, 138, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 138, 138, 0.12) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.06;
    z-index: -2;
    animation: gridMove 40s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* ===================================
   SCAN LINE
   =================================== */

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(166, 124, 26, 0.4),
        rgba(10, 138, 138, 0.3),
        rgba(166, 124, 26, 0.4),
        transparent
    );
    z-index: 1000;
    animation: scanMove 10s linear infinite;
    pointer-events: none;
    opacity: 0.5;
    will-change: transform;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .grid-background { animation: none; }
    .scan-line { display: none; }
}

/* ===================================
   CONTAINER
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===================================
   HEADER / BREADCRUMB
   =================================== */

header {
    background: linear-gradient(180deg, rgba(10, 10, 16, 0.7) 0%, rgba(5, 5, 7, 0.6) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(166, 124, 26, 0.2);
    box-shadow:
        0 1px 0 rgba(10, 138, 138, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(166, 124, 26, 0.5),
        rgba(212, 168, 48, 0.7),
        rgba(166, 124, 26, 0.5),
        transparent
    );
}

.breadcrumb {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.breadcrumb-link {
    color: #9ac0c0;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.breadcrumb-link:hover {
    color: #b8dada;
    text-shadow: 0 0 20px rgba(10, 138, 138, 0.35);
}

.separator {
    color: var(--forge-amber);
    margin: 0 0.6rem;
    opacity: 0.6;
}

.breadcrumb-current {
    color: var(--forge-amber);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ===================================
   INTRO HERO SECTION
   =================================== */

/* Page Title (replaces old intro hero) */
.research-title-section {
    padding: 1.5rem 0 0.8rem;
    position: relative;
    z-index: 10;
}

.research-page-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-dim);
    letter-spacing: 6px;
}


/* ===================================
   SUB-DOSSIERS (Interactive Models)
   =================================== */

.sub-dossiers-section {
    padding: 0.2rem 0 0.8rem;
    position: relative;
    z-index: 10;
}

.sub-dossiers-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sub-dossiers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sub-dossier-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: rgba(166, 124, 26, 0.06);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 280px;
    max-width: 640px;
}

.sub-dossier-card:hover {
    border-color: rgba(166, 124, 26, 0.6);
    background: rgba(166, 124, 26, 0.1);
    box-shadow: 0 0 20px rgba(166, 124, 26, 0.1);
}

.sub-dossier-icon {
    font-size: 1.3rem;
    color: var(--forge-amber-bright);
    flex-shrink: 0;
}

.sub-dossier-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.sub-dossier-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--forge-amber-bright);
    text-transform: uppercase;
}

.sub-dossier-desc {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-dossier-arrow {
    font-size: 1rem;
    color: var(--forge-amber);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sub-dossier-card:hover .sub-dossier-arrow {
    color: var(--forge-amber-bright);
    transform: translateX(3px);
}
/* Cross-link buttons (findings <-> evidence map) */
.cross-link-btn {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.35rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--forge-amber);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    background: rgba(166, 124, 26, 0.05);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cross-link-btn:hover {
    border-color: rgba(166, 124, 26, 0.6);
    background: rgba(166, 124, 26, 0.12);
    box-shadow: 0 0 10px rgba(166, 124, 26, 0.08);
}

/* ===================================
   VIEW TOGGLE SECTION
   =================================== */

.view-toggle-section {
    background: rgba(5, 5, 7, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--dark-border);
    padding: 0.8rem 0;
    position: relative;
    z-index: 10;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.view-toggles {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(8, 8, 12, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle:hover {
    border-color: rgba(166, 124, 26, 0.4);
    background: rgba(166, 124, 26, 0.06);
}

.view-toggle.active {
    border-color: rgba(166, 124, 26, 0.6);
    background: rgba(166, 124, 26, 0.08);
    color: var(--forge-amber);
    box-shadow: 0 0 15px rgba(166, 124, 26, 0.08);
}

.toggle-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.view-toggle.active .toggle-icon {
    opacity: 1;
}

/* Search */
.research-search {
    display: flex;
    align-items: center;
    background: rgba(5, 5, 7, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    padding: 0.5rem 0.8rem;
    transition: all 0.3s ease;
    min-width: 250px;
}

.research-search:focus-within {
    border-color: rgba(166, 124, 26, 0.4);
    box-shadow: 0 0 20px rgba(166, 124, 26, 0.08);
}

.search-prefix {
    color: var(--forge-amber);
    font-weight: bold;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    white-space: nowrap;
    opacity: 0.85;
}

#research-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    caret-color: var(--forge-amber);
    min-width: 120px;
}

#research-search::placeholder {
    color: var(--text-dim);
}

/* ===================================
   GRAPH VIEW
   =================================== */

#graph-view {
    position: relative;
    z-index: 1;
}

#graph-view:not(.active-view) {
    display: none;
}

.graph-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 130px);
    min-height: 500px;
    background: rgba(3, 3, 5, 0.6);
}

#cy {
    width: 100%;
    height: 100%;
}


/* ===================================
   GRAPH LOADING OVERLAY (M1)
   =================================== */

.graph-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 7, 0.8);
    z-index: 6;
    transition: opacity 0.4s ease;
}

.graph-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.graph-loading-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--forge-amber);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===================================
   GRAPH LEGEND
   =================================== */

.graph-legend {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(10, 10, 16, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    padding: 0.8rem 1rem;
    z-index: 5;
}

.legend-title {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    transform: rotate(45deg);
}

.legend-dot.contaminant { background: var(--node-contaminant); box-shadow: 0 0 4px var(--node-contaminant); }
.legend-dot.health-effect { background: var(--node-health); box-shadow: 0 0 4px var(--node-health); }
.legend-dot.solution { background: var(--node-solution); box-shadow: 0 0 4px var(--node-solution); }
.legend-dot.product { background: var(--node-product); box-shadow: 0 0 4px var(--node-product); }
.legend-dot.context { background: var(--node-context); }
.legend-dot.investigation { background: #4a1a5e; box-shadow: 0 0 4px #4a1a5e; }

/* ===================================
   GRAPH CONTROLS
   =================================== */

.graph-controls {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 5;
}

.graph-controls button {
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 16, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.graph-controls button:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
    background: rgba(166, 124, 26, 0.06);
}

/* ===================================
   DETAIL PANEL — DESKTOP (right slide)
   =================================== */

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: rgb(10, 10, 16);
    border-left: 1px solid var(--dark-border);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(37, 37, 48, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    font-family: var(--font-mono);
}

.detail-close:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
}

.detail-content {
    padding: 1.5rem;
    padding-top: 3.5rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

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

.detail-content::-webkit-scrollbar-track {
    background: transparent;
}

.detail-content::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

/* Detail panel inner elements */
.detail-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--forge-amber-bright);
    letter-spacing: 3px;
    margin-bottom: 0.6rem;
    padding-right: 2.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(166, 124, 26, 0.15);
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.detail-type-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.detail-type-badge.contaminant {
    background: rgba(139, 32, 32, 0.15);
    color: var(--node-contaminant-bright);
    border: 1px solid rgba(139, 32, 32, 0.3);
}

.detail-type-badge.health-effect {
    background: rgba(166, 124, 26, 0.12);
    color: var(--node-health-bright);
    border: 1px solid rgba(166, 124, 26, 0.3);
}

.detail-type-badge.solution {
    background: rgba(26, 107, 26, 0.12);
    color: var(--node-solution-bright);
    border: 1px solid rgba(26, 107, 26, 0.3);
}

.detail-type-badge.product {
    background: rgba(10, 138, 138, 0.12);
    color: var(--node-product-bright);
    border: 1px solid rgba(10, 138, 138, 0.3);
}

.detail-type-badge.context {
    background: rgba(80, 80, 80, 0.15);
    color: var(--node-context-bright);
    border: 1px solid rgba(80, 80, 80, 0.3);
}

.detail-type-badge.domain {
    background: rgba(212, 168, 48, 0.12);
    color: var(--node-domain-bright);
    border: 1px solid rgba(212, 168, 48, 0.3);
}

.severity-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.severity-badge.critical {
    background: rgba(107, 26, 26, 0.2);
    color: #d04040;
    border: 1px solid rgba(107, 26, 26, 0.4);
    animation: severityPulse 2.5s ease-in-out infinite;
}

.severity-badge.high {
    background: rgba(166, 124, 26, 0.15);
    color: var(--forge-amber-bright);
    border: 1px solid rgba(166, 124, 26, 0.4);
}

.severity-badge.moderate {
    background: rgba(80, 80, 80, 0.15);
    color: var(--text-dim);
    border: 1px solid rgba(80, 80, 80, 0.3);
}

@keyframes severityPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(107, 26, 26, 0.3); }
}

.detail-summary {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-border);
}

/* Detail sections */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(37, 37, 48, 0.8);
}

.detail-section-content {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.75;
}

/* Key stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: rgba(5, 5, 7, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    padding: 0.6rem;
}

.stat-label {
    font-size: 0.6rem;
    color: var(--forge-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Chart images in detail panel */
.detail-chart {
    width: 100%;
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    margin: 0.5rem 0;
}

/* Evidence chain */
.evidence-chain {
    margin: 0.5rem 0;
}

.evidence-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(37, 37, 48, 0.5);
}

.evidence-item:last-child {
    border-bottom: none;
}

.evidence-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 40px;
}

.evidence-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--forge-amber);
    flex-shrink: 0;
}

.evidence-line {
    width: 1px;
    height: 20px;
    background: rgba(166, 124, 26, 0.3);
}

.evidence-label {
    font-size: 0.6rem;
    color: var(--forge-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(166, 124, 26, 0.1);
    border: 1px solid rgba(166, 124, 26, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    white-space: nowrap;
    margin-top: 0.25rem;
}

.evidence-body {
    flex: 1;
}

.evidence-target {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.evidence-citation {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    opacity: 0.85;
}

/* Connected nodes list */
.connected-nodes {
    list-style: none;
}

.connected-node-link {
    display: block;
    padding: 0.5rem 0.7rem;
    margin: 0.25rem 0;
    background: rgba(5, 5, 7, 0.4);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.connected-node-link:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
    background: rgba(166, 124, 26, 0.04);
}

.connected-node-link::before {
    content: '\2500\2500 ';
    color: rgba(166, 124, 26, 0.4);
}

/* Data sources */
.data-sources {
    list-style: none;
}

.data-sources li {
    padding: 0.2rem 0;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.data-sources li::before {
    content: '\25AA ';
    color: var(--forge-amber);
    opacity: 0.5;
}

/* ===================================
   REPORT VIEW
   =================================== */

.report-container {
    position: relative;
    z-index: 1;
    padding: 2rem 0 4rem;
}

.report-category {
    margin-bottom: 3rem;
}

.report-category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-border);
}

.report-category-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.report-headline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(10, 10, 16, 0.5);
    border-left: 2px solid var(--forge-amber);
    border-radius: 0 2px 2px 0;
}

/* Finding cards */
.finding-card {
    background: rgba(10, 10, 16, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    margin-bottom: 1.2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.finding-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(166, 124, 26, 0.35),
        rgba(10, 138, 138, 0.25),
        rgba(166, 124, 26, 0.35),
        transparent
    );
}

.finding-card.severity-critical {
    border-color: rgba(107, 26, 26, 0.4);
    box-shadow: 0 0 20px rgba(107, 26, 26, 0.08);
    animation: cardPulseCritical 4s ease-in-out infinite;
}

.finding-card.severity-high {
    border-color: rgba(166, 124, 26, 0.4);
}

.finding-card.severity-moderate {
    border-color: rgba(80, 80, 80, 0.3);
}

@keyframes cardPulseCritical {
    0%, 100% { box-shadow: 0 0 20px rgba(107, 26, 26, 0.08); }
    50% { box-shadow: 0 0 30px rgba(107, 26, 26, 0.15); }
}

.finding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.finding-header:hover {
    background: rgba(166, 124, 26, 0.04);
}

.finding-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

.finding-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.finding-expand-icon {
    color: var(--text-dim);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.finding-card.expanded .finding-expand-icon {
    transform: rotate(90deg);
}

.finding-body {
    display: none;
    padding: 0 1.2rem 1.2rem;
    border-top: 1px solid rgba(37, 37, 48, 0.5);
}

.finding-card.expanded .finding-body {
    display: block;
}

.finding-content {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Action items */
.action-items {
    margin: 2rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(37, 37, 48, 0.5);
}

.action-items-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--forge-amber);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.action-list {
    list-style: none;
    counter-reset: action-counter;
}

.action-list li {
    counter-increment: action-counter;
    padding: 0.4rem 0 0.4rem 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.6;
    border-bottom: 1px solid rgba(37, 37, 48, 0.4);
    position: relative;
}

.action-list li:last-child {
    border-bottom: none;
}

.action-list li::before {
    content: counter(action-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    color: var(--forge-amber);
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0.7;
}

/* Evidence expandable section */
.evidence-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-dim);
    font-size: 0.7rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    background: none;
    font-family: var(--font-mono);
    transition: color 0.2s ease;
}

.evidence-toggle:hover {
    color: var(--forge-amber);
}

.evidence-toggle-icon {
    transition: transform 0.3s ease;
}

.evidence-toggle.expanded .evidence-toggle-icon {
    transform: rotate(90deg);
}

/* Citation hyperlinks */
.cite-link {
    color: var(--neon-cyan-bright);
    text-decoration: none;
    border-bottom: 1px dotted rgba(0, 200, 212, 0.3);
    transition: all 0.2s ease;
}

.cite-link:hover {
    color: #fff;
    border-bottom-color: var(--neon-cyan-bright);
}

.evidence-section {
    display: none;
    padding: 0.5rem 0;
}

.evidence-section.visible {
    display: block;
}

.evidence-text {
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.7;
    font-style: italic;
    padding-left: 1rem;
    border-left: 1px solid rgba(166, 124, 26, 0.2);
}

/* ===================================
   PRODUCT RECOMMENDATIONS
   =================================== */

.products-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dark-border);
}

.products-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--forge-amber);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.product-category {
    margin-bottom: 2rem;
}

.product-category-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(37, 37, 48, 0.8);
}

.product-picks {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.product-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(5, 5, 7, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: rgba(166, 124, 26, 0.3);
    background: rgba(166, 124, 26, 0.02);
}

.product-card.top-pick {
    border-color: rgba(26, 107, 26, 0.4);
    box-shadow: 0 0 15px rgba(26, 107, 26, 0.06);
}

.product-card.top-pick .product-rank {
    color: var(--neon-green-text);
    border-color: rgba(26, 107, 26, 0.4);
}

.product-rank {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text-dim);
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.product-type {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.product-meta {
    font-size: 0.7rem;
    color: var(--forge-amber);
    margin-bottom: 0.4rem;
    opacity: 0.85;
}

.product-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.product-certs {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
    font-style: italic;
}

.product-avoid {
    margin-top: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: rgba(107, 26, 26, 0.06);
    border: 1px solid rgba(107, 26, 26, 0.15);
    border-radius: 2px;
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.product-avoid.collapsed .avoid-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avoid-label {
    color: #d04040;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
}

.avoid-toggle {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--text-dim);
    font-size: 0.6rem;
    cursor: pointer;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.avoid-toggle:hover {
    opacity: 1;
    color: #d04040;
}

/* ===================================
   SHOW MORE / EXPAND BUTTONS
   =================================== */

.show-more-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.4rem 1rem;
    background: rgba(166, 124, 26, 0.1);
    border: 1px solid rgba(166, 124, 26, 0.35);
    border-radius: 2px;
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.show-more-btn:hover {
    background: rgba(166, 124, 26, 0.2);
    border-color: rgba(166, 124, 26, 0.5);
    color: #d4a832;
}

/* Collapsed citation/datasource lists */
.collapsed-list .overflow-item {
    display: none;
}

/* ===================================
   TOPIC FILTER BUTTONS
   =================================== */

.topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dark-border);
}

.topic-filter {
    padding: 0.5rem 1.2rem;
    background: rgba(10, 10, 16, 0.75);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.topic-filter:hover {
    border-color: rgba(166, 124, 26, 0.3);
    color: var(--text-secondary);
    background: rgba(166, 124, 26, 0.04);
}

.topic-filter.active {
    border-color: rgba(166, 124, 26, 0.5);
    color: var(--forge-amber);
    background: rgba(166, 124, 26, 0.08);
    box-shadow: 0 0 12px rgba(166, 124, 26, 0.06);
}

/* ===================================
   FOOTER
   =================================== */

footer {
    background: rgba(8, 8, 12, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--dark-border);
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(166, 124, 26, 0.35),
        transparent
    );
}

footer p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.footer-note {
    color: var(--text-dim);
    font-size: 0.65rem;
    line-height: 1.8;
    max-width: 500px;
    margin: 0.5rem auto 0;
    font-style: italic;
}

/* ===================================
   PROJECT FILTER BAR (unified view)
   =================================== */

.project-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem 2rem;
    border-bottom: 1px solid var(--dark-border);
    background: rgba(5, 5, 7, 0.3);
}

.project-filter {
    padding: 0.35rem 0.8rem;
    background: rgba(10, 10, 16, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.project-filter:hover {
    border-color: rgba(10, 138, 138, 0.4);
    color: var(--text-secondary);
    background: rgba(10, 138, 138, 0.04);
}

.project-filter.active {
    border-color: rgba(10, 138, 138, 0.6);
    color: var(--neon-cyan-bright);
    background: rgba(10, 138, 138, 0.08);
    box-shadow: 0 0 12px rgba(10, 138, 138, 0.06);
}

/* ===================================
   PROJECT BADGE (detail panel)
   =================================== */

.detail-project-origin {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(10, 138, 138, 0.12);
}

.project-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(10, 138, 138, 0.08);
    border: 1px solid rgba(10, 138, 138, 0.25);
    border-radius: 2px;
    color: var(--neon-cyan-bright);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.dossier-link {
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dossier-link:hover {
    color: var(--neon-cyan-bright);
    text-shadow: 0 0 10px rgba(10, 138, 138, 0.3);
}

/* ===================================
   BRIDGE EDGE LEGEND
   =================================== */

.legend-line {
    width: 20px;
    height: 0;
    border-top-width: 1.5px;
    border-top-style: dashed;
    flex-shrink: 0;
}

.legend-line.bridge {
    border-top-color: var(--forge-amber);
    opacity: 0.6;
}

/* ===================================
   CONFIDENCE LEGEND INDICATORS
   =================================== */

.legend-confidence {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transform: rotate(45deg);
    background: var(--node-context);
}

.legend-confidence.verified {
    border: 2px solid var(--text-secondary);
    border-style: solid;
    opacity: 1;
}

.legend-confidence.plausible {
    border: 1px solid var(--text-secondary);
    border-style: solid;
    opacity: 0.75;
}

.legend-confidence.unverified {
    border: 1px dashed var(--text-secondary);
    opacity: 0.55;
}

/* ===================================
   BACK TO UNIFIED (topic pages)
   =================================== */

.back-to-unified {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-to-unified:hover {
    color: var(--neon-cyan-bright);
    text-shadow: 0 0 10px rgba(10, 138, 138, 0.3);
}

/* ===================================
   GRAPH BREADCRUMB (tier navigation)
   =================================== */

.graph-breadcrumb {
    background: rgba(5, 5, 7, 0.5);
    border-bottom: 1px solid var(--dark-border);
    padding: 0.5rem 0;
    position: relative;
    z-index: 10;
}

.graph-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 0;
}

.breadcrumb-segment {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    cursor: default;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.breadcrumb-segment.clickable {
    color: var(--neon-cyan);
    cursor: pointer;
}

.breadcrumb-segment.clickable:hover {
    color: var(--neon-cyan-bright);
    text-shadow: 0 0 10px rgba(10, 138, 138, 0.3);
}

.breadcrumb-segment.current {
    color: var(--forge-amber);
}

.breadcrumb-separator {
    color: var(--forge-amber);
    margin: 0 0.2rem;
    opacity: 0.5;
    font-size: 0.6rem;
}

/* ===================================
   CATEGORY ENTER BUTTON (detail panel)
   =================================== */

.category-enter-btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    background: rgba(166, 124, 26, 0.08);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.category-enter-btn:hover {
    background: rgba(166, 124, 26, 0.15);
    border-color: rgba(166, 124, 26, 0.5);
    box-shadow: 0 0 15px rgba(166, 124, 26, 0.1);
}

/* ===================================
   LEGEND ICON (navigation hints)
   =================================== */

.legend-icon {
    display: inline-block;
    width: 8px;
    text-align: center;
    color: var(--forge-amber);
    font-size: 0.7rem;
    flex-shrink: 0;
}


/* ===================================
   TOPIC SUMMARY (Rec 2)
   Plain-language "What you need to know"
   =================================== */

.topic-summary {
    margin-bottom: 1.8rem;
    padding: 1rem 1.2rem;
    background: rgba(166, 124, 26, 0.04);
    border-left: 3px solid rgba(166, 124, 26, 0.4);
    border-radius: 0 2px 2px 0;
}

.topic-summary-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--forge-amber);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.topic-summary p {
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.75;
    margin: 0;
}

/* ===================================
   CONFIDENCE BADGES (Rec 4)
   Subtle inline indicators
   =================================== */

.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.confidence-badge.confidence-verified {
    color: #4aaa4a;
    background: rgba(26, 107, 26, 0.1);
    border: 1px solid rgba(26, 107, 26, 0.25);
}

.confidence-badge.confidence-plausible {
    color: var(--forge-amber-bright);
    background: rgba(166, 124, 26, 0.08);
    border: 1px solid rgba(166, 124, 26, 0.2);
}

.confidence-badge.confidence-unverified {
    color: var(--text-dim);
    background: rgba(80, 80, 80, 0.1);
    border: 1px solid rgba(80, 80, 80, 0.2);
}

/* ===================================
   CONFIDENCE OVERVIEW (Rec 4)
   Per-topic summary bar
   =================================== */

.confidence-overview {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.conf-stat {
    font-weight: bold;
}

.conf-stat.confidence-verified {
    color: #4aaa4a;
}

.conf-stat.confidence-plausible {
    color: var(--forge-amber);
}

.conf-stat.confidence-unverified {
    color: var(--text-dim);
}

/* ===================================
   ENHANCED CATEGORY HEADER (Rec 4)
   =================================== */

.report-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-border);
    flex-wrap: wrap;
}

.report-category-header-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* ===================================
   FINDING VERDICT (Rec 1)
   1-line summary visible when collapsed
   =================================== */

.finding-verdict {
    padding: 0 1.2rem 0.8rem;
    font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(37, 37, 48, 0.3);
}

.finding-card.expanded .finding-verdict {
    display: none;
}

/* ===================================
   FINDING HEADER ENHANCEMENTS (Rec 3)
   =================================== */

.finding-header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.finding-cite-count {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ===================================
   CITATION SUPERSCRIPTS (Rec 3)
   Numbered inline references
   =================================== */

.cite-superscript {
    display: inline;
    font-size: 0.65rem;
    color: var(--neon-cyan-bright);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    vertical-align: super;
    line-height: 0;
    transition: color 0.2s ease;
}

.cite-superscript:hover {
    color: #fff;
}

a.cite-superscript {
    border-bottom: none;
}

/* ===================================
   CITATION TOOLTIP (Rec 3)
   Hover preview for superscripts
   =================================== */

.cite-tooltip {
    position: fixed;
    z-index: 10002;
    max-width: 300px;
    padding: 0.6rem 0.8rem;
    background: rgba(10, 10, 16, 0.95);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    animation: tooltipFade 0.15s ease;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================
   FINDING CITATIONS LIST (Rec 3)
   Expanded-state source list
   =================================== */

.finding-citations {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(37, 37, 48, 0.5);
}

.finding-citations-title {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.citation-list {
    list-style: none;
    counter-reset: cite-counter;
    padding-left: 0;
    margin: 0;
}

.citation-list li {
    counter-increment: cite-counter;
    padding: 0.3rem 0 0.3rem 1.8rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.5;
    border-bottom: 1px solid rgba(37, 37, 48, 0.3);
    position: relative;
}

.citation-list li:last-child {
    border-bottom: none;
}

.citation-list li::before {
    content: "[" counter(cite-counter) "]";
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-size: 0.6rem;
    font-weight: bold;
    opacity: 0.6;
}

/* ===================================
   FINDING CARD CONFIDENCE ACCENTS (Rec 4)
   Subtle left-border color by confidence
   =================================== */

.finding-card.conf-verified {
    border-left: 2px solid rgba(42, 155, 42, 0.4);
}

.finding-card.conf-plausible {
    border-left: 2px solid rgba(166, 124, 26, 0.3);
}

.finding-card.conf-unverified {
    border-left: 2px solid rgba(80, 80, 80, 0.25);
}

/* Bold key terms in evidence (Rec 3) */
.finding-content strong {
    color: var(--text-primary);
    font-weight: bold;
}

/* ===================================
   RESPONSIVE — TABLET
   =================================== */

@media (max-width: 768px) {
    .toggle-row {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggles {
        justify-content: center;
    }

    .research-search {
        min-width: unset;
    }

    .graph-container {
        height: calc(100vh - 160px);
        min-height: 400px;
    }

    /* Detail panel: bottom drawer on mobile */
    .detail-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 70vh;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid var(--dark-border);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
        border-radius: 8px 8px 0 0;
    }

    .detail-panel.open {
        transform: translateY(0);
    }

    .graph-legend {
        bottom: 1rem;
        left: 1rem;
        padding: 0.5rem 0.7rem;
    }

    .legend-title {
        font-size: 0.5rem;
    }

    .legend-item {
        font-size: 0.6rem;
    }

    .legend-dot {
        width: 6px;
        height: 6px;
    }

    .graph-controls {
        bottom: 1rem;
        right: 1rem;
    }

    .graph-controls button {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .breadcrumb {
        font-size: 0.9rem;
    }

    .research-page-title {
        font-size: 1rem;
    }

    .project-filter-bar {
        padding: 0.5rem 1rem;
        justify-content: center;
    }

    .project-filter {
        font-size: 0.55rem;
        padding: 0.3rem 0.6rem;
    }

    .graph-breadcrumb {
        padding: 0.4rem 0;
    }

    .breadcrumb-segment {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }

    .report-category-title {
        font-size: 1rem;
    }

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

    .product-card {
        flex-direction: column;
        gap: 0.6rem;
    }

    .product-rank {
        align-self: flex-start;
    }
    .report-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .confidence-overview {
        font-size: 0.55rem;
    }

    .finding-title-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .topic-summary {
        padding: 0.8rem 1rem;
    }

}

/* ===================================
   RESPONSIVE — MOBILE
   =================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    header {
        padding: 1rem 0;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    .research-page-title {
        font-size: 0.9rem;
        letter-spacing: 4px;
    }

    .graph-container {
        height: calc(100vh - 120px);
        min-height: 300px;
    }

    /* Larger touch targets for zoom controls on mobile */
    .graph-controls {
        bottom: 0.8rem;
        right: 0.8rem;
        gap: 0.4rem;
    }

    .graph-controls button {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* M3: Maximize graph area on mobile */
    .graph-breadcrumb {
        padding: 0.25rem 0;
    }

    .detail-title {
        font-size: 1.15rem;
    }

    .detail-content {
        padding: 1.5rem 1rem 1rem;
        padding-top: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .finding-title {
        font-size: 0.8rem;
    }

    .report-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .report-category-title {
        font-size: 0.85rem;
    }

    .view-toggle {
        padding: 0.5rem 0.8rem;
        font-size: 0.65rem;
    }

    .graph-legend {
        display: none;
    }

    /* Project filter bar -- tighter on mobile */
    .project-filter-bar {
        padding: 0.4rem 0.8rem;
        justify-content: center;
    }

    .project-filter {
        font-size: 0.55rem;
        padding: 0.35rem 0.6rem;
    }

    /* Search bar full-width on mobile */
    .research-search {
        min-width: unset;
        width: 100%;
    }

    .graph-breadcrumb {
        padding: 0.3rem 0;
    }

    .breadcrumb-segment {
        font-size: 0.55rem;
        letter-spacing: 1px;
        padding: 0.15rem 0.3rem;
    }

    .breadcrumb-separator {
        font-size: 0.5rem;
    }
    .confidence-badge {
        font-size: 0.45rem;
        padding: 0.08rem 0.35rem;
    }

    .finding-verdict {
        font-size: 0.72rem;
        padding: 0 1rem 0.6rem;
    }

    .finding-cite-count {
        display: none;
    }

    .topic-summary p {
        font-size: 0.8rem;
    }

    .cite-tooltip {
        max-width: 250px;
        font-size: 0.6rem;
    }

}

/* ===================================
   CAUSAL CHAINS PANEL
   =================================== */

.causal-chains-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(8, 8, 12, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--dark-border);
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 6;
}

.causal-chains-panel.visible {
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.causal-chains-panel.visible::-webkit-scrollbar {
    width: 4px;
}

.causal-chains-panel.visible::-webkit-scrollbar-track {
    background: transparent;
}

.causal-chains-panel.visible::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.cc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--dark-border);
    position: sticky;
    top: 0;
    background: rgba(8, 8, 12, 0.98);
    z-index: 2;
}

.cc-panel-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--forge-amber);
    letter-spacing: 3px;
}

.cc-panel-close {
    width: 28px;
    height: 28px;
    background: rgba(37, 37, 48, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.cc-panel-close:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
}

.cc-summary {
    padding: 0.6rem 1.5rem;
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(37, 37, 48, 0.5);
}

.cc-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.cc-chain {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(37, 37, 48, 0.4);
}

.cc-chain:last-child {
    border-bottom: none;
}

.cc-chain-header {
    font-family: var(--font-display);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
}

.cc-chain-flow {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.cc-chain-flow::-webkit-scrollbar {
    height: 3px;
}

.cc-chain-flow::-webkit-scrollbar-track {
    background: transparent;
}

.cc-chain-flow::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.cc-step {
    flex-shrink: 0;
    min-width: 100px;
    max-width: 180px;
    padding: 0.5rem 0.7rem;
    background: rgba(10, 10, 16, 0.8);
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cc-step:hover {
    background: rgba(166, 124, 26, 0.06);
    border-color: rgba(166, 124, 26, 0.4);
}

.cc-step-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.4;
    word-break: break-word;
}

.cc-step-confidence {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.cc-arrow {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.3rem;
    min-width: 60px;
}

.cc-arrow-label {
    font-size: 0.5rem;
    color: var(--forge-amber);
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    opacity: 0.75;
}

.cc-arrow-cite {
    font-size: 0.45rem;
    color: var(--text-dim);
    text-align: center;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

.cc-arrow-line {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--forge-amber);
    opacity: 0.6;
    white-space: nowrap;
}

.cc-arrow-gap .cc-arrow-line {
    color: #8b2020;
    opacity: 0.8;
}

.cc-arrow-gap .cc-arrow-label {
    color: #8b2020;
}

/* Active state for CC toggle button */
#toggle-causal-chains.active {
    border-color: rgba(166, 124, 26, 0.6) !important;
    color: var(--forge-amber) !important;
    background: rgba(166, 124, 26, 0.1) !important;
}

/* ===================================
   KNOWN UNKNOWNS MAP PANEL
   =================================== */

.ku-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(8, 8, 12, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--dark-border);
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 6;
}

.ku-panel.visible {
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.ku-panel.visible::-webkit-scrollbar {
    width: 4px;
}

.ku-panel.visible::-webkit-scrollbar-track {
    background: transparent;
}

.ku-panel.visible::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.ku-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--dark-border);
    position: sticky;
    top: 0;
    background: rgba(8, 8, 12, 0.98);
    z-index: 2;
}

.ku-panel-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--forge-amber);
    letter-spacing: 3px;
}

.ku-panel-close {
    width: 28px;
    height: 28px;
    background: rgba(37, 37, 48, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.ku-panel-close:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
}

.ku-summary {
    padding: 0.6rem 1.5rem;
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(37, 37, 48, 0.5);
}

.ku-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.ku-quadrant {
    padding: 1rem 1.2rem;
    min-height: 120px;
}

/* Known Knowns -- solid border, green tint */
.ku-q-kk {
    border-right: 1px solid var(--dark-border);
    border-bottom: 1px solid var(--dark-border);
}

.ku-q-kk .ku-quadrant-header {
    border-bottom: 2px solid rgba(26, 107, 26, 0.4);
}

.ku-q-kk .ku-quadrant-title {
    color: #4aaa4a;
}

/* Known Unknowns -- dashed border, amber tint */
.ku-q-ku {
    border-bottom: 1px solid var(--dark-border);
}

.ku-q-ku .ku-quadrant-header {
    border-bottom: 2px dashed rgba(166, 124, 26, 0.4);
}

.ku-q-ku .ku-quadrant-title {
    color: var(--forge-amber-bright);
}

/* Unknown Knowns -- dotted border, blue tint */
.ku-q-uk {
    border-right: 1px solid var(--dark-border);
}

.ku-q-uk .ku-quadrant-header {
    border-bottom: 2px dotted rgba(10, 138, 138, 0.4);
}

.ku-q-uk .ku-quadrant-title {
    color: var(--neon-cyan-bright);
}

/* Unknown Unknowns -- no extra border, gray tint */
.ku-q-uu .ku-quadrant-header {
    border-bottom: 2px solid rgba(80, 80, 80, 0.3);
}

.ku-q-uu .ku-quadrant-title {
    color: var(--text-dim);
}

.ku-quadrant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
}

.ku-quadrant-title {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.ku-quadrant-count {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-dim);
}

.ku-quadrant-subtitle {
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    font-style: italic;
}

.ku-empty {
    color: var(--text-dim);
    font-size: 0.65rem;
    font-style: italic;
    padding: 0.5rem 0;
}

.ku-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.ku-items::-webkit-scrollbar {
    width: 3px;
}

.ku-items::-webkit-scrollbar-track {
    background: transparent;
}

.ku-items::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.ku-item {
    padding: 0.4rem 0.6rem;
    background: rgba(10, 10, 16, 0.6);
    border: 1px solid rgba(37, 37, 48, 0.6);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ku-item:hover {
    border-color: rgba(166, 124, 26, 0.4);
    background: rgba(166, 124, 26, 0.04);
}

.ku-item-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.ku-item-meta {
    margin-top: 0.15rem;
}

.ku-item-project {
    font-size: 0.5rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ku-item-reason {
    font-size: 0.5rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
    line-height: 1.4;
}

.ku-overflow {
    padding: 0.4rem 0;
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-align: center;
}

/* Active state for KU toggle button */
#toggle-known-unknowns.active {
    border-color: rgba(166, 124, 26, 0.6) !important;
    color: var(--forge-amber) !important;
    background: rgba(166, 124, 26, 0.1) !important;
}

/* ===================================
   RESPONSIVE -- PANELS
   =================================== */

@media (max-width: 768px) {
    .causal-chains-panel.visible,
    .ku-panel.visible {
        max-height: 70vh;
    }

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

    .ku-q-kk {
        border-right: none;
    }

    .ku-q-uk {
        border-right: none;
        border-bottom: 1px solid var(--dark-border);
    }

    .cc-step {
        min-width: 80px;
        max-width: 140px;
    }

    .cc-step-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .cc-chain-flow {
        gap: 0;
    }

    .cc-step {
        min-width: 70px;
        max-width: 120px;
        padding: 0.4rem 0.5rem;
    }

    .cc-step-label {
        font-size: 0.55rem;
    }

    .cc-arrow {
        min-width: 40px;
        padding: 0 0.15rem;
    }

    .cc-arrow-label {
        font-size: 0.45rem;
    }

    .cc-arrow-line {
        font-size: 0.6rem;
    }

    .ku-quadrant {
        padding: 0.8rem;
    }

    .ku-quadrant-title {
        font-size: 0.6rem;
    }
}

/* ===================================
   MINI-MAP NAVIGATOR
   =================================== */

#cy-navigator {
    position: absolute;
    bottom: 1.5rem;
    right: 5rem;
    width: 180px;
    height: 135px;
    background: rgba(5, 5, 7, 0.85);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    z-index: 5;
    overflow: hidden;
}

#cy-navigator .cytoscape-navigator .cytoscape-navigatorView {
    border: 2px solid var(--forge-amber-bright) !important;
    background: rgba(212, 168, 48, 0.12) !important;
    box-shadow: 0 0 8px rgba(212, 168, 48, 0.3) !important;
}

#cy-navigator .cytoscape-navigator .cytoscape-navigatorOverlay {
    background: rgba(5, 5, 7, 0.4) !important;
}

@media (max-width: 768px) {
    #cy-navigator {
        display: none;
    }
}

@media (max-width: 480px) {
    #cy-navigator {
        display: none;
    }
}

/* ===================================
   FACETED FILTER PANEL
   =================================== */

.filter-panel {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 6;
    display: flex;
    flex-direction: row;
}

.filter-panel .filter-toggle {
    width: 40px;
    height: 100%;
    background: rgba(10, 10, 16, 0.85);
    border: none;
    border-right: 1px solid var(--dark-border);
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-transform: uppercase;
    transition: all 0.25s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-panel .filter-toggle:hover {
    background: rgba(166, 124, 26, 0.08);
    border-right-color: rgba(166, 124, 26, 0.4);
}

.filter-panel.open .filter-toggle {
    border-right-color: rgba(166, 124, 26, 0.3);
    background: rgba(10, 10, 16, 0.95);
}

.filter-body {
    width: 0;
    overflow: hidden;
    background: rgba(10, 10, 16, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--dark-border);
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.filter-panel.open .filter-body {
    width: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.filter-body::-webkit-scrollbar {
    width: 3px;
}

.filter-body::-webkit-scrollbar-track {
    background: transparent;
}

.filter-body::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.filter-group {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(37, 37, 48, 0.5);
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group-title {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--forge-amber);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.filter-checkbox:hover {
    opacity: 1;
}

.filter-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    background: rgba(5, 5, 7, 0.6);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked {
    background: rgba(166, 124, 26, 0.15);
    border-color: rgba(166, 124, 26, 0.5);
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    width: 4px;
    height: 7px;
    border: solid var(--forge-amber);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.filter-checkbox .filter-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.filter-checkbox input[type="checkbox"]:not(:checked) + .filter-label {
    color: var(--text-dim);
    opacity: 0.6;
}

.filter-severity-toggles,
.filter-confidence-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.filter-severity-btn,
.filter-confidence-btn {
    padding: 0.25rem 0.5rem;
    background: rgba(5, 5, 7, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-severity-btn.active {
    border-color: rgba(166, 124, 26, 0.5);
    color: var(--forge-amber);
    background: rgba(166, 124, 26, 0.08);
}

.filter-severity-btn.active.critical {
    border-color: rgba(107, 26, 26, 0.5);
    color: #d04040;
    background: rgba(107, 26, 26, 0.1);
}

.filter-severity-btn.active.high {
    border-color: rgba(166, 124, 26, 0.5);
    color: var(--forge-amber-bright);
    background: rgba(166, 124, 26, 0.08);
}

.filter-confidence-btn.active {
    border-color: rgba(10, 138, 138, 0.5);
    color: var(--neon-cyan-bright);
    background: rgba(10, 138, 138, 0.08);
}

.filter-severity-btn:hover,
.filter-confidence-btn:hover {
    border-color: rgba(166, 124, 26, 0.4);
}

.filter-reset-btn {
    display: block;
    width: calc(100% - 1.6rem);
    margin: 0.5rem 0.8rem 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(107, 26, 26, 0.06);
    border: 1px solid rgba(107, 26, 26, 0.2);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-btn:hover {
    background: rgba(107, 26, 26, 0.12);
    border-color: rgba(107, 26, 26, 0.4);
    color: #d04040;
}

@media (max-width: 768px) {
    .filter-panel {
        flex-direction: column;
        width: 100%;
        height: auto;
        top: auto;
        bottom: 0;
    }

    .filter-panel .filter-toggle {
        width: 100%;
        height: 36px;
        writing-mode: horizontal-tb;
        text-orientation: initial;
        border-right: none;
        border-top: 1px solid var(--dark-border);
    }

    .filter-body {
        width: 100% !important;
        height: 0;
        border-right: none;
        border-top: 1px solid var(--dark-border);
        transition: height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .filter-panel.open .filter-body {
        height: 50vh;
        width: 100% !important;
    }
}

/* ===================================
   RECOMMENDATIONS VIEW
   =================================== */

.recommendations-container {
    position: relative;
    z-index: 1;
    padding: 2rem 0 4rem;
}

.rec-loading, .rec-error {
    text-align: center;
    padding: 3rem 2rem;
    font-size: 0.75rem;
    letter-spacing: 2px;
}
.rec-loading { color: var(--text-dim); }
.rec-error { color: #6b1a1a; }

.rec-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-border);
}

.rec-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--forge-amber-bright);
    letter-spacing: 4px;
}

.rec-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: rgba(166, 124, 26, 0.12);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.rec-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.rec-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rec-filter-pill {
    padding: 0.4rem 0.8rem;
    background: rgba(10, 10, 16, 0.75);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.rec-filter-pill:hover {
    border-color: rgba(166, 124, 26, 0.3);
    color: var(--text-secondary);
    background: rgba(166, 124, 26, 0.04);
}

.rec-filter-pill.active {
    border-color: rgba(166, 124, 26, 0.5);
    color: var(--forge-amber);
    background: rgba(166, 124, 26, 0.08);
    box-shadow: 0 0 12px rgba(166, 124, 26, 0.06);
}

.rec-sort-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rec-sort-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    margin-right: 0.2rem;
}

.rec-sort-btn {
    padding: 0.35rem 0.7rem;
    background: rgba(10, 10, 16, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.rec-sort-btn:hover {
    border-color: rgba(10, 138, 138, 0.4);
    color: var(--text-secondary);
}

.rec-sort-btn.active {
    border-color: rgba(10, 138, 138, 0.5);
    color: var(--neon-cyan-bright);
    background: rgba(10, 138, 138, 0.08);
}

.rec-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rec-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.rec-column-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.8rem;
    align-items: start;
}

.rec-column-header {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--dark-border);
}

.rec-column-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.rec-column-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.rec-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    background: rgba(166, 124, 26, 0.08);
    border: 1px solid rgba(166, 124, 26, 0.2);
    border-radius: 2px;
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: bold;
}

.rec-column-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.rec-column-projects {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rec-severity-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    flex: 1;
    min-width: 60px;
    max-width: 120px;
    background: rgba(37, 37, 48, 0.5);
}

.rec-sev-seg {
    height: 100%;
    min-width: 2px;
}

.rec-card {
    background: rgba(10, 10, 16, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid var(--dark-border);
}

.rec-card:hover { box-shadow: 0 0 8px rgba(166, 124, 26, 0.3); }
.rec-card.severity-critical { border-left-color: #d4442f; }
.rec-card.severity-high { border-left-color: #d4872f; }
.rec-card.severity-moderate { border-left-color: #a67c1a; }
.rec-card.severity-low { border-left-color: #666; }
.rec-card.rec-avoid { border-left-color: #d4442f; }
.rec-card.rec-avoid .rec-card-title { color: #d04040; }

.rec-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.7rem 0.8rem 0.3rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    gap: 0.5rem;
}

.rec-card-header:hover { background: rgba(166, 124, 26, 0.04); }

.rec-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.rec-card-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-transform: uppercase;
}

.rec-card-badges {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.rec-severity-dots {
    display: inline-flex;
    gap: 3px;
    flex-shrink: 0;
}

.rec-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.rec-dot.empty {
    background: rgba(37, 37, 48, 0.8);
    border: 1px solid rgba(80, 80, 80, 0.3);
}

.rec-confidence {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.rec-confidence-verified {
    color: #4aaa4a;
    border: 1px solid rgba(26, 107, 26, 0.5);
    background: rgba(26, 107, 26, 0.08);
}

.rec-confidence-plausible {
    color: var(--forge-amber);
    border: 1px solid rgba(166, 124, 26, 0.4);
    background: rgba(166, 124, 26, 0.06);
}

.rec-confidence-unverified {
    color: var(--text-dim);
    border: 1px dashed rgba(80, 80, 80, 0.5);
    background: rgba(80, 80, 80, 0.04);
}

.rec-cross-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: var(--neon-cyan-bright);
    border: 1px solid rgba(10, 138, 138, 0.4);
    background: rgba(10, 138, 138, 0.06);
    white-space: nowrap;
}

.rec-card-preview {
    padding: 0 0.8rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.5;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rec-card-body {
    display: none;
    padding: 0 0.8rem 0.8rem;
    border-top: 1px solid rgba(37, 37, 48, 0.5);
}

.rec-card.expanded .rec-card-body { display: block; }
.rec-card.expanded .rec-card-preview { display: none; }

.rec-card-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.7;
    margin: 0.6rem 0;
}

.rec-specifics {
    margin: 0.8rem 0;
    padding: 0.6rem 0.8rem;
    background: rgba(5, 5, 7, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
}

.rec-specifics-title {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--forge-amber);
    letter-spacing: 2px;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.rec-specific-row {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.15rem 0;
}

.rec-specific-label {
    color: var(--text-dim);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.rec-why-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.8rem;
    background: rgba(166, 124, 26, 0.06);
    border: 1px solid rgba(166, 124, 26, 0.25);
    border-radius: 2px;
    color: var(--forge-amber);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.rec-why-btn:hover {
    background: rgba(166, 124, 26, 0.12);
    border-color: rgba(166, 124, 26, 0.5);
    box-shadow: 0 0 10px rgba(166, 124, 26, 0.1);
}

.rec-why-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.3rem;
    background: rgba(10, 10, 16, 0.98);
    border: 1px solid rgba(166, 124, 26, 0.3);
    border-radius: 2px;
    padding: 0.5rem;
    z-index: 20;
    min-width: 200px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.rec-why-popover-title {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--dark-border);
}

.rec-why-popover-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    margin: 0.2rem 0;
    background: rgba(5, 5, 7, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rec-why-popover-link:hover {
    border-color: rgba(166, 124, 26, 0.4);
    background: rgba(166, 124, 26, 0.04);
}

.rec-why-popover-project {
    font-family: var(--font-display);
    font-size: 0.6rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.rec-why-popover-action {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--forge-amber);
    letter-spacing: 1px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .rec-column-cards { grid-template-columns: 1fr; }
    .rec-controls { flex-direction: column; align-items: stretch; }
    .rec-sort-controls { justify-content: flex-start; }
    .rec-title { font-size: 1.1rem; letter-spacing: 3px; }
}

/* ===================================
   SEVERITY HEATMAP
   =================================== */

.heatmap-section {
    position: relative;
    z-index: 1;
    padding: 1rem 0 0.5rem;
    border-bottom: 1px solid var(--dark-border);
}

.heatmap-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.heatmap-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--forge-amber-bright);
    letter-spacing: 3px;
    margin: 0;
}

.heatmap-subtitle {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    margin: 0;
}

.heatmap-collapse-btn {
    margin-left: auto;
    padding: 0.25rem 0.6rem;
    background: rgba(10, 10, 16, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.heatmap-collapse-btn:hover {
    border-color: rgba(166, 124, 26, 0.4);
    color: var(--forge-amber);
}

.heatmap-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-border) transparent;
}

.heatmap-table-wrap::-webkit-scrollbar {
    height: 4px;
}

.heatmap-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.heatmap-table-wrap::-webkit-scrollbar-thumb {
    background: var(--dark-border);
    border-radius: 2px;
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    min-width: 500px;
}

.heatmap-th-project,
.heatmap-th {
    padding: 0.4rem 0.6rem;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--dark-border);
    white-space: nowrap;
}

.heatmap-th-project {
    text-align: left;
    min-width: 140px;
}

.heatmap-td-project {
    padding: 0.35rem 0.6rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(37, 37, 48, 0.4);
    white-space: nowrap;
    font-size: 0.6rem;
}

.heatmap-td {
    padding: 0.35rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid rgba(37, 37, 48, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.heatmap-td:hover {
    background: rgba(166, 124, 26, 0.08);
    box-shadow: inset 0 0 12px rgba(166, 124, 26, 0.04);
}

.heatmap-cell-critical {
    background: rgba(107, 26, 26, 0.4);
}

.heatmap-cell-high {
    background: rgba(166, 124, 26, 0.3);
}

.heatmap-cell-moderate {
    background: rgba(80, 80, 80, 0.2);
}

.heatmap-count {
    display: block;
    font-weight: bold;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.heatmap-severity-badge {
    display: block;
    font-size: 0.45rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.1rem;
}

.heatmap-severity-badge.critical {
    color: #d04040;
}

.heatmap-severity-badge.high {
    color: var(--forge-amber-bright);
}

/* ===================================
   PATH EXPLORER BUTTON ACTIVE STATE
   =================================== */

.graph-controls button.active,
#path-explore.active {
    border-color: rgba(0, 200, 212, 0.6);
    color: #00c8d4;
    background: rgba(0, 200, 212, 0.1);
    box-shadow: 0 0 12px rgba(0, 200, 212, 0.08);
}

/* ===================================
   HEATMAP RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .heatmap-header {
        flex-wrap: wrap;
    }

    .heatmap-table {
        min-width: 420px;
    }
}

@media (max-width: 480px) {
    .heatmap-title {
        font-size: 0.7rem;
    }

    .heatmap-table {
        font-size: 0.55rem;
        min-width: 360px;
    }

    .heatmap-count {
        font-size: 0.65rem;
    }
}

/* ===================================
   RECOMMENDATIONS INTRO TEXT
   =================================== */

.rec-intro-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    text-align: center;
    padding: 1rem 2rem 1.5rem;
    max-width: 600px;
    margin: 0 auto 1rem;
    border-bottom: 1px solid rgba(166, 124, 26, 0.12);
    font-style: italic;
}

/* ===================================
   RECOMMENDATION SUBCATEGORY HEADERS
   =================================== */

.rec-subcategory-group {
    margin-bottom: 0.6rem;
}

.rec-subcategory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    background: rgba(10, 10, 16, 0.5);
    border: 1px solid rgba(37, 37, 48, 0.6);
    border-radius: 2px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.rec-subcategory-header:hover {
    border-color: rgba(166, 124, 26, 0.3);
    background: rgba(166, 124, 26, 0.04);
}

.rec-subcategory-header .subcategory-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.rec-subcategory-header .subcategory-toggle {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

.rec-subcategory-header.collapsed .subcategory-toggle {
    transform: rotate(-90deg);
}

.rec-subcategory-group.collapsed .rec-subcategory-cards {
    display: none;
}

/* ===================================
   RECOMMENDATION PLAIN ENGLISH CONTEXT
   =================================== */

.rec-card-plain {
    padding: 0 0.8rem 0.5rem;
    font-size: 0.68rem;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.5;
}

/* ===================================
   RECOMMENDATION QUICK GUIDE
   =================================== */

.rec-quick-guide {
    margin: 0.6rem 0;
    padding: 0.5rem 0.7rem;
    background: rgba(5, 5, 7, 0.5);
    border: 1px solid var(--dark-border);
    border-radius: 2px;
}

.rec-quick-guide-title {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--forge-amber);
    letter-spacing: 2px;
    margin-bottom: 0.4rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.rec-quick-guide-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(37, 37, 48, 0.3);
}

.rec-quick-guide-row:last-child {
    border-bottom: none;
}

.rec-quick-guide-row .guide-label {
    color: var(--text-dim);
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 60px;
    font-size: 0.6rem;
    text-transform: uppercase;
}
