/* ===========================================================================
   Outage Theater — cinematic dark aesthetic
   Geometric, diagrammatic, atmospheric. No dashboard look.
   =========================================================================== */

:root {
    /* Core surfaces */
    --ot-bg:            #07090d;   /* near-black void */
    --ot-bg-2:          #0b0f16;   /* panel base */
    --ot-bg-3:          #11161f;   /* raised panel */
    --ot-line:          #1c2430;   /* hairline borders */
    --ot-line-2:        #2a3543;   /* stronger borders */

    /* Text */
    --ot-text:          #e6edf5;
    --ot-text-dim:      #8a97a8;
    --ot-text-faint:    #5b6676;

    /* Brand (matches BaseConfig cyan) */
    --ot-accent:        #22d3ee;
    --ot-accent-dim:    #0e7490;

    /* Status palette — the visual language of an outage */
    --ot-healthy:       #34d399;   /* emerald  */
    --ot-degraded:      #fbbf24;   /* amber    */
    --ot-down:          #f43f5e;   /* rose     */
    --ot-recovering:    #38bdf8;   /* sky      */
    --ot-unknown:       #64748b;   /* slate    */

    --ot-healthy-glow:    rgba(52, 211, 153, 0.45);
    --ot-degraded-glow:   rgba(251, 191, 36, 0.5);
    --ot-down-glow:       rgba(244, 63, 94, 0.55);
    --ot-recovering-glow: rgba(56, 189, 248, 0.5);

    --ot-font: 'Inter', system-ui, sans-serif;
    --ot-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Colour-blind-safe palette (Okabe-Ito). Toggled via the C key / button.
   Overriding the vars recolours all chrome; SVG renderers are re-coloured
   in JS by OT.applyPalette("cb"). */
body.cb {
    --ot-healthy:       #009e73;
    --ot-degraded:      #f0e442;
    --ot-down:          #d55e00;
    --ot-recovering:    #56b4e9;
    --ot-healthy-glow:    rgba(0, 158, 115, 0.5);
    --ot-degraded-glow:   rgba(240, 228, 66, 0.5);
    --ot-down-glow:       rgba(213, 94, 0, 0.55);
    --ot-recovering-glow: rgba(86, 180, 233, 0.5);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--ot-bg);
    color: var(--ot-text);
    font-family: var(--ot-font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Atmospheric backdrop: subtle vignette + grid */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 30%, rgba(34, 211, 238, 0.05), transparent 60%),
        radial-gradient(circle at 50% 120%, rgba(244, 63, 94, 0.06), transparent 55%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 85%);
    pointer-events: none;
    z-index: 0;
}

/* =========================================================================
   App shell — fills viewport
   ========================================================================= */
.ot-app {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr 360px;
    grid-template-areas:
        "topbar  topbar"
        "stage   side"
        "timeline timeline";
    height: 100vh;
    gap: 0;
}

/* ---- Top bar ---- */
.ot-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(11, 15, 22, 0.95), rgba(7, 9, 13, 0.6));
    border-bottom: 1px solid var(--ot-line);
    backdrop-filter: blur(8px);
}
.ot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ot-mono);
    font-weight: 700;
    color: var(--ot-accent);
    text-decoration: none;
    white-space: nowrap;
}
.ot-brand .ot-blink { animation: ot-blink 1.1s steps(1) infinite; }
@keyframes ot-blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

.ot-title-block { display: flex; flex-direction: column; line-height: 1.15; }
.ot-title-block .ot-kicker {
    font-family: var(--ot-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
}
.ot-title-block .ot-name { font-size: 14px; font-weight: 600; }

.ot-spacer { flex: 1; }

/* Scenario selector */
.ot-select-wrap { position: relative; }
.ot-select {
    appearance: none;
    background: var(--ot-bg-3);
    color: var(--ot-text);
    border: 1px solid var(--ot-line-2);
    border-radius: 8px;
    padding: 9px 38px 9px 14px;
    font-family: var(--ot-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 280px;
    transition: border-color .15s, box-shadow .15s;
}
.ot-select:hover { border-color: var(--ot-accent-dim); }
.ot-select:focus { outline: none; border-color: var(--ot-accent); box-shadow: 0 0 0 3px rgba(34,211,238,.12); }
.ot-select-wrap::after {
    content: "";
    position: absolute;
    right: 14px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--ot-text-dim);
    border-bottom: 2px solid var(--ot-text-dim);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* View-type pills */
.ot-views { display: flex; gap: 6px; }
.ot-view-btn {
    background: var(--ot-bg-3);
    color: var(--ot-text-dim);
    border: 1px solid var(--ot-line);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    white-space: nowrap;
}
.ot-view-btn:hover { color: var(--ot-text); border-color: var(--ot-line-2); }
.ot-view-btn.active {
    color: var(--ot-accent);
    border-color: var(--ot-accent-dim);
    background: rgba(34, 211, 238, 0.08);
}
.ot-view-btn i { width: 15px; height: 15px; }

.ot-icon-btn {
    background: var(--ot-bg-3);
    color: var(--ot-text-dim);
    border: 1px solid var(--ot-line);
    border-radius: 7px;
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}
.ot-icon-btn:hover { color: var(--ot-accent); border-color: var(--ot-accent-dim); }
.ot-icon-btn i { width: 17px; height: 17px; }

/* =========================================================================
   Visualization stage
   ========================================================================= */
.ot-stage {
    grid-area: stage;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(17, 22, 31, 0.6), rgba(7, 9, 13, 0.95));
}
.ot-stage svg { width: 100%; height: 100%; display: block; }

/* View crossfade — the outgoing view is cloned into a fading "ghost" overlay
   while the new one is built underneath, so swaps dissolve instead of cutting.
   Sits above the SVG but below the headline/narration overlays (z-index 5). */
.ot-view-ghost {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 1;
    transition: opacity .45s ease;
}
.ot-view-ghost svg { width: 100%; height: 100%; display: block; }
#ot-stage.ot-view-enter { animation: ot-view-in .45s ease; }
@keyframes ot-view-in { from { opacity: .15; } to { opacity: 1; } }

/* Scenario headline overlay (top-left of stage) — compact, defers to narration */
.ot-stage-head {
    position: absolute;
    top: 20px; left: 26px;
    max-width: 52%;
    pointer-events: none;
    z-index: 5;
}
.ot-stage-head .ot-sev {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--ot-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--ot-line-2);
    color: var(--ot-text-dim);
    margin-bottom: 9px;
}
.ot-stage-head .ot-sev .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ot-down);
    box-shadow: 0 0 10px var(--ot-down-glow);
}
.ot-stage-head h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--ot-text-dim);
}
/* the persistent subtitle is redundant once we have the title card + narration */
.ot-stage-head .ot-sub { display: none; }

/* =========================================================================
   INTRO TITLE CARD — the opening "story setup", shown before the failure.
   ========================================================================= */
.ot-intro {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8%;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(11,15,22,.55), rgba(7,9,13,.92) 70%);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility .6s;
}
.ot-intro.show { opacity: 1; visibility: visible; }
.ot-intro .ot-intro-kicker {
    font-family: var(--ot-mono);
    font-size: 13px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ot-accent);
    margin-bottom: 22px;
    opacity: 0;
    animation: ot-rise .7s ease .15s forwards;
}
.ot-intro h2 {
    margin: 0;
    font-size: clamp(34px, 5.2vw, 72px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.02;
    background: linear-gradient(180deg, #ffffff 0%, #9fb2c6 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(34,211,238,.15);
    opacity: 0;
    animation: ot-rise .8s ease .3s forwards;
}
.ot-intro .ot-intro-premise {
    margin: 26px auto 0;
    max-width: 720px;
    font-size: clamp(15px, 1.5vw, 19px);
    line-height: 1.65;
    color: var(--ot-text-dim);
    opacity: 0;
    animation: ot-rise .8s ease .5s forwards;
}
.ot-intro .ot-intro-cta {
    margin-top: 36px;
    font-family: var(--ot-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: ot-rise .8s ease .7s forwards;
}
.ot-intro .ot-intro-cta .kbd {
    border: 1px solid var(--ot-line-2);
    border-radius: 5px;
    padding: 3px 9px;
    color: var(--ot-text);
}
@keyframes ot-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* =========================================================================
   LOWER-THIRD NARRATOR — the big plain-English story line on the stage.
   ========================================================================= */
.ot-narration {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 12;
    padding: 60px 8% 34px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(5,7,10,.78) 55%, rgba(5,7,10,.92));
    transition: opacity .4s ease;
}
.ot-narration-inner {
    max-width: 1040px;
    margin: 0 auto;
}
.ot-narration .ot-narr-beat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ot-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--ot-text-dim);
}
.ot-narration .ot-narr-beat .pip {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--ot-text-dim);
    box-shadow: 0 0 12px currentColor;
}
.ot-narration .ot-narr-text {
    font-size: clamp(20px, 2.6vw, 34px);
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -0.01em;
    color: #f4f8fc;
    text-shadow: 0 2px 24px rgba(0,0,0,.7);
}
/* phase coloring of the beat pip + label */
.ot-narration[data-phase="trigger"]  .ot-narr-beat { color: var(--ot-accent); }
.ot-narration[data-phase="trigger"]  .pip { background: var(--ot-accent); }
.ot-narration[data-phase="degraded"] .ot-narr-beat { color: var(--ot-degraded); }
.ot-narration[data-phase="degraded"] .pip { background: var(--ot-degraded); }
.ot-narration[data-phase="down"]     .ot-narr-beat { color: var(--ot-down); }
.ot-narration[data-phase="down"]     .pip { background: var(--ot-down); }
.ot-narration[data-phase="recovery"] .ot-narr-beat { color: var(--ot-recovering); }
.ot-narration[data-phase="recovery"] .pip { background: var(--ot-recovering); }
.ot-narration[data-phase="resolved"] .ot-narr-beat { color: var(--ot-healthy); }
.ot-narration[data-phase="resolved"] .pip { background: var(--ot-healthy); }
/* re-trigger a soft fade each time the line changes */
.ot-narr-text.flip { animation: ot-narr-flip .5s ease; }
@keyframes ot-narr-flip {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* Live clock readout (top-right of stage) */
.ot-clock {
    position: absolute;
    top: 22px; right: 26px;
    text-align: right;
    font-family: var(--ot-mono);
    z-index: 5;
    pointer-events: none;
}
.ot-clock .ot-clock-time {
    font-size: 26px;
    font-weight: 600;
    color: var(--ot-accent);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.ot-clock .ot-clock-label {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
    margin-top: 2px;
}
.ot-clock .ot-elapsed { color: var(--ot-accent); }

/* Live metric overlay (top-right, under the clock) — e.g. traffic collapse.
   Sits in a subtle contained card so the sparkline always reads clearly over
   the diagram nodes beneath it (otherwise the chart looks "cut off" wherever a
   node overlaps, especially in the shorter 16:9 presentation frame). */
.ot-metric {
    position: absolute;
    top: 84px; right: 26px;
    width: 248px;
    z-index: 5;
    pointer-events: none;
    text-align: right;
    font-family: var(--ot-mono);
    padding: 9px 11px 8px;
    border-radius: 9px;
    border: 1px solid var(--ot-line);
    background: linear-gradient(180deg, rgba(7, 9, 13, 0.45), rgba(7, 9, 13, 0.74));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.ot-metric[hidden] { display: none; }
.ot-metric .ot-metric-label {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
}
.ot-metric .ot-metric-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--ot-text);
    line-height: 1.1;
    transition: color .3s;
}
.ot-metric .ot-metric-spark {
    display: block;
    width: 100%; height: 56px;
    margin-top: 4px;
    overflow: visible;
}

/* Status legend (top-left of stage, under the compact header) */
.ot-legend {
    position: absolute;
    top: 92px; left: 26px;
    display: flex;
    gap: 16px;
    z-index: 6;
    pointer-events: none;
    font-size: 11px;
    color: var(--ot-text-dim);
    font-family: var(--ot-mono);
}
.ot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ot-legend .swatch { width: 9px; height: 9px; border-radius: 2px; }
.ot-legend .swatch.s-healthy    { background: var(--ot-healthy); }
.ot-legend .swatch.s-degraded   { background: var(--ot-degraded); }
.ot-legend .swatch.s-down       { background: var(--ot-down); }
.ot-legend .swatch.s-recovering { background: var(--ot-recovering); }
.ot-icon-btn.active { color: var(--ot-accent); border-color: var(--ot-accent); }

/* =========================================================================
   Side panel — evidence + verdict
   ========================================================================= */
.ot-side {
    grid-area: side;
    background: linear-gradient(180deg, var(--ot-bg-2), var(--ot-bg));
    border-left: 1px solid var(--ot-line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ot-side-tabs {
    display: flex;
    border-bottom: 1px solid var(--ot-line);
}
.ot-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--ot-text-faint);
    font-family: var(--ot-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 8px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
}
.ot-tab:hover { color: var(--ot-text-dim); }
.ot-tab.active { color: var(--ot-accent); border-bottom-color: var(--ot-accent); }

.ot-side-body { flex: 1; overflow-y: auto; }
.ot-panel { display: none; padding: 16px; }
.ot-panel.active { display: block; }

/* Evidence items */
.ot-evidence-item {
    border: 1px solid var(--ot-line);
    border-left: 3px solid var(--ot-line-2);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--ot-bg-3);
    opacity: 0.35;
    transform: translateX(6px);
    transition: opacity .35s, transform .35s, border-color .35s, box-shadow .35s;
}
.ot-evidence-item.revealed { opacity: 1; transform: none; }
.ot-evidence-item.live {
    border-left-color: var(--ot-accent);
    box-shadow: -3px 0 16px -8px var(--ot-accent);
}
.ot-evidence-item.kind-down    { border-left-color: var(--ot-down); }
.ot-evidence-item.kind-degraded{ border-left-color: var(--ot-degraded); }
.ot-evidence-item.kind-recovery{ border-left-color: var(--ot-recovering); }
.ot-evidence-item.kind-trigger { border-left-color: var(--ot-accent); }

.ot-evidence-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ot-mono);
    font-size: 10px;
    color: var(--ot-text-faint);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.ot-evidence-meta .ot-ev-time { color: var(--ot-accent); }
.ot-evidence-item h4 { margin: 0 0 5px; font-size: 13px; font-weight: 600; }
.ot-evidence-item p { margin: 0; font-size: 12.5px; color: var(--ot-text-dim); line-height: 1.5; }
.ot-evidence-item code,
.ot-evidence-item .ot-snippet {
    display: block;
    margin-top: 8px;
    font-family: var(--ot-mono);
    font-size: 11px;
    background: #05070a;
    border: 1px solid var(--ot-line);
    border-radius: 6px;
    padding: 8px 10px;
    color: #b8c4d4;
    white-space: pre-wrap;
    word-break: break-word;
}

.ot-empty {
    color: var(--ot-text-faint);
    font-size: 12px;
    text-align: center;
    padding: 30px 12px;
    font-family: var(--ot-mono);
}

/* Verdict card */
.ot-verdict h3 {
    font-size: 13px;
    font-family: var(--ot-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
    margin: 0 0 6px;
}
.ot-verdict .ot-root {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--ot-text);
}
.ot-verdict-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--ot-line);
    font-size: 12.5px;
}
.ot-verdict-row .k { color: var(--ot-text-faint); font-family: var(--ot-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.ot-verdict-row .v { color: var(--ot-text); text-align: right; font-weight: 500; }
.ot-verdict-list { margin: 14px 0 0; padding: 0; list-style: none; }
.ot-verdict-list li {
    position: relative;
    padding: 7px 0 7px 20px;
    font-size: 12.5px;
    color: var(--ot-text-dim);
    line-height: 1.5;
}
.ot-verdict-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: 13px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ot-accent);
}
.ot-verdict-list.lessons li::before { background: var(--ot-healthy); }
.ot-section-label {
    font-family: var(--ot-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ot-text-faint);
    margin: 20px 0 4px;
}
.ot-grade {
    display: inline-block;
    font-family: var(--ot-mono);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--ot-line-2);
}
.ot-sources { margin-top: 18px; }
.ot-sources a {
    display: block;
    color: var(--ot-accent);
    font-size: 12px;
    text-decoration: none;
    padding: 4px 0;
    word-break: break-all;
}
.ot-sources a:hover { text-decoration: underline; }

/* =========================================================================
   Timeline / scrubber
   ========================================================================= */
.ot-timeline {
    grid-area: timeline;
    background: linear-gradient(180deg, rgba(7,9,13,0.6), var(--ot-bg-2));
    border-top: 1px solid var(--ot-line);
    padding: 12px 22px 16px;
}
.ot-transport {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.ot-play {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--ot-accent);
    color: #04141a;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s, background .15s;
    flex-shrink: 0;
}
.ot-play:hover { transform: scale(1.06); }
.ot-play i { width: 20px; height: 20px; }

.ot-speed {
    background: var(--ot-bg-3);
    color: var(--ot-text-dim);
    border: 1px solid var(--ot-line);
    border-radius: 7px;
    padding: 7px 10px;
    font-family: var(--ot-mono);
    font-size: 12px;
    cursor: pointer;
    min-width: 78px;
    text-align: center;
    white-space: nowrap;
    transition: color .2s, border-color .2s, background .2s;
}
.ot-speed.auto {
    color: var(--ot-accent);
    border-color: color-mix(in srgb, var(--ot-accent) 45%, transparent);
    background: color-mix(in srgb, var(--ot-accent) 10%, var(--ot-bg-3));
}
.ot-phase-label {
    font-family: var(--ot-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ot-text-dim);
    flex: 1;
}
.ot-phase-label b { color: var(--ot-accent); font-weight: 600; }

/* The track */
.ot-track-wrap { position: relative; padding: 18px 0 8px; }
.ot-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ot-healthy), var(--ot-degraded), var(--ot-down), var(--ot-recovering), var(--ot-healthy));
    opacity: 0.28;
    cursor: pointer;
}
.ot-track-fill {
    position: absolute;
    top: 0; left: 0; height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ot-healthy), var(--ot-degraded), var(--ot-down), var(--ot-recovering), var(--ot-healthy));
    background-size: 100vw 100%;
    pointer-events: none;
}
.ot-playhead {
    position: absolute;
    top: -7px;
    width: 3px; height: 20px;
    margin-left: -1.5px;
    background: var(--ot-text);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(255,255,255,0.6);
    pointer-events: none;
}
/* event markers on track */
.ot-marker {
    position: absolute;
    top: 50%;
    width: 11px; height: 11px;
    margin: -5.5px 0 0 -5.5px;
    border-radius: 50%;
    border: 2px solid var(--ot-bg);
    background: var(--ot-text-dim);
    cursor: pointer;
    transition: transform .12s;
    z-index: 2;
}
.ot-marker:hover { transform: scale(1.4); }
.ot-marker.phase-trigger  { background: var(--ot-accent); }
.ot-marker.phase-degraded { background: var(--ot-degraded); }
.ot-marker.phase-down     { background: var(--ot-down); }
.ot-marker.phase-recovery { background: var(--ot-recovering); }
.ot-marker.phase-resolved { background: var(--ot-healthy); }

.ot-track-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-family: var(--ot-mono);
    font-size: 10px;
    color: var(--ot-text-faint);
}

/* tooltip for markers */
.ot-tip {
    position: fixed;
    z-index: 100;
    background: #05070a;
    border: 1px solid var(--ot-line-2);
    border-radius: 8px;
    padding: 9px 12px;
    max-width: 280px;
    font-size: 12px;
    color: var(--ot-text);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity .12s;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.ot-tip.show { opacity: 1; }
.ot-tip .t { font-family: var(--ot-mono); font-size: 10px; color: var(--ot-accent); display: block; margin-bottom: 3px; }

/* =========================================================================
   SVG node styling (shared across renderers)
   ========================================================================= */
.node-shape { transition: fill .4s, stroke .4s, filter .4s, stroke-width .4s; }
.node-label { font-family: var(--ot-mono); font-size: 11px; fill: var(--ot-text); }
.node-sub   { font-family: var(--ot-mono); font-size: 9px; fill: var(--ot-text-faint); }
.edge-line  { transition: stroke .4s, opacity .4s, stroke-width .4s; }

/* Cascade chips — plain name (sans) + technical caption (mono) */
.chip-g     { transition: opacity .4s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
.chip-name  { font-family: var(--ot-font); font-size: 14.5px; font-weight: 600; fill: #eef4fa; }
.chip-tech  { font-family: var(--ot-mono); font-size: 10px; fill: var(--ot-text-faint); letter-spacing: .02em; }
.edge-label { font-family: var(--ot-mono); font-size: 11px; fill: var(--ot-text-faint); transition: fill .4s, opacity .4s; }

/* Draggable scrub zone (timeline heatmap) */
.ot-scrub-zone { cursor: col-resize; }

/* World map land + view headings (geographic / topology) */
.ot-land    { fill: #131c29; stroke: #25344780; stroke-width: 0.6; }
.topo-title { font-family: var(--ot-mono); font-size: 15px; letter-spacing: .22em; fill: var(--ot-text-dim); text-transform: uppercase; }
.topo-sub   { font-family: var(--ot-font); font-size: 13px; fill: var(--ot-text-faint); }
.topo-stat  { font-family: var(--ot-mono); font-size: 15px; letter-spacing: .08em; fill: var(--ot-text-dim); }

@keyframes ot-pulse-down {
    0%,100% { opacity: 1; }
    50%     { opacity: 0.45; }
}
.pulse-down { animation: ot-pulse-down 1.4s ease-in-out infinite; }

@keyframes ot-dash {
    to { stroke-dashoffset: -16; }
}
.flow-dash { stroke-dasharray: 4 6; animation: ot-dash 0.7s linear infinite; }

/* Respect reduced-motion: kill looping animations + transitions (also gives
   cleaner screen recordings). Status colours still change instantly. */
@media (prefers-reduced-motion: reduce) {
    .pulse-down { animation: none !important; }
    .flow-dash  { animation: none !important; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================================
   Presentation mode — all chrome vanishes for OBS capture
   ========================================================================= */
body.presentation .ot-topbar,
body.presentation .ot-side,
body.presentation .ot-timeline,
body.presentation .ot-legend {
    display: none !important;
}
body.presentation .ot-app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "stage";
    background: #000;
    place-items: center;
}
/* Lock the stage to a centred 16:9 frame so the captured composition is
   identical no matter the window/monitor aspect — letterbox bars fill the rest.
   This keeps the narration, clock and metric aligned to the visualization. */
body.presentation .ot-stage {
    background: var(--ot-bg);
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    align-self: center;
    justify-self: center;
}
/* Hide the mouse cursor once idle so it never leaks into the recording. */
body.presentation.cursor-hidden,
body.presentation.cursor-hidden * { cursor: none !important; }
/* "Clean plate": drop all on-screen text overlays so you can add your own
   voiceover + lower-thirds in the editor over a pure visualization. */
body.presentation.pres-clean .ot-narration,
body.presentation.pres-clean .ot-clock,
body.presentation.pres-clean .ot-metric,
body.presentation.pres-clean .ot-stage-head,
body.presentation.pres-clean .ot-intro {
    opacity: 0 !important;
    transition: opacity .35s ease;
}
/* minimal presentation HUD (auto-hides) */
.ot-pres-hud {
    position: fixed;
    bottom: 28px; left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: none;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    background: rgba(5, 7, 10, 0.8);
    border: 1px solid var(--ot-line);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    font-family: var(--ot-mono);
    font-size: 12px;
    color: var(--ot-text-dim);
    transition: opacity .4s;
}
body.presentation .ot-pres-hud { display: flex; }
.ot-pres-hud.dim { opacity: 0; }
.ot-pres-hud b { color: var(--ot-accent); }
.ot-pres-hud .kbd {
    border: 1px solid var(--ot-line-2);
    border-radius: 5px;
    padding: 2px 7px;
    color: var(--ot-text);
    font-size: 11px;
}

/* Toast for copy/share actions */
.ot-toast {
    position: fixed;
    top: 70px; right: 22px;
    z-index: 120;
    background: #05070a;
    border: 1px solid var(--ot-accent-dim);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--ot-text);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.ot-toast.show { opacity: 1; transform: none; }

/* Scrollbars */
.ot-side-body::-webkit-scrollbar { width: 8px; }
.ot-side-body::-webkit-scrollbar-thumb { background: var(--ot-line-2); border-radius: 4px; }
.ot-side-body::-webkit-scrollbar-track { background: transparent; }

/* Responsive: collapse side panel under stage on narrow screens */
@media (max-width: 980px) {
    .ot-app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas:
            "topbar"
            "stage"
            "side"
            "timeline";
    }
    .ot-side { border-left: none; border-top: 1px solid var(--ot-line); max-height: 40vh; }
    .ot-topbar { flex-wrap: wrap; }
    .ot-stage-head { max-width: 80%; }
    .ot-stage-head h1 { font-size: 22px; }
}
