:root {
  --bg: #07090b;
  --panel: #0e1215;
  --panel2: #131a1e;
  --line: #1f2a30;
  --text: #e8ecee;
  --dim: #8a979e;
  --amber: #ff8a3d;
  --amber-dim: #5a3418;
  --red: #ff4545;
  --yellow: #ffc933;
  --green: #3ddc84;
  --blue: #58a6ff;
  --cyan: #00d1c1;
  --l1: #3ddc84;
  --l2: #9bd74a;
  --l3: #ffc933;
  --l4: #ff8a3d;
  --l5: #ff4545;
  --target-size: 24px;
}

@media (pointer: coarse) {
  :root { --target-size: 44px; }
  input, textarea, select { font-size: max(16px, 1rem); }
}

* { box-sizing: border-box; }
html {
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { overflow-wrap: break-word; }
:where(a, code) { overflow-wrap: anywhere; }
img, video { max-inline-size: 100%; block-size: auto; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
h1, h2, h3, h4 { font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.03em; margin: 0; text-transform: uppercase; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], .top .nav-actions a, .chip, summary) {
  min-block-size: var(--target-size);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 6px;
  font: 600 14px Inter, system-ui, sans-serif;
  padding: 11px 18px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--amber); color: #1a0d03; }
.btn-primary:hover { filter: brightness(1.15); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Top Nav */
.top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 11, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding-block: 8px;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.brand {
  font: 700 22px "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand b { color: var(--amber); }
.brand .aus-flag { font-size: 16px; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 11px "JetBrains Mono", monospace;
  color: var(--red);
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 69, 69, 0.12);
  border: 1px solid rgba(255, 69, 69, 0.3);
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 69, 69, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 69, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 69, 69, 0); }
}

.top .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.top .nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Sections */
section { padding: 28px 0; }
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sec-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 1.875rem); letter-spacing: 0.02em; }
.sec-head p { margin: 4px 0 0; color: var(--dim); font-size: 14px; }
.kicker {
  font: 600 11px "JetBrains Mono", monospace;
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.livedot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: livep 1.6s infinite;
}
@keyframes livep { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Bloomberg-style Macro Strip */
.mstrip {
  margin-top: 10px;
  width: 100%;
  background: #000;
  border: 1px solid #222a30;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  overflow: hidden;
}
.mx-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 4px 10px;
  background: #ff8a00;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.mx-top b { background: #000; color: #ff8a00; padding: 0 4px; margin-left: 4px; border-radius: 2px; }
.mx-threat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #1c1c1c;
  background: rgba(14, 18, 21, 0.6);
}
.mx-tl .mx-l { font-size: 10px; color: var(--amber); font-weight: 700; }
.mx-tl .mx-v { font-size: 20px; font-weight: 700; white-space: normal; }
.mx-bars { display: flex; gap: 4px; margin-top: 4px; }
.mx-bars i { width: 22px; height: 5px; border-radius: 1px; display: block; }
.mx-tr { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 12px; color: #cfcfcf; min-width: 0; }
.mx-tr span { max-width: 100%; }
.mx-tr span:not(:last-child)::after { content: "·"; color: var(--amber); margin: 0 8px; }
.mx-row { display: grid; gap: 1px; background: #1c1c1c; border-top: 1px solid #1c1c1c; }
.mx-row.r6 { grid-template-columns: repeat(6, 1fr); }
.mx-row.r5 { grid-template-columns: repeat(5, 1fr); }
.mx-row.r4 { grid-template-columns: repeat(4, 1fr); }
.mx-row.r3 { grid-template-columns: repeat(3, 1fr); }
.mx-dplot { background: #000; border-top: 1px solid #1c1c1c; padding: 10px 12px 8px; }
.mx-dplot-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: #9a9a9a; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.mx-dplot-hd b { color: #ff9d2e; letter-spacing: 0.06em; font-size: 10px; }
.mx-dplot svg { display: block; width: 100%; height: 84px; overflow: visible; }
.mx { padding: 8px 12px; background: #000; min-width: 0; }
.mx[data-mkey] { cursor: pointer; transition: background 0.15s ease; }
.mx[data-mkey]:hover, .mx[data-mkey]:focus-visible { background: #0e1418; outline: none; }
.mx[data-mkey]:hover .mx-l { color: #ffc933; }
dialog.mx-dlg { background: #0b0f12; color: #e6edf3; border: 1px solid #2b353d; border-radius: 10px; max-width: 560px; width: calc(100vw - 28px); padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,0.75); margin: auto; }
dialog.mx-dlg::backdrop { background: rgba(0,0,0,0.72); backdrop-filter: blur(2px); }
.mx-dlg-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #1c242b; }
.mx-dlg-k { font-size: 11px; color: #ff9d2e; font-weight: 700; letter-spacing: 0.08em; }
.mx-dlg-v { font-size: 24px; font-weight: 700; color: #f2f2f2; margin-top: 2px; }
.mx-dlg-x { background: transparent; border: 1px solid #2b353d; color: #9fb3c8; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.mx-dlg-x:hover { color: #fff; border-color: #58a6ff; }
.mx-dlg-bd { padding: 14px 16px 16px; max-height: 70dvh; overflow-y: auto; }
.mx-dlg-why { font-size: 13px; line-height: 1.5; color: #c9d1d9; margin-bottom: 14px; }
.mx-dlg-sec { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: #8b949e; text-transform: uppercase; margin: 12px 0 8px; }
.mx-dlg-news { display: flex; flex-direction: column; gap: 8px; }
.mx-dlg-n { display: block; padding: 9px 11px; background: #11171c; border: 1px solid #1e272e; border-radius: 6px; text-decoration: none; color: #e6edf3; }
.mx-dlg-n:hover { border-color: #ff9d2e; background: #141c22; }
.mx-dlg-n b { font-size: 13px; line-height: 1.35; display: block; color: #f0f6fc; }
.mx-dlg-n span { font-size: 11px; color: #8b949e; margin-top: 3px; display: block; }
.mx-l { color: #ff9d2e; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.mx-v { color: #f2f2f2; font-size: 18px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-s { font-size: 11px; color: #9a9a9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.up, .t-g { color: var(--green); }
.down, .dn, .t-r { color: var(--red); }
.t-y { color: var(--yellow); }
.t-a { color: var(--amber); }
.mx-d { color: #666; font-size: 9px; }
.mx-tw { font-size: 0.55em; font-weight: 700; vertical-align: middle; margin-left: 4px; letter-spacing: 0.5px; }
.delta-arr { font-size: 0.72em; margin-left: 4px; vertical-align: middle; font-weight: 700; }
#mstrip, #feed, #panels { transition: opacity 0.25s ease; }
#mstrip.fading, #feed.fading, #panels.fading { opacity: 0.18; }
@media (prefers-reduced-motion: reduce) {
  #mstrip, #feed, #panels { transition: none; }
}

/* Map Container */
.map-first { padding-top: 18px; }
.map-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
#map {
  height: 560px;
  background: radial-gradient(ellipse at 50% 50%, #0f2230 0%, #070b0e 55%, #030507 100%);
  position: relative;
}
.map-veil {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(7, 11, 14, 0.90);
  border: 1px solid var(--amber-dim);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.map-veil b { color: var(--amber); }
.map-veil:empty { display: none; }

/* Layer Chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 13px Inter, system-ui, sans-serif;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--amber); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.off { opacity: 0.4; }
.chip.locked { color: var(--dim); }
.chip.locked:after { content: "🔒"; font-size: 11px; margin-left: 2px; }
.chip.more { border-color: rgba(255, 138, 61, 0.4); color: var(--amber); }

/* Hook teaser */
.hook {
  background: linear-gradient(180deg, rgba(255, 69, 69, 0.08), rgba(255, 69, 69, 0.02));
  border: 1px solid rgba(255, 69, 69, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0 0;
}
.hook .h {
  font: 700 12px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.hook .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.hook a.t {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  transition: border-color 0.15s;
}
.hook a.t:hover { border-color: var(--amber); }
.hook .n { font: 700 24px/1.1 "Barlow Condensed", sans-serif; color: var(--text); }
.hook .l { font-size: 12px; color: var(--dim); margin-top: 2px; }
.hook .go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }

/* Plan Mode */
.plan-btn { margin-left: auto; }
.plan-locked {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px dashed var(--amber-dim);
  border-radius: 12px;
  padding: 14px 18px;
}
.plan-locked strong { font: 700 20px "Barlow Condensed", sans-serif; text-transform: uppercase; color: var(--text); }
.plan {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--amber-dim);
  border-radius: 12px;
  padding: 18px;
}
.plan-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #0a0d10;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.wp-btn:hover { border-color: var(--amber); }
.wp-btn.on { border-color: var(--amber); background: rgba(255, 138, 61, 0.15); }
.plan-hint { font-size: 13px; color: var(--dim); margin: 10px 0 0; }
.plan-hint.active { color: var(--amber); font-weight: 500; }
.plan-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 14px; }
.plan-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
.wp { background: #0a0d10; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.wp-top { display: flex; align-items: center; gap: 8px; }
.wp-top .emo { font-size: 18px; }
.wp-top input[type=text] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text);
  font: 600 14px Inter, sans-serif;
  padding: 4px 6px;
}
.wp-top input[type=text]:focus { border-color: var(--line); outline: none; background: #07090b; }
.wp-top button { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.wp-top button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.wp-top button.del:hover { color: var(--red); }
.wp-meta { font-size: 12px; color: var(--dim); margin-top: 5px; line-height: 1.5; }
.wp-meta b { color: #c3ccd1; font-weight: 600; }
.wp-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0b0f12;
  border: 2px solid;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.plan-route .btn { padding: 9px 14px; font-size: 13px; margin: 0 6px 8px 0; }
.route-out {
  background: #0a0d10;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin: 6px 0 12px;
  font-size: 14px;
  min-height: 48px;
}
.route-out .big2 { font: 700 28px "Barlow Condensed", sans-serif; color: var(--amber); }
.route-out .warn { color: var(--red); }
.plan-io { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plan-io .btn { padding: 8px 12px; font-size: 12px; }
.plan-note { font-size: 12px; color: var(--dim); margin-top: 12px; line-height: 1.5; }

/* Feed / Headlines */
.feed-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.feed-filter {
  font: 600 11px "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.feed-filter:hover { border-color: var(--amber); color: var(--text); }
.feed-filter.on { border-color: var(--amber); background: rgba(255, 138, 61, 0.15); color: var(--amber); }
.feed { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.feed-track { display: flex; flex-direction: column; }
@keyframes wireSlideReveal {
  0% {
    max-height: 0;
    opacity: 0;
    transform: translateY(-14px);
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.45);
  }
  65% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: inset 0 0 18px rgba(255, 179, 71, 0.16);
  }
  100% {
    max-height: 140px;
    opacity: 1;
    transform: translateY(0);
    padding-top: 12px;
    padding-bottom: 12px;
    border-top-width: 1px;
    box-shadow: none;
  }
}
.item.is-entering {
  overflow: hidden;
  animation: wireSlideReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
body.fill-window .wrap { max-width: none; width: calc(100vw - 32px); padding-left: 16px; padding-right: 16px; }
body.fill-window #panels { max-width: none; width: 100%; margin-left: 0; transform: none; }
body.fill-window .map-first .sec-head > div:first-child { flex: 1; min-width: 0; }
@media (min-width: 1120px) {
  body.fill-window .map-first {
    display: grid;
    grid-template-columns: minmax(520px, 1.15fr) minmax(440px, 1fr);
    gap: 16px;
    align-items: stretch;
  }
  body.fill-window .map-first .sec-head { grid-column: 1; margin-bottom: 0; }
  body.fill-window .map-first .map-wrap { grid-column: 2; height: 100%; min-height: 540px; }
  body.fill-window .map-first #map { height: 100%; min-height: 540px; }
  body.fill-window .map-first .chips,
  body.fill-window .map-first .plan { grid-column: 1 / -1; }
}
body.fill-window #wireSection,
body.fill-window #wireSection .feed,
body.fill-window #chat,
body.fill-window .mx-dplot { width: 100%; }
.item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: var(--panel);
  transition: background 0.15s;
}
.item.kind-CONFLICT { background: rgba(255, 138, 61, 0.06); border-left-color: rgba(255, 138, 61, 0.55); }
.item.kind-ATTACK { background: rgba(255, 69, 69, 0.07); border-left-color: rgba(255, 69, 69, 0.65); }
.item.kind-ENERGY { background: rgba(255, 201, 51, 0.06); border-left-color: rgba(255, 201, 51, 0.55); }
.item.kind-MILITARY { background: rgba(88, 166, 255, 0.06); border-left-color: rgba(88, 166, 255, 0.55); }
.item.kind-DISASTER { background: rgba(255, 106, 0, 0.07); border-left-color: rgba(255, 106, 0, 0.65); }
.item.kind-SUPPLY { background: rgba(61, 220, 132, 0.05); border-left-color: rgba(61, 220, 132, 0.5); }
.item.kind-BIO { background: rgba(199, 125, 255, 0.07); border-left-color: rgba(199, 125, 255, 0.6); }
.item:first-child { border-top: 0; }
.item:hover { background: var(--panel2); }
.tag {
  font: 700 11px "JetBrains Mono", monospace;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.06em;
}
.tag.CONFLICT { background: rgba(255, 138, 61, 0.14); color: var(--amber); }
.tag.ATTACK { background: rgba(255, 69, 69, 0.14); color: var(--red); }
.tag.ENERGY { background: rgba(255, 201, 51, 0.14); color: var(--yellow); }
.tag.MILITARY { background: rgba(88, 166, 255, 0.14); color: var(--blue); }
.tag.DISASTER { background: rgba(255, 106, 0, 0.16); color: #ff6a00; }
.tag.SUPPLY { background: rgba(61, 220, 132, 0.14); color: var(--green); }
.tag.BIO { background: rgba(199, 125, 255, 0.16); color: #c77dff; }
.item a { color: var(--text); text-decoration: none; font-weight: 500; }
.item a:hover { color: var(--amber); }
.item .meta { font-size: 12px; color: var(--dim); margin-top: 2px; }
.item time { font: 12px "JetBrains Mono", monospace; color: var(--dim); white-space: nowrap; }
.more {
  padding: 14px 18px;
  background: var(--panel2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Home-Front Cards Masonry */
.grid {
  columns: 2 360px;
  column-gap: 16px;
}
.grid.masonry-fit {
  columns: unset;
  position: relative;
  width: calc(100vw - 32px);
  max-width: 1800px;
  margin-left: 50%;
  transform: translateX(-50%);
}
.grid.masonry-fit .card {
  position: absolute;
  display: block;
  margin-bottom: 0;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease;
}
.card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card h3 { font-size: 20px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.card .sub { color: var(--dim); font-size: 13px; margin-bottom: 12px; line-height: 1.4; }
.big { font: 700 36px/1.05 "Barlow Condensed", sans-serif; color: var(--amber); }
.rows { font-size: 13.5px; }
.rows div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.rows div span:last-child { font-family: "JetBrains Mono", monospace; text-align: right; margin-left: auto; }
.st { font: 600 11px "JetBrains Mono", monospace; padding: 2px 7px; border-radius: 4px; }
.st.STABLE { color: var(--green); background: rgba(61, 220, 132, 0.1); }
.st.TIGHTENING { color: var(--yellow); background: rgba(255, 201, 51, 0.12); }
.st.DISRUPTED { color: var(--red); background: rgba(255, 69, 69, 0.12); }
.card.hot {
  border-color: rgba(255, 69, 69, 0.55);
  background: linear-gradient(180deg, rgba(255, 69, 69, 0.10), var(--panel) 55%);
  box-shadow: 0 0 28px rgba(255, 69, 69, 0.12);
}
.card.hot h3 { color: var(--red); }
.card.warm {
  border-color: rgba(255, 138, 61, 0.5);
  background: linear-gradient(180deg, rgba(255, 138, 61, 0.09), var(--panel) 55%);
}
.card.warm h3 { color: var(--amber); }

/* Card Outbreak Hero */
.ob-hero {
  border: 1px solid rgba(255, 69, 69, 0.45);
  background: rgba(255, 69, 69, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.ob-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 11px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  padding: 3px 8px;
}
.ob-badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.ob-name { font: 700 28px/1.05 "Barlow Condensed", sans-serif; color: var(--red); text-transform: uppercase; margin: 8px 0 2px; }
.ob-where { color: var(--dim); font-size: 13px; }
.ob-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.ob-stats b { display: block; font: 700 24px/1 "Barlow Condensed", sans-serif; color: var(--red); }
.ob-stats span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.ob-foot { font-size: 12px; color: var(--dim); }

/* Power Card */
.pw-hero {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.pw-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 11px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 3px 8px;
  color: #07120c;
  background: var(--green);
}
.pw-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.card.hot .pw-badge { color: #fff; background: var(--red); }
.card.warm .pw-badge { color: #1a0d04; background: var(--amber); }
.pw-num { font: 700 42px/1 "Barlow Condensed", sans-serif; color: var(--text); margin: 10px 0 2px; }
.pw-lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.pw-bars div { display: grid; grid-template-columns: 80px 1fr 64px; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.pw-bars em { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(255, 138, 61, 0.7), var(--amber)); }
.pw-bars span:last-child { font: 12px "JetBrains Mono", monospace; text-align: right; }

/* Shelf watch expandable details */
.sw-cat { border-top: 1px solid var(--line); }
.sw-cat summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 6px 0;
  cursor: pointer;
}
.sw-cat summary::-webkit-details-marker { display: none; }
.sw-arr { display: inline-block; margin-left: 6px; font-style: normal; color: var(--dim); transition: transform 0.15s; }
.sw-cat[open] .sw-arr { transform: rotate(180deg); }
.rows .sw-body {
  display: block;
  border-top: 0;
  padding: 4px 0 8px 10px;
  border-left: 2px solid var(--amber-dim);
  margin: 0 0 6px 2px;
}
.rows .sw-top { display: flex !important; justify-content: space-between; gap: 8px; font-size: 13px; }
.sw-why { font-size: 12px; color: var(--dim); margin-top: 3px; line-height: 1.35; }

/* Card locked overlay */
.card.locked .blur { filter: blur(6px); opacity: 0.55; pointer-events: none; user-select: none; }
.card.locked .veil {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(14, 18, 21, 0), var(--panel) 45%);
}
.card.locked .veil strong { display: block; font: 700 22px "Barlow Condensed", sans-serif; color: var(--text); text-transform: uppercase; margin-bottom: 6px; }

/* Members Chat */
.chat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-log { height: clamp(260px, 50dvh, 420px); overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.cmsg { line-height: 1.45; }
.cmsg .who { font: 600 13px Inter, sans-serif; color: var(--amber); }
.cmsg .who.me { color: var(--green); }
.cmsg .badge { font: 700 10px "JetBrains Mono", monospace; background: rgba(255, 138, 61, 0.15); color: var(--amber); padding: 1px 5px; border-radius: 3px; margin-left: 5px; }
.cmsg time { font: 11px "JetBrains Mono", monospace; color: var(--dim); margin-left: 6px; }
.cmsg .body { white-space: pre-wrap; word-break: break-word; color: #dfe5e8; font-size: 14px; margin-top: 2px; }
.chat-bar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel2); align-items: stretch; }
.chat-bar input {
  width: 140px;
  flex: none;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0a0d10;
  color: var(--amber);
  font: 600 13px "JetBrains Mono", monospace;
}
.chat-bar input:focus { border-color: var(--amber); outline: none; }
.chat-bar textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  height: 46px;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0a0d10;
  color: var(--text);
  font: 14px Inter, sans-serif;
}
.chat-bar textarea:focus { border-color: var(--amber); outline: none; }
.chat-bar .btn { padding: 10px 20px; }
.chat-note { font-size: 12px; color: var(--dim); padding: 0 14px 10px; background: var(--panel2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.chat-status { color: var(--amber); font-family: "JetBrains Mono", monospace; }
.chat-status.err { color: var(--red); }

/* Pricing & Access Box */
.pricing { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.price-card {
  background: linear-gradient(180deg, #1a1109, var(--panel));
  border: 1px solid var(--amber-dim);
  border-radius: 14px;
  padding: 26px;
}
.price { font: 700 clamp(2.75rem, 2rem + 3vw, 4rem)/1 "Barlow Condensed", sans-serif; color: var(--text); }
.price small { font: 500 18px Inter, sans-serif; color: var(--dim); }
.ticks { list-style: none; padding: 0; margin: 18px 0 22px; }
.ticks li { padding: 6px 0; font-size: 14px; }
.ticks li:before { content: "✓  "; color: var(--amber); font-weight: 700; }
.code-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.code-box input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0a0d10;
  color: var(--text);
  font: 600 16px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 12px 0;
}
.code-box input:focus { border-color: var(--amber); outline: none; }
.msg { min-height: 20px; font-size: 14px; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.spots { margin: 16px 0 4px; }
.spots .track { height: 10px; border-radius: 5px; background: #1c2429; overflow: hidden; }
.spots .fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--red)); width: 14%; transition: width 0.6s; }
.spots .txt { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font: 600 13px "JetBrains Mono", monospace; margin-top: 7px; color: var(--dim); }
.spots .txt b { color: var(--amber); }

/* Details / FAQ */
details { border-top: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--text); }
details p { color: #c3ccd1; margin: 8px 0 0; font-size: 14px; }

/* Why Grid */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.why-card { border-left: 3px solid var(--amber); padding: 6px 0 6px 16px; }
.why-card p { margin: 0; color: #c3ccd1; font-size: 14px; }

/* Maplibre Popup Dark Theme & Mobile Guard */
.maplibregl-popup { max-width: calc(100vw - 24px) !important; z-index: 600; }
.maplibregl-popup-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 28px 12px 14px;
  font: 13px/1.45 Inter, system-ui, sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
}
.maplibregl-popup-content a { color: var(--amber); }
.maplibregl-popup-close-button {
  color: var(--dim);
  font-size: 18px;
  padding: 4px 8px;
  min-block-size: auto;
  min-inline-size: auto;
}
.maplibregl-popup-close-button:hover { color: var(--text); background: transparent; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--panel); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--panel); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel); }
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel); }
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel); }

/* Banner & Footer */
.banner { display: none; background: rgba(61, 220, 132, 0.1); border: 1px solid rgba(61, 220, 132, 0.35); color: #c9f5dc; border-radius: 10px; padding: 14px 16px; margin-top: 18px; }
footer { border-top: 1px solid var(--line); padding: 28px 0 max(44px, env(safe-area-inset-bottom, 0px)); color: var(--dim); font-size: 13px; margin-top: 40px; }

/* Projection Control Button */
.proj-btn {
  font: 600 12px Inter, sans-serif;
  color: var(--text);
  background: #10161a;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
.proj-btn:hover { border-color: var(--amber); color: var(--amber); }

/* Map Markers Styling */
.emo-mk {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 5px rgba(0, 0, 0, 0.6));
  cursor: pointer;
  user-select: none;
}
.emo-mk.fresh { animation: boom 1.8s ease-in-out infinite; }
@keyframes boom { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
.siren-n {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #0b0f12;
  border: 1px solid #ff4545;
  color: #fff;
  font: 700 10px/14px "JetBrains Mono", monospace;
  text-align: center;
}
.fc {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 209, 193, 0.28);
  border: 2px solid #00d1c1;
  color: #e8fffc;
  font: 700 11px "JetBrains Mono", monospace;
  box-shadow: 0 0 0 4px rgba(0, 209, 193, 0.12);
  cursor: pointer;
}
.fc:hover { background: rgba(0, 209, 193, 0.45); }

/* Unlocked toggles */
.unlocked-only { display: none; }
body.unlocked .unlocked-only { display: initial; }
body.unlocked .locked-only { display: none !important; }

/* Responsive adjustments */
@media (max-width: 960px) {
  .pricing, .plan-grid, .why-grid { grid-template-columns: 1fr; }
  .mx-row.r6, .mx-row.r5, .mx-row.r4, .mx-row.r3 { grid-template-columns: repeat(2, 1fr); }
  .mx-row.r5 > .mx:last-child:nth-child(odd), .mx-row.r3 > .mx:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #map { height: clamp(320px, 52dvh, 440px); }
}
@media (max-width: 640px) {
  section { padding: 20px 0; }
  .grid { columns: 1; }
  .top .wrap { gap: 8px; }
  .brand { font-size: 17px; }
  .live { margin-left: 4px; font-size: 10px; }
  .top .nav-actions { width: auto; justify-content: flex-end; }
  .top .nav-actions .btn { padding: 6px 12px; font-size: 12px; }
  .mx-threat { grid-template-columns: 1fr; gap: 8px; }
  .mx-tr { gap: 6px 12px; }
  .mx-tr span:not(:last-child)::after { content: none; margin: 0; }
  .mx-v { font-size: 16px; }
  #map { height: clamp(280px, 48dvh, 380px); }
  .chips { gap: 6px; }
  .chip { font-size: 12px; padding: 6px 10px; max-width: 100%; min-block-size: 38px; }
  .plan-btn { margin-left: 0; width: 100%; justify-content: center; }
  .plan { padding: 14px; }
  .plan-route .btn { width: 100%; justify-content: center; margin-right: 0; }
  .item { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; }
  .item .tag { justify-self: start; }
  .item > div { grid-column: 1 / -1; min-width: 0; }
  .item time { order: 0; align-self: center; }
  .card { padding: 16px; min-height: 0; }
  .pw-bars div { grid-template-columns: 56px 1fr 68px; gap: 6px; font-size: 12px; }
  .ob-stats { grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); }
  .chat-bar { flex-direction: column; }
  .chat-bar input { width: 100%; }
  .chat-bar .btn { width: 100%; justify-content: center; }
}
