:root {
  --abyss: #03090f;
  --panel: rgba(5, 15, 24, 0.74);
  --panel-solid: #07131c;
  --line: rgba(160, 205, 230, 0.10);
  --line-strong: rgba(160, 205, 230, 0.20);
  --ink: #e8f0f4;
  --soft: #b6c8d3;
  --mute: #7f98a8;
  --amber: #ffb020;
  --red: #ff4d5e;

  --c-mil: #ece6da; /* military aircraft: warm white for airlift and others; tankers, spy planes, drones and the rest have their own colours (AC in app.js); red is kept for sirens and the top story */
  --c-civil: #5d9fc4;
  --c-conflict: #ff7847;
  --c-news: #dfe8ee;
  --c-quake: #ffd23f;
  --c-nature: #2fd8a8;
  --c-outage: #c084fc;
  --c-cyber: #ff5fd2;
  --c-air: #7dd3fc;
  --c-fire: #ff8a1f;
  --c-siren: #ff2d4a;
  --c-gps: #a3e635; /* lime: quakes keep the yellow, fires the orange */
  --c-region: #cdd6e0; /* watched regions: a quiet silver dashed frame */
  --c-ship: #8fd3c3;
  --c-sat: #b9c7ff;

  --r: 14px;
  --gap: 10px;
  --side: 300px;
  --right: 384px;
  --font: 'Barlow', system-ui, sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--abyss); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 48%, rgba(30, 90, 130, 0.20), transparent 70%), radial-gradient(ellipse 120% 90% at 50% 50%, #061420 0%, #02060a 72%); }
#map::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #9cc 50%, transparent 51%), radial-gradient(1px 1px at 78% 12%, #acd 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 66%, #9bc 50%, transparent 51%), radial-gradient(1px 1px at 22% 82%, #bcd 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 88%, #9bc 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 8%, #cde 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #9bc 50%, transparent 51%), radial-gradient(1px 1px at 95% 34%, #bcd 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 95%, #9bc 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 40%, #def 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 30%, #9bc 50%, transparent 51%), radial-gradient(1px 1px at 58% 22%, #abd 50%, transparent 51%); }
.maplibregl-canvas { outline: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 50%, transparent 55%, rgba(1, 4, 8, 0.78) 100%); }
.grain { position: absolute; inset: -50%; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
body.alarm .vignette { animation: alarm 1.2s ease-out 3; }
@keyframes alarm { 0% { box-shadow: inset 0 0 0 0 rgba(255, 45, 74, 0); } 30% { box-shadow: inset 0 0 160px 20px rgba(255, 45, 74, .35); } 100% { box-shadow: inset 0 0 0 0 rgba(255, 45, 74, 0); } }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; gap: 16px; padding: 0 14px 0 18px; z-index: 8;
  background: linear-gradient(to bottom, rgba(2, 7, 11, .92), rgba(2, 7, 11, .55)); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--amber); flex: none; }
.brand-mark { width: 22px; height: 22px; animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.brand-name { font-family: var(--cond); font-weight: 700; font-size: 23px; color: var(--ink); }
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 45, 74, .12); color: #ff8a96; font-size: 12px; font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-siren); box-shadow: 0 0 8px var(--c-siren); animation: blink 1.6s ease-in-out infinite; }
.live.stale { background: rgba(255, 255, 255, .06); color: var(--mute); }
.live.stale i { background: var(--mute); box-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: .25; } }

.prices { flex: 1; min-width: 0; display: flex; gap: 6px; overflow: hidden; mask-image: linear-gradient(to right, #000 92%, transparent); }
.px { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, .035); flex: none; }
.px .pl { font-size: 11.5px; color: var(--mute); grid-column: 1; white-space: nowrap; }
.px .pv { font-family: var(--cond); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; grid-column: 1; line-height: 1.05; }
.px .pc { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; grid-column: 2; grid-row: 2; text-align: right; }
.px svg { grid-column: 2; grid-row: 1; width: 44px; height: 16px; }
.px .up { color: #4fd1b0; } .px .down { color: #ff7a87; }
.px.hot { background: rgba(255, 176, 32, .12); box-shadow: inset 0 0 0 1px rgba(255, 176, 32, .35); }

.search { position: relative; width: 260px; flex: none; }
.search input { width: 100%; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05); padding: 0 12px; font-size: 13.5px; outline: none; }
.search input:focus { border-color: var(--amber); background: rgba(255, 255, 255, .08); }
.search input::placeholder { color: var(--mute); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); max-height: 60vh; overflow: auto; z-index: 30; }
.search-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.search-results li:hover, .search-results li.sel { background: rgba(255, 255, 255, .07); }
.search-results .sk { font-size: 11.5px; color: var(--mute); display: block; }

.tools { display: flex; align-items: center; gap: 4px; flex: none; }
.tool { display: flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; justify-content: center; padding: 0 8px; border-radius: 10px; color: var(--soft); font-size: 13px; font-weight: 600; }
.tool:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.tool svg { width: 18px; height: 18px; fill: currentColor; }
.tool[aria-pressed="false"] .wave { opacity: .25; }
.tool[aria-pressed="true"] { color: var(--amber); }
#tourBtn.on { background: var(--amber); color: #1a1000; }
.health { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; color: var(--soft); height: 34px; }
.health:hover { background: rgba(255, 255, 255, .06); }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-nature); box-shadow: 0 0 10px var(--c-nature); }
.health.warn .health-dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.clock { font-family: var(--cond); font-weight: 600; font-size: 15px; color: var(--soft); font-variant-numeric: tabular-nums; padding-left: 4px; }
.health-pop { position: absolute; top: 56px; right: 14px; width: 340px; max-height: 70vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); font-size: 13px; z-index: 20; }
.health-pop h3 { margin: 0 0 8px; font-family: var(--cond); font-size: 17px; font-weight: 600; }
.health-pop ul { list-style: none; margin: 0; padding: 0; }
.health-pop li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.health-pop .bad { color: var(--amber); }
.health-pop .ok { color: var(--mute); white-space: nowrap; }
.health-pop p { color: var(--mute); margin: 10px 0 0; }

/* ---------- panels ---------- */
.left, .right { position: absolute; top: 64px; bottom: 46px; z-index: 4; display: flex; flex-direction: column; gap: var(--gap); }
.left { left: 12px; width: var(--side); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-bottom: 2px; }
.left::-webkit-scrollbar { display: none; }
.left > * { flex: none; }
.right { right: 12px; width: var(--right); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); overflow: hidden; }
.block, .tension { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.block.grow { display: flex; flex-direction: column; }
.block.grow .regions { overflow: visible; }
.block-title { margin: 0 0 8px; font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--soft); display: flex; align-items: baseline; gap: 8px; }
.hint { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--mute); }
body.tour .left, body.tour .right, body.tour .ticker { opacity: 0; pointer-events: none; transform: translateY(8px); }
.left, .right, .ticker { transition: opacity .5s, transform .5s; }

/* tension hero */
.tension { position: relative; overflow: hidden; }
.tension::before { content: ''; position: absolute; width: 280px; height: 280px; left: -100px; top: -130px; border-radius: 50%;
  background: radial-gradient(circle, var(--tcolor, var(--amber)) 0%, transparent 65%); opacity: .2; filter: blur(10px); pointer-events: none; }
.tension-head { display: flex; justify-content: space-between; align-items: baseline; }
.tension-label { font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--soft); }
.tension-band { font-family: var(--cond); font-weight: 700; font-size: 18px; color: var(--tcolor, var(--amber)); }
.tension-row { display: flex; align-items: flex-end; gap: 10px; }
.tension-score { font-family: var(--cond); font-weight: 700; font-size: 92px; line-height: .86; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px color-mix(in srgb, var(--tcolor, var(--amber)) 45%, transparent); }
.tension-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tension-delta { font-size: 12.5px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.tension-delta.up { color: #ff8a96; } .tension-delta.down { color: #4fd1b0; }
.tension-spark { height: 54px; width: 100%; }
.tension-bar { display: flex; gap: 3px; height: 6px; margin: 12px 0 9px; }
.tension-bar span { display: block; height: 100%; border-radius: 3px; background: rgba(255, 255, 255, .08); position: relative; overflow: hidden; }
.tension-bar span i { position: absolute; inset: 0; transform-origin: left; background: var(--tcolor, var(--amber)); }
.tension-why { margin: 0; color: var(--soft); font-size: 13px; line-height: 1.45; }
.pulse-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pulse-stats div { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 6px 8px; }
.pulse-stats b { display: block; font-family: var(--cond); font-size: 20px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pulse-stats span { font-size: 11.5px; color: var(--mute); }
.pulse-stats .hot b { color: var(--c-siren); }

/* layers */
.layers { display: flex; flex-direction: column; gap: 6px; }
.lgroup-t { font-size: 11.5px; color: var(--mute); margin: 4px 0 0 4px; }
/* one row per layer: swatch, name, what it shows now, and when its data last changed */
.lgroup { display: grid; gap: 2px; }
.layer { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 38px; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 8px; border-radius: 9px; font-size: 12.5px; color: var(--soft); background: rgba(255, 255, 255, .04); border: 1px solid transparent; text-align: left; }
.layer:hover { border-color: var(--line-strong); }
.layer .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }
.layer .ln { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer .ln small { font-size: 11px; color: var(--mute); }
.layer .lcount { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; text-align: right; }
.layer .lcount.zero { color: var(--mute); font-weight: 500; }
.layer .lt { font-size: 11px; color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.layer .lt.bad { color: var(--amber); }
.layer.off { opacity: .45; background: transparent; border-color: var(--line); }
.layer.off .sw { box-shadow: none; background: transparent; border: 1.5px solid var(--c); }
.layer.lempty:not(.off) .sw { box-shadow: none; opacity: .5; }
.lkey { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 2px 4px 4px; font-size: 11.5px; color: var(--mute); }
.lkey i { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.lkey .ring { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #9fb4c2; background: rgba(159, 180, 194, .22); }
.lkey .ring.war { border-color: var(--c-conflict); background: color-mix(in srgb, var(--c-conflict) 22%, transparent); }
.lkey .shade { width: 13px; height: 9px; border-radius: 2px; background: rgba(223, 232, 238, .14); box-shadow: inset 0 0 0 1px rgba(223, 232, 238, .4); }
.dz-grid .zero { opacity: .45; }

/* regions */
.regions { list-style: none; margin: 0 -6px; padding: 0; overflow: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: #1d3444 transparent; }
.region { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 6px; border-radius: 10px; width: 100%; text-align: left; }
.region:hover { background: rgba(255, 255, 255, .04); }
.region .rname { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region .rscore { font-family: var(--cond); font-weight: 700; font-size: 18px; line-height: 1; text-align: right; color: var(--soft); font-variant-numeric: tabular-nums; }
.region .rmeta { font-size: 12px; color: var(--mute); grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.region .rbar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.region .rbar i { display: block; height: 100%; background: var(--soft); border-radius: 2px; }
.region.hot .rscore { color: var(--amber); }
.region.hot .rbar i { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.region .rstat { color: var(--amber); }
.region .siren { color: #ff8a96; font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 0; padding: 6px 6px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { padding: 8px 10px 9px; font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 5px; align-items: center; }
.tab:hover { color: var(--soft); }
.tab.active { color: var(--ink); border-bottom-color: var(--amber); }
.tab-count { font-family: var(--font); font-size: 11px; font-weight: 700; background: var(--amber); color: #1a1000; border-radius: 999px; padding: 1px 6px; }
.tab-count.hot { background: var(--c-siren); color: #fff; }
.tab-count:empty { display: none; }
.tabpanel { display: none; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #1d3444 transparent; }
.tabpanel.active { display: flex; flex-direction: column; }
#tab-signals, #tab-markets, #tab-stories { padding: 12px 14px; gap: 16px; }

.filters { display: flex; gap: 6px; padding: 10px 12px; flex-wrap: wrap; flex: none; position: sticky; top: 0; background: linear-gradient(var(--panel-solid) 75%, transparent); z-index: 1; }
.chip { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; color: var(--soft); background: rgba(255, 255, 255, .05); min-height: 26px; }
.chip.active { background: var(--ink); color: var(--abyss); font-weight: 600; }

.feed { list-style: none; margin: 0; padding: 0 6px 12px; }
.item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.item:hover { background: rgba(255, 255, 255, .045); }
.item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-top: 6px; box-shadow: 0 0 8px var(--c); }
.item .meta { display: flex; gap: 8px; font-size: 12px; color: var(--mute); margin-bottom: 2px; flex-wrap: wrap; }
.item .meta b { color: var(--soft); font-weight: 600; }
.item .title { font-size: 14px; line-height: 1.38; }
.item .sub { font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.item.urgent .title { font-weight: 600; }
.item .flag { color: var(--amber); font-weight: 700; }
.item.fresh { animation: fresh 2.4s ease-out 1; }
@keyframes fresh { from { background: color-mix(in srgb, var(--amber) 22%, transparent); } to { background: transparent; } }
.empty { color: var(--mute); padding: 16px; font-size: 13px; }

/* alerts tab */
.alerts-head { padding: 12px 14px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.alerts-head h3 { margin: 0; font-family: var(--cond); font-size: 20px; font-weight: 700; }
.alerts-head span { font-size: 12px; color: var(--mute); }
.alert { display: grid; grid-template-columns: 4px 1fr; gap: 12px; margin: 4px 8px; padding: 10px 12px 10px 0; border-radius: 10px; cursor: pointer; }
.alert:hover { background: rgba(255, 255, 255, .045); }
.alert .lvl { border-radius: 3px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.alert .meta { display: flex; gap: 8px; font-size: 12px; color: var(--mute); margin-bottom: 2px; }
.alert .meta b { color: var(--c); font-weight: 700; }
.alert .title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.alert .sub { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.alert.l1 .title { font-weight: 500; font-size: 14px; }
.alert.new { animation: fresh 3s ease-out 1; }
.day-sep { font-size: 12px; color: var(--mute); padding: 10px 20px 2px; }

/* stories */
.story { border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); cursor: pointer; }
.story:hover { border-color: var(--line-strong); }
.story-top { display: flex; gap: 12px; align-items: flex-start; }
.story-n { font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: .9; min-width: 34px; text-align: center; }
.story-n small { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 500; color: var(--mute); margin-top: 3px; }
.story-h { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.story-m { font-size: 12px; color: var(--mute); margin-top: 4px; }
.story-outlets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.story-outlets span { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--soft); }
.story-outlets span.o { background: rgba(255, 176, 32, .12); color: #ffd28a; }
.story.conflict .story-n { color: var(--c-conflict); }
.story-items { margin: 8px 0 0; padding: 0; list-style: none; display: none; }
.story.open .story-items { display: block; }
.story-items li { font-size: 13px; padding: 5px 0; border-top: 1px solid var(--line); }
.story-items a { text-decoration: none; color: var(--soft); }
.story-items a:hover { color: var(--ink); text-decoration: underline; }
.story-items b { color: var(--ink); font-weight: 600; margin-right: 6px; }

/* signals */
.sig-h { margin: 0 0 4px; font-family: var(--cond); font-weight: 700; font-size: 20px; }
.sig-p { margin: 0 0 10px; color: var(--mute); font-size: 13px; }
.card { background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.card:hover { border-color: var(--line-strong); }
.card.alert-card { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.card-name { font-weight: 600; font-size: 14.5px; }
.card-score { font-family: var(--cond); font-weight: 700; font-size: 22px; color: var(--amber); font-variant-numeric: tabular-nums; }
.card ul { margin: 6px 0 0; padding-left: 16px; color: var(--soft); font-size: 13px; }
.card .foot { margin-top: 6px; font-size: 12px; color: var(--mute); }
.card blockquote { margin: 6px 0 0; font-size: 13px; color: var(--soft); }
.parts { list-style: none; margin: 0; padding: 0; }
.parts li { display: grid; grid-template-columns: 1fr 40px; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.parts .pl { font-size: 13.5px; }
.parts .pv { text-align: right; font-family: var(--cond); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.parts .pd { grid-column: 1 / -1; font-size: 12px; color: var(--mute); }
.parts .pb { grid-column: 1 / -1; height: 3px; background: rgba(255, 255, 255, .06); border-radius: 2px; overflow: hidden; }
.parts .pb i { display: block; height: 100%; background: var(--amber); }

/* markets */
.mkt { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.mkt .q { font-size: 13.5px; line-height: 1.35; }
.mkt .p { font-family: var(--cond); font-weight: 700; font-size: 26px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.mkt .m { font-size: 12px; color: var(--mute); display: flex; gap: 10px; flex-wrap: wrap; }
.mkt .up { color: #4fd1b0; } .mkt .down { color: #ff7a87; }
.mkt .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.mkt .bar i { display: block; height: 100%; background: var(--soft); }
.mkt.mover .p { color: var(--amber); }

/* country dossier (slides over the tabs) */
.dossier { position: absolute; inset: 0; background: var(--panel-solid); z-index: 3; overflow: auto; padding: 14px 16px 20px; animation: slidein .25s ease-out; scrollbar-width: thin; scrollbar-color: #1d3444 transparent; }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } }
.dz-back { font-size: 13px; color: var(--mute); padding: 4px 0; }
.dz-back:hover { color: var(--ink); }
.dz-name { font-family: var(--cond); font-weight: 700; font-size: 34px; line-height: 1.05; margin: 6px 0 2px; }
.dz-sub { color: var(--mute); font-size: 13px; }
.dz-score { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 12px; }
.dz-score b { font-family: var(--cond); font-weight: 700; font-size: 48px; line-height: 1; color: var(--tcolor, var(--amber)); }
.dz-score span { color: var(--soft); font-size: 13px; }
.dz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.dz-grid div { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 7px 9px; }
.dz-grid b { display: block; font-family: var(--cond); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.dz-grid span { font-size: 11.5px; color: var(--mute); }
.dz-h { font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--soft); margin: 14px 0 4px; }

/* toasts */
.toasts { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - var(--side) - var(--right) - 60px)); z-index: 9; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: start; padding: 11px 10px 11px 0; border-radius: 12px; cursor: pointer;
  background: rgba(8, 10, 14, .86); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px color-mix(in srgb, var(--c) 20%, transparent); animation: toastin .4s cubic-bezier(.2, .9, .3, 1.2); }
.toast .lvl { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--c); box-shadow: 0 0 12px var(--c); }
.toast .tk { font-family: var(--cond); font-weight: 700; font-size: 14px; color: var(--c); display: flex; align-items: center; gap: 7px; }
.toast .tk::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); animation: blink 1.2s ease-in-out infinite; }
.toast .tt { font-weight: 600; font-size: 15px; line-height: 1.35; margin-top: 1px; }
.toast .td { font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.toast .tx { color: var(--mute); font-size: 18px; width: 28px; height: 28px; border-radius: 8px; }
.toast .tx:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.toast.out { animation: toastout .3s ease-in forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-8px); } }

.hover-tip { position: absolute; z-index: 7; pointer-events: none; background: rgba(5, 13, 20, .92); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; max-width: 260px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.hover-tip b { font-size: 14px; display: block; }
.hover-tip span { color: var(--soft); }
.hover-tip .tip-note { display: block; margin: 1px 0 3px; font-size: 12px; font-style: normal; color: var(--mute); }

/* tour */
.tour-caption { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(760px, calc(100vw - 40px)); z-index: 9; padding: 16px 20px 18px; border-radius: 16px;
  background: rgba(4, 10, 16, .82); border: 1px solid var(--line-strong); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.tc-k { font-family: var(--cond); font-weight: 700; font-size: 16px; color: var(--amber); }
.tc-t { font-family: var(--cond); font-weight: 700; font-size: 34px; line-height: 1.05; margin: 2px 0 4px; }
.tc-d { color: var(--soft); font-size: 15px; }
.tc-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .08); margin-top: 12px; overflow: hidden; }
.tc-bar i { display: block; height: 100%; width: 0; background: var(--amber); }
.tc-x { position: absolute; top: 12px; right: 12px; font-size: 12.5px; color: var(--mute); padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); }

/* ticker */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 38px; z-index: 5; overflow: hidden; display: flex; align-items: center;
  background: linear-gradient(to top, rgba(2, 7, 11, .96), rgba(2, 7, 11, .7)); border-top: 1px solid var(--line); }
.ticker-track { display: flex; gap: 36px; white-space: nowrap; padding-left: 100%; animation: tick var(--dur, 240s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { text-decoration: none; color: var(--soft); font-size: 13.5px; }
.ticker a b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.ticker a .tk-src { color: var(--mute); margin-left: 6px; font-size: 12px; }
.ticker a.hot b { color: var(--amber); }
@keyframes tick { to { transform: translateX(-100%); } }

/* map popups & controls */
.maplibregl-popup-content { background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); font-family: var(--font); }
.maplibregl-popup-tip { border-top-color: var(--panel-solid) !important; border-bottom-color: var(--panel-solid) !important; }
.maplibregl-popup-close-button { color: var(--mute); font-size: 18px; padding: 2px 8px; }
.pop-k { font-size: 12px; color: var(--mute); display: flex; align-items: center; gap: 6px; }
.pop-k i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.pop-t { font-weight: 600; font-size: 15px; margin: 3px 0 4px; line-height: 1.3; }
.pop-d { font-size: 13px; color: var(--soft); }
.pop-d div { margin-top: 2px; }
.pop-a { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--amber); }
.maplibregl-ctrl-attrib { background: rgba(3, 9, 14, .6) !important; color: var(--mute); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--mute); }
.maplibregl-ctrl-bottom-right { bottom: 40px; right: calc(var(--right) + 20px); }
.maplibregl-ctrl-group { background: var(--panel-solid); border: 1px solid var(--line-strong); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line); }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(.85); }

.mobile-tabs { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1500px) { .px:nth-child(n+6) { display: none; } }
@media (max-width: 1280px) { :root { --side: 276px; --right: 350px; } .tension-score { font-size: 78px; } .px:nth-child(n+4) { display: none; } .search { width: 200px; } }
@media (max-width: 1060px) { .prices { display: none; } .search { flex: 1; width: auto; } }
@media (max-width: 960px) {
  .topbar { gap: 8px; padding: 0 8px 0 12px; }
  .brand-name { font-size: 20px; }
  .search { display: none; }
  .tools { margin-left: auto; }
  .tool span, #healthText, .clock, #notifyBtn { display: none; }
  .left, .right { top: 60px; bottom: 96px; left: 10px; right: 10px; width: auto; display: none; }
  .left.show, .right.show { display: flex; }
  .left.show { overflow: auto; }
  .block.grow { flex: none; }
  .ticker { bottom: 50px; }
  .toasts { width: calc(100vw - 20px); top: 60px; }
  .mobile-tabs { display: flex; position: absolute; left: 0; right: 0; bottom: 0; height: 50px; z-index: 6; background: var(--panel-solid); border-top: 1px solid var(--line); }
  .mobile-tabs button { flex: 1; font-family: var(--cond); font-weight: 600; font-size: 16px; color: var(--mute); }
  .mobile-tabs button.active { color: var(--ink); box-shadow: inset 0 2px 0 var(--amber); }
  .maplibregl-ctrl-bottom-right { right: 8px; bottom: 96px; }
  .tension-score { font-size: 70px; }
  .tour-caption { bottom: 100px; }
  .tc-t { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .ticker-track, .live i, .toast .tk::before { animation: none; }
  .ticker-track { padding-left: 16px; overflow-x: auto; }
  .item.fresh, .alert.new, .toast, body.alarm .vignette { animation: none; }
}

/* ---------- the map's panels in the Home look (one design for every view): Home's tokens, type and quiet accents ---------- */
.left, .right, .health-pop, .search-results, .maplibregl-popup-content, .hover-tip, .tour-caption {
  --panel: color-mix(in srgb, var(--card, #141418) 94%, transparent);
  --panel-solid: var(--card, #141418);
  --line: var(--rule, rgba(255, 255, 255, .075));
  --line-strong: var(--rule-2, rgba(255, 255, 255, .15));
  --ink: var(--ink-1, #f5f5f7);
  --soft: var(--ink-2, #c7c7cc);
  --mute: var(--ink-3, #8e8e93);
  --amber: var(--ink-1, #f5f5f7);
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cond: var(--font);
  font-family: var(--font);
}
.right, .block, .tension { border-radius: 18px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px rgba(0, 0, 0, .35); }
.block-title, .tension-label { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
/* the overview block: "Right now" and three plain counts (no index score, band, gauge or sparkline) */
.tension::before, .tension-band, .tension-row, .tension-bar, #tensionDelta, #tensionSpark { display: none !important; }
.tension-head { margin-bottom: 8px; }
.tension-why:empty { display: none; }
.tension-why { margin: 0 0 10px; }
#pulseStats .hot b { color: var(--ink) !important; }
/* tabs: never clipped; they scroll sideways with a soft edge when the panel is narrow */
.right .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 2px; padding: 6px 10px 0; mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.right .tabs::-webkit-scrollbar { display: none; }
.right .tab { flex: none; white-space: nowrap; font-size: 15px; font-weight: 700; padding: 9px 10px 10px; }
.right .tab.active { border-bottom-color: var(--ink); }
.right .tab-count, .right .tab-count.hot { background: var(--card-2, rgba(255, 255, 255, .12)); color: var(--ink); }
/* layer names wrap instead of being cut ("Sea warnings (missile tests, exercises)") */
.layer { align-items: start; }
.layer .ln { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; padding: 2px 0; }
.layer .sw { margin-top: 6px; box-shadow: none; }
.layer .lcount, .layer .lt { padding-top: 2px; }
.layer .lt.bad { color: var(--mute); font-style: italic; }
/* hotspots: plain counts, no score */
.region .rscore { display: none; }
.region.hot .rbar i, .region .rbar i { background: var(--soft); box-shadow: none; }
.region .rstat { color: var(--soft); }
.region .siren { color: var(--ink); }
/* "Notable now" chips: one neutral chip style, not a colour each */
#leftPanel .mc { border-color: var(--line-strong); background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
#leftPanel .mc b { color: var(--soft); }
#leftPanel .mc .mc-ic { color: var(--soft); filter: grayscale(1); }
/* alert rows: neutral labels; the side bar is red only for the most urgent (live) level */
.alert .meta b { color: var(--ink) !important; font-weight: 700; }
.alert .lvl { background: var(--line-strong) !important; box-shadow: none !important; }
.alert.l3 .lvl { background: var(--onair, #ff2d2d) !important; }
.alert:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.pop-a { color: var(--ink); text-decoration: underline; }
/* the source counter speaks only when something is delayed */
#healthBtn[hidden] { display: none !important; }
/* zoom buttons sit at the canvas edge whenever the right panel is not shown */
body.map-simple .maplibregl-ctrl-bottom-right { right: 16px; }
.maplibregl-ctrl-group { background: var(--card, #141418); border-color: var(--rule-2, rgba(255, 255, 255, .15)); border-radius: 12px; overflow: hidden; }
/* the header price chips: a whole chip or none, never a cut sparkline */
@media (max-width: 1366px) { .px { grid-template-columns: auto; } .px svg { display: none; } .px .pc { grid-column: 1; grid-row: 3; text-align: left; } }
/* the map header: no extra clock (times on the page are already local) */
.clock { display: none !important; }
.ticker a.hot b { color: var(--ink-1, #f5f5f7); }
/* the panels carry their own text colour, so a light theme gets dark text on its light cards */
.left, .right, .health-pop, .search-results, .maplibregl-popup-content, .hover-tip { color: var(--ink); }
.pulse-stats div { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.pulse-stats b, .alerts-head h3, .alert .title, .tabpanel h3 { color: var(--ink); }
.ticker a.hot b { color: #f5f5f7; }
