:root {
    /* Bloomberg Amber & Obsidian Terminal Palette */
    --bg-canvas: #080A0E;
    --bg-surface: #0F131A;
    --bg-surface-elevated: #151B24;
    --bg-surface-active: #1D2430;

    /* Hairline Dividers & Bezels */
    --border-subtle: #1E2430;
    --border-strong: #2D3748;
    --border-active: #FFB000;

    /* Typography Colors */
    --text-primary: #F0F4F8;
    --text-secondary: #9BA3AF;
    --text-muted: #5D6675;
    --text-inverse: #080A0E;

    /* Terminal Accent & Financial Deltas */
    --color-amber: #FFB000;
    --color-amber-dim: rgba(255, 176, 0, 0.12);
    --color-amber-glow: rgba(255, 176, 0, 0.25);
    --color-cyan: #00E5FF;
    --color-cyan-dim: rgba(0, 229, 255, 0.12);
    --color-gain: #00D26A;
    --color-gain-bg: rgba(0, 210, 106, 0.10);
    --color-loss: #F83F55;
    --color-loss-bg: rgba(248, 63, 85, 0.10);

    /* Series Colors */
    --series-total: #FFB000;       /* Luminous Terminal Amber */
    --series-active: #00E5FF;      /* Electric Cyan */
    --series-engagement: #D946EF;  /* Technical Magenta */
    --series-velocity: #FFB000;    /* Amber Run Rate */
    --series-prior: #D97706;       /* Muted Ochre Baseline */

    /* Typography */
    --font-display: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;
}

/* Reset & Baseline */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html {
    scrollbar-gutter: stable;
    color-scheme: dark;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.25rem 1rem;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle Technical Terminal Grid (Zero Blobs/Glow) */
.background-effects {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Dashboard Container */
.dashboard-container {
    width: 100%;
    max-width: 1360px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Base Terminal Panel */
.terminal-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    position: relative;
}

/* Tabular Numeric Precision */
.tabular-stat {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "zero" 1;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Terminal Header
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border-color: var(--border-strong);
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.terminal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.6rem;
    background-color: var(--color-amber-dim);
    border: 1px solid rgba(255, 176, 0, 0.35);
    border-radius: 2px;
    width: fit-content;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-amber);
}

.badge-pulse {
    width: 6px;
    height: 6px;
    background-color: var(--color-amber);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-amber);
    animation: terminalPulse 2s infinite;
}

@keyframes terminalPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.dashboard-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.dashboard-header h1 span {
    color: var(--color-amber);
    font-weight: 600;
}

.header-subtitle {
    font-size: 0.825rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.header-status-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 2px;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #5D6675;
}

.status-indicator.live .status-dot {
    background-color: var(--color-gain);
    box-shadow: 0 0 6px var(--color-gain);
}

.status-indicator.archive .status-dot {
    background-color: var(--color-cyan);
    box-shadow: 0 0 6px var(--color-cyan);
}

.status-indicator.fallback .status-dot {
    background-color: var(--color-amber);
}

.last-updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    font-size: 0.75rem;
}

.update-label {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

#last-updated-time {
    color: var(--color-amber);
    font-weight: 600;
}

.refresh-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.refresh-btn:hover {
    color: var(--color-amber);
    border-color: var(--border-strong);
    background-color: var(--bg-surface-active);
}

.refresh-btn:focus-visible {
    outline: 2px solid var(--color-amber);
    outline-offset: 1px;
}

/* ==========================================================================
   Sticky Command Bar
   ========================================================================== */
.terminal-command-bar {
    position: sticky;
    top: 0.75rem;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.25rem;
    gap: 1rem;
    background: var(--bg-surface);
    border-color: var(--border-strong);
    border-radius: 3px;
    flex-wrap: wrap;
}

.command-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.command-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* Terminal Keycap Switchers */
.pill-segmented {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 2px;
    gap: 2px;
    overflow-x: auto;
    max-width: 100%;
}

.time-btn, .control-btn {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    padding: 0.35rem 0.7rem;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}

.time-btn:hover, .control-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-active);
    border-color: var(--border-subtle);
}

/* Active Keycap State: Warm Amber */
.time-btn.active, .control-btn.active, .control-btn[aria-pressed="true"] {
    background-color: var(--color-amber-dim);
    color: var(--color-amber);
    border: 1px solid rgba(255, 176, 0, 0.45);
    box-shadow: 0 0 10px rgba(255, 176, 0, 0.12);
}

.time-btn:focus-visible, .control-btn:focus-visible {
    outline: 2px solid var(--color-amber);
    outline-offset: 1px;
}

.control-btn.range-unsupported {
    opacity: 0.45;
    cursor: pointer;
}

.year-range-container {
    display: inline-flex;
}

.year-range-select {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 0.35rem 0.5rem;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.year-range-select:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-active);
}

.year-range-select:focus-visible {
    outline: 2px solid var(--color-amber);
}

.range-display {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.range-display strong {
    color: var(--color-amber);
    font-weight: 600;
}

/* ==========================================================================
   Dashboard Grid & Metric Ticker Blocks
   ========================================================================== */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    min-height: 155px;
    gap: 0.75rem;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    transition: border-color 0.15s ease;
}

.metric-card:hover {
    border-color: var(--border-strong);
}

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

.metric-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.metric-chip {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.chip-cyan {
    background-color: var(--color-cyan-dim);
    border-color: rgba(0, 229, 255, 0.3);
    color: var(--color-cyan);
}

.chip-violet {
    background-color: rgba(217, 70, 239, 0.12);
    border-color: rgba(217, 70, 239, 0.3);
    color: var(--series-engagement);
}

.chip-amber {
    background-color: var(--color-amber-dim);
    border-color: rgba(255, 176, 0, 0.3);
    color: var(--color-amber);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.metric-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

/* Delta Trend Badges */
.trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    white-space: nowrap;
}

.trend.up {
    background-color: var(--color-gain-bg);
    color: var(--color-gain);
    border: 1px solid rgba(0, 210, 106, 0.3);
}

.trend.down {
    background-color: var(--color-loss-bg);
    color: var(--color-loss);
    border: 1px solid rgba(248, 63, 85, 0.3);
}

.velocity-pace-stat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.velocity-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
}

.velocity-val {
    font-weight: 600;
    color: var(--color-amber);
}

.comparison {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    border-top: 1px dashed var(--border-subtle);
    padding-top: 0.35rem;
    transition: color 0.15s ease;
}

.comparison.comp-up {
    color: var(--color-gain);
}

.comparison.comp-down {
    color: var(--color-loss);
}

.card-footer {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.sparkline-wrapper {
    width: 100%;
    height: 26px;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sparkline-path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-total { stroke: var(--series-total); }
.sparkline-active { stroke: var(--series-active); }
.sparkline-engagement { stroke: var(--series-engagement); }
.sparkline-velocity { stroke: var(--series-velocity); }

/* ==========================================================================
   Charts Section
   ========================================================================== */
.charts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-section {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 3px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chart-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chart-comparison-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.25rem;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}

.chart-comparison-legend:hover {
    opacity: 0.85;
}

.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.legend-line {
    display: inline-block;
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

.legend-line.line-amber {
    background-color: var(--series-total);
}

.legend-line.line-cyan {
    background-color: var(--series-active);
}

.legend-line.line-prior {
    border-top: 2px dashed var(--series-prior);
    height: 0;
    width: 16px;
}

.chart-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.chart-actions .control-btn {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.65rem;
    border-radius: 2px;
    font-size: 0.72rem;
}

.chart-actions .control-btn:hover {
    background-color: var(--bg-surface-active);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 440px;
}

/* Velocity Title Row & Mode Selector */
.velocity-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.velocity-mode-pill {
    margin-left: 0.25rem;
}

.velocity-mode-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    padding: 0.25rem 0.55rem;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}

.velocity-mode-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-active);
    border-color: var(--border-subtle);
}

.velocity-mode-btn.active[data-mode="active"] {
    background-color: var(--color-cyan-dim);
    color: var(--color-cyan);
    border-color: rgba(0, 229, 255, 0.45);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.12);
}

.velocity-mode-btn.active[data-mode="total"] {
    background-color: var(--color-amber-dim);
    color: var(--color-amber);
    border-color: rgba(255, 176, 0, 0.45);
    box-shadow: 0 0 10px rgba(255, 176, 0, 0.12);
}

/* Peak Signup Surges Strip */
.peak-surges-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    flex-wrap: wrap;
}

.peak-surges-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-amber);
    white-space: nowrap;
}

.peak-surges-chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.peak-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.peak-chip:hover {
    background: var(--bg-surface-active);
    color: var(--text-primary);
    border-color: var(--color-amber);
    box-shadow: 0 0 8px rgba(255, 176, 0, 0.15);
}

.peak-chip .chip-title {
    font-weight: 500;
    color: var(--text-primary);
}

.peak-chip .chip-val {
    font-weight: 700;
    color: var(--color-amber);
}

.peak-chip.active {
    background: rgba(255, 176, 0, 0.16);
    border-color: var(--color-amber);
    color: var(--color-amber-light);
    box-shadow: 0 0 10px rgba(255, 176, 0, 0.35);
}

.peak-chip.active .chip-title {
    color: var(--color-amber-light);
}

.peak-chip.active::before {
    content: "●";
    color: var(--color-amber);
    font-size: 0.55rem;
    line-height: 1;
}

.peak-chip-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: transparent;
    border: 1px dashed var(--border-subtle);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.12s ease;
}

.peak-chip-reset:hover {
    color: var(--text-primary);
    border-color: var(--color-amber);
    background: var(--bg-surface-active);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 500;
}

.footer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-amber);
}

.dashboard-footer a {
    color: var(--color-amber);
    text-decoration: none;
    transition: color 0.15s;
}

.dashboard-footer a:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* ==========================================================================
   Terminal Insights & SEO Knowledge Base (Bloomberg Terminal Style)
   ========================================================================== */
.insights-panel {
    margin-top: 1.5rem;
    padding: 1.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.insights-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.insights-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.insights-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 900px;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.insight-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 1.15rem;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-amber);
}

.insight-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.insight-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.insight-card strong {
    color: var(--text-primary);
}

/* Historical Milestone Data Table */
.insights-table-wrap {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    margin-bottom: 2rem;
}

.table-header-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.table-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-amber);
}

.insights-table-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    background: var(--bg-surface-elevated);
}

.insights-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
    white-space: nowrap;
}

.insights-data-table th {
    background: var(--bg-surface-active);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-strong);
}

.insights-data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    line-height: 1.4;
}

.insights-data-table tbody tr:last-child td {
    border-bottom: none;
}

.insights-data-table tbody tr:hover td {
    background: rgba(255, 176, 0, 0.04);
}

.insights-data-table td strong {
    color: var(--text-primary);
}

.insights-data-table .highlight-row td {
    background: rgba(255, 176, 0, 0.06);
}

.insights-data-table .highlight-row td strong {
    color: var(--color-amber);
}

.insights-data-table .current-row td {
    background: rgba(0, 229, 255, 0.05);
}

.insights-data-table .current-row td strong {
    color: var(--color-cyan);
}

.insights-faq-wrap {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
}

.faq-section-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-amber);
    margin-bottom: 1rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.faq-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.faq-item[open] {
    border-color: var(--border-strong);
}

.faq-question {
    padding: 0.85rem 1.15rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    background: var(--bg-surface-active);
    color: var(--color-amber);
}

.faq-arrow {
    font-size: 0.65rem;
    color: var(--color-amber);
    transition: transform 0.2s ease;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.faq-item[open] .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.15rem 1rem 1.15rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer p {
    margin: 0;
}

.faq-answer strong {
    color: var(--text-primary);
}

.faq-answer code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    color: var(--color-cyan);
}

/* ==========================================================================
   Terminal Methodology & Reference Guide Dialog (Bloomberg Style)
   ========================================================================== */
dialog.guide-dialog {
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 0;
    max-width: 680px;
    width: calc(100% - 2rem);
    margin: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

dialog.guide-dialog::backdrop {
    background: rgba(8, 10, 14, 0.85);
}

dialog.guide-dialog[open] {
    animation: guideModalFadeIn 0.15s ease forwards;
}

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

.guide-dialog-container {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.guide-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.guide-header-tag {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-amber);
    margin-bottom: 0.25rem;
}

#guide-dialog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.guide-close-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.12s ease;
}

.guide-close-btn:hover {
    color: var(--color-amber);
    border-color: var(--border-strong);
    background: var(--bg-surface-active);
}

.guide-close-btn:focus-visible {
    outline: 2px solid var(--color-amber);
}

.guide-dialog-body {
    padding: 1.4rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.guide-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-section-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.guide-section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.guide-section-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-section-desc strong {
    color: var(--color-amber);
}

.guide-table-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
    background: var(--bg-canvas);
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.775rem;
    text-align: left;
}

.guide-table th {
    padding: 0.55rem 0.85rem;
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}

.guide-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.guide-table tbody tr:last-child td {
    border-bottom: none;
}

.guide-table tbody tr:hover {
    background: var(--bg-surface-active);
}

.range-chip {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.7rem;
    background: var(--bg-surface-elevated);
    color: var(--color-amber);
    border: 1px solid var(--border-strong);
}

.range-chip.disabled {
    color: var(--text-muted);
    border-style: dashed;
    background: transparent;
}

.guide-tooltip-demo {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-canvas);
    border: 1px dashed var(--border-strong);
    border-radius: 2px;
}

.demo-tooltip-box {
    background: #0B0E14;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    padding: 0.75rem 1rem;
    min-width: 280px;
}

.demo-tooltip-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-amber);
    margin-bottom: 0.5rem;
}

.demo-tooltip-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.demo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-curr {
    background: var(--series-total);
}

.dot-comp {
    background: var(--series-prior);
}

.demo-label {
    color: var(--text-secondary);
    flex-grow: 1;
}

.demo-val {
    font-weight: 600;
    color: var(--text-primary);
}

.demo-tooltip-footer {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.guide-feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    list-style: none;
}

.guide-feature-list li {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.25rem;
}

.guide-feature-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--color-amber);
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.2;
}

.guide-feature-list li strong {
    color: var(--text-primary);
}

.guide-feature-list li code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    color: var(--color-cyan);
}

.guide-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.4rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.guide-shortcut-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.guide-shortcut-hint kbd {
    background: var(--bg-canvas);
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    padding: 0.1rem 0.35rem;
    color: var(--text-primary);
    font-size: 0.68rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1180px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    body {
        padding: 0.75rem 0.5rem;
    }

    .dashboard-header {
        padding: 1rem 1.15rem;
    }

    .dashboard-header h1 {
        font-size: 1.4rem;
    }

    .insights-panel {
        padding: 1.25rem 1rem;
    }

    .insights-header h2 {
        font-size: 1.15rem;
    }

    .terminal-command-bar {
        position: static;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .pill-segmented {
        width: 100%;
        justify-content: flex-start;
    }

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

    .chart-container {
        height: 320px;
    }

    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 390px) {
    body {
        padding: 0.5rem 0.35rem;
    }

    .metric-card {
        padding: 0.9rem;
    }

    .metric-card .value {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 280px;
    }
}
