:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #22222e;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-tertiary: #606070;

    --accent-cyan: #00d4aa;
    --accent-magenta: #ff0066;
    --accent-gold: #ffb800;
    --accent-violet: #8b5cf6;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);

    --glow-cyan: 0 0 20px rgba(0, 212, 170, 0.3);
    --glow-magenta: 0 0 20px rgba(255, 0, 102, 0.3);

    /* Original Aesthetic Colors */
    --iron-gall: #2b2620;
    --iron-gall-deep: #1a1714;
    --cinnabar: #cc3333;
    --gold-leaf: #d4af37;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Main Top Navigation */
.top-site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-medium);
    z-index: 1000;
    padding: 1rem 2rem;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav-links {
    display: flex;
    gap: 1.5rem; /* Slightly tighter base gap */
    align-items: center;
}

/* Temporal Status Ticker */
.temporal-ticker {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: rgba(22, 22, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 999;
    padding: 0.5rem 2rem;
}

.ticker-grid {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.clock-cluster {
    display: flex;
    gap: 1.5rem; /* Slightly tighter base gap */
}

.clock-cluster.right {
    justify-content: flex-end;
}

.clock-unit {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.clock-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Epoch Picker Dropdown Overlay */
.epoch-picker-overlay {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #0f0f15; /* Solid dark background */
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 1.25rem;
    width: 260px;
    z-index: 1002; /* Ensure it stays above EVERYTHING */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 212, 170, 0.1);
    display: none;
    flex-direction: column;
    gap: 1rem;
    animation: pickerFadeIn 0.2s ease-out;
}

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

.epoch-picker-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.epoch-preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.epoch-preset-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.epoch-custom-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
}

.epoch-custom-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.epoch-custom-field {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    color: var(--accent-cyan);
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

.epoch-custom-field:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.2);
}

.epoch-apply-btn {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    border: none;
    padding: 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: filter 0.2s;
}

.epoch-apply-btn:hover {
    filter: brightness(1.1);
}


.clock-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.clock-value.harmonic {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.clock-value.lunar {
    color: var(--accent-magenta);
}

.clock-value.metonic {
    color: var(--accent-gold);
}

.brand-mark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    transition: color 0.2s, text-shadow 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

/* Main Layout */
.app-container {
    padding-top: 140px;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Theory Markdown Styles */
.theory-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.theory-content h1 {
    color: var(--accent-cyan);
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    letter-spacing: -0.02em;
}

.theory-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.theory-content h3 {
    color: var(--accent-violet);
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.theory-content p {
    margin-bottom: 1.25rem;
}

.theory-content ul {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.theory-content li {
    margin-bottom: 0.5rem;
}

.theory-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.theory-content em {
    color: var(--accent-cyan);
    font-style: italic;
}

.theory-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 2.5rem 0;
}

.theory-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.theory-content th,
.theory-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.theory-content th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theory-content tr:last-child td {
    border-bottom: none;
}

.hero-section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero-title span {
    font-weight: 600;
    color: var(--accent-cyan);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.narrative-block {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-cyan);
    padding: 2rem;
    border-radius: 0 12px 12px 0;
    max-width: 800px;
}

.narrative-block h3 {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.alert-box {
    background: rgba(255, 0, 102, 0.1);
    border: 1px solid rgba(255, 0, 102, 0.3);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.alert-icon {
    color: var(--accent-magenta);
    font-size: 1.2rem;
}

.narrative-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.narrative-text.highlight {
    color: var(--text-primary);
    font-weight: 500;
    border-left: 2px solid var(--accent-violet);
    padding-left: 1rem;
}

.narrative-list {
    margin-bottom: 1rem;
    padding-left: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.narrative-list li {
    margin-bottom: 0.25rem;
}

.narrative-list li strong {
    color: var(--accent-gold);
    font-weight: 500;
}

.narrative-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.8;
}

/* Dashboard Grid */
.dashboard {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.panel-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

.panel-body {
    padding: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan), #00a884);
    border: none;
    border-radius: 8px;
    padding: 1rem;
    color: var(--bg-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

/* Quick Select */
.quick-select {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.quick-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Results Panel */
.result-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

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

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

.result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.result-icon.harmonic {
    background: rgba(0, 212, 170, 0.15);
}

.result-icon.lunar {
    background: rgba(255, 0, 102, 0.15);
}

.result-icon.metonic {
    background: rgba(255, 184, 0, 0.15);
}

.result-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
}

.result-value.highlight {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.result-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Kairos Status */
.kairos-banner {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.kairos-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.kairos-status {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.kairos-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.signal-tag {
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.signal-tag.critical {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
    background: rgba(255, 0, 102, 0.1);
}

/* Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.data-cell {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
}

.data-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.data-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Wheel Visualization */
.wheel-container {
    position: relative;
    aspect-ratio: 1;
    max-width: 500px;
    margin: 0 auto;
}

.wheel-svg {
    width: 100%;
    height: 100%;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.wheel-hub-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.wheel-hub-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
}

/* Ultradian Panel */
.ultradian-panel {
    margin-top: 2rem;
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.phase-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-cyan) 0% 60%, var(--bg-elevated) 60% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.phase-ring::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.phase-text {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.phase-info h4 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.phase-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0;
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.footer-right {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .top-site-nav {
        padding: 0.75rem 1rem;
    }

    .nav-container {
        gap: 0.5rem;
    }

    .brand-mark {
        font-size: 1rem;
    }

    .main-nav-links {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.7rem;
    }

    /* Keep Ticker on 1 Line but Scale */
    .temporal-ticker {
        top: 48px; /* Offset for smaller header */
        padding: 0.4rem 0.5rem;
    }

    .ticker-grid {
        justify-content: center;
        gap: 0.5rem;
    }

    .clock-cluster {
        gap: 0.5rem;
    }

    .clock-cluster.right {
        display: flex; /* DO NOT HIDE ANY DATA */
        justify-content: flex-start;
    }

    .clock-unit {
        gap: 0.1rem;
    }

    .clock-label {
        font-size: 0.5rem;
        letter-spacing: 0.05em;
    }

    .clock-value {
        font-size: 0.7rem;
    }

    .hero-title {
        font-size: 2rem;
    }


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

    .metrics-row {
        grid-template-columns: 1fr;
    }
}

/* PLR Panel */
.plr-birth-info {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.plr-returns-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plr-return-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.2s;
}

.plr-return-card:hover {
    border-color: var(--accent-magenta);
}

.plr-return-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.plr-cycle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-magenta);
}

.plr-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-gold);
    background: rgba(255, 184, 0, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.plr-return-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.plr-return-details div {
    font-family: 'JetBrains Mono', monospace;
}

/* Wheel Tooltip */
.wheel-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 1rem;
    min-width: 200px;
    display: none;
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tt-header {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin-bottom: 0.25rem;
}

.tt-full {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.tt-data {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.tt-power {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
}

/* Chart reveal animation */
.chart-visible {
    animation: fadeInUp 0.4s ease-out;
}

/* Year Day Celebration Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(14, 12, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--gold-leaf);
    flex-direction: column;
}

.overlay-content {
    animation: zoomInFade 2s ease-out;
}

.yearday-text {
    font-size: 5rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.15em;
    margin: 0;
    color: var(--gold-leaf);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.yearday-subtitle {
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.3em;
    color: var(--cinnabar);
    margin-top: 1rem;
    opacity: 0.8;
}

@keyframes zoomInFade {
    0% {
        transform: scale(0.9);
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   HARMONIC COMPATIBILITY ENGINE (HCE)
   ============================================================ */

.hce-section {
    border-left: 4px solid var(--accent-violet);
}

.hce-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 680px;
}

.hce-intro strong {
    color: var(--accent-cyan);
}

/* Input Row */
.hce-input-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .hce-input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hce-vs {
        display: none;
    }
}

.hce-person {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hce-select {
    cursor: pointer;
}

.hce-person-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    min-height: 1.4rem;
    padding: 0.25rem 0;
    transition: color 0.3s;
}

.hce-person-preview.active {
    color: var(--accent-cyan);
}

.hce-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1.5rem;
}

.hce-vs-symbol {
    font-size: 1.75rem;
    color: var(--accent-violet);
    animation: hcePulse 2s ease-in-out infinite;
}

.hce-vs-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

@keyframes hcePulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.hce-analyze-btn {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-violet), #6d28d9);
}

.hce-analyze-btn:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.hce-auto-row {
    margin-bottom: 1rem;
    text-align: center;
}

/* Results */
.hce-results {
    animation: fadeInUp 0.5s ease-out;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
}

/* Score Ring */
.hce-score-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hce-score-header {
        flex-direction: column;
        text-align: center;
    }
}

.hce-score-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.hce-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hce-ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.hce-ring-fg {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1s ease-out, stroke 0.5s;
}

.hce-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hce-score-info {
    flex: 1;
}

.hce-relationship-type {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hce-advice {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Three Dimensions */
.hce-dimensions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .hce-dimensions {
        grid-template-columns: 1fr;
    }
}

.hce-dim {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    transition: border-color 0.3s;
}

.hce-dim:hover {
    border-color: var(--accent-violet);
}

.hce-dim-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hce-dim-icon {
    font-size: 1.1rem;
    color: var(--accent-violet);
}

.hce-dim-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    flex: 1;
}

.hce-dim-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.hce-dim-bar {
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.hce-dim-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
    transition: width 1s ease-out;
    width: 0%;
}

.hce-dim-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Interval Card */
.hce-interval-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.hce-interval-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.hce-interval-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.hce-interval-body .hce-freq {
    color: var(--accent-magenta);
    font-weight: 600;
}

.hce-interval-body .hce-ratio {
    color: var(--accent-cyan);
    font-weight: 600;
}

.hce-interval-body .hce-name {
    color: var(--accent-gold);
}

/* Completer Cards */
.hce-completers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .hce-completers {
        grid-template-columns: 1fr;
    }
}

.hce-completer-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hce-completer-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.hce-completer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.hce-completer-value {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.hce-completer-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Dasha Panel */
.hce-dasha-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(0, 212, 170, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 0.5rem;
}

.hce-dasha-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-violet);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.hce-dasha-body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.hce-dasha-body .dasha-planet {
    color: var(--accent-magenta);
    font-weight: 600;
}

.hce-dasha-body .dasha-nakshatra {
    color: var(--accent-gold);
}

@keyframes hceReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hce-results {
    animation: hceReveal 0.6s ease-out;
}

/* ============================================================
   HCE v4 — PERSON CARDS
   ============================================================ */

.hce-person-card {
    background: linear-gradient(135deg, rgba(26, 26, 36, 0.9), rgba(34, 34, 46, 0.7));
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hce-person-card:hover,
.hce-person-card:focus-within {
    border-color: var(--accent-violet);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.1);
}

.hce-person-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hce-person-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hce-field label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    display: block;
}

.hce-fill-btn {
    width: 100%;
    font-size: 0.75rem !important;
    opacity: 0.8;
}

.hce-fill-btn:hover {
    opacity: 1;
}

.hce-loc-btn {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.hce-loc-btn:hover {
    border-color: var(--accent-cyan) !important;
}

/* ============================================================
   HCE v4 — RESULT TABS
   ============================================================ */

.hce-result-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hce-rtab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.25rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s;
}

.hce-rtab:hover {
    color: var(--text-secondary);
}

.hce-rtab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    font-weight: 600;
}

.hce-tab-content {
    display: none;
}

.hce-tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* ============================================================
   HCE v4 — ORACLE READING
   ============================================================ */

.oracle-settings {
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
}

.oracle-settings-toggle {
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    list-style: none;
    transition: color 0.3s;
}

.oracle-settings-toggle:hover {
    color: var(--text-secondary);
}

.oracle-settings-toggle::-webkit-details-marker {
    display: none;
}

.oracle-settings-body {
    padding: 0 1.25rem 1.25rem;
}

.oracle-reading {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(0, 212, 170, 0.03));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.oracle-reading-header {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent-violet);
    margin-bottom: 1rem;
    font-weight: 700;
}

.oracle-reading-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.oracle-reading-body p {
    margin-bottom: 0.75rem;
}

.oracle-placeholder {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.85rem;
}

.oracle-loading {
    padding: 1rem 0;
}

.oracle-dots span {
    animation: oracleBlink 1.4s infinite;
    font-size: 1.2em;
}

.oracle-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.oracle-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes oracleBlink {

    0%,
    20% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ============================================================
   HCE v4 — ORACLE CHAT
   ============================================================ */

.oracle-chat {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oracle-chat-messages {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oracle-system-msg {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

.oracle-chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.6;
    animation: fadeInUp 0.3s ease-out;
}

.oracle-chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-violet), #6d28d9);
    color: white;
    border-bottom-right-radius: 4px;
}

.oracle-chat-bubble.oracle {
    align-self: flex-start;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
}

.oracle-chat-input {
    display: flex;
    gap: 0.75rem;
}

.oracle-chat-input .form-input {
    flex: 1;
}

.oracle-chat-input .btn-primary {
    flex-shrink: 0;
    width: auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   WHEEL & ORIGINS PANEL
   ============================================================ */
.wheel-origins-panel {
    border-top: 2px solid var(--accent-gold);
    overflow: hidden;
}

.wheel-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.wheel-left {
    flex: 1 1 400px;
}

.wheel-right {
    flex: 1 1 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.mi-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
    flex-grow: 1;
}

.mi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.mi-name {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    margin: 0;
    line-height: 1;
}

.mi-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'JetBrains Mono', monospace;
    gap: 0.25rem;
}

.mi-num {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.mi-freq {
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 700;
}

.mi-section {
    margin-bottom: 1.25rem;
}

.mi-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin: 0 0 0.4rem 0;
}

.mi-babel {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.mi-sumer {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    color: var(--cinnabar);
    margin: 0;
    letter-spacing: 0.05em;
}

.mi-desc,
.mi-cb {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .wheel-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .wheel-right {
        min-height: auto;
    }
}