:root {
  color-scheme: dark;
  --bg: #050709;
  --panel: #080b0e;
  --line: #20262c;
  --line-strong: #333b43;
  --ink: #edf1f3;
  --muted: #818b93;
  --dim: #525b63;
  --red: #f1263d;
  --red-dark: #6f101d;
  --stage-pad: clamp(18px, 2vw, 34px);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.situation-shell {
  display: grid;
  width: 100vw;
  height: 100dvh;
  grid-template-columns: minmax(0, 1fr) clamp(390px, 31vw, 500px);
  overflow: hidden;
  background: var(--bg);
}

.globe-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #030506;
  isolation: isolate;
}

.globe-stage::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 48% 50%, #000 0, transparent 72%);
}

.situation-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  min-height: 72px;
  padding: 0 var(--stage-pad);
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(3,5,6,.7);
  backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 124px; height: auto; object-fit: contain; }
.brand > span { width: 1px; height: 25px; background: var(--line-strong); }
.brand strong { font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.situation-header > p { display: flex; margin: 0; align-items: center; gap: 9px; color: var(--muted); font: 700 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.situation-header > p i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px rgba(241,38,61,.85); }
.situation-header time { color: var(--muted); font: 700 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }

.globe-host { position: absolute; inset: 72px 0 80px; outline: none; cursor: crosshair; touch-action: none; }
.globe-host:active { cursor: grabbing; }
.globe-host:focus-visible { box-shadow: inset 0 0 0 2px var(--red); }
.globe-host canvas { display: block; width: 100%; height: 100%; }

.globe-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: min(290px, 70%);
  translate: -50% -50%;
  justify-items: center;
  gap: 8px;
  text-align: center;
  transition: opacity .3s ease;
}
.globe-loading i { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-top-color: var(--red); border-radius: 50%; animation: spin .9s linear infinite; }
.globe-loading strong { margin-top: 7px; font-size: 13px; letter-spacing: .03em; }
.globe-loading span { color: var(--muted); font: 700 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.situation-shell[data-app-state="ready"] .globe-loading { opacity: 0; pointer-events: none; }
@keyframes spin { to { rotate: 360deg; } }

.globe-tooltip {
  position: absolute;
  z-index: 4;
  max-width: 230px;
  padding: 8px 10px;
  border-left: 2px solid var(--red);
  color: var(--ink);
  background: rgba(5,7,9,.9);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  font: 700 9px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}
.globe-tooltip::before { content: "SELECTED / "; color: var(--red); }

.globe-caption {
  position: absolute;
  right: var(--stage-pad);
  bottom: 98px;
  left: var(--stage-pad);
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 4vw, 54px);
  color: var(--dim);
  font: 700 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .11em;
}
.globe-caption span::before { content: "/"; margin-right: 8px; color: var(--red); }

.stream-console {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: grid;
  min-height: 80px;
  padding: 0 var(--stage-pad);
  grid-template-columns: 44px auto minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line-strong);
  background: #080b0d;
}
.stream-toggle { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--red); cursor: pointer; }
.stream-toggle:hover { background: #ff3f54; }
.stream-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.stream-toggle svg { width: 17px; height: 17px; fill: currentColor; }
.stream-toggle .pause-icon, .stream-toggle[aria-pressed="true"] .play-icon { display: none; }
.stream-toggle[aria-pressed="true"] .pause-icon { display: block; }
.stream-copy { display: flex; min-width: 135px; flex-direction: column; gap: 3px; }
.stream-copy small { color: var(--red); font: 800 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; }
.stream-copy small i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--red); }
.stream-copy strong { font-size: 14px; }
.stream-signal { display: flex; height: 22px; align-items: center; gap: 4px; overflow: hidden; }
.stream-signal i { width: 2px; height: 6px; background: #384249; }
.stream-signal i:nth-child(2) { height: 11px; }
.stream-signal i:nth-child(3) { height: 18px; }
.stream-signal i:nth-child(4) { height: 13px; }
.stream-signal i:nth-child(5) { height: 8px; }
.stream-toggle[aria-pressed="true"] ~ .stream-signal i { background: var(--red); animation: signal .8s ease-in-out infinite alternate; }
.stream-toggle[aria-pressed="true"] ~ .stream-signal i:nth-child(2) { animation-delay: -.5s; }
.stream-toggle[aria-pressed="true"] ~ .stream-signal i:nth-child(3) { animation-delay: -.2s; }
@keyframes signal { to { scale: 1 1.55; } }
[data-stream-status] { color: var(--muted); font: 700 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; }
.stream-volume { display: flex; align-items: center; gap: 8px; color: var(--dim); font: 700 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.stream-volume input { width: 74px; accent-color: var(--red); }

.timeline { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto auto auto minmax(0, 1fr) auto; border-left: 1px solid var(--line-strong); background: var(--panel); }
.timeline-header { display: flex; min-height: 102px; padding: 24px 24px 19px; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.timeline-header p { display: flex; margin: 0 0 9px; align-items: center; gap: 8px; color: var(--red); font: 800 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .13em; }
.timeline-header p i { width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px rgba(241,38,61,.7); }
.timeline-header h1 { margin: 0; font-size: clamp(24px, 2.2vw, 34px); line-height: .95; letter-spacing: -.045em; }
.timeline-count { display: flex; align-items: flex-end; flex-direction: column; }
.timeline-count strong { color: var(--ink); font: 500 24px/.9 ui-monospace, SFMono-Regular, Consolas, monospace; }
.timeline-count small { margin-top: 6px; color: var(--dim); font: 700 7px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.timeline-context { display: flex; min-height: 36px; padding: 0 24px; align-items: center; gap: 14px; overflow: hidden; border-bottom: 1px solid var(--line); color: var(--dim); font: 700 7px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; white-space: nowrap; }
.timeline-context span + span::before { content: "·"; margin-right: 14px; color: var(--red); }
.country-filter {
  display: flex;
  min-height: 38px;
  padding: 0 22px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  border: 0;
  border-bottom: 1px solid rgba(241,38,61,.35);
  background: #240b11;
  cursor: pointer;
  font: 800 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .09em;
  text-align: left;
}
.country-filter[hidden] { display: none; }
.country-filter:hover { background: #311018; }
.country-filter:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.country-filter small { color: var(--red); font: inherit; }
.news-list { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior: contain; }
.news-card { position: relative; display: grid; padding: 20px 22px; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; color: inherit; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .15s ease; }
.news-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; content: ""; background: var(--red); scale: 1 0; transform-origin: center; transition: scale .15s ease; }
.news-card:hover, .news-card:focus-visible { background: #0d1115; outline: none; }
.news-card:hover::before, .news-card:focus-visible::before { scale: 1 1; }
.source-mark { display: grid; width: 36px; height: 36px; overflow: hidden; place-items: center; border: 1px solid #343d45; border-radius: 9px; color: #cbd2d7; background: #11161a; }
.source-mark svg { display: block; width: 32px; height: 32px; }
.news-body { min-width: 0; }
.news-meta { display: flex; margin-bottom: 7px; align-items: center; gap: 7px; color: var(--muted); font: 700 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.news-meta strong { overflow: hidden; color: #cfd5d9; text-overflow: ellipsis; white-space: nowrap; }
.news-meta time::before { content: "·"; margin-right: 7px; color: var(--red); }
.news-card h2 { margin: 0; font-size: 15px; line-height: 1.28; letter-spacing: -.012em; }
.news-card p { display: -webkit-box; margin: 9px 0 0; overflow: hidden; color: #9aa3aa; font-size: 11px; line-height: 1.52; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.news-tags { display: flex; margin-top: 11px; align-items: center; gap: 7px; flex-wrap: wrap; }
.news-tags i { padding: 4px 6px; color: #c3c9cd; border: 1px solid #2c343a; font: normal 700 7px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .07em; }
.news-tags span { margin-left: auto; color: var(--red); font: 800 7px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .09em; }
.timeline-footer { min-height: 46px; padding: 11px 22px; border-top: 1px solid var(--line); }
.timeline-footer p { margin: 0; color: var(--dim); font-size: 8px; line-height: 1.45; }
.timeline-skeleton { display: grid; min-height: 150px; padding: 22px; grid-template-columns: 38px 1fr; gap: 12px; border-bottom: 1px solid var(--line); }
.timeline-skeleton i { width: 36px; height: 36px; border-radius: 50%; background: #12171b; }
.timeline-skeleton span { display: block; height: 10px; margin-bottom: 11px; background: #12171b; }
.timeline-skeleton span:nth-child(3) { width: 82%; }
.timeline-skeleton span:nth-child(4) { width: 62%; }
.empty-state { display: grid; min-height: 100%; padding: 40px; place-content: center; color: var(--muted); text-align: center; }
.empty-state strong { margin-bottom: 8px; color: var(--ink); }

@media (max-width: 900px) {
  .situation-shell { grid-template-columns: 1fr; grid-template-rows: minmax(390px, 54dvh) minmax(0, 46dvh); }
  .timeline { border-top: 1px solid var(--line-strong); border-left: 0; }
  .situation-header { min-height: 58px; padding-inline: 14px; grid-template-columns: auto 1fr; gap: 12px; }
  .brand { gap: 9px; }
  .brand img { width: 98px; }
  .brand > span { height: 19px; }
  .brand strong { font-size: 9px; }
  .situation-header > p { justify-self: end; font-size: 7px; letter-spacing: .09em; }
  .situation-header time { display: none; }
  .globe-host { inset: 58px 0 58px; }
  .globe-caption { display: none; }
  .stream-console { min-height: 58px; padding: 0 14px; grid-template-columns: 36px auto 1fr auto; gap: 9px; }
  .stream-toggle { width: 36px; height: 36px; }
  .stream-copy { min-width: 104px; }
  .stream-copy strong { font-size: 12px; }
  .stream-signal { justify-content: flex-end; }
  [data-stream-status], .stream-volume { display: none; }
  .timeline-header { min-height: 72px; padding: 14px 16px 12px; }
  .timeline-header h1 { font-size: 25px; }
  .timeline-context { min-height: 32px; padding-inline: 16px; }
  .timeline-context span:nth-child(2) { display: none; }
  .country-filter { min-height: 34px; padding-inline: 16px; }
  .news-card { padding: 16px; }
  .timeline-footer { display: none; }
}

@media (max-width: 430px) {
  .situation-shell { grid-template-rows: minmax(360px, 52dvh) minmax(0, 48dvh); }
  .situation-header > p span { display: none; }
  .situation-header > p::after { content: "LIVE"; }
  .news-card { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .source-mark { width: 30px; height: 30px; border-radius: 8px; }
  .source-mark svg { width: 27px; height: 27px; }
  .news-card h2 { font-size: 14px; }
  .news-card p { font-size: 10px; -webkit-line-clamp: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
