:root {
  color-scheme: dark;
  --bg: #060a10;
  --panel: #0c131c;
  --border: #1b2735;
  --muted: #7f8e9f;
  --text: #e8eef5;
  --cyan: #35d5cf;
  --green: #49d99b;
  --red: #ff6575;
  --amber: #ffb75e;
  --violet: #9885ff;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; min-width: 360px; color: var(--text); font-size: 13px; background: radial-gradient(1200px 500px at 50% -120px, #0f2230 0%, transparent 70%), var(--bg); }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.mono { font-family: "DM Mono", monospace; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1200; height: 60px; display: flex; align-items: center; gap: 28px; padding: 0 28px; background: #070c12d9; backdrop-filter: blur(14px); border-bottom: 1px solid #16222e; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 7px); grid-template-rows: repeat(2, 7px); gap: 3px; transform: rotate(-8deg); }
.brand-mark span { background: var(--cyan); border-radius: 2px; box-shadow: 0 0 9px #30d5cf55; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .5; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.9px; }
.brand-name span { color: var(--cyan); }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 13px; border-radius: 6px; color: #93a1b0; font-weight: 600; font-size: 13px; transition: color .15s, background .15s; }
.topnav a:hover { color: #e1ecf5; background: #121c27; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.infocon-pill, .live-pill { font: 500 10px "DM Mono", monospace; letter-spacing: .7px; padding: 6px 10px; border-radius: 5px; border: 1px solid #2a3846; color: #aab7c4; background: #101923; white-space: nowrap; }
.infocon-pill strong { margin-left: 4px; }
.infocon-pill.green strong { color: var(--green); }.infocon-pill.yellow strong { color: #f2dc6a; }.infocon-pill.orange strong { color: var(--amber); }.infocon-pill.red strong { color: var(--red); }
.live-pill { color: #8fe3bd; border-color: #24473a; background: #11201c; }
.live-pill span { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; animation: blink 1.8s ease-in-out infinite; }
.live-pill.offline { color: #ff9aa5; border-color: #55303a; background: #231519; }
.live-pill.offline span { background: var(--red); animation: none; }
.updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.updated strong { color: #c9d4df; font: 500 11px "DM Mono", monospace; margin-left: 4px; }
.icon-button { width: 30px; height: 30px; border: 1px solid #283542; border-radius: 6px; background: #101923; color: #8a99a8; font-size: 16px; }
.icon-button:hover { color: var(--cyan); border-color: #34716f; }
.banner { margin: 14px 28px 0; padding: 10px 14px; border: 1px solid #54452c; background: #201c15; color: #e5c98f; border-radius: 6px; font-size: 12px; }

.page { max-width: 1800px; margin: 0 auto; padding: 16px 28px 28px; }

/* ---------- Hero: header bar + map + feed column ---------- */
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; margin: 4px 2px 16px; }
.eyebrow { color: #8fa1b2; font: 500 10px "DM Mono", monospace; letter-spacing: 1.2px; }
.live-indicator { display: inline-block; width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px #35d5cf; margin-right: 6px; animation: blink 1.8s ease-in-out infinite; }
h1 { font-size: 28px; line-height: 1.15; margin: 8px 0 0; letter-spacing: -.8px; }
h1 span { color: var(--cyan); font-weight: 600; }
.hero-stats { display: flex; gap: 34px; margin-right: auto; }
.hero-stats strong { display: block; font: 500 26px "DM Mono", monospace; letter-spacing: -1px; color: #f1f7fc; }
.hero-stats span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.hero-stats b { color: var(--cyan); font-weight: 600; }
.hero-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.map-card, .feed-card { background: linear-gradient(180deg, #0e1620, #0b121a); border: 1px solid #1d2c3a; border-radius: 12px; overflow: hidden; }
.map-card { min-width: 0; }
.hero-map { position: relative; width: 100%; aspect-ratio: 2 / 1; max-height: 76vh; background: #070d14; }
.hero-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; box-shadow: inset 0 0 50px 4px #04070c; }
#world-map { position: absolute; inset: 0; z-index: 0; background: radial-gradient(ellipse at 50% 45%, #0e1d29 0%, #080f17 100%); }
.leaflet-container { font-family: "Manrope", sans-serif; background: #0a141d; outline: none; }
.leaflet-interactive { outline: none; }
.leaflet-control-zoom { border: 1px solid #35414c !important; box-shadow: none !important; margin: 0 12px 12px 0 !important; }
.leaflet-control-zoom a { background: #111a24 !important; color: #bdc9d3 !important; border-color: #35414c !important; }
.arc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 450; }
.target-marker { display: block; position: relative; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: #ffffff22; box-shadow: 0 0 14px #fff8; }
.target-marker::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }

.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 9px; top: 50%; transform: translateY(-58%); color: #8492a0; pointer-events: none; font-size: 12px; }
.select-wrap select { appearance: none; background: #0f1822; border: 1px solid #2a3744; border-radius: 6px; color: #c1ccd8; font-size: 12px; padding: 8px 26px 8px 10px; outline: none; max-width: 230px; }
.select-wrap select:focus-visible { border-color: #378c89; }
.toggle-button { height: 33px; padding: 0 12px; border: 1px solid #2a3744; border-radius: 6px; background: #0f1822; color: #8fa0b0; font-size: 12px; font-weight: 600; }
.toggle-button:hover { color: var(--cyan); }
.toggle-button.active { color: #bff6f2; border-color: #2f7471; background: #12292d; }

.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-top: 1px solid #1a2530; font-size: 11px; color: #a3b0bd; }
.legend-title { color: #6f7f90; font: 10px "DM Mono", monospace; letter-spacing: .8px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 8px currentColor; }
.legend-warn { color: #e5c98f; background: #251f14; border: 1px solid #54452c; border-radius: 4px; padding: 3px 8px; font-size: 10.5px; margin-left: auto; }
.legend-scale { display: inline-flex; align-items: center; gap: 8px; color: #6f7f90; font-size: 10px; }
.scale-bar { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #1e2d3d, #20a8aa); }

.feed-card { position: relative; }
.feed-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }
.feed-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 8px; }
.feed-head h2 { font-size: 14px; margin: 0; }
.feed-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.count-badge { color: #adbbc8; background: #1b2732; font: 11px "DM Mono", monospace; padding: 3px 8px; border-radius: 9px; }
.feed-list { flex: 1; overflow-y: auto; padding: 0 10px; scrollbar-width: thin; scrollbar-color: #26384a transparent; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid #ffffff0d; animation: slide-in .5s ease; }
.feed-bar { width: 3px; height: 30px; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.feed-main { min-width: 0; flex: 1; }
.feed-ip { font: 500 12px "DM Mono", monospace; color: #e1eaf2; }
.feed-meta { color: #8493a4; font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { color: #7f8e9e; font: 10px "DM Mono", monospace; white-space: nowrap; }
.feed-foot { padding: 9px 16px; border-top: 1px solid #ffffff10; color: #6f7e8f; font-size: 10px; line-height: 1.4; }
.empty-note { color: #6f7e8f; font-size: 12px; padding: 16px 6px; line-height: 1.5; }

.map-tip.leaflet-tooltip { background: #0f1a25; color: #e8eef5; border: 1px solid #33404d; box-shadow: 0 7px 24px #0008; padding: 8px 10px; }
.map-tip.leaflet-tooltip-top::before { border-top-color: #33404d; }
.tip strong { font-size: 12px; }
.tip-count { color: var(--cyan); font: 11px "DM Mono", monospace; margin-top: 3px; }
.map-disclaimer { margin: 10px 4px 0; color: #6f7e8f; font-size: 11px; line-height: 1.6; }
.map-disclaimer strong { color: #a9b8c6; font-weight: 600; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(180deg, #0e1620, #0b121a); border: 1px solid var(--border); border-radius: 12px; }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; flex: 0 0 auto; }
.kpi-icon.cyan { color: var(--cyan); background: #12282c; }.kpi-icon.red { color: var(--red); background: #2b1b22; }.kpi-icon.violet { color: var(--violet); background: #211d33; }.kpi-icon.green { color: var(--green); background: #14281f; }
.kpi-label { display: block; color: #96a5b4; font-size: 11.5px; }
.kpi strong { display: block; font-size: 26px; letter-spacing: -.8px; margin: 3px 0 1px; }
.kpi em { font-style: normal; color: #6f7f90; font-size: 11px; }

/* ---------- Sections & cards ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 0 2px 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; letter-spacing: -.4px; margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-news { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.news-list { padding: 0 14px 6px; }
.news-item { display: flex; gap: 12px; align-items: baseline; padding: 11px 4px; border-top: 1px solid #1a2530; }
.news-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: #dbe5ee; }
a.news-title:hover { color: var(--cyan); }
.news-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 112px; }
.news-source { font: 500 10px "DM Mono", monospace; color: #8fe3de; letter-spacing: .3px; }
.news-time { font: 10px "DM Mono", monospace; color: #6f7e8f; }
.sub-heading { color: #6c7b8c; font: 10px "DM Mono", monospace; letter-spacing: .8px; text-transform: uppercase; padding: 14px 18px 4px; border-top: 1px solid #1a2530; margin-top: 6px; }
.tag-cyan { color: #8fe3de; background: #12292d; }
.tag-violet { color: #c6bbff; background: #221e33; }
.feed-tags { display: flex; gap: 4px; margin-top: 4px; }
.card { background: linear-gradient(180deg, #0e1620, #0b121a); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; }
.card-head h3 { margin: 0; font-size: 14px; letter-spacing: -.1px; }
.card-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.card-note { margin: 4px 18px 16px; color: #6f7e8f; font-size: 11px; line-height: 1.5; }
.seg { display: inline-flex; background: #0f1822; border: 1px solid #2a3744; border-radius: 6px; padding: 2px; flex: 0 0 auto; }
.seg-btn { border: 0; background: none; padding: 4px 9px; border-radius: 4px; color: #8fa0b0; font-size: 11px; font-weight: 600; }
.seg-btn.active { background: #17313a; color: #bff6f2; }

.rank-list { padding: 0 18px 18px; display: grid; gap: 12px; }
.rank-row { border-radius: 6px; }
.rank-row.clickable { cursor: pointer; padding: 4px 6px; margin: -4px -6px; transition: background .15s; }
.rank-row.clickable:hover, .rank-row.selected { background: #14212b; }
.rank-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.rank-name { color: #d2dce6; display: flex; align-items: center; gap: 9px; min-width: 0; }
.rank-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-pos { color: #5f6f80; font: 11px "DM Mono", monospace; width: 16px; flex: 0 0 auto; }
.rank-value { color: #93a2b1; font: 11px "DM Mono", monospace; white-space: nowrap; }
.rank-track { height: 5px; background: #16212c; border-radius: 3px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.cc-badge { font: 10px "DM Mono", monospace; color: #a5b6c5; background: #1a2631; border-radius: 3px; padding: 2px 5px; min-width: 25px; text-align: center; flex: 0 0 auto; }
.info-box { margin: 0 18px 18px; padding: 14px; border: 1px dashed #34495b; border-radius: 8px; background: #0f1822; color: #9aa9b8; font-size: 12px; line-height: 1.6; }
.info-box strong { color: #d4dfe9; }
.info-box code { font: 11px "DM Mono", monospace; background: #17232f; padding: 2px 5px; border-radius: 3px; color: #bff6f2; }
.info-box ol { margin: 8px 0 0; padding-left: 18px; }

.chart-box { padding: 0 14px; }
#hourly-chart { width: 100%; height: auto; }
.grid-line { stroke: #223040; stroke-width: 1; stroke-dasharray: 3 4; }
.bar { fill: #2b6f78; }.bar-now { fill: var(--cyan); }
.bar-value { fill: #9eadbb; font: 10px "DM Mono", monospace; }
.axis-label { fill: #6c7b8c; font: 10px "DM Mono", monospace; }

.kev-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 10px; }
.kev-stat { background: #111b25; border-radius: 8px; padding: 10px 11px; }
.kev-stat strong { display: block; font-size: 17px; letter-spacing: -.4px; }
.kev-stat span { color: #7f8e9e; font-size: 10.5px; }
.kev-list { padding: 0 14px 8px; }
.kev-item { border-top: 1px solid #1a2530; padding: 10px 4px; }
.kev-head { display: flex; align-items: center; gap: 8px; }
.kev-cve { font: 500 12px "DM Mono", monospace; color: var(--cyan); }
.kev-cve:hover { text-decoration: underline; }
.kev-date { margin-left: auto; color: #6f7e8f; font: 10px "DM Mono", monospace; }
.kev-name { margin-top: 4px; font-size: 12px; color: #d3dde7; font-weight: 600; }
.kev-desc { margin-top: 2px; font-size: 11px; color: #7f8e9e; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font: 9px "DM Mono", monospace; padding: 2px 6px; border-radius: 3px; letter-spacing: .4px; }
.tag-red { color: #ff9aa5; background: #2b1c23; }

.mini-list { padding: 0 16px 8px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid #1a2530; }
.mini-main { flex: 1; min-width: 0; }
.mini-main .mono { font-size: 12px; color: #dfe8f0; }
.mini-sub { color: #7f8e9e; font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-value { color: #98a7b5; font: 10px "DM Mono", monospace; white-space: nowrap; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.state-dot.hot { background: var(--red); box-shadow: 0 0 8px #ff657590; }.state-dot.off { background: #4a5663; }
.infocon-card { margin: 4px 18px 18px; padding: 14px; border-radius: 8px; background: #111b25; display: flex; align-items: center; gap: 12px; }
.infocon-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px currentColor; color: var(--green); flex: 0 0 auto; }
.infocon-dot.yellow { background: #f2dc6a; color: #f2dc6a; }.infocon-dot.orange { background: var(--amber); color: var(--amber); }.infocon-dot.red { background: var(--red); color: var(--red); }
.infocon-card strong { display: block; font-size: 13px; }.infocon-card span { color: #7f8e9e; font-size: 11px; line-height: 1.5; }

.table-wrap { overflow-x: auto; padding: 4px 10px 10px; }
.source-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.source-table th { text-align: left; font: 500 10px "DM Mono", monospace; letter-spacing: .7px; color: #6c7b8c; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid #1a2530; white-space: nowrap; }
.source-table td { padding: 12px; border-bottom: 1px solid #16202a; }
.source-table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; }
.src-link { font-weight: 600; color: #d6e0e9; }.src-link:hover { color: var(--cyan); }
.chip { font: 500 10px "DM Mono", monospace; padding: 3px 9px; border-radius: 10px; letter-spacing: .3px; white-space: nowrap; }
.chip-ok { color: #8fe3bd; background: #11201c; }.chip-warn { color: #f0c987; background: #251f14; }.chip-bad { color: #ff9aa5; background: #2b1c23; }.chip-wait { color: #9aa8b6; background: #18222c; }.chip-off { color: #8795a4; background: #151e27; }
.page-footer { display: flex; justify-content: space-between; gap: 24px; color: #647588; font-size: 11px; padding: 28px 2px 0; line-height: 1.6; }
.page-footer span:last-child { text-align: right; max-width: 45%; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topnav { display: none; }
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .hero-map { max-height: none; }
  .feed-card { height: 340px; }
  .grid-news { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child:nth-child(odd) { grid-column: span 2; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 12px; }
  .updated, .infocon-pill { display: none; }
  .page { padding: 12px 12px 24px; }
  .map-legend { gap: 6px 12px; padding: 10px 12px; font-size: 10.5px; }
  .legend-warn { margin-left: 0; }
  .legend-scale { margin-left: auto; }
  .icon-button { width: 40px; height: 40px; }
  .toggle-button { height: 40px; }
  .select-wrap select { padding: 11px 28px 11px 10px; }
  .hero-controls { gap: 6px; }
  .hero-controls .select-wrap { flex: 1 1 140px; }
  .hero-controls .select-wrap select { width: 100%; max-width: none; }
  .news-item { flex-direction: column; gap: 4px; }
  .news-meta { flex-direction: row; gap: 8px; align-items: center; }
  h1 { font-size: 21px; }
  .hero-stats { gap: 18px; flex-wrap: wrap; }
  .hero-stats strong { font-size: 20px; }
  .hero-controls { width: 100%; }
  .grid-4, .grid-3, .kpis { grid-template-columns: minmax(0, 1fr); }
  .grid-3 > :last-child:nth-child(odd) { grid-column: auto; }
  .page-footer { flex-direction: column; }.page-footer span:last-child { text-align: left; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition: none !important; } }
