/* Gimle Observatory — light theme matching gimlelabs.com */

:root {
    --bg: #ffffff;
    --fg: #1a1a1a;
    --fg-muted: #666666;
    --accent: #0066cc;
    --border: #e0e0e0;
    --surface: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --node-size: 100px;
    --edge-color: #ccc;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    color: var(--fg);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-link {
    text-decoration: none;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--fg);
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

nav a:hover, nav a.active {
    color: var(--accent);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--fg-muted);
    margin: 0 0 1.5rem;
    font-style: italic;
}

.hero-date {
    display: block;
    font-size: 0.72rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}
.hero-error { color: #c0392b; font-size: 0.95rem; margin: 0; }

/* Chain visualization — horizontal DAG with scroll */
.chain-section {
    padding: 1rem 0 2rem;
    overflow-x: auto;
}

.chain {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: max-content;
    padding: 1rem 2rem;
    margin: 0 auto;
    justify-content: center;
}

.chain-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chain-edge-col {
    display: flex;
    align-items: center;
    padding: 0 0.2rem;
    min-width: 30px;
}

/* Horizontal edge arrows */
.chain-edge-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem; /* must match .chain-col gap */
}

.chain-arrow-line {
    width: 30px;
    height: var(--node-size);
    margin-bottom: 36px; /* space for label + sublabel below node */
    display: flex;
    align-items: center;
    position: relative;
}

.chain-arrow-line::before {
    content: "";
    width: 100%;
    height: 2px;
    background: var(--edge-color);
}

.chain-arrow-line::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 7px solid var(--edge-color);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* Node */
.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.node:hover {
    transform: translateY(-4px);
}

.node-circle {
    width: var(--node-size);
    height: var(--node-size);
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.node:hover .node-circle {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.node-circle.node-scenario {
    border-color: var(--border);
    background: var(--surface);
}

.node-delta {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}

.node-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.2;
}

.node-unit {
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.node-label {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg);
    text-align: center;
    max-width: 100px;
}

.node-sublabel {
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-align: center;
}

/* Edge (arrow between nodes) */
.edge {
    display: flex;
    align-items: center;
    padding: 0 0.3rem;
    color: var(--edge-color);
    font-size: 1.5rem;
    position: relative;
}

.edge-arrow {
    width: 40px;
    height: 2px;
    background: var(--edge-color);
    position: relative;
}

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

.edge-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--fg-muted);
    white-space: nowrap;
}

/* Detail panel */
.detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 1rem 0 2rem;
    position: relative;
    box-shadow: var(--shadow-md);
}

.close-btn {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--fg-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--fg);
}

.detail-header {
    margin-bottom: 1.5rem;
}

.detail-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    letter-spacing: -0.01em;
}

.detail-equation {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--fg-muted);
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0.5rem 0 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
}

.detail-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.detail-card-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--fg);
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.param-table th {
    text-align: left;
    font-weight: 500;
    color: var(--fg-muted);
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.param-table td {
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

.fit-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

.fit-good { color: #16a34a; background: rgba(22, 163, 74, 0.08); }
.fit-ok { color: #b45309; background: rgba(180, 83, 9, 0.08); }
.fit-weak { color: #dc2626; background: rgba(220, 38, 38, 0.08); }

/* Sparkline chart in detail panel */
.detail-chart {
    margin: 1rem 0;
}

.detail-chart {
    position: relative;
    height: 200px;
}

.detail-chart canvas {
    width: 100% !important;
    height: 100% !important;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
}

.detail-chart-label {
    font-size: 0.7rem;
    color: var(--fg-muted);
    text-align: center;
    margin-top: 0.3rem;
}

/* LaTeX equation */
.detail-equation {
    font-size: 1rem;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 0.5rem 0 1rem;
    overflow-x: auto;
}

.detail-equation .katex {
    font-size: 1rem;
}

/* Scenario */
/* Control bar */
.control-bar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg);
    cursor: pointer;
    padding: 0.3rem 2rem;
    list-style: none;
    user-select: none;
}

.control-bar-title::-webkit-details-marker { display: none; }

.control-bar-title::before {
    content: "\25BC";
    font-size: 0.55rem;
    margin-right: 0.4rem;
    display: inline-block;
    transition: transform 0.15s;
}

.control-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.2rem 2rem;
}

.section-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    display: block;
    margin-bottom: 0.15rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.section-label::-webkit-details-marker { display: none; }

.section-label::before {
    content: "\25BC";
    font-size: 0.5rem;
    margin-right: 0.3rem;
    display: inline-block;
    transition: transform 0.15s;
}

details:not([open]) > .section-label::before {
    transform: rotate(-90deg);
}

/* Tooltip ? icon */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    color: var(--fg-muted);
    font-size: 8px;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 1px;
}

.tip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: white;
    font-size: 11px;
    font-weight: 400;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    white-space: normal;
    width: 200px;
    line-height: 1.4;
    z-index: 100;
    pointer-events: none;
    margin-bottom: 4px;
    box-shadow: var(--shadow-md);
    text-transform: none;
    letter-spacing: 0;
}

.tip:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--fg);
    margin-bottom: -6px;
    z-index: 100;
}

.control-bar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 120px;
    max-width: 200px;
}

.control-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-width: 32px;
}

.control-group input[type="range"] {
    flex: 1;
    min-width: 60px;
}

.control-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.control-secondary-row {
    max-width: 900px;
    margin: 0.3rem auto 0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.scenario-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.preset-label {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-weight: 500;
}

.pill-preset {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
}

.slider-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 35px;
    text-align: right;
}

.horizon-pills {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.pill {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--fg-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

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

/* Mode switch */
.mode-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.mode-label {
    font-size: 0.8rem;
    color: var(--fg-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.mode-label.active-label {
    color: var(--fg);
}

.mode-label.unavailable {
    opacity: 0.4;
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: background 0.2s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .switch-slider {
    background: var(--accent);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Compute button + spinner */
.compute-row {
    margin-bottom: 0.5rem;
}

.btn-compute {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.scenario-mode {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin: 0.5rem 0 0;
}

.scenario-mode .sim-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    margin-left: 0.3rem;
}

.sim-badge--approx {
    color: #b45309;
    background: rgba(180, 83, 9, 0.08);
}

.sim-badge--sde {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

.sim-badge--loading {
    color: var(--accent);
    background: rgba(0, 102, 204, 0.08);
}

.scenario-result {
    margin: 0 0 1rem;
    padding: 0;
}

.scenario-narrative {
    font-size: 0.95rem;
    color: var(--fg);
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    line-height: 1.6;
}

.cascade {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cascade-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.cascade-arrow {
    color: var(--fg-muted);
}

.delta-positive { color: #dc2626; }
.delta-negative { color: #16a34a; }

/* Scenario result footer */
.scenario-result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.btn-reset {
    background: white;
    color: var(--fg-muted);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
}

.btn-reset:hover {
    color: var(--fg);
    border-color: var(--fg-muted);
}

/* Forecast charts */
.forecast-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.forecast-card {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
}

.forecast-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.forecast-card canvas {
    width: 100%;
    height: 100px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

footer p {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin: 0.2rem 0;
}

.muted {
    color: var(--fg-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .control-bar-inner {
        gap: 0.5rem;
    }

    .control-group {
        min-width: 100%;
    }

    .control-divider { display: none; }

    .header-inner {
        padding: 0.6rem 1rem;
    }

    nav { gap: 1rem; }

    main { padding: 0 1rem; }

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

    .chain {
        min-width: 0;
        flex-direction: column;
        gap: 0.5rem;
    }

    .edge-arrow {
        width: 2px;
        height: 30px;
    }

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

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

    .scenario-controls {
        max-width: 100%;
    }
}

/* === Feature B: inline insight headlines === */
.node-circle { position: relative; }  /* anchor for the badge — no-op if already set */
.node-insight-badge {
    position: absolute; top: -3px; right: -3px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #d4a017; border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(212, 160, 23, 0.5);
}
.node-insight-headline {
    color: #b8860b; font-style: italic; font-size: 0.82em;
    margin-top: 4px; line-height: 1.3; max-width: 160px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.node-insight-spacer { height: 18px; margin-top: 4px; }

/* === Feature C: today-vs-yesterday diff (a view toggle — sits above the chain, not in "What if?") === */
.view-options {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 900px;
    margin: 0.5rem auto 0.3rem;
    padding: 0 2rem;
}
.day-diff-label { font-size: 0.85em; color: #555; white-space: nowrap; }
.node-day-delta { font-size: 0.82em; margin-top: 3px; }
.node-day-delta.up { color: #1e8449; }
.node-day-delta.down { color: #c0392b; }
.node-day-delta.neutral { color: #888; }

/* === Feature A: animated scenario propagation === */
.node-delta { transition: opacity 120ms ease-in; }
.node-delta.hidden { opacity: 0; pointer-events: none; }

@keyframes edge-pulse {
    0%   { filter: none; }
    40%  { filter: drop-shadow(0 0 5px #d4a017) brightness(1.4); }
    100% { filter: none; }
}
.chain-arrow-line.pulsing { animation: edge-pulse 150ms ease-out; }

/* === FX node: cyclic carry back-edge (drawn by chainviz.js renderChain) === */
.chain-back-edge {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 1;
}

/* === News-as-model-input: per-node news-pressure arrow + detail block === */
.node-news-badge {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 9px;
    line-height: 1;
    color: #9ca3af;
    text-shadow: 0 0 2px #fff, 0 0 2px #fff;  /* keep it legible over the node circle */
}
.node-news-badge.node-news-up { color: #e11d48; }
.node-news-badge.node-news-down { color: #2563eb; }
.node-news-badge.node-news-neutral { color: #9ca3af; }

/* === Coupling calibration provenance (node detail panel) === */
.detail-coupling-calibration { margin-top: 1.25rem; }
.detail-coupling-calibration h4 { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: 600; }
.coupling-fit { color: #10b981; font-size: 0.75rem; }
.coupling-placeholder { color: #9ca3af; font-size: 0.75rem; }

/* === Instrument section in the node detail panel === */
.detail-instrument { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.detail-instrument h4 { margin: 0 0 0.3rem; font-size: 0.85rem; font-weight: 600; }
.detail-instrument-note { font-size: 0.72rem; color: var(--fg-muted); margin: 0 0 0.6rem; }
.instrument-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: end; font-size: 0.78rem; }
.instrument-form label { display: flex; flex-direction: column; gap: 2px; }
.instrument-form input, .instrument-form select { font: inherit; padding: 0.2rem 0.3rem; }
.instrument-form button { padding: 0.3rem 0.8rem; cursor: pointer; }
.instrument-card { margin-top: 0.8rem; font-size: 0.8rem; }
.instrument-value { font-size: 0.95rem; margin-bottom: 0.4rem; }
.instrument-value .instrument-sub, .instrument-sub { color: var(--fg-muted); font-size: 0.72rem; font-weight: 400; }
.instrument-greeks { color: #444; margin: 0.3rem 0; }
.instrument-risk-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-muted); margin: 0.5rem 0 0.2rem; }
.risk-row { display: grid; grid-template-columns: 70px 1fr 90px; align-items: center; gap: 0.4rem; font-size: 0.72rem; }
.risk-bar { background: #eee; height: 8px; border-radius: 4px; overflow: hidden; }
.risk-fill { display: block; height: 100%; }
.risk-fill.pos { background: #1e8449; } .risk-fill.neg { background: #c0392b; }
.risk-val.pos { color: #1e8449; } .risk-val.neg { color: #c0392b; } .risk-name { color: #555; }
.instrument-scen { margin: 0.5rem 0; }
.scen-chip { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px; background: #f1f1f1; font-size: 0.72rem; margin-right: 0.3rem; }
.scen-chip.pos { color: #1e8449; } .scen-chip.neg { color: #c0392b; }
.instrument-ves { font-size: 0.75rem; color: #444; }
.instrument-live { font-size: 0.78rem; color: #555; margin-top: 0.3rem; }
.instrument-live .pos { color: #1e8449; } .instrument-live .neg { color: #c0392b; }
.instrument-err { color: #c0392b; }

/* === Asset detail page hero (observatory.html?asset=<id>) === */

.breadcrumb-link {
    display: inline-block;
    margin: 0.6rem 1rem 0;
    font-size: 0.78rem;
    color: #6b7280;
    text-decoration: none;
}
.breadcrumb-link:hover { color: #111; text-decoration: underline; }

.asset-title {
    margin: 0.4rem 1rem 0.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
}

.asset-hero-zoom {
    max-width: 900px;
    margin: 0 auto 0.4rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-left: 4px solid #c0392b;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.asset-hero-domain {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.asset-hero-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: #111;
    line-height: 1;
}
.asset-hero-unit {
    font-size: 1rem;
    font-weight: 400;
    color: #6b7280;
    margin-left: 0.3rem;
}
.asset-hero-delta {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.asset-hero-delta.up { color: #c0392b; }
.asset-hero-delta.down { color: #1e8449; }
.asset-hero-delta.zero { color: #6b7280; font-weight: 400; }

/* === Density pass: hero zoom sparkline + chips === */
.asset-hero-spark { margin-top: 0.6rem; }
.asset-hero-spark .asset-sparkline { width: 100%; height: 40px; display: block; }
.asset-hero-zoom .asset-chips { margin-top: 0.4rem; }

/* === Density pass: hero chart slot === */
.asset-hero-chart {
    max-width: 900px;
    margin: 0.5rem auto 1rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
}
/* drawSparkline sets canvas.style.height = "200px" inline, so the !important
 * here is only the floor — actual height is whatever JS picks. Match it for
 * documentation. */
.asset-hero-chart canvas { width: 100% !important; height: 200px !important; }
.asset-hero-chart .detail-chart-label { font-size: 0.7rem; color: #6b7280; margin-top: 0.3rem; text-align: center; }
.asset-hero-zoom .asset-chip { font-size: 0.78rem; padding: 0.15rem 0.45rem; }

/* === Density pass: Today block === */
.detail-today {
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}
.detail-today h4 {
    margin: 0 0 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 600;
}
.today-news + .today-insight { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid #f1f1f1; }
.today-news-line { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.78rem; }
.news-signal-dir { font-weight: 700; letter-spacing: 0.04em; }
.news-signal-dir.news-up { color: #e11d48; }
.news-signal-dir.news-down { color: #2563eb; }
.news-signal-dir.news-neutral { color: var(--fg-muted); }
.today-news-rationale { font-size: 0.85rem; color: #333; margin-top: 0.3rem; }
.today-news-cites { font-size: 0.7rem; color: #6b7280; margin-top: 0.3rem; }
.today-news-cites a { color: #4b5563; margin-right: 0.4rem; }
.today-insight-headline { font-weight: 600; color: #111; font-size: 0.9rem; margin-bottom: 0.3rem; }
.today-insight-body { font-size: 0.85rem; color: #333; }
.today-insight-body p { margin: 0.2rem 0; }

/* === Density pass: chain DAG halved height === */
.chain-section.chain-compact { padding: 0.5rem 0; }
.chain-section.chain-compact .chain { transform: scale(0.7); transform-origin: top center; margin-bottom: -3rem; }

/* === Density pass: three detail-page collapsible panels === */
.panel-model, .panel-whatif, .panel-price {
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    margin-bottom: 1rem;
}
.panel-model > summary, .panel-whatif > summary, .panel-price > summary {
    cursor: pointer;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #111;
    list-style: none;
}
.panel-model > summary::before, .panel-whatif > summary::before, .panel-price > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.5rem;
    color: #6b7280;
    transition: transform 0.15s;
}
.panel-model[open] > summary::before, .panel-whatif[open] > summary::before, .panel-price[open] > summary::before {
    transform: rotate(90deg);
}
.panel-model > .panel-body, .panel-whatif > .panel-body, .panel-price > .panel-body {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid #f1f1f1;
}
/* panel-whatif inherits the existing .control-bar-inner styles for its sliders */
.panel-whatif .control-bar-inner { padding: 0.5rem 0; }
