/* ============================================================
   UNIVERSE SOLVER — Crystal Matrix Design System
   ============================================================ */

:root {
    /* Core palette */
    --bg-primary: #060810;
    --bg-secondary: #0c0f1a;
    --bg-card: #101424;
    --bg-card-hover: #161b32;
    --bg-tertiary: #141830;
    --bg-input: #0d1020;
    
    /* Text */
    --text-primary: #e0e4f0;
    --text-secondary: #8890a8;
    --text-muted: #555e78;
    
    /* Accent colors */
    --crystal-blue: #4a90d9;
    --crystal-glow: #64b5f6;
    --gold: #d4a832;
    --gold-bright: #f0c850;
    --emerald: #2ecc71;
    --ruby: #e74c3c;
    --amethyst: #9b59b6;
    --sapphire: #3498db;
    
    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #d4a832, #f0c850);
    --gradient-crystal: linear-gradient(135deg, #1a237e, #283593);
    --gradient-deep: linear-gradient(180deg, #060810, #0c0f1a);
    
    /* Spacing */
    --nav-height: 60px;
    --content-max: 1300px;
    --radius: 12px;
    --radius-sm: 8px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--crystal-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--crystal-glow); }

h1, h2, h3 { font-family: 'Orbitron', sans-serif; letter-spacing: 1px; }

code, .mono { font-family: 'Space Mono', monospace; }

/* ============================================================
   PARTICLE CANVAS
   ============================================================ */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(6, 8, 16, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 144, 217, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon-img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 8px rgba(212, 168, 50, 0.6));
    vertical-align: middle;
}

.footer-icon-img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 6px rgba(212, 168, 50, 0.4));
    vertical-align: middle;
}

.title-icon-img {
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-right: 8px;
}

.card-icon-img {
    width: 48px;
    height: 48px;
    display: block;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 6px rgba(74, 144, 217, 0.3));
}

.inline-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 2px;
}

.btn-icon-img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 4px;
}

.empty-icon-img {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 16px;
    opacity: 0.6;
}

.math-symbol-img {
    width: 48px;
    height: 48px;
}

.crystal-glow-img {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 20px rgba(155, 89, 182, 0.5));
    animation: crystalPulseImg 3s ease-in-out infinite;
}

@keyframes crystalPulseImg {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(155, 89, 182, 0.3)); }
    50% { filter: drop-shadow(0 0 40px rgba(155, 89, 182, 0.6)); }
}

.timeline-dot-img {
    width: 20px;
    height: 20px;
}

.nav-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(212, 168, 50, 0.3);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(74, 144, 217, 0.1);
}

.nav-link.active {
    color: var(--crystal-glow);
    background: rgba(74, 144, 217, 0.15);
    box-shadow: 0 0 15px rgba(74, 144, 217, 0.1);
}

.nav-link .nav-icon-img { 
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
    filter: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-primary);
    font-size: 20px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

@media (max-width: 1100px) {
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(6, 8, 16, 0.98);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        border-bottom: 1px solid rgba(74, 144, 217, 0.15);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    position: relative;
    z-index: 1;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.page-section {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 40px 24px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--crystal-glow), var(--gold-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* title-icon replaced by .title-icon-img above */

.section-desc {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

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

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-image-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        rgba(6, 8, 16, 0.3),
        rgba(6, 8, 16, 0.7) 70%,
        rgba(6, 8, 16, 1)
    );
    padding: 40px 24px;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 56px;
    font-weight: 900;
    letter-spacing: 8px;
    text-shadow: 0 0 40px rgba(212, 168, 50, 0.4), 0 0 80px rgba(74, 144, 217, 0.2);
    background: linear-gradient(135deg, #fff 0%, var(--gold-bright) 50%, var(--crystal-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 168, 50, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .hero-title { font-size: 32px; letter-spacing: 4px; }
    .hero-subtitle { font-size: 14px; }
    .hero-stats { gap: 20px; }
    .stat-number { font-size: 20px; }
}

/* ============================================================
   CHAT DOCK — Fixed to bottom of viewport
   ============================================================ */

.chat-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    max-height: 60px; /* collapsed = just the header */
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    border-top: 1px solid rgba(74, 144, 217, 0.2);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(74, 144, 217, 0.05);
}

.chat-dock.expanded {
    max-height: 480px;
}

/* Header / collapse bar */
.chat-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    background: rgba(12, 15, 26, 0.95);
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
    min-height: 58px;
}

.chat-dock-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.chat-dock-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-dock-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.chat-dock-toggle svg {
    transition: transform 0.3s ease;
}

.chat-dock.expanded .chat-dock-toggle svg {
    transform: rotate(180deg);
}

.file-upload-btn.compact,
.action-btn.compact {
    padding: 4px 8px;
    font-size: 0;
    line-height: 0;
    border: none;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 6px;
}

.file-upload-btn.compact img,
.action-btn.compact img {
    width: 18px;
    height: 18px;
}

/* Messages area */
.chat-dock-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.chat-dock .chat-messages {
    height: 100%;
    max-height: 320px;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-dock .chat-messages::-webkit-scrollbar { width: 5px; }
.chat-dock .chat-messages::-webkit-scrollbar-track { background: var(--bg-secondary); }
.chat-dock .chat-messages::-webkit-scrollbar-thumb { background: var(--crystal-blue); border-radius: 3px; }

/* Input area */
.chat-dock-input {
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: rgba(12, 15, 26, 0.95);
    flex-shrink: 0;
}

.chat-message {
    display: flex;
    gap: 10px;
    animation: messageIn 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.message-avatar img {
    width: 20px;
    height: 20px;
}

.chat-message.user .message-avatar {
    border-color: rgba(212, 168, 50, 0.3);
}

.message-content {
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    max-width: 80%;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.chat-message.user .message-content {
    background: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.2);
}

.message-content p { margin-bottom: 6px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content strong { color: var(--gold); }

.typing-indicator {
    color: var(--text-muted);
    font-style: italic;
}

.typing-indicator .dots {
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0; }
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    transition: var(--transition);
}

#chat-input:focus {
    outline: none;
    border-color: var(--crystal-blue);
    box-shadow: 0 0 15px rgba(74, 144, 217, 0.1);
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-gold);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(212, 168, 50, 0.3);
}

.send-btn img {
    width: 18px;
    height: 18px;
}

/* Home page needs bottom padding for the chat dock */
.home-page.has-chat-dock {
    padding-bottom: 70px;
}

/* Action buttons kept for re-use */
.file-upload-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.file-upload-btn:hover {
    background: rgba(74, 144, 217, 0.2);
}

.action-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(212, 168, 50, 0.1);
    border: 1px solid rgba(212, 168, 50, 0.2);
    color: var(--gold);
    cursor: pointer;
    font-size: 13px;
    font-family: 'Rajdhani', sans-serif;
    transition: var(--transition);
}

.action-btn:hover {
    background: rgba(212, 168, 50, 0.2);
}

/* ============================================================
   MOBILE BOTTOM NAV BAR
   ============================================================ */

.bottom-nav {
    display: none; /* shown via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(6, 8, 16, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(74, 144, 217, 0.15);
    padding: 4px 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item img {
    width: 22px;
    height: 22px;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bottom-nav-item.active {
    color: var(--crystal-glow);
}

.bottom-nav-item.active img {
    opacity: 1;
    transform: scale(1.1);
}

.bottom-nav-item span {
    display: block;
    white-space: nowrap;
}

/* "More" overlay */
.bottom-more-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.bottom-more-overlay.open {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 1;
}

.bottom-more-menu {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 16px 20px;
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom) + 60px));
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.bottom-more-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.bottom-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    transition: var(--transition);
}

.more-menu-item img {
    width: 28px;
    height: 28px;
}

.more-menu-item:hover,
.more-menu-item.active {
    background: rgba(74, 144, 217, 0.15);
    color: var(--crystal-glow);
}

/* ============================================================
   INSIGHT CARDS (Home Page Feed)
   ============================================================ */

.insights-feed {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 40px 24px;
}

.insight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.insight-card:hover {
    transform: translateY(-2px);
    border-color: rgba(74, 144, 217, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.insight-card.profound {
    border-color: rgba(212, 168, 50, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(212, 168, 50, 0.05));
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.insight-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: rgba(74, 144, 217, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.profundity-badge {
    font-size: 14px;
    color: var(--gold);
    font-weight: 600;
}

.insight-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
}

.insight-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.insight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.insight-date {
    font-size: 12px;
    color: var(--text-muted);
}

.vote-btn {
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    color: var(--crystal-blue);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-family: 'Space Mono', monospace;
    transition: var(--transition);
}

.vote-btn:hover, .vote-btn.voted {
    background: rgba(74, 144, 217, 0.2);
    color: var(--crystal-glow);
}

/* ============================================================
   QUICK ACCESS GRID
   ============================================================ */

.quick-access {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 40px 24px 80px;
}

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

.access-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: var(--transition);
    display: block;
    text-decoration: none;
}

.access-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74, 144, 217, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 144, 217, 0.08);
}

/* card-icon replaced by .card-icon-img above */

.access-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
}

.access-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.access-card.knowledge:hover { border-color: var(--sapphire); }
.access-card.insights:hover { border-color: var(--gold); }
.access-card.theories:hover { border-color: var(--amethyst); }
.access-card.geometry:hover { border-color: var(--gold-bright); }
.access-card.timeline:hover { border-color: var(--emerald); }
.access-card.anomalies:hover { border-color: var(--ruby); }
.access-card.synthesis:hover { border-color: var(--crystal-glow); }

/* ============================================================
   UPLOAD PANEL
   ============================================================ */

.upload-panel {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 30px;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gold);
    font-family: 'Orbitron', sans-serif;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    transition: var(--transition);
}

.form-input.small { min-width: 120px; max-width: 200px; }

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--crystal-blue);
    box-shadow: 0 0 15px rgba(74, 144, 217, 0.1);
}

.form-select {
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 12px;
    transition: var(--transition);
}

.file-upload-area {
    padding: 10px 16px;
    border: 1px dashed rgba(74, 144, 217, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.file-upload-area:hover {
    border-color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.05);
}

.file-name {
    font-size: 13px;
    color: var(--gold);
}

.submit-btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    background: var(--gradient-gold);
    border: none;
    color: var(--bg-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.submit-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(212, 168, 50, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.upload-result { margin-top: 16px; }

.result-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--emerald);
}

.result-success h4 { margin-bottom: 8px; }
.result-success p { margin-bottom: 6px; color: var(--text-secondary); font-size: 0.95em; }
.result-success .epoch-note {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(46, 204, 113, 0.15);
}
.result-success ul { padding-left: 20px; margin-top: 8px; }
.result-success li { margin-bottom: 4px; font-size: 14px; color: var(--text-secondary); }

.result-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--ruby);
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-pills, .sort-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-pills span {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 4px;
}

.pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.pill:hover {
    color: var(--text-primary);
    border-color: rgba(74, 144, 217, 0.3);
}

.pill.active {
    color: var(--crystal-glow);
    background: rgba(74, 144, 217, 0.15);
    border-color: var(--crystal-blue);
}

.pill.small {
    padding: 4px 10px;
    font-size: 12px;
}

.search-form {
    display: flex;
    gap: 6px;
}

.search-input {
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    width: 200px;
}

.search-input:focus { outline: none; border-color: var(--crystal-blue); }

.search-btn {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}

/* ============================================================
   KNOWLEDGE GRID
   ============================================================ */

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.knowledge-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.knowledge-card:hover {
    border-color: rgba(74, 144, 217, 0.25);
    transform: translateY(-2px);
}

.knowledge-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.category-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(74, 144, 217, 0.15);
    color: var(--crystal-blue);
}

.category-badge.astronomy { background: rgba(255, 107, 157, 0.15); color: #ff6b9d; }
.category-badge.mathematics { background: rgba(139, 233, 253, 0.15); color: #8be9fd; }
.category-badge.history { background: rgba(255, 184, 108, 0.15); color: #ffb86c; }
.category-badge.mythology { background: rgba(189, 147, 249, 0.15); color: #bd93f9; }
.category-badge.engineering { background: rgba(80, 250, 123, 0.15); color: #50fa7b; }
.category-badge.acoustics { background: rgba(255, 121, 198, 0.15); color: #ff79c6; }
.category-badge.speculation { background: rgba(241, 250, 140, 0.15); color: #f1fa8c; }

.source-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(212, 168, 50, 0.1);
    color: var(--gold);
}

.knowledge-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
}

.knowledge-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.knowledge-footer {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.file-badge {
    color: var(--gold);
}

/* ============================================================
   INSIGHTS (FULL PAGE)
   ============================================================ */

.profound-spotlight {
    margin-bottom: 40px;
}

.spotlight-title {
    text-align: center;
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 20px;
}

.spotlight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.spotlight-card {
    background: linear-gradient(135deg, rgba(212, 168, 50, 0.1), rgba(74, 144, 217, 0.05));
    border: 1px solid rgba(212, 168, 50, 0.25);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 168, 50, 0.03) 0%, transparent 70%);
    animation: spotlightRotate 20s linear infinite;
}

@keyframes spotlightRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spotlight-score {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 18px;
    color: var(--gold);
    font-weight: 700;
}

.spotlight-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--gold-bright);
    position: relative;
    font-family: 'Rajdhani', sans-serif;
}

.spotlight-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    position: relative;
}

.submit-insight-panel {
    background: var(--bg-card);
    border: 1px solid rgba(212, 168, 50, 0.15);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
}

.insight-form .form-input,
.insight-form .form-textarea {
    margin-bottom: 12px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.insight-card-full {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.insight-card-full:hover {
    border-color: rgba(74, 144, 217, 0.25);
}

.insight-card-full.profound {
    border-color: rgba(212, 168, 50, 0.3);
    box-shadow: 0 0 30px rgba(212, 168, 50, 0.05);
}

.insight-type-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
}

.insight-type-badge.ai_generated { background: rgba(74, 144, 217, 0.15); color: var(--crystal-blue); }
.insight-type-badge.community { background: rgba(46, 204, 113, 0.15); color: var(--emerald); }
.insight-type-badge.cross_correlation { background: rgba(155, 89, 182, 0.15); color: var(--amethyst); }

.profundity-meter {
    display: flex;
    align-items: center;
    gap: 3px;
}

.meter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.15);
    transition: var(--transition);
}

.meter-dot.filled {
    background: var(--gold);
    box-shadow: 0 0 4px rgba(212, 168, 50, 0.5);
}

.meter-value {
    font-size: 12px;
    color: var(--gold);
    margin-left: 6px;
    font-family: 'Space Mono', monospace;
}

.insight-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 12px 0;
}

.insight-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   THEORIES
   ============================================================ */

.theories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.theory-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.theory-card:hover {
    border-color: rgba(74, 144, 217, 0.25);
    transform: translateY(-2px);
}

.theory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.theory-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(74, 144, 217, 0.15);
    color: var(--crystal-blue);
}

.plausibility-gauge {
    position: relative;
    width: 120px;
    height: 8px;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient-gold);
    transition: width 0.5s ease;
}

.gauge-label {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 12px;
    color: var(--gold);
    font-family: 'Space Mono', monospace;
}

.theory-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
}

.theory-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.evidence-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.evidence-for, .evidence-against {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.evidence-for {
    background: rgba(46, 204, 113, 0.05);
    border: 1px solid rgba(46, 204, 113, 0.15);
}

.evidence-against {
    background: rgba(231, 76, 60, 0.05);
    border: 1px solid rgba(231, 76, 60, 0.15);
}

.evidence-for h4 { color: var(--emerald); font-size: 13px; margin-bottom: 8px; font-family: 'Rajdhani', sans-serif; }
.evidence-against h4 { color: var(--ruby); font-size: 13px; margin-bottom: 8px; font-family: 'Rajdhani', sans-serif; }

.evidence-for ul, .evidence-against ul {
    padding-left: 16px;
    list-style: none;
}

.evidence-for li, .evidence-against li {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.5;
}

.evidence-for li::before { content: '• '; color: var(--emerald); }
.evidence-against li::before { content: '• '; color: var(--ruby); }

.theory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}

.vote-controls {
    display: flex;
    gap: 8px;
}

.vote-up, .vote-down {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.15);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    color: var(--text-secondary);
}

.vote-up:hover { border-color: var(--emerald); color: var(--emerald); }
.vote-down:hover { border-color: var(--ruby); color: var(--ruby); }
.vote-up.voted { background: rgba(46, 204, 113, 0.15); color: var(--emerald); }
.vote-down.voted { background: rgba(231, 76, 60, 0.15); color: var(--ruby); }

.community-score {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

/* ============================================================
   GEOMETRY LAB — 3D VIEWER
   ============================================================ */

#giza-viewer-wrapper {
    position: relative;
    width: 100%;
    height: 82vh;
    min-height: 520px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #111827;
    border: 1px solid rgba(218, 165, 32, 0.25);
    margin-bottom: 40px;
}

#three-container {
    width: 100%;
    height: 100%;
}

#three-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* ── View Preset Buttons ── */

#view-presets {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 10;
}

.preset-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(218, 165, 32, 0.25);
    background: rgba(10, 12, 26, 0.85);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(6px);
}

.preset-btn:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(218, 165, 32, 0.12);
}

.preset-btn.active {
    background: rgba(218, 165, 32, 0.2);
    color: var(--gold-bright);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.15);
}

/* ── Layer Toggle Controls ── */

#layer-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: rgba(10, 12, 26, 0.85);
    border: 1px solid rgba(74, 144, 217, 0.15);
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(6px);
    user-select: none;
}

.layer-toggle:hover {
    border-color: rgba(74, 144, 217, 0.3);
    color: var(--text-primary);
}

.layer-toggle input[type="checkbox"] {
    accent-color: var(--gold);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ── Legend ── */

#structure-legend {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: rgba(10, 12, 26, 0.88);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    z-index: 10;
    backdrop-filter: blur(6px);
}

.legend-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-family: 'Rajdhani', sans-serif;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Info Panel ── */

#info-panel {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(10, 12, 26, 0.9);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    max-width: 320px;
    min-width: 200px;
    z-index: 10;
    backdrop-filter: blur(8px);
}

#info-panel #info-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--gold-bright);
    margin-bottom: 6px;
}

#info-panel #info-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

#info-panel #info-body p {
    margin: 0;
}

/* ── Compass ── */

#compass-container {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

#compass-canvas {
    width: 80px;
    height: 80px;
}

/* ── Loading Overlay ── */

#loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 26, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 20;
}

#loading-overlay .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(218, 165, 32, 0.15);
    border-top-color: var(--gold);
    border-right-color: var(--crystal-blue);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

#loading-overlay .loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--gold);
    letter-spacing: 1px;
}

/* ── Responsive ── */

@media (max-width: 900px) {
    #giza-viewer-wrapper {
        height: 60vh;
        min-height: 400px;
    }
    #view-presets {
        top: 8px; left: 8px;
    }
    .preset-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    #layer-controls {
        top: 8px; right: 8px;
    }
    .layer-toggle {
        padding: 4px 8px;
        font-size: 11px;
    }
    #structure-legend {
        display: none; /* too small on mobile */
    }
    #info-panel {
        max-width: 220px;
        padding: 10px 12px;
    }
    #info-panel #info-title { font-size: 12px; }
    #info-panel #info-body { font-size: 11px; }
}

@media (max-width: 560px) {
    #layer-controls {
        position: absolute;
        top: auto;
        bottom: 100px;
        right: 8px;
    }
    #info-panel {
        display: none; /* tap to reveal would be better but keep simple */
    }
}

/* ── Legacy geometry styles (keep for backward compat) ── */

.geometry-canvas-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
}

.geometry-canvas-wrapper canvas {
    width: 100%;
    display: block;
}

.canvas-controls {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(12, 15, 26, 0.8);
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    flex-wrap: wrap;
}

.geo-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.15);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    transition: var(--transition);
}

.geo-btn:hover { border-color: var(--crystal-blue); color: var(--text-primary); }
.geo-btn.active { background: rgba(74, 144, 217, 0.15); color: var(--crystal-glow); border-color: var(--crystal-blue); }

.math-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.math-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.math-card:hover {
    border-color: rgba(212, 168, 50, 0.25);
    transform: translateY(-2px);
}

.math-symbol {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.math-card h3 {
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 8px;
    font-family: 'Rajdhani', sans-serif;
}

.math-detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.math-equation {
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.math-equation .equals {
    color: var(--gold);
    font-weight: bold;
}

.math-equation .result {
    color: var(--crystal-glow);
}

.math-equation .result strong {
    color: var(--gold-bright);
    font-size: 14px;
}

.math-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
    line-height: 1.5;
}

/* ============================================================
   TIMELINE
   ============================================================ */

/* Stats bar */
.timeline-stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    margin-bottom: 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.timeline-stat {
    text-align: center;
}

.timeline-stat-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--crystal-glow);
}

.timeline-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.revelation-stat .timeline-stat-value {
    color: var(--gold-bright);
    text-shadow: 0 0 10px rgba(240, 200, 80, 0.3);
}

/* Era Legend */
.era-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 12px 20px;
    background: rgba(16, 20, 36, 0.6);
    border-radius: var(--radius-sm);
}

.era-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.era-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.era-dot.era-pre-history { background: #9b59b6; }
.era-dot.era-pyramid-age { background: #d4a832; }
.era-dot.era-global { background: #2ecc71; }
.era-dot.era-historical { background: #3498db; }
.era-dot.era-modern { background: #e74c3c; }
.era-dot.era-revelation { background: linear-gradient(135deg, #f0c850, #ff6b35); box-shadow: 0 0 6px rgba(240, 200, 80, 0.5); }

/* Era Sections */
.timeline-era {
    margin-bottom: 50px;
}

.era-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid var(--crystal-blue);
}

.era-header-pre_history { border-left-color: #9b59b6; background: rgba(155, 89, 182, 0.08); }
.era-header-pyramid_age { border-left-color: #d4a832; background: rgba(212, 168, 50, 0.08); }
.era-header-global_spread { border-left-color: #2ecc71; background: rgba(46, 204, 113, 0.08); }
.era-header-historical { border-left-color: #3498db; background: rgba(52, 152, 219, 0.08); }
.era-header-modern { border-left-color: #e74c3c; background: rgba(231, 76, 60, 0.08); }

.era-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
}

.era-range {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

.era-event-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-left: auto;
}

/* Timeline core */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--crystal-blue), var(--gold), var(--crystal-blue));
    transform: translateX(-50%);
}

.timeline-line-pre_history { background: linear-gradient(to bottom, #9b59b6, #7d3c98); }
.timeline-line-pyramid_age { background: linear-gradient(to bottom, #d4a832, #b8860b); }
.timeline-line-global_spread { background: linear-gradient(to bottom, #2ecc71, #27ae60); }
.timeline-line-historical { background: linear-gradient(to bottom, #3498db, #2980b9); }
.timeline-line-modern { background: linear-gradient(to bottom, #e74c3c, #c0392b, #d4a832); }

.timeline-event {
    position: relative;
    width: 45%;
    margin-bottom: 30px;
}

.timeline-event.left { margin-right: auto; text-align: right; padding-right: 40px; }
.timeline-event.right { margin-left: auto; text-align: left; padding-left: 40px; }

.timeline-dot {
    position: absolute;
    top: 20px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    transition: var(--transition);
}

.timeline-dot.revelation-dot {
    border-color: #f0c850;
    background: rgba(240, 200, 80, 0.15);
    box-shadow: 0 0 12px rgba(240, 200, 80, 0.3);
    animation: revelation-pulse 2s ease-in-out infinite;
}

.timeline-dot.solver-dot {
    border-color: var(--crystal-glow);
    background: rgba(100, 181, 246, 0.15);
    box-shadow: 0 0 12px rgba(100, 181, 246, 0.3);
}

@keyframes revelation-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(240, 200, 80, 0.3); }
    50% { box-shadow: 0 0 20px rgba(240, 200, 80, 0.5); }
}

.timeline-event.left .timeline-dot { right: -18px; }
.timeline-event.right .timeline-dot { left: -18px; }

.timeline-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.timeline-card:hover {
    border-color: rgba(212, 168, 50, 0.3);
    transform: translateY(-2px);
}

.timeline-card.revelation-card {
    border-color: rgba(240, 200, 80, 0.25);
    background: linear-gradient(135deg, rgba(212, 168, 50, 0.06), rgba(16, 20, 36, 1));
    box-shadow: 0 4px 20px rgba(212, 168, 50, 0.08);
}

.timeline-card.revelation-card:hover {
    border-color: rgba(240, 200, 80, 0.5);
    box-shadow: 0 6px 28px rgba(212, 168, 50, 0.15);
}

.timeline-card.solver-card {
    border-color: rgba(100, 181, 246, 0.25);
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.06), rgba(16, 20, 36, 1));
    box-shadow: 0 4px 20px rgba(74, 144, 217, 0.08);
}

.revelation-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 10px;
    border-radius: 4px;
    background: rgba(240, 200, 80, 0.15);
    color: var(--gold-bright);
    border: 1px solid rgba(240, 200, 80, 0.3);
    margin-bottom: 8px;
}

.timeline-date {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 6px;
}

.timeline-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}

.timeline-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: inherit;
}

.civ-badge, .location-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(74, 144, 217, 0.1);
    color: var(--crystal-blue);
}

.location-badge {
    background: rgba(212, 168, 50, 0.1);
    color: var(--gold);
}

/* Civilization-specific badge colors */
.civ-egyptian { background: rgba(212, 168, 50, 0.15); color: #d4a832; }
.civ-unknown---pre-dynastic { background: rgba(155, 89, 182, 0.15); color: #bb86fc; }
.civ-nubian---pre-egyptian { background: rgba(155, 89, 182, 0.15); color: #bb86fc; }
.civ-norte-chico { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.civ-sumerian { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.civ-nubian { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.civ-mesoamerican { background: rgba(22, 160, 133, 0.15); color: #1abc9c; }
.civ-mayan { background: rgba(22, 160, 133, 0.15); color: #1abc9c; }
.civ-javanese { background: rgba(39, 174, 96, 0.15); color: #27ae60; }
.civ-chinese { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.civ-greek { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.civ-islamic { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.civ-french---egyptian { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.civ-british---egyptian { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.civ-babylonian { background: rgba(155, 89, 182, 0.15); color: #bb86fc; }
.civ-european { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.civ-french { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.civ-discovery { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.civ-international { background: rgba(100, 181, 246, 0.15); color: #64b5f6; }
.civ-universe-solver { background: rgba(240, 200, 80, 0.15); color: #f0c850; border: 1px solid rgba(240, 200, 80, 0.3); }

/* Inline timeline media query (700px was duplicate, merge into the 768 block below) */
@media (max-width: 768px) {
    .timeline-line { left: 24px; }
    .timeline-event { width: calc(100% - 50px); margin-left: 50px !important; text-align: left; padding-left: 24px !important; padding-right: 0 !important; }
    .timeline-dot { left: -42px !important; right: auto !important; }

    .era-header { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
    .era-range { width: 100%; order: 2; }
    .era-event-count { order: 3; margin-left: 0; }

    .timeline-stats-bar { flex-wrap: wrap; gap: 16px; }
    .era-legend { gap: 10px; }
}

/* Cross-civilization patterns */
.patterns-section {
    margin-top: 50px;
}

.pattern-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pattern-card {
    background: var(--bg-card);
    border: 1px solid rgba(212, 168, 50, 0.15);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.pattern-card:hover {
    border-color: rgba(212, 168, 50, 0.3);
    transform: translateY(-2px);
}

.pattern-card.revelation-pattern {
    border-color: rgba(240, 200, 80, 0.25);
    background: linear-gradient(135deg, rgba(240, 200, 80, 0.05), rgba(16, 20, 36, 1));
}

.pattern-card.revelation-pattern:hover {
    border-color: rgba(240, 200, 80, 0.5);
    box-shadow: 0 4px 20px rgba(240, 200, 80, 0.1);
}

.pattern-card h3 {
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 8px;
    font-family: 'Rajdhani', sans-serif;
}

.pattern-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Convergence Diagram */
.connections-section {
    margin-top: 50px;
}

.convergence-diagram {
    margin-top: 24px;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid rgba(240, 200, 80, 0.15);
    border-radius: var(--radius);
}

.convergence-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
}

.convergence-node {
    flex: 0 0 220px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
}

.convergence-node.convergence-center {
    border-color: rgba(240, 200, 80, 0.4);
    background: rgba(240, 200, 80, 0.06);
    box-shadow: 0 0 30px rgba(240, 200, 80, 0.08);
}

.conv-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.conv-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.conv-detail {
    font-size: 0.8rem;
    color: var(--crystal-glow);
    margin-bottom: 4px;
}

.conv-result {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
}

.convergence-arrow {
    flex: 0 0 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--crystal-blue), var(--gold));
    position: relative;
}

.convergence-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border-left: 8px solid var(--gold);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.convergence-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.convergence-bottom .convergence-node {
    flex: 0 0 auto;
    width: 300px;
}

.convergence-arrow.vertical-arrow {
    flex: 0 0 auto;
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--crystal-blue), var(--gold));
}

.convergence-arrow.vertical-arrow::after {
    right: auto;
    left: -4px;
    top: auto;
    bottom: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--gold);
    border-bottom: none;
}

.convergence-conclusion {
    max-width: 600px;
    text-align: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(240, 200, 80, 0.06), rgba(16, 20, 36, 1));
    border: 1px solid rgba(240, 200, 80, 0.25);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 500;
}

@media (max-width: 768px) {
    .convergence-row {
        flex-direction: column;
        gap: 0;
    }

    .convergence-node {
        flex: 0 0 auto;
        width: 100%;
        max-width: 280px;
    }

    .convergence-arrow {
        width: 2px;
        height: 24px;
        flex: 0 0 24px;
        background: linear-gradient(to bottom, var(--crystal-blue), var(--gold));
    }

    .convergence-arrow::after {
        right: auto;
        left: -4px;
        top: auto;
        bottom: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 8px solid var(--gold);
        border-bottom: none;
    }

    .convergence-bottom .convergence-node {
        width: 100%;
        max-width: 280px;
    }

    .convergence-conclusion {
        padding: 16px;
    }
}

/* ============================================================
   TIMELINE DETAIL PAGE
   ============================================================ */

/* Card link in list view */
.timeline-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.timeline-card-link:hover {
    color: inherit;
}

.timeline-card-link:hover .timeline-card {
    border-color: rgba(212, 168, 50, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.timeline-read-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crystal-glow);
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.timeline-card-link:hover .timeline-read-more {
    color: var(--gold-bright);
}

/* Detail page hero */
.tl-detail-hero {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.tl-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--crystal-blue), var(--gold));
}

.tl-detail-hero.revelation-hero {
    border-color: rgba(240, 200, 80, 0.2);
    background: linear-gradient(135deg, rgba(240, 200, 80, 0.04), var(--bg-card));
}

.tl-detail-hero.revelation-hero::before {
    background: linear-gradient(90deg, var(--gold), var(--gold-bright), var(--gold));
    height: 4px;
}

.tl-detail-hero.solver-hero {
    border-color: rgba(100, 181, 246, 0.2);
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.04), var(--bg-card));
}

.tl-detail-hero.solver-hero::before {
    background: linear-gradient(90deg, var(--crystal-blue), var(--crystal-glow), var(--crystal-blue));
    height: 4px;
}

.tl-detail-header {
    margin-bottom: 12px;
}

.tl-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tl-date-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(212, 168, 50, 0.1);
    border: 1px solid rgba(212, 168, 50, 0.2);
}

.tl-civ-badge {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 6px;
}

.tl-revelation-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(240, 200, 80, 0.15);
    color: var(--gold-bright);
    border: 1px solid rgba(240, 200, 80, 0.3);
}

.tl-solver-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(100, 181, 246, 0.12);
    color: var(--crystal-glow);
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.tl-detail-title {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.tl-detail-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tl-coords {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 8px;
}

/* Detail grid layout */
.tl-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    margin-bottom: 30px;
}

.tl-detail-main,
.tl-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tl-detail-description p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.tl-detail-description p:last-child {
    margin-bottom: 0;
}

/* Geographic Context */
.geo-context-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.geo-data-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.geo-data-row:last-of-type {
    border-bottom: none;
}

.geo-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.geo-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.geo-highlight {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(240, 200, 80, 0.06);
    border: 1px solid rgba(240, 200, 80, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--gold);
    line-height: 1.6;
}

/* Related grids */
.tl-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.tl-related-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.tl-related-card:hover {
    border-color: rgba(212, 168, 50, 0.3);
    transform: translateY(-2px);
    color: inherit;
}

.tl-related-card h3 {
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 600;
}

.tl-related-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tl-related-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.tl-related-status.status-unexplained {
    background: rgba(231, 76, 60, 0.15);
    color: var(--ruby);
}

.tl-related-status.status-theorized {
    background: rgba(155, 89, 182, 0.15);
    color: var(--amethyst);
}

.tl-related-score {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 6px;
}

/* Knowledge sidebar list */
.tl-knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tl-knowledge-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.tl-knowledge-cat {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    background: rgba(74, 144, 217, 0.1);
    color: var(--crystal-blue);
}

.tl-knowledge-cat.cat-mathematics { background: rgba(52, 152, 219, 0.12); color: var(--sapphire); }
.tl-knowledge-cat.cat-engineering { background: rgba(46, 204, 113, 0.12); color: var(--emerald); }
.tl-knowledge-cat.cat-astronomy { background: rgba(155, 89, 182, 0.12); color: var(--amethyst); }
.tl-knowledge-cat.cat-physics { background: rgba(231, 76, 60, 0.12); color: var(--ruby); }
.tl-knowledge-cat.cat-speculation { background: rgba(212, 168, 50, 0.12); color: var(--gold); }
.tl-knowledge-cat.cat-chemistry { background: rgba(22, 160, 133, 0.12); color: #1abc9c; }
.tl-knowledge-cat.cat-acoustics { background: rgba(241, 196, 15, 0.12); color: #f1c40f; }

.tl-knowledge-item h4 {
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 600;
}

.tl-knowledge-item p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Same-civilization events sidebar */
.tl-civ-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tl-civ-event-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.tl-civ-event-item:hover {
    background: rgba(74, 144, 217, 0.06);
    color: inherit;
}

.tl-civ-event-item.revelation-item {
    border-left: 2px solid rgba(240, 200, 80, 0.3);
}

.tl-civ-event-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 80px;
}

.tl-civ-event-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tl-civ-event-item:hover .tl-civ-event-title {
    color: var(--text-primary);
}

/* Map link */
.tl-map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Prev/Next navigation */
.tl-prev-next {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.tl-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.tl-nav-link:hover {
    border-color: rgba(212, 168, 50, 0.3);
    transform: translateY(-2px);
    color: inherit;
}

.tl-nav-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.tl-nav-link.tl-nav-next {
    text-align: right;
}

.tl-nav-direction {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tl-nav-date {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 2px;
}

.tl-nav-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Mobile responsive for timeline detail */
@media (max-width: 900px) {
    .tl-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tl-detail-hero {
        padding: 20px;
    }

    .tl-detail-title {
        font-size: 1.3rem;
    }

    .tl-detail-badges {
        gap: 6px;
    }

    .tl-detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tl-related-grid {
        grid-template-columns: 1fr;
    }

    .tl-prev-next {
        flex-direction: column;
        gap: 10px;
    }

    .tl-nav-link.tl-nav-next {
        text-align: left;
    }
}


/* ============================================================
   ANOMALIES
   ============================================================ */

.anomalies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.anomaly-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.anomaly-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.anomaly-card.status-unexplained::before { background: var(--ruby); }
.anomaly-card.status-theorized::before { background: var(--gold); }
.anomaly-card.status-partially_explained::before { background: #ff9800; }
.anomaly-card.status-resolved::before { background: var(--emerald); }

.anomaly-card:hover {
    border-color: rgba(74, 144, 217, 0.25);
    transform: translateY(-2px);
}

.anomaly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.status-indicator {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.status-indicator.unexplained { background: rgba(231, 76, 60, 0.15); color: var(--ruby); }
.status-indicator.theorized { background: rgba(212, 168, 50, 0.15); color: var(--gold); }
.status-indicator.partially_explained { background: rgba(255, 152, 0, 0.15); color: #ff9800; }
.status-indicator.resolved { background: rgba(46, 204, 113, 0.15); color: var(--emerald); }

.anomaly-location {
    font-size: 12px;
    color: var(--text-muted);
}

.anomaly-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
}

.anomaly-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.anomaly-footer {
    display: flex;
    justify-content: flex-end;
}

/* ============================================================
   SYNTHESIS
   ============================================================ */

.synthesis-controls {
    margin-bottom: 30px;
}

.synthesis-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.synthesis-btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.2);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.synthesis-btn:hover {
    border-color: var(--crystal-blue);
    color: var(--crystal-glow);
    background: rgba(74, 144, 217, 0.1);
    transform: translateY(-2px);
}

.synthesis-output {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    min-height: 300px;
    margin-bottom: 40px;
    overflow: hidden;
}

.synthesis-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.crystal-icon {
    margin-bottom: 20px;
}

/* crystal-glow replaced by .crystal-glow-img above */

.synthesis-placeholder h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
}

.synthesis-placeholder p {
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 20px;
    font-size: 14px;
}

.matrix-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--emerald);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.synthesis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.crystal-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(74, 144, 217, 0.15);
    border-top: 3px solid var(--crystal-glow);
    border-right: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

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

.synthesis-loading p {
    color: var(--text-secondary);
    font-size: 16px;
}

.loading-sub {
    color: var(--text-muted) !important;
    font-size: 13px !important;
    margin-top: 8px;
}

.synthesis-report {
    padding: 32px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.15);
}

.report-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--crystal-glow);
    padding: 6px 14px;
    background: rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-sm);
}

.report-date {
    font-size: 13px;
    color: var(--text-muted);
}

.report-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.report-content h1 { font-size: 24px; color: var(--gold); margin: 20px 0 10px; }
.report-content h2 { font-size: 20px; color: var(--crystal-glow); margin: 18px 0 8px; }
.report-content h3 { font-size: 17px; color: var(--text-primary); margin: 14px 0 6px; }
.report-content strong { color: var(--gold); }
.report-content em { color: var(--crystal-blue); }
.report-content ul { padding-left: 20px; margin: 8px 0; }
.report-content li { margin-bottom: 4px; }

.synthesis-error {
    padding: 40px;
    text-align: center;
    color: var(--ruby);
}

.connections-section {
    margin-top: 20px;
}

.connections-section canvas {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    grid-column: 1 / -1;
}

/* empty-icon replaced by .empty-icon-img above */

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'Orbitron', sans-serif;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    font-size: 14px;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash-message {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin: 12px 24px;
    font-size: 14px;
}

.flash-success { background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.3); color: var(--emerald); }
.flash-error { background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.3); color: var(--ruby); }
.flash-info { background: rgba(74, 144, 217, 0.1); border: 1px solid rgba(74, 144, 217, 0.3); color: var(--crystal-blue); }

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

.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    padding: 40px 24px;
    text-align: center;
    background: rgba(6, 8, 16, 0.9);
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 8px;
}

/* footer-icon replaced by .footer-icon-img above */

.footer-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer-stats {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   10-METRIC INSIGHT SCORING SYSTEM
   ============================================================ */

/* Methodology Panel */
.methodology-panel {
    margin-bottom: 32px;
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.methodology-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--crystal-blue);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: background 0.2s;
}

.methodology-toggle:hover {
    background: rgba(74, 144, 217, 0.05);
}

.toggle-arrow {
    margin-left: auto;
    font-size: 20px;
    color: var(--gold);
    font-weight: 400;
}

.methodology-content {
    padding: 0 20px 20px;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.methodology-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.meth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.meth-key {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--gold);
}

.meth-weight {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(74, 144, 217, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.meth-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.methodology-formula {
    padding: 12px 16px;
    background: rgba(212, 168, 50, 0.06);
    border: 1px solid rgba(212, 168, 50, 0.15);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.profound-badge {
    display: inline-block;
    background: var(--gradient-gold);
    color: #000;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Scored Insight Cards */
.insight-card-scored {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.insight-card-scored:hover {
    border-color: rgba(74, 144, 217, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.insight-card-scored.profound {
    border-color: rgba(212, 168, 50, 0.3);
    background: linear-gradient(135deg, #101424 0%, #1a1830 100%);
    box-shadow: 0 0 30px rgba(212, 168, 50, 0.08);
}

.insight-card-scored .insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.profundity-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profundity-number {
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.profundity-number.high { color: var(--gold-bright); }
.profundity-number.mid { color: var(--crystal-blue); }
.profundity-number.low { color: var(--text-muted); }

.insight-card-scored .insight-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.insight-card-scored .insight-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px 0;
}

/* Metric Visualization */
.insight-metrics {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: rgba(6, 8, 16, 0.5);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.metrics-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-chart {
    display: block;
}

.radar-mini {
    display: block;
}

.metrics-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.metric-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-label {
    width: 80px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
    cursor: help;
}

.metric-track {
    flex: 1;
    height: 6px;
    background: rgba(74, 144, 217, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.metric-fill.high {
    background: linear-gradient(90deg, #d4a832, #f0c850);
    box-shadow: 0 0 6px rgba(212, 168, 50, 0.3);
}

.metric-fill.mid {
    background: linear-gradient(90deg, #3498db, #64b5f6);
    box-shadow: 0 0 6px rgba(74, 144, 217, 0.2);
}

.metric-fill.low {
    background: rgba(136, 144, 168, 0.4);
}

.metric-val {
    width: 28px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

/* Insight Footer */
.insight-card-scored .insight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.expand-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.15);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    transition: all 0.2s;
}

.expand-btn:hover {
    background: rgba(74, 144, 217, 0.1);
    color: var(--crystal-blue);
}

/* Expanded Content */
.insight-expanded {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}

.expanded-content h4 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expanded-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 16px 0;
}

.connections-list {
    font-family: 'Rajdhani', monospace;
    font-size: 12px;
    color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

/* Spotlight Score with Radar */
.spotlight-card .spotlight-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.spotlight-card .score-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
}

/* Responsive */
@media (max-width: 768px) {
    .insight-metrics {
        flex-direction: column;
        align-items: center;
    }

    .metrics-right {
        width: 100%;
    }

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

/* ============================================================
   INSIGHT DETAIL PAGE
   ============================================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
}

.breadcrumb-link {
    color: var(--crystal-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--gold-bright);
}

.breadcrumb-sep {
    color: rgba(180, 200, 220, 0.3);
}

.breadcrumb-current {
    color: var(--text-secondary);
}

/* Hero Card */
.insight-detail-hero {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.08), rgba(30, 40, 60, 0.6));
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.insight-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--crystal-blue), var(--gold-bright), var(--crystal-blue));
}

.insight-detail-hero.profound {
    border-color: rgba(212, 168, 50, 0.3);
    background: linear-gradient(135deg, rgba(212, 168, 50, 0.06), rgba(30, 40, 60, 0.6));
    box-shadow: 0 0 40px rgba(212, 168, 50, 0.08);
}

.insight-detail-hero.profound::before {
    background: linear-gradient(90deg, var(--gold-bright), #fff8e1, var(--gold-bright));
}

.detail-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.detail-badges {
    display: flex;
    gap: 10px;
    align-items: center;
}

.detail-score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.detail-score-number {
    font-family: 'Orbitron', monospace;
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.insight-detail-hero.profound .detail-score-number {
    color: var(--gold-bright);
    text-shadow: 0 0 20px rgba(212, 168, 50, 0.4);
}

.detail-score-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.detail-title {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-author, .detail-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-vote {
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.detail-vote:hover {
    background: rgba(74, 144, 217, 0.2);
    color: var(--crystal-blue);
}

.detail-vote.voted {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}

/* Main Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    margin-bottom: 32px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.detail-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crystal-blue);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

.detail-content-body {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.detail-content-body strong, .detail-content-body b {
    color: var(--gold-bright);
}

/* Connections Map */
.connections-map {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.connection-node {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(74, 144, 217, 0.06);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
}

.conn-type {
    color: var(--text-secondary);
    font-weight: 500;
}

.conn-ref {
    color: var(--crystal-blue);
    font-weight: 600;
}

/* Linked Item Cards */
.linked-item-card {
    background: rgba(74, 144, 217, 0.04);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.linked-item-card:last-child {
    margin-bottom: 0;
}

.linked-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
}

.linked-type-badge {
    background: rgba(74, 144, 217, 0.15);
    color: var(--crystal-blue);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.linked-source {
    color: var(--text-secondary);
}

.linked-item-card h4 {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.linked-item-card p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.linked-item-footer {
    margin-top: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}

.linked-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.plausibility-badge {
    background: rgba(212, 168, 50, 0.15);
    color: var(--gold-bright);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
}

/* Knowledge link accent */
.knowledge-link {
    border-left: 3px solid var(--crystal-blue);
}

/* Anomaly link accent */
.anomaly-link {
    border-left: 3px solid #e74c3c;
}

/* Theory link accent */
.theory-link {
    border-left: 3px solid var(--gold-bright);
}

/* Sidebar */
.detail-radar-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.detail-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-metric-row {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.06);
}

.detail-metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dm-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.dm-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.dm-weight {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
}

.dm-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dm-bar {
    flex: 1;
    height: 6px;
    background: rgba(74, 144, 217, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.dm-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.dm-fill.high {
    background: linear-gradient(90deg, var(--gold-bright), #f0c040);
}

.dm-fill.mid {
    background: linear-gradient(90deg, var(--crystal-blue), #6ab0ff);
}

.dm-fill.low {
    background: linear-gradient(90deg, #8899aa, #aabbcc);
}

.dm-value {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

.dm-desc {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Related Insights List */
.related-insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-insight-item {
    display: block;
    background: rgba(74, 144, 217, 0.04);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-decoration: none;
    transition: all 0.2s;
}

.related-insight-item:hover {
    border-color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.08);
    transform: translateX(3px);
}

.related-insight-item.profound {
    border-color: rgba(212, 168, 50, 0.2);
}

.related-insight-item.profound:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 15px rgba(212, 168, 50, 0.1);
}

.ri-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ri-score {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
}

.ri-score.high { color: var(--gold-bright); }
.ri-score.mid  { color: var(--crystal-blue); }
.ri-score.low  { color: var(--text-secondary); }

.ri-type {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ri-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.ri-preview {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Cross-Match Analysis */
.cross-match-desc {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.cross-match-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cross-match-item {
    display: block;
    background: rgba(212, 168, 50, 0.03);
    border: 1px solid rgba(212, 168, 50, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-decoration: none;
    transition: all 0.2s;
}

.cross-match-item:hover {
    border-color: var(--gold-bright);
    background: rgba(212, 168, 50, 0.06);
    transform: translateX(3px);
}

.cm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cm-relevance {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-bright);
    background: rgba(212, 168, 50, 0.12);
    padding: 2px 8px;
    border-radius: 8px;
}

.profound-badge-sm {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    font-weight: 700;
    color: var(--gold-bright);
    border: 1px solid var(--gold-bright);
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.cm-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.cm-via {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cm-score-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cm-score-val {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-bright);
}

/* Empty Sidebar State */
.empty-sidebar-state {
    text-align: center;
    padding: 20px 10px;
}

.empty-sidebar-state .inline-icon-lg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
}

.empty-sidebar-state p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Back Button */
.detail-back-section {
    text-align: center;
    padding: 20px 0 40px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    color: var(--crystal-blue);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(74, 144, 217, 0.2);
    border-color: var(--crystal-blue);
    transform: translateX(-3px);
}

/* Clickable Insight Titles */
a.insight-title-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a.insight-title-link:hover {
    color: var(--gold-bright);
}

/* Responsive Detail Page */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .insight-detail-hero {
        padding: 20px;
    }

    .detail-title {
        font-size: 18px;
    }

    .detail-score-number {
        font-size: 28px;
    }

    .detail-hero-header {
        flex-direction: column;
        gap: 12px;
    }

    .detail-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================================
   ANOMALY DETAIL PAGE
   ============================================================ */

.anomaly-detail-hero {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.06), rgba(30, 40, 60, 0.6));
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.anomaly-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #e74c3c);
}

.anomaly-detail-hero.status-unexplained {
    border-color: rgba(231, 76, 60, 0.25);
}

.anomaly-detail-hero.status-theorized {
    border-color: rgba(243, 156, 18, 0.25);
}

.anomaly-detail-hero.status-theorized::before {
    background: linear-gradient(90deg, #f39c12, #f1c40f, #f39c12);
}

.anomaly-detail-hero.status-partially_explained {
    border-color: rgba(74, 144, 217, 0.25);
}

.anomaly-detail-hero.status-partially_explained::before {
    background: linear-gradient(90deg, #4a90d9, #6ab0ff, #4a90d9);
}

.anomaly-detail-hero.status-resolved {
    border-color: rgba(46, 204, 113, 0.25);
}

.anomaly-detail-hero.status-resolved::before {
    background: linear-gradient(90deg, #2ecc71, #82e0aa, #2ecc71);
}

.anomaly-detail-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
}

.anomaly-upvotes-display .detail-vote {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.anomaly-upvotes-display .detail-vote:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.anomaly-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.vote-counts {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   SYNTHESIS PAGE — GRAND UNIFICATION
   ============================================================ */

.synthesis-page {
    max-width: 1100px;
    margin: 0 auto;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}

.report-badge {
    background: rgba(74, 144, 217, 0.15);
    color: var(--crystal-blue);
    padding: 4px 14px;
    border-radius: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8em;
    letter-spacing: 1px;
    border: 1px solid rgba(74, 144, 217, 0.25);
}

.report-badge.matrix-badge {
    background: rgba(212, 168, 50, 0.12);
    color: var(--pyramid-gold);
    border-color: rgba(212, 168, 50, 0.25);
}

.report-date {
    color: var(--text-muted);
    font-size: 0.85em;
    font-family: 'Space Mono', monospace;
}

/* Table of Contents */
.synthesis-toc {
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-lg);
    padding: 25px 30px;
    margin: 30px 0 40px;
}

.synthesis-toc h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4em;
    color: var(--crystal-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list {
    columns: 2;
    column-gap: 40px;
    list-style: decimal;
    padding-left: 20px;
}

.toc-list li {
    padding: 4px 0;
    break-inside: avoid;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95em;
}

.toc-list a:hover {
    color: var(--crystal-blue);
}

/* Synthesis Sections */
.synthesis-section {
    background: var(--bg-secondary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-bottom: 35px;
    scroll-margin-top: 80px;
}

.synthesis-section.speed-of-light-section {
    border-color: rgba(212, 168, 50, 0.25);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(212, 168, 50, 0.03));
}

.synthesis-section.conclusion-section {
    border-color: rgba(74, 144, 217, 0.3);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(74, 144, 217, 0.04));
}

.synthesis-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.7em;
    color: var(--text-primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(74, 144, 217, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}

.synthesis-body {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.02em;
}

.synthesis-body h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.4em;
    color: var(--pyramid-gold);
    margin: 30px 0 15px;
}

.synthesis-body h4 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.synthesis-body p {
    margin-bottom: 15px;
}

.synthesis-body ul, .synthesis-body ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.synthesis-body li {
    padding: 3px 0;
}

.synthesis-body strong {
    color: var(--text-primary);
}

/* Key Finding Box */
.key-finding {
    background: rgba(212, 168, 50, 0.06);
    border-left: 4px solid var(--pyramid-gold);
    padding: 20px 25px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 25px;
}

.key-finding h3 {
    color: var(--pyramid-gold);
    margin-top: 0;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}

.summary-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
}

.summary-card h4 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: var(--crystal-blue);
}

.summary-card ul {
    padding-left: 18px;
}

.summary-card li {
    font-size: 0.92em;
    padding: 2px 0;
}

/* Evidence Table */
.evidence-table {
    overflow-x: auto;
    margin: 20px 0;
}

.evidence-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}

.evidence-table th {
    background: rgba(74, 144, 217, 0.1);
    color: var(--crystal-blue);
    padding: 12px 15px;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05em;
    letter-spacing: 0.5px;
}

.evidence-table td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.06);
    color: var(--text-secondary);
}

.evidence-table tr:hover td {
    background: rgba(74, 144, 217, 0.04);
}

.evidence-table .highlight-row td {
    background: rgba(212, 168, 50, 0.08);
    color: var(--text-primary);
    font-weight: 500;
}

.evidence-table code, .evidence-table sup {
    color: var(--pyramid-gold);
}

/* Synthesis Callout */
.synthesis-callout {
    background: rgba(74, 144, 217, 0.06);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-md);
    padding: 20px 25px;
    margin: 25px 0;
}

.synthesis-callout.warning {
    background: rgba(231, 76, 60, 0.06);
    border-color: rgba(231, 76, 60, 0.2);
}

.synthesis-callout h4 {
    color: var(--crystal-blue);
    margin-bottom: 10px;
    font-size: 1.15em;
}

.synthesis-callout.warning h4 {
    color: #e74c3c;
}

.synthesis-callout code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.9em;
    color: var(--pyramid-gold);
    overflow-x: auto;
}

/* Evidence Block */
.evidence-block {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 15px 0 25px;
}

/* Flow Diagram */
.flow-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 15px 0;
}

.flow-step {
    background: rgba(74, 144, 217, 0.08);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    width: 80%;
    max-width: 600px;
    text-align: center;
}

.flow-step.chem {
    background: rgba(80, 250, 123, 0.06);
    border-color: rgba(80, 250, 123, 0.15);
}

.flow-step strong {
    display: block;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.flow-step span {
    font-size: 0.88em;
    color: var(--text-muted);
}

.flow-arrow {
    color: var(--crystal-blue);
    font-size: 1.4em;
    padding: 2px 0;
}

/* Shaft Grid */
.shaft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.shaft-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
}

.shaft-card h4 {
    font-size: 1em;
    margin-bottom: 10px;
    color: var(--crystal-blue);
}

.shaft-angle {
    font-family: 'Space Mono', monospace;
    color: var(--pyramid-gold);
    font-size: 1.3em;
    margin-bottom: 6px;
}

.shaft-target {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.shaft-meaning {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}

/* Speed of Light Highlight */
.speed-highlight {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: rgba(212, 168, 50, 0.06);
    border: 1px solid rgba(212, 168, 50, 0.2);
    border-radius: var(--radius-lg);
    margin: 20px 0 30px;
}

.speed-number {
    text-align: center;
}

.speed-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.speed-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.8em;
    color: var(--pyramid-gold);
    font-weight: 700;
}

.speed-equals {
    font-size: 2.5em;
    color: var(--crystal-blue);
    font-weight: 300;
}

.equation-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.equation-box code {
    font-family: 'Space Mono', monospace;
    font-size: 1.15em;
    color: var(--pyramid-gold);
    background: none;
    padding: 0;
    display: inline;
    margin: 0;
}

.equation-caption {
    font-size: 0.88em;
    color: var(--text-muted);
    margin-top: 10px;
    margin-bottom: 0;
    font-style: italic;
}

/* System Map */
.system-map {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.system-component {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-left: 3px solid var(--crystal-blue);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 18px 20px;
}

.system-component h4 {
    color: var(--crystal-blue);
    margin-bottom: 6px;
}

.system-component p {
    margin-bottom: 6px;
}

.component-evidence {
    font-size: 0.82em;
    color: var(--text-muted);
    font-style: italic;
    display: block;
    margin-top: 4px;
}

/* Theory Evaluation Grid */
.theory-eval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.theory-eval-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 22px;
}

.theory-eval-card.highlight {
    border-color: rgba(80, 250, 123, 0.3);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(80, 250, 123, 0.03));
}

.theory-eval-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.theory-score-bar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    height: 24px;
    margin-bottom: 12px;
    overflow: hidden;
}

.theory-score-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--crystal-blue), var(--pyramid-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.75em;
    color: white;
    font-weight: 700;
    min-width: 40px;
}

.theory-verdict {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.9em;
}

.theory-explains, .theory-fails {
    margin-bottom: 10px;
}

.theory-explains h4 {
    color: #50fa7b;
    font-size: 0.95em;
}

.theory-fails h4 {
    color: #ff5555;
    font-size: 0.95em;
}

.theory-explains ul, .theory-fails ul {
    padding-left: 16px;
    font-size: 0.88em;
}

/* Experiment Cards */
.experiment-list {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.experiment-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-md);
    padding: 18px 22px;
}

.experiment-card h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.experiment-card p {
    font-size: 0.92em;
    margin-bottom: 8px;
}

.experiment-cost, .experiment-impact {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 0.78em;
    padding: 3px 10px;
    border-radius: 12px;
    margin-right: 8px;
}

.experiment-cost {
    background: rgba(74, 144, 217, 0.1);
    color: var(--crystal-blue);
}

.experiment-impact {
    background: rgba(212, 168, 50, 0.12);
    color: var(--pyramid-gold);
}

.synthesis-note {
    font-style: italic;
    color: var(--text-muted);
    border-top: 1px solid rgba(74, 144, 217, 0.1);
    padding-top: 15px;
    margin-top: 20px;
}

/* Top Insights List */
.top-insights-list {
    display: grid;
    gap: 15px;
}

.top-insight-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.top-insight-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.top-insight-item.profound {
    border-color: rgba(212, 168, 50, 0.25);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(212, 168, 50, 0.04));
}

.insight-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6em;
    color: var(--pyramid-gold);
    min-width: 45px;
    text-align: center;
    opacity: 0.7;
}

.insight-info {
    flex: 1;
}

.insight-info h4 {
    margin-bottom: 6px;
}

.insight-info h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.insight-info h4 a:hover {
    color: var(--crystal-blue);
}

.insight-info p {
    font-size: 0.88em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.insight-score-bar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 6px;
}

.score-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--crystal-blue), var(--pyramid-gold));
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 0.75em;
    color: white;
    font-weight: 700;
}

.profound-tag {
    display: inline-block;
    background: rgba(212, 168, 50, 0.15);
    color: var(--pyramid-gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7em;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
}

/* Conclusion Section */
.conclusion-statement {
    padding: 10px 0;
}

.conclusion-points {
    margin-top: 25px;
}

.conclusion-point {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.point-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 2em;
    color: var(--pyramid-gold);
    opacity: 0.6;
    min-width: 45px;
    text-align: center;
    line-height: 1;
    padding-top: 5px;
}

.conclusion-point h4 {
    color: var(--text-primary);
    font-size: 1.15em;
    margin-bottom: 6px;
}

.conclusion-point p {
    font-size: 0.95em;
}

.final-statement {
    background: rgba(212, 168, 50, 0.05);
    border: 1px solid rgba(212, 168, 50, 0.15);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.final-statement p {
    font-size: 1.1em;
    line-height: 1.9;
}

.synthesis-sign-off {
    font-family: 'Space Mono', monospace;
    font-size: 0.8em !important;
    color: var(--text-muted);
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Anomaly Overview Grid */
.anomaly-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.anomaly-mini-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: transform 0.2s;
}

.anomaly-mini-card:hover {
    transform: translateY(-3px);
}

.anomaly-mini-card a {
    text-decoration: none;
}

.anomaly-mini-card h4 {
    color: var(--text-primary);
    font-size: 0.9em;
    margin-bottom: 6px;
}

.anomaly-mini-card .status-tag {
    font-size: 0.72em;
    font-family: 'Space Mono', monospace;
    padding: 2px 8px;
    border-radius: 8px;
}

.status-tag.unexplained {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.status-tag.theorized {
    background: rgba(241, 196, 15, 0.12);
    color: #f1c40f;
}

.status-tag.partially_explained {
    background: rgba(74, 144, 217, 0.12);
    color: var(--crystal-blue);
}

.status-tag.resolved {
    background: rgba(80, 250, 123, 0.12);
    color: #50fa7b;
}

/* Responsive */
@media (max-width: 768px) {
    .synthesis-section {
        padding: 20px 15px;
    }
    
    .synthesis-heading {
        font-size: 1.3em;
    }
    
    .toc-list {
        columns: 1;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .speed-highlight {
        flex-direction: column;
        gap: 15px;
    }
    
    .speed-value {
        font-size: 1.3em;
    }
    
    .speed-equals {
        font-size: 1.5em;
    }
    
    .theory-eval-grid {
        grid-template-columns: 1fr;
    }
    
    .conclusion-point {
        flex-direction: column;
        gap: 10px;
    }
    
    .point-number {
        font-size: 1.5em;
    }
    
    .flow-step {
        width: 95%;
    }

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

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(74, 144, 217, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 144, 217, 0.5); }

/* ============================================================
   SELECTION
   ============================================================ */

::selection {
    background: rgba(212, 168, 50, 0.3);
    color: white;
}

/* ============================================================
   FORUM STYLES
   ============================================================ */

.forum-page {
    max-width: 1000px;
}

/* Stats Bar */
.forum-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.forum-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.forum-stat .stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5em;
    color: var(--crystal-blue);
}

.forum-stat .stat-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.forum-stat.queued .stat-number {
    color: var(--gold);
}

/* Category Grid */
.forum-categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 40px;
}

.forum-category-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.08);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.forum-category-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(74, 144, 217, 0.2);
    transform: translateX(4px);
}

.cat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 144, 217, 0.1);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.cat-icon .card-icon-img {
    width: 32px;
    height: 32px;
}

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

.cat-info h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.cat-info p {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.cat-counts {
    display: flex;
    gap: 16px;
    font-size: 0.75em;
    color: var(--text-muted);
}

/* Recent Activity */
.forum-recent {
    margin-top: 10px;
}

.forum-recent .section-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.recent-threads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.06);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.recent-thread-item:hover {
    background: var(--bg-card-hover);
}

.thread-meta-left h4 {
    font-size: 1em;
    margin-top: 4px;
}

.thread-category-tag {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
}

.thread-author {
    font-size: 0.75em;
    color: var(--text-muted);
}

.thread-meta-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.75em;
    color: var(--text-muted);
}

.epoch-badge {
    background: rgba(212, 168, 50, 0.2);
    color: var(--gold);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--crystal-blue);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.bc-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Thread list */
.forum-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.thread-count-label {
    font-size: 0.85em;
    color: var(--text-muted);
}

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

.thread-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.06);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.thread-row:hover {
    background: var(--bg-card-hover);
    border-color: rgba(74, 144, 217, 0.15);
}

.thread-row.pinned {
    border-left: 3px solid var(--gold);
}

.thread-row.queued {
    border-left: 3px solid var(--crystal-blue);
}

.thread-row-main {
    flex: 1;
    min-width: 0;
}

.thread-row-main h3 {
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.pin-badge {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    background: rgba(212, 168, 50, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.epoch-badge-sm {
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.thread-row-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 4px;
}

.thread-row-stats {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 40px;
}

.stat-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 1em;
    color: var(--text-primary);
}

.stat-lbl {
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Thread View */
.thread-title-main {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.thread-meta-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.thread-meta-bar strong {
    color: var(--text-primary);
}

.thread-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85em;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-action.voted {
    color: var(--crystal-blue);
    border-color: var(--crystal-blue);
}

.btn-action.epoch-btn.active {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(212, 168, 50, 0.1);
}

/* Forum Posts */
.forum-post {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(74, 144, 217, 0.06);
}

.forum-post.original-post {
    border-left: 3px solid var(--crystal-blue);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-avatar img {
    width: 20px;
    height: 20px;
}

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

.post-author-name {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary);
}

.post-timestamp {
    font-size: 0.75em;
    color: var(--text-muted);
}

.op-badge {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crystal-blue);
    background: rgba(74, 144, 217, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.post-body {
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8em;
    transition: var(--transition);
}

.post-vote-btn:hover {
    color: var(--crystal-blue);
    border-color: var(--crystal-blue);
}

.post-vote-btn.voted {
    color: var(--crystal-blue);
}

/* Reply Section */
.replies-header {
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
}

.replies-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1em;
    color: var(--text-secondary);
}

.reply-form-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.reply-form-section h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1em;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.thread-locked-notice {
    margin-top: 30px;
    padding: 15px 20px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

/* Form Styles */
.new-thread-form {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9em;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--crystal-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9em;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--crystal-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-row-split {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.form-row-split .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--crystal-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--crystal-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(74, 144, 217, 0.1);
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    padding-top: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
    transition: var(--transition);
}

.page-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.page-info {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 15px 0 8px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 0.9em;
}

.empty-icon-img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE OVERRIDES
   ============================================================ */

/* --- Nav (already has 1100px breakpoint, enhance) --- */

@media (max-width: 1100px) {
    .nav-links {
        z-index: 100;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
    }
}

/* --- Large tablet (≤ 900px) --- */
@media (max-width: 900px) {
    .page-section {
        padding: 24px 16px;
    }

    /* Hero */
    .hero-section {
        min-height: 50vh;
    }

    .hero-title {
        font-size: 28px;
        letter-spacing: 3px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    /* Access Grid */
    .access-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Knowledge Grid */
    .knowledge-grid {
        grid-template-columns: 1fr;
    }

    /* Insight Grid */
    .insight-feed-grid,
    .insights-grid {
        grid-template-columns: 1fr;
    }

    /* Theories Grid */
    .theories-grid {
        grid-template-columns: 1fr;
    }

    /* Math Grid */
    .math-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Anomaly Grid */
    .anomalies-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline (900px) */
    .timeline-line {
        left: 24px;
    }

    .timeline-event {
        width: calc(100% - 50px);
        margin-left: 50px !important;
        text-align: left;
        padding-left: 24px !important;
        padding-right: 0 !important;
    }

    .convergence-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .convergence-node {
        flex: 0 0 180px;
    }

    /* Synthesis */
    .synthesis-cards-grid {
        grid-template-columns: 1fr;
    }

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

    .system-map {
        flex-direction: column;
    }

    .system-arrow {
        width: 2px;
        height: 30px;
    }

    .system-arrow::after {
        right: auto;
        left: -4px;
        top: auto;
        bottom: 0;
        border-top: 8px solid var(--crystal-blue);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: none;
    }

    /* Forum */
    .forum-stats-bar {
        flex-wrap: wrap;
    }

    .thread-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .thread-row-stats {
        align-self: flex-start;
    }
}

/* --- Tablet / Phone (≤ 768px) --- */
@media (max-width: 768px) {
    :root {
        --nav-height: 54px;
    }

    /* ========== BOTTOM NAV + APP FEEL ========== */
    .bottom-nav {
        display: flex;
    }

    /* Hide top nav links and user area on mobile (use bottom nav instead) */
    .nav-links {
        display: none !important;
    }

    .nav-toggle {
        display: none !important;
    }

    .nav-user {
        display: none !important;
    }

    /* Hide desktop footer on mobile */
    .site-footer {
        display: none;
    }

    /* Add bottom padding for bottom nav on ALL pages */
    .main-content {
        padding-bottom: 70px;
    }

    /* Chat dock sits above bottom nav on home */
    .chat-dock {
        bottom: 56px; /* height of bottom nav */
    }

    .home-page.has-chat-dock {
        padding-bottom: 0; /* main-content padding handles it */
    }

    /* ========== END BOTTOM NAV ========== */

    .page-section {
        padding: 20px 12px;
    }

    /* Hero */
    .hero-section {
        min-height: 40vh;
        padding: 30px 16px;
    }

    .hero-title {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 12px;
    }

    /* Page Titles */
    .page-title, .detail-title {
        font-size: 1.3em;
    }

    .section-desc {
        font-size: 0.85em;
    }

    /* Access Grid */
    .access-grid {
        grid-template-columns: 1fr 1fr;
    }

    .access-card {
        padding: 14px;
    }

    .access-card h3 {
        font-size: 0.9em;
    }

    .access-card p {
        font-size: 0.75em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .access-card .card-icon-img {
        width: 32px;
        height: 32px;
    }

    /* Chat Dock Mobile */
    .chat-dock.expanded {
        max-height: calc(100vh - 56px - var(--nav-height));
    }

    .chat-dock .chat-messages {
        max-height: calc(100vh - 56px - var(--nav-height) - 130px);
    }

    .chat-dock-title span {
        font-size: 13px;
    }

    /* Forum Mobile — handled below */

    /* This used to be .chat-input-container, no longer relevant */
    .chat-input-container {
        flex-direction: column;
        gap: 8px;
    }

    .chat-input-container input {
        width: 100%;
    }

    /* Knowledge */
    .upload-form {
        flex-direction: column;
    }

    .upload-form .form-input,
    .upload-form .form-select,
    .upload-form button {
        width: 100%;
    }

    /* Insight Cards */
    .insight-card, .insight-card-full {
        padding: 16px;
    }

    .insight-metrics-container {
        flex-direction: column;
    }

    .radar-chart-wrapper {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .metric-bars-wrapper {
        width: 100%;
    }

    /* Insight Detail */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .insight-detail-hero {
        padding: 20px;
    }

    .linked-items-grid {
        grid-template-columns: 1fr;
    }

    /* Theory Cards */
    .theory-card {
        padding: 16px;
    }

    .theory-evidence-grid {
        grid-template-columns: 1fr;
    }

    /* Geometry Lab */
    #three-container,
    .giza-viewer-wrapper {
        height: 50vh;
        min-height: 300px;
    }

    .viewer-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .geo-btn {
        font-size: 0.7em;
        padding: 6px 10px;
    }

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

    /* Timeline (768px) */
    .timeline-line {
        left: 20px;
    }

    .timeline-event {
        width: calc(100% - 40px);
        margin-left: 40px !important;
        padding-left: 20px !important;
    }

    .timeline-dot {
        left: -36px !important;
        width: 30px;
        height: 30px;
    }

    .timeline-stats-bar {
        gap: 12px;
        padding: 16px;
    }

    .timeline-stat-value {
        font-size: 1.2rem;
    }

    .era-header {
        padding: 10px 14px;
    }

    .era-title {
        font-size: 1rem;
    }

    .timeline-card {
        padding: 16px;
    }

    /* Anomaly Detail */
    .anomaly-detail-page .detail-section {
        padding: 16px;
    }

    /* Synthesis */
    .section-heading {
        font-size: 1.4em;
    }

    .subsection-heading {
        font-size: 1.2em;
    }

    .section-content {
        font-size: 0.95em;
        text-align: left;
    }

    .synthesis-comparison {
        flex-direction: column;
        gap: 10px;
    }

    .comparison-value {
        font-size: 1.4em;
    }

    .comparison-separator {
        font-size: 1.5em;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-step {
        width: 100%;
    }

    .flow-arrow {
        width: 2px;
        height: 20px;
    }

    .flow-arrow::after {
        right: auto;
        left: -4px;
        top: auto;
        bottom: 0;
        border-top: 8px solid var(--crystal-blue);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: none;
    }

    .synthesis-callout {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .synthesis-callout p {
        font-size: 1em;
    }

    .synthesis-table {
        font-size: 0.8em;
    }

    .synthesis-table th, .synthesis-table td {
        padding: 8px 10px;
    }

    /* Forum Mobile */
    .forum-stats-bar {
        gap: 12px;
    }

    .forum-category-card {
        padding: 14px;
        gap: 12px;
    }

    .cat-icon {
        width: 44px;
        height: 44px;
    }

    .cat-icon .card-icon-img {
        width: 24px;
        height: 24px;
    }

    .cat-info h3 {
        font-size: 1em;
    }

    .recent-thread-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .thread-meta-right {
        flex-wrap: wrap;
    }

    .thread-title-main {
        font-size: 1.3em;
    }

    .thread-meta-bar {
        flex-direction: column;
        gap: 4px;
        font-size: 0.8em;
    }

    .thread-actions-bar {
        flex-direction: column;
    }

    .thread-actions-bar .btn-action {
        width: 100%;
        justify-content: center;
    }

    .form-row-split {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions {
        width: 100%;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /* Scoring Methodology Panel */
    .scoring-methodology-panel {
        padding: 16px;
    }

    .scoring-methodology-panel .metric-row {
        flex-direction: column;
        gap: 4px;
    }

    /* Connections Canvas */
    #connections-canvas {
        height: 250px;
    }
}

/* --- Small Phone (≤ 480px) --- */
@media (max-width: 480px) {
    .page-section {
        padding: 16px 10px;
    }

    .hero-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .hero-subtitle {
        font-size: 11px;
    }

    .hero-stats {
        gap: 12px;
    }

    .stat-number {
        font-size: 18px;
    }

    /* Nav brand */
    .nav-brand .nav-title {
        font-size: 14px;
    }

    .nav-brand .nav-icon-img {
        width: 18px;
        height: 18px;
    }

    /* Bottom nav smaller */
    .bottom-nav-item {
        font-size: 9px;
        padding: 5px 2px;
    }

    .bottom-nav-item img {
        width: 20px;
        height: 20px;
    }

    /* Access grid 2-col on small phones */
    .access-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .access-card {
        padding: 12px;
    }

    .access-card .card-icon-img {
        width: 28px;
        height: 28px;
    }

    .access-card h3 {
        font-size: 0.8em;
    }

    .access-card p {
        display: none; /* hide description on very small screens */
    }

    /* Cards — compact */
    .forum-category-card,
    .insight-card, .insight-card-full,
    .theory-card, .anomaly-card,
    .knowledge-card, .forum-post,
    .linked-item-card {
        border-radius: var(--radius-sm);
    }

    /* Thread Row Stats */
    .thread-row-stats {
        gap: 10px;
    }

    .stat-col {
        min-width: 32px;
    }

    .stat-num {
        font-size: 0.85em;
    }

    /* Forum Post */
    .forum-post {
        padding: 14px;
    }

    .post-body {
        font-size: 0.88em;
    }

    /* Synthesis */
    .section-heading {
        font-size: 1.2em;
    }

    .synthesis-card {
        padding: 16px;
    }

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

    /* Detail Pages */
    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .vote-btn,
    .detail-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Radar Chart on Mobile */
    .radar-chart-wrapper canvas {
        width: 180px !important;
        height: 180px !important;
    }

    /* Chat dock */
    .chat-dock-header {
        padding: 10px 14px;
        min-height: 50px;
    }

    .chat-dock-title span {
        font-size: 12px;
    }

    #chat-input {
        font-size: 16px; /* prevent iOS zoom */
        padding: 8px 14px;
    }
}

/* ============================================================
   AUTH PAGES (Login / Register / Settings)
   ============================================================ */

.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(212, 168, 50, 0.4));
}

.auth-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check-row {
    display: flex;
    align-items: center;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-check input[type="checkbox"] {
    accent-color: var(--crystal-blue);
    width: 18px;
    height: 18px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--crystal-glow);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}


/* ============================================================
   SETTINGS PAGE
   ============================================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: var(--radius);
    padding: 28px;
}

.settings-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.current-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============================================================
   PROFILE PAGES
   ============================================================ */

.profile-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.12);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(212, 168, 50, 0.15), rgba(74, 144, 217, 0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(212, 168, 50, 0.3);
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 48px;
    height: 48px;
}

.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-display-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-username {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: rgba(212, 168, 50, 0.2);
    color: var(--gold-bright);
    border: 1px solid rgba(212, 168, 50, 0.3);
}

.role-badge.moderator {
    background: rgba(155, 89, 182, 0.2);
    color: #c084fc;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.role-badge.banned {
    background: rgba(231, 76, 60, 0.2);
    color: var(--ruby);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.role-badge.active-user,
.role-badge.user {
    background: rgba(46, 204, 113, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.profile-bio {
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meta-item a {
    color: var(--crystal-glow);
    text-decoration: none;
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-self: flex-start;
}

.profile-stats-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.profile-stat {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    text-align: center;
    flex: 1;
    min-width: 100px;
}

.profile-section {
    margin-top: 32px;
}

.profile-threads-list .thread-row {
    margin-bottom: 8px;
}

.profile-post-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.08);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 8px;
}

.post-context {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.post-context a {
    color: var(--crystal-glow);
    text-decoration: none;
}

.post-date {
    color: var(--text-muted);
}

.post-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Avatar Picker */
.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.avatar-option:hover {
    border-color: rgba(74, 144, 217, 0.3);
    background: var(--bg-card-hover);
}

.avatar-option.selected,
.avatar-option:has(input:checked) {
    border-color: var(--gold);
    background: rgba(212, 168, 50, 0.1);
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-option img {
    width: 40px;
    height: 40px;
}

.avatar-option span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}


/* ============================================================
   PRIVATE MESSAGES
   ============================================================ */

.messages-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.folder-tabs {
    display: flex;
    gap: 4px;
}

.folder-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    border: 1px solid transparent;
}

.folder-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.folder-tab.active {
    background: var(--bg-card);
    color: var(--crystal-glow);
    border-color: rgba(74, 144, 217, 0.2);
}

.unread-badge {
    background: var(--ruby);
    color: white;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.06);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
}

.message-row:hover {
    background: var(--bg-card-hover);
    border-color: rgba(74, 144, 217, 0.15);
}

.message-row.unread {
    border-left: 3px solid var(--crystal-glow);
    background: rgba(74, 144, 217, 0.04);
}

.msg-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    padding: 4px;
}

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

.msg-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.msg-user {
    font-weight: 600;
    font-size: 0.9rem;
}

.msg-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.msg-subject {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.msg-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--crystal-glow);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(100, 181, 246, 0.5);
}

/* Message Thread */
.msg-participants {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.msg-participants a {
    color: var(--crystal-glow);
    text-decoration: none;
    font-weight: 500;
}

.msg-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.msg-bubble {
    max-width: 80%;
    border-radius: var(--radius);
    padding: 16px;
}

.msg-bubble.received {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    align-self: flex-start;
}

.msg-bubble.sent {
    background: rgba(74, 144, 217, 0.1);
    border: 1px solid rgba(74, 144, 217, 0.2);
    align-self: flex-end;
}

.msg-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.msg-bubble-avatar img {
    width: 24px;
    height: 24px;
}

.msg-bubble-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.msg-bubble-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.msg-bubble-body {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.msg-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.msg-subject-title {
    font-size: 1.3rem !important;
}

.compose-form {
    max-width: 600px;
}

.inline-form {
    display: inline;
}


/* ============================================================
   ADMIN BACKEND
   ============================================================ */

.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.1);
    padding-bottom: 8px;
}

.admin-nav-item {
    padding: 10px 20px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.admin-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.admin-nav-item.active {
    color: var(--gold-bright);
    background: var(--bg-card);
    border-bottom: 2px solid var(--gold);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(74, 144, 217, 0.1);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.admin-stat-card img {
    width: 32px;
    height: 32px;
    opacity: 0.7;
}

.admin-section {
    margin-bottom: 32px;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 144, 217, 0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-top: 1px solid rgba(74, 144, 217, 0.06);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.admin-table a {
    color: var(--crystal-glow);
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}

.admin-table .user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-table .user-cell div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-table .user-cell small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.action-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.role-form select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-mini:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(74, 144, 217, 0.3);
}

.btn-mini img {
    width: 16px;
    height: 16px;
}

.btn-mini.btn-danger {
    border-color: rgba(231, 76, 60, 0.3);
    color: var(--ruby);
}

.btn-mini.btn-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

.btn-mini.btn-success {
    border-color: rgba(46, 204, 113, 0.3);
    color: var(--emerald);
}

.btn-mini.btn-success:hover {
    background: rgba(46, 204, 113, 0.1);
}

.btn-danger {
    border-color: rgba(231, 76, 60, 0.3) !important;
    color: var(--ruby) !important;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

.banned-row {
    background: rgba(231, 76, 60, 0.04);
}

.admin-search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    max-width: 500px;
}

.admin-search .form-input {
    flex: 1;
}

.pin-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(212, 168, 50, 0.2);
    color: var(--gold-bright);
    margin-left: 6px;
}

.lock-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(231, 76, 60, 0.2);
    color: var(--ruby);
    margin-left: 6px;
}


/* ============================================================
   NAV USER AREA
   ============================================================ */

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-msg-link,
.nav-admin-link {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--ruby);
    color: white;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-username {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-nav-register {
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
}

.nav-logout-link .nav-icon-img {
    opacity: 0.5;
}

.nav-logout-link:hover .nav-icon-img {
    opacity: 1;
}


/* Forum enhancements */
.posting-as {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.posting-as strong {
    color: var(--crystal-glow);
    margin-left: 4px;
}

.login-prompt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-prompt a {
    color: var(--crystal-glow);
    text-decoration: none;
    font-weight: 600;
}

.mod-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.btn-mod {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    opacity: 0.7;
}

.btn-mod:hover {
    opacity: 1;
}

/* ============================================================
   ERROR PAGES
   ============================================================ */

.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-container {
    text-align: center;
    max-width: 480px;
    padding: 40px;
}

.error-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
    filter: drop-shadow(0 0 20px rgba(212, 168, 50, 0.3));
}

.error-code {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.error-container h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.error-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}


/* Bottom more auth */
.bottom-more-auth {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 0;
    margin-top: 8px;
    border-top: 1px solid rgba(74, 144, 217, 0.1);
}


/* --- Mobile responsive for auth/profile/messages/admin --- */
@media (max-width: 768px) {
    .auth-container {
        padding: 28px 20px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 16px;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-actions {
        align-self: center;
    }

    .profile-stats-bar {
        gap: 8px;
    }

    .profile-stat {
        padding: 12px 8px;
    }

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

    .messages-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .message-row {
        padding: 12px;
    }

    .msg-bubble {
        max-width: 90%;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .admin-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }

    .avatar-picker {
        grid-template-columns: repeat(3, 1fr);
    }

    .mod-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .nav-username {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 24px 16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-more-auth {
        grid-template-columns: repeat(2, 1fr);
    }

    .folder-tabs {
        width: 100%;
    }

    .folder-tab {
        flex: 1;
        justify-content: center;
    }
}


/* --- Touch-friendly sizing --- */
@media (hover: none) and (pointer: coarse) {
    .bottom-nav-item {
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-primary,
    .btn-secondary,
    .btn-action,
    .page-btn {
        min-height: 44px;
    }

    .form-input, .form-textarea {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px 14px;
    }

    .post-vote-btn {
        min-width: 44px;
        min-height: 36px;
    }

    .vote-btn {
        min-height: 44px;
    }

    .geo-btn {
        min-height: 36px;
        padding: 8px 12px;
    }

    #chat-input {
        font-size: 16px;
    }

    .send-btn {
        min-width: 42px;
        min-height: 42px;
    }

    .more-menu-item {
        min-height: 60px;
    }
}

/* ═══════════════════════════════════════════════════════
   GEOPHYSICS LABORATORY — Scientific Panels
   ═══════════════════════════════════════════════════════ */

.sci-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.sci-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.sci-panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
    font-weight: 600;
}

.sci-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.sci-panel-body {
    padding: 20px 24px;
}

.sci-viz-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.sci-viz-main {
    flex: 1;
    min-width: 0;
}

.sci-viz-main canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0a0e1a;
}

.sci-viz-data {
    flex: 0 0 280px;
    min-width: 260px;
}

.sci-canvas-controls {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
}

.sci-canvas-controls label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.sci-canvas-controls input[type="checkbox"] {
    accent-color: var(--primary);
}

.sci-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.sci-btn:hover {
    background: var(--primary);
    color: var(--bg);
}

.sci-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
    font-size: 13px;
}

.sci-table caption {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.sci-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sci-table td {
    padding: 5px 6px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
}

.sci-table td strong {
    color: var(--text);
}

.sci-table td.em-hot {
    color: #ff6b6b;
}

.sci-table td.em-hot strong {
    color: #ff4444;
}

.sci-table td.em-warm {
    color: #ffd93d;
}

.sci-table td.em-warm strong {
    color: #ffc107;
}

.sci-table td.em-mild {
    color: #6bcb77;
}

.sci-table td.em-mild strong {
    color: #4caf50;
}

.sci-table td.em-cool {
    color: #4d96ff;
}

.sci-table td.em-cool strong {
    color: #2196f3;
}

.sci-note {
    background: rgba(0, 229, 255, 0.05);
    border-left: 3px solid rgba(0, 229, 255, 0.4);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.sci-note strong {
    color: var(--text);
}

.sci-formula {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

.sci-formula strong {
    color: var(--primary);
}

/* ── Responsive: Geophysics Lab ── */
@media (max-width: 900px) {
    .sci-viz-row {
        flex-direction: column;
    }

    .sci-viz-data {
        flex: 1 1 auto;
        min-width: auto;
    }

    .sci-panel-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .sci-panel-header h3 {
        font-size: 15px;
    }

    .sci-panel-body {
        padding: 14px 16px;
    }
}

@media (max-width: 600px) {
    .sci-canvas-controls {
        gap: 8px;
    }

    .sci-canvas-controls label {
        font-size: 11px;
    }

    .sci-table td,
    .sci-table th {
        padding: 3px 4px;
        font-size: 11px;
    }

    .sci-note,
    .sci-formula {
        font-size: 11px;
        padding: 8px 10px;
    }
}
