/* ============================================================
   $XPD PETRODOLLAR — war-room terminal
   One ink surface, hairline borders, zero radius, no blur,
   amber phosphor for data, one alert red for live events.
   ============================================================ */

:root {
    /* Surfaces (olive-tinted ink, never pure black) */
    --ink-0: oklch(15% 0.012 110);
    --ink-1: oklch(19% 0.014 110);
    --ink-2: oklch(24% 0.016 110);
    --line: oklch(38% 0.025 110);
    --line-dim: oklch(29% 0.02 110);

    /* Text */
    --text-hi: oklch(93% 0.015 105);
    --text-lo: oklch(70% 0.025 108);
    --text-dim: oklch(63% 0.02 108);   /* floor tier still clears 4.5:1 AA on --ink-1 */

    /* Signals */
    --phosphor: oklch(80% 0.135 85);       /* amber CRT — data, accents */
    --phosphor-dim: oklch(80% 0.135 85 / 0.14);
    --alert: oklch(62% 0.205 28);          /* live-event red */
    --alert-dim: oklch(62% 0.205 28 / 0.15);
    --up: oklch(74% 0.1 145);              /* muted gain green */
    --down: oklch(66% 0.17 25);            /* loss red */

    /* Severity */
    --sev-critical: var(--alert);
    --sev-high: var(--phosphor);
    --sev-medium: var(--text-lo);
    --sev-info: var(--text-dim);

    /* Type */
    --font-display: 'Big Shoulders Display', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-body: 'IBM Plex Sans', sans-serif;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.14s var(--ease-out);
    --t-base: 0.22s var(--ease-out);

    --strip-h: 34px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ink-0);
    font-family: var(--font-body);
    color: var(--text-hi);
    -webkit-font-smoothing: antialiased;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Keyboard focus reads as a phosphor reticle, not the UA default */
:focus-visible {
    outline: 1px solid var(--phosphor);
    outline-offset: 2px;
}

.ca-copy:focus-visible { outline-color: var(--text-hi); }

#canvas-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

/* Vignette keeps HUD text readable over the globe */
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 30%, oklch(15% 0.012 110 / 0.55) 70%, oklch(15% 0.012 110 / 0.95) 100%);
}

/* Faint CRT scanlines: the one piece of decoration allowed */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, oklch(0% 0 0 / 0.05) 2px 3px);
}

/* ============================================
   LOADING
   ============================================ */

.loading {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--ink-0);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-reticle {
    width: 56px;
    height: 56px;
    border: 1px solid var(--line);
    position: relative;
    animation: reticle-spin 2.4s linear infinite;
}

.loading-reticle::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid var(--phosphor);
}

@keyframes reticle-spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: var(--text-lo);
}

/* ============================================
   MARKET STRIP
   ============================================ */

.strip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--strip-h);
    z-index: 150;
    background: var(--ink-1);
    border-bottom: 1px solid var(--line-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    display: flex;
    align-items: stretch;
}

/* Prices scroll; status + UPDATED stay pinned in .strip-meta */
.strip-scroll {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.strip-scroll::-webkit-scrollbar { display: none; }

.strip-track {
    display: flex;
    align-items: stretch;
    height: 100%;
    width: max-content;
    min-width: 100%;
}

.strip-meta {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.strip-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    border-right: 1px solid var(--line-dim);
    white-space: nowrap;
}

.strip-label { color: var(--text-dim); font-weight: 600; }
.strip-value { color: var(--text-hi); font-weight: 600; }
.strip-cell-xpd .strip-value { color: var(--phosphor); }

.strip-chg { font-weight: 500; }
.strip-chg.up { color: var(--up); }
.strip-chg.down { color: var(--down); }

.strip-cell-status { border-right: none; border-left: 1px solid var(--line-dim); }

.strip-status {
    color: var(--alert);
    font-weight: 700;
    letter-spacing: 0.12em;
}

.strip-status.ok { color: var(--up); }
.strip-status.offline { color: var(--text-dim); }

.strip-cell-updated { border-right: none; border-left: 1px solid var(--line-dim); }
.strip-updated { color: var(--text-lo); font-weight: 500; }

/* ============================================
   HEADER
   ============================================ */

.header {
    position: fixed;
    top: var(--strip-h);
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1.25rem 0;
    pointer-events: none;
}

.header-left, .header-right { pointer-events: auto; }

.wordmark {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.wordmark-main {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.9rem;
    letter-spacing: 0.06em;
    color: var(--text-hi);
    line-height: 1;
}

.wordmark-ticker {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--phosphor);
}

.thesis {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.ca-block {
    display: flex;
    align-items: stretch;
    margin-top: 0.75rem;
    border: 1px solid var(--line);
    background: var(--ink-1);
    max-width: min(540px, calc(100vw - 2.5rem));
}

.ca-label {
    display: flex;
    align-items: center;
    padding: 0 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    border-right: 1px solid var(--line-dim);
}

.ca-address {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--phosphor);
    padding: 0.5rem 0.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.ca-copy {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ink-0);
    background: var(--phosphor);
    border: none;
    padding: 0 0.9rem;
    cursor: pointer;
    transition: background var(--t-fast);
}

.ca-copy:hover { background: oklch(86% 0.13 85); }
.ca-copy.copied { background: var(--up); }
.ca-copy.failed { background: var(--down); }

.header-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hlink {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-lo);
    text-decoration: none;
    border: 1px solid var(--line-dim);
    background: var(--ink-1);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast);
}

.hlink:hover { color: var(--text-hi); border-color: var(--line); }

/* ============================================
   LIVE OPS BUTTON
   ============================================ */

.ops-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-hi);
    background: var(--ink-1);
    border: 1px solid var(--line);
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
}

.ops-btn:hover { border-color: var(--phosphor); }

.ops-btn[aria-expanded="true"] {
    background: var(--phosphor-dim);
    border-color: var(--phosphor);
}

.ops-btn-dot {
    width: 8px;
    height: 8px;
    background: var(--alert);
}

.ops-btn-dot.live { animation: ops-blink 1.6s steps(2, start) infinite; }

@keyframes ops-blink { to { visibility: hidden; } }

.ops-count {
    font-size: 0.75rem;
    color: var(--alert);
    font-weight: 700;
}

.ops-count:empty { display: none; }

/* ============================================
   STRAIT WATCH MODULE
   ============================================ */

.watch-panel {
    position: fixed;
    top: calc(var(--strip-h) + 178px);
    left: 1.25rem;
    z-index: 90;
    width: 312px;
    background: var(--ink-1);
    border: 1px solid var(--line-dim);
    padding: 0.7rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.watch-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 0.55rem;
}

.watch-stamp {
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-dim);
}

.watch-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-top: 1px solid var(--line-dim);
    color: var(--text-lo);
}

.watch-row:first-child { border-top: none; }

.watch-label {
    color: var(--text-dim);
    font-weight: 600;
    min-width: 88px;
}

.watch-value {
    color: var(--text-hi);
    font-weight: 700;
}

.watch-value.alert { color: var(--alert); }
.watch-value.amber { color: var(--phosphor); }

.watch-delta { font-weight: 600; }
.watch-delta.down { color: var(--down); }
.watch-delta.up { color: var(--up); }

.watch-row .spark { margin-left: auto; flex-shrink: 0; }
.spark { display: block; color: var(--text-lo); }
.spark.alert { color: var(--alert); }
.spark.amber { color: var(--phosphor); }

.watch-note {
    padding: 0.35rem 0 0.1rem;
    border-top: 1px solid var(--line-dim);
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.45;
}

.watch-empty {
    color: var(--text-dim);
    letter-spacing: 0.15em;
    padding: 0.6rem 0;
    text-align: center;
}

/* ============================================
   KEY PANEL
   ============================================ */

.key-panel {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 90;
    background: var(--ink-1);
    border: 1px solid var(--line-dim);
    padding: 0.7rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.key-title {
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-lo);
    padding: 0.15rem 0;
}

.key-glyph { width: 10px; height: 10px; flex-shrink: 0; }
/* Discs via radial-gradient: mirrors the round globe markers without border-radius */
.key-strike { background: radial-gradient(circle closest-side, var(--alert) 97%, transparent); }
.key-maritime { background: var(--phosphor); transform: rotate(45deg); }
.key-reserve { background: radial-gradient(circle closest-side, oklch(55% 0.04 110) 97%, transparent); opacity: 0.6; }
.key-choke { border: 1px solid var(--text-lo); width: 9px; height: 9px; }

/* ============================================
   INFO PANEL (country / event details)
   ============================================ */

.info-panel {
    position: fixed;
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%) translateX(20px);
    width: 330px;
    max-width: calc(100vw - 2.5rem);
    z-index: 110;
    background: var(--ink-1);
    border: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
}

.info-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.info-header {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid var(--line-dim);
}

.info-header.alert { background: var(--alert-dim); }
.info-header.amber { background: var(--phosphor-dim); }

.info-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--line-dim);
    color: var(--text-lo);
    font-size: 1rem;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast);
}

.info-close:hover { color: var(--text-hi); border-color: var(--line); }

.info-kicker {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--text-dim);
}

.info-kicker.alert { color: var(--alert); }
.info-kicker.amber { color: var(--phosphor); }

.info-country {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
    line-height: 1.1;
}

.info-sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-lo);
    margin-top: 0.3rem;
}

.info-body { padding: 1rem; }

.info-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line-dim);
    border: 1px solid var(--line-dim);
}

.info-stat {
    background: var(--ink-1);
    padding: 0.6rem 0.7rem;
}

.info-stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
}

.info-stat-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-hi);
    margin-top: 0.2rem;
}

.info-stat-value span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-lo);
    margin-left: 0.2rem;
}

.info-bar-container { margin-top: 0.9rem; }

.info-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-lo);
    margin-bottom: 0.35rem;
}

.info-bar-bg {
    height: 6px;
    background: var(--ink-2);
    border: 1px solid var(--line-dim);
    overflow: hidden;
}

.info-bar-fill {
    height: 100%;
    background: var(--phosphor);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.5s var(--ease-out);
}

/* Event detail body */
.event-summary {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-hi);
}

.event-meta {
    margin-top: 0.9rem;
    border-top: 1px solid var(--line-dim);
}

.event-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.event-meta dt { color: var(--text-dim); font-weight: 600; }
.event-meta dd { color: var(--text-hi); text-align: right; }

/* ============================================
   CONTROLS HINT
   ============================================ */

.controls-hint {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 90;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: right;
}

.controls-hint p { padding: 0.1rem 0; }

.key-cap {
    display: inline-block;
    border: 1px solid var(--line-dim);
    padding: 0.05rem 0.35rem;
    color: var(--text-lo);
    font-weight: 600;
    margin-right: 0.3rem;
}

/* ============================================
   LIVE OPS PANEL
   ============================================ */

.ops-panel {
    position: fixed;
    top: var(--strip-h);
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    z-index: 200;
    background: var(--ink-1);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s var(--ease-out), visibility 0.25s;
}

.ops-panel.active {
    transform: translateX(0);
    visibility: visible;
}

.ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line-dim);
}

.panel-handle { display: none; }

.ops-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}

.ops-stamp {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-dim);
}

.ops-stamp.offline { color: var(--down); }

.ops-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--line-dim);
    color: var(--text-lo);
    font-size: 1.05rem;
    cursor: pointer;
}

.ops-close:hover { color: var(--text-hi); border-color: var(--line); }

.ops-filters {
    display: flex;
    border-bottom: 1px solid var(--line-dim);
}

.ops-filter {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-right: 1px solid var(--line-dim);
    padding: 0.55rem 0;
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
}

.ops-filter:last-child { border-right: none; }
.ops-filter:hover { color: var(--text-lo); }

.ops-filter.active {
    color: var(--phosphor);
    background: var(--phosphor-dim);
}

.ops-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.watch-mobile { display: none; }
.key-mobile { display: none; }

.ops-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line-dim);
    text-decoration: none;
    color: inherit;
}

/* Curated events render as <button> for keyboard access */
button.ops-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line-dim);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

a.ops-item:hover, button.ops-item:hover { background: var(--ink-2); }

.ops-item-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.sev {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sev-critical { color: var(--sev-critical); }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-info { color: var(--sev-info); }

.ops-item-time { color: var(--text-dim); margin-left: auto; white-space: nowrap; }
.ops-item-time.recent { color: var(--alert); font-weight: 700; }

.ops-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-hi);
    margin-top: 0.3rem;
}

a.ops-item .ops-item-title::after {
    content: ' ↗';
    color: var(--text-dim);
}

.ops-item-sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-lo);
    margin-top: 0.25rem;
}

/* FEEDS tab: broadcaster uplink tiles (click-to-load, nothing preloads) */
.feed-tile {
    border-bottom: 1px solid var(--line-dim);
    padding: 0.75rem 1rem;
}

.feed-facade {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    background: var(--ink-0);
    border: 1px solid var(--line);
    cursor: pointer;
    overflow: hidden;
}

.feed-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* pull broadcaster thumbnails toward the console's night palette */
    filter: grayscale(0.45) sepia(0.18) brightness(0.8);
    transition: filter var(--t-base);
}

.feed-facade:hover .feed-thumb { filter: grayscale(0.2) sepia(0.1) brightness(0.95); }

.feed-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--ink-0);
    background: var(--phosphor);
    padding: 0.5rem 0.9rem;
}

.feed-player {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    background: var(--ink-0);
}

.feed-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.feed-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.feed-src { color: var(--text-dim); }

.ops-empty {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-dim);
    text-align: center;
    padding: 2.5rem 1rem;
    letter-spacing: 0.15em;
}

.ops-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--line-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: oklch(10% 0.01 110 / 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-base), visibility var(--t-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 560px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: var(--ink-1);
    border: 1px solid var(--line);
    transform: translateY(8px);
    transition: transform var(--t-base);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line-dim);
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--line-dim);
    color: var(--text-lo);
    font-size: 1.05rem;
    cursor: pointer;
}

.modal-close:hover { color: var(--text-hi); border-color: var(--line); }

.modal-body {
    padding: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-lo);
}

.modal-body p + p { margin-top: 0.8rem; }
.modal-body strong { color: var(--text-hi); }

.highlight { color: var(--phosphor); font-weight: 600; }

.modal-facts {
    margin-top: 1rem;
    border-top: 1px solid var(--line-dim);
}

.modal-facts > div {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-dim);
    font-size: 0.8125rem;
}

.modal-facts dt {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-dim);
    min-width: 64px;
}

.modal-facts dd { color: var(--text-hi); }

.modal-ca {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    word-break: break-all;
    color: var(--phosphor);
}

.modal-disclaimer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ============================================
   TACTICAL VIEW (2D close-up map)
   ============================================ */

.event-tactical {
    width: 100%;
    justify-content: center;
    margin-top: 0.9rem;
    color: var(--phosphor);
}

.tactical-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(860px, calc(100vw - 2rem));
    height: min(560px, calc(100vh - 5rem));
    z-index: 350;
    background: var(--ink-1);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.tactical-panel[hidden] { display: none; }

.tactical-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line-dim);
}

.tactical-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
}

.tactical-sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-dim);
    margin-left: 0.5rem;
}

.tactical-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--line-dim);
    color: var(--text-lo);
    font-size: 1.05rem;
    cursor: pointer;
}

.tactical-close:hover { color: var(--text-hi); border-color: var(--line); }

.tactical-map {
    flex: 1;
    min-height: 0;
    background: var(--ink-0);
}

.tactical-error {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    text-align: center;
    padding: 1rem;
}

.tactical-ais {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--phosphor);
    margin-left: auto;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.tactical-ais.offline { color: var(--text-dim); }
.tactical-ais.dark { color: var(--alert); }

/* Map markers: same language as the globe (discs/diamonds, no radius) */
.tmk { width: 12px; height: 12px; cursor: pointer; }
.tmk-strike { background: radial-gradient(circle closest-side, oklch(62% 0.205 28) 97%, transparent); }
.tmk-maritime { background: oklch(80% 0.135 85); transform: rotate(45deg); }
.tmk-choke { background: transparent; border: 1px solid oklch(80% 0.025 110); transform: rotate(45deg); width: 10px; height: 10px; }
/* Live vessels: heading wedge, dimmer than incident markers */
.tmk-tanker {
    width: 9px;
    height: 11px;
    background: oklch(80% 0.135 85 / 0.65);
    clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

/* MapLibre chrome, re-skinned to the console */
.maplibregl-popup-content {
    background: var(--ink-1);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    color: var(--text-hi);
    font-family: var(--font-mono);
    padding: 0.55rem 0.7rem;
}

.maplibregl-popup-tip { display: none; }

.tmk-pop-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-dim);
}

.tmk-pop-kicker.alert { color: var(--alert); }
.tmk-pop-kicker.amber { color: var(--phosphor); }

.tmk-pop-title {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.15rem;
    line-height: 1.35;
}

.tmk-pop-sub {
    font-size: 0.75rem;
    color: var(--text-lo);
    margin-top: 0.2rem;
}

.maplibregl-ctrl-group {
    border-radius: 0;
    background: var(--ink-1);
    box-shadow: none;
    border: 1px solid var(--line-dim);
}

.maplibregl-ctrl-group button { border-radius: 0; }

@media (max-width: 768px) {
    .tactical-panel {
        width: calc(100vw - 1rem);
        height: calc(100vh - var(--strip-h) - 2rem);
        top: calc(50% + var(--strip-h) / 2);
    }

    .tactical-close { min-width: 44px; min-height: 44px; }
}

/* ============================================
   TOOLTIP
   ============================================ */

.tooltip {
    position: fixed;
    z-index: 300;
    pointer-events: none;
    background: var(--ink-1);
    border: 1px solid var(--line);
    padding: 0.55rem 0.7rem;
    max-width: 240px;
    opacity: 0;
    transition: opacity var(--t-fast);
}

.tooltip.visible { opacity: 1; }

.tooltip-kicker {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-dim);
}

.tooltip-kicker.alert { color: var(--alert); }
.tooltip-kicker.amber { color: var(--phosphor); }

.tooltip-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-hi);
    margin-top: 0.15rem;
    line-height: 1.35;
}

.tooltip-detail {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-lo);
    margin-top: 0.2rem;
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Two-row strip: scrollable prices on top, pinned status + UPDATED below.
       Proof-of-life must never sit off-screen on the primary device. */
    :root { --strip-h: 64px; }

    .strip { flex-direction: column; }

    .strip-scroll {
        flex: none;
        height: 32px;
        /* fade edge = "more cells this way" */
        mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    }

    .strip-meta {
        flex: 1;
        border-top: 1px solid var(--line-dim);
        justify-content: space-between;
    }

    .strip-cell-status { border-left: none; }
    .strip-cell-updated { border-left: 1px solid var(--line-dim); }

    .header { padding: 0.75rem 0.75rem 0; }

    .wordmark-main { font-size: 1.4rem; }
    .wordmark-ticker { font-size: 0.875rem; }
    .thesis { font-size: 0.75rem; letter-spacing: 0.22em; }

    .ca-block { margin-top: 0.5rem; }

    /* Full CA visible: a screenshot must propagate the whole address */
    .ca-address {
        font-size: 0.75rem;
        white-space: normal;
        word-break: break-all;
        line-height: 1.45;
        padding: 0.4rem 0.6rem;
    }

    .header-right {
        position: fixed;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        right: 0.75rem;
        z-index: 210;
    }

    .ops-btn { padding: 0.8rem 1.1rem; }

    .key-panel { display: none; }
    .controls-hint { display: none; }
    .watch-panel { display: none; }

    .watch-mobile {
        display: block;
        border-bottom: 1px solid var(--line-dim);
        padding: 0.7rem 1rem;
        font-family: var(--font-mono);
        font-size: 0.75rem;
    }

    .watch-mobile .watch-title { margin-bottom: 0.4rem; }

    .info-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(20px);
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .info-panel.active { transform: translateY(0); }

    .ops-panel {
        top: auto;
        left: 0;
        width: 100%;
        height: 72vh;
        border-left: none;
        border-top: 1px solid var(--line);
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .ops-panel.active { transform: translateY(0); }

    .panel-handle {
        display: block;
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: var(--line);
    }

    .ops-header { padding-top: 1.1rem; }

    .key-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem 1.1rem;
        padding: 0.6rem 1rem;
        border-bottom: 1px solid var(--line-dim);
        font-family: var(--font-mono);
        font-size: 0.75rem;
    }

    .key-mobile .key-item { padding: 0; }

    .ops-filter, .ops-close, .info-close, .ca-copy, .hlink, .ops-btn {
        min-height: 44px;
    }

    .ops-close, .info-close { min-width: 44px; }

    .ops-filter {
        letter-spacing: 0.02em;
        padding-left: 0;
        padding-right: 0;
    }

    .hlink { padding: 0.55rem 0.6rem; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
