/* ============================================================
   Aegis — Global Intelligence Dashboard
   Dark HUD aesthetic, mobile-first, 3-col desktop / bottom tab mobile
   ============================================================ */

:root {
  --bg: #0a0a0f;
  --bg-2: #11101a;
  --bg-3: #15131f;
  --ink: #e8e6f0;
  --ink-dim: #9a98ad;
  --ink-mute: #5a5870;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --magenta: #ff2d8a;
  --cyan: #00e5ff;
  --gold: #f5d472;
  --green: #34d399;
  --red: #fb7185;
  --orange: #fb923c;
  --purple: #a855f7;
  --radius: 14px;
  --radius-lg: 22px;
  --pad: clamp(14px, 2vw, 28px);
  --ease: cubic-bezier(.65, .05, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -webkit-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 800px 600px at 20% 0%, rgba(0, 229, 255, .04), transparent 60%),
    radial-gradient(ellipse 700px 500px at 80% 100%, rgba(255, 45, 138, .04), transparent 60%),
    var(--bg);
}
canvas, img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: 0 0; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: 0; }

/* PRELOADER */
.pre {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
.pre.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.pre__row { display: flex; align-items: center; gap: 14px; }
.pre__brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: .22em; background: linear-gradient(135deg, #00e5ff, #ff2d8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pre__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 0 4px rgba(255, 45, 138, .2); animation: pulse 1.6s var(--ease) infinite; }
.pre__sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .22em; color: var(--ink-mute); }
.pre__bar { width: 220px; height: 2px; background: rgba(255, 255, 255, .08); border-radius: 1px; overflow: hidden; }
.pre__fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #00e5ff, #ff2d8a); transition: width .3s var(--ease-out); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 45, 138, .15); } 50% { box-shadow: 0 0 0 10px rgba(255, 45, 138, 0); } }

/* TOP NAV — glass pill */
.top {
  position: sticky; top: 8px; z-index: 200;
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  padding: 10px var(--pad);
  margin: 8px var(--pad) 0;
  background: rgba(15, 14, 24, .72);
  backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  border: 1px solid var(--line-2); border-radius: 999px;
}
.top__brand { display: inline-flex; align-items: center; gap: 10px; }
.top__mark { width: 32px; height: 32px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 8px; }
.top__txt { display: flex; flex-direction: column; line-height: 1; }
.top__txt strong { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .14em; }
.top__txt i { font-style: normal; font-size: 10px; color: var(--ink-dim); letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }

.top__tabs { display: flex; gap: 4px; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.top__tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; font-size: 12px; color: var(--ink-dim);
  border: 1px solid transparent; border-radius: 999px;
  transition: all .2s var(--ease); white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.tab.is-on { color: var(--bg); background: linear-gradient(135deg, #00e5ff, #ff2d8a); border-color: transparent; font-weight: 600; }
.tab.is-on .tab__c { background: rgba(0, 0, 0, .18); color: rgba(0, 0, 0, .65); }
.tab__c { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 1px 6px; background: rgba(255, 255, 255, .06); border-radius: 8px; color: var(--ink-mute); }

.top__status { display: flex; align-items: center; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); }
.top__time { letter-spacing: .06em; color: var(--ink); }
.top__zone { color: var(--ink-mute); font-size: 10px; padding: 2px 8px; background: rgba(255, 255, 255, .04); border-radius: 999px; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); flex-shrink: 0; }
.dot--live { background: var(--magenta); box-shadow: 0 0 0 3px rgba(255, 45, 138, .15); animation: pulse 1.6s var(--ease) infinite; }

/* GRID */
.grid {
  display: grid; gap: 14px; padding: 14px var(--pad) 100px;
  max-width: 1700px; margin: 0 auto;
  grid-template-columns: 280px 1fr 340px;
  grid-template-areas:
    "lcol ccol rcol"
    "full  full  full";
}
.lcol { grid-area: lcol; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ccol { grid-area: ccol; min-width: 0; }
.rcol { grid-area: rcol; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.full { grid-area: full; display: none; }
.full.is-on { display: block; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: 1fr; grid-template-areas: "ccol" "lcol" "rcol" "full"; }
}

/* PANEL base — glass cards */
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .005));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  position: relative;
  transition: border-color .3s, background .3s;
}
.panel:hover { border-color: rgba(255, 255, 255, .22); }
.panel__h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel__k { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .16em; color: var(--ink-mute); text-transform: uppercase; }
.panel__sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); }
.panel__live { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .12em; color: var(--ink-dim); }
.panel--map { padding: 14px; }
.panel--mini { padding: 14px; gap: 10px; }

/* COUNTERS (left col) */
.counters { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.counter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 14px 16px; background: var(--bg-2); cursor: pointer; transition: background .2s, transform .2s var(--ease-out); }
.counter:hover { background: var(--bg-3); transform: translateX(2px); }
.counter__k { font-size: 12px; color: var(--ink-dim); }
.counter__v { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; grid-row: 1 / span 2; }
.counter__v.mono { font-size: 14px; letter-spacing: 0; word-break: break-all; }
.counter__s { grid-column: 1; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .12em; color: var(--ink-mute); text-transform: uppercase; }

/* PRESETS */
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset {
  padding: 8px 10px; font-size: 11px; color: var(--ink-dim);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 8px;
  transition: all .2s var(--ease); font-family: 'JetBrains Mono', monospace; letter-spacing: .04em;
}
.preset:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, .06); }
.preset.is-on { color: var(--bg); background: linear-gradient(135deg, #00e5ff, #ff2d8a); border-color: transparent; font-weight: 600; }

/* SOURCES list */
.srcs { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-dim); }
.srcs li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.srcs__d { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* GLOBE — orthographic, draggable */
.globe { position: relative; width: 100%; aspect-ratio: 1 / 1; max-width: 720px; margin: 0 auto; background: radial-gradient(circle at center, rgba(0, 229, 255, .08) 0%, rgba(168, 85, 247, .04) 40%, transparent 70%), #07060d; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); cursor: grab; user-select: none; }
.globe:active { cursor: grabbing; }
.globe svg { width: 100%; height: 100%; display: block; }
.globe .sphere { fill: #0a0814; stroke: var(--cyan); stroke-opacity: .25; stroke-width: 1.2; }
.globe .graticule { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: .5; }
.globe path.country { fill: rgba(255, 255, 255, .07); stroke: rgba(255, 255, 255, .15); stroke-width: .5; transition: fill .4s, stroke .4s; }
.globe path.country:hover { fill: rgba(0, 229, 255, .22); stroke: rgba(0, 229, 255, .55); }
.globe .qdot, .globe .fdot, .globe .edot, .globe .wdot { cursor: pointer; transition: opacity .3s; }
.globe .qdot:hover, .globe .fdot:hover, .globe .edot:hover, .globe .wdot:hover { opacity: 1; }
.globe .paris-dot { fill: var(--gold); stroke: rgba(245, 212, 114, .4); stroke-width: 2; filter: drop-shadow(0 0 6px var(--gold)); }
.globe .paris-pulse { fill: none; stroke: var(--gold); stroke-width: 1.5; opacity: .6; transform-origin: center; transform-box: fill-box; animation: parisPulse 2.6s var(--ease) infinite; }
.globe .paris-label { font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; fill: var(--gold); letter-spacing: .2em; paint-order: stroke; stroke: rgba(10, 10, 15, .9); stroke-width: 3; }
@keyframes parisPulse { 0% { r: 8; opacity: .8; } 100% { r: 28; opacity: 0; } }

.globe__hud { position: absolute; right: 12px; top: 12px; padding: 10px 14px; background: rgba(10, 10, 15, .78); border: 1px solid var(--line-2); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); }
.hud__row { display: flex; gap: 8px; align-items: baseline; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.hud__row b { color: var(--ink-mute); font-size: 9px; letter-spacing: .14em; width: 36px; }
.hud__row span { color: var(--ink); }

.globe__zoom { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 10; display: flex; gap: 4px; padding: 4px; background: rgba(10, 10, 15, .82); border: 1px solid var(--line-2); border-radius: 999px; backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.gzoom { width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 50%; color: var(--ink); font-size: 16px; font-weight: 600; transition: background .2s, border-color .2s, color .2s; }
.gzoom:hover { background: rgba(255, 255, 255, .08); border-color: var(--line-2); color: var(--cyan); }

.globe__hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 10; padding: 7px 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .14em; color: var(--ink); text-transform: uppercase; background: rgba(10, 10, 15, .82); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 12px 14px; padding: 8px 0 0; font-size: 11px; color: var(--ink-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: 999px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* LIVE DESK (right col) */
.desk__counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.desk__counts > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 10px; }
.desk__counts b { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.desk__counts span { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; color: var(--ink-mute); text-transform: uppercase; }
.desk__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.desk__tabs::-webkit-scrollbar { display: none; }
.dt { padding: 5px 10px; font-size: 11px; color: var(--ink-dim); border-radius: 6px; transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.dt:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.dt.is-on { color: var(--bg); background: linear-gradient(135deg, #00e5ff, #ff2d8a); font-weight: 600; }
.desk__list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.desk__list::-webkit-scrollbar { width: 6px; }
.desk__list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }
.desk__item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 10px; transition: background .2s, border-color .2s, transform .2s var(--ease-out); cursor: pointer; }
.desk__item:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-2); transform: translateX(2px); }
.desk__row { display: flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); }
.desk__row .sev { padding: 2px 6px; border-radius: 4px; font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.sev--crit { background: rgba(251, 113, 133, .15); color: var(--red); }
.sev--high { background: rgba(251, 146, 60, .15); color: var(--orange); }
.sev--med { background: rgba(245, 212, 114, .15); color: var(--gold); }
.sev--low { background: rgba(52, 211, 153, .15); color: var(--green); }
.desk__row .src { margin-left: auto; padding: 2px 6px; background: rgba(255, 255, 255, .04); border-radius: 4px; }
.desk__row .ts { font-size: 9px; color: var(--ink-mute); }
.desk__title { font-size: 12px; color: var(--ink); line-height: 1.35; }
.desk__title b { font-weight: 500; color: var(--ink); }
.desk__meta { display: flex; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); }
.desk__meta span { display: inline-flex; align-items: center; gap: 3px; }

/* MARKETS mini */
.mkts { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mkt { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg-2); transition: background .2s; }
.mkt:hover { background: var(--bg-3); }
.mkt__n { font-weight: 600; font-size: 12px; }
.mkt__p { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.mkt__c { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.mkt__c.up { background: rgba(52, 211, 153, .12); color: var(--green); }
.mkt__c.down { background: rgba(251, 113, 133, .12); color: var(--red); }

/* IP PANEL */
.ip { display: flex; flex-direction: column; gap: 12px; }
.ip__big { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(135deg, rgba(0, 229, 255, .08), rgba(168, 85, 247, .08)); border: 1px solid var(--line); border-radius: 12px; }
.ip__big b { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.ip__big span { font-size: 24px; }
.ip__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ip__grid > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--bg-2); min-width: 0; }
.ip__grid > div span { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; color: var(--ink-mute); text-transform: uppercase; }
.ip__grid > div b { font-size: 12px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip__grid > div b.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.ip__form { display: flex; gap: 6px; }
.ip__form input { flex: 1; padding: 10px 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 12px; outline: 0; transition: border-color .2s; }
.ip__form input:focus { border-color: var(--cyan); }
.ip__form input::placeholder { color: var(--ink-mute); }
.ip__form button { padding: 10px 14px; font-size: 11px; font-weight: 700; letter-spacing: .12em; background: linear-gradient(135deg, #00e5ff, #ff2d8a); color: var(--bg); border-radius: 8px; transition: filter .2s, transform .15s var(--ease-out); }
.ip__form button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ip__form button:active { transform: translateY(0); }
.ip__full { padding: 20px; min-height: 120px; }
.ip__full .hint { color: var(--ink-dim); font-size: 13px; }
.ip__result { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ip__result > div { padding: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.ip__result > div span { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; color: var(--ink-mute); text-transform: uppercase; }
.ip__result > div b { font-size: 13px; color: var(--ink); }
.ip__result > div b.mono { font-family: 'JetBrains Mono', monospace; }

/* FULL LIST PANELS */
.qlist, .nlist, .flist, .mlist, .wxlist { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 560px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.qlist::-webkit-scrollbar, .nlist::-webkit-scrollbar, .flist::-webkit-scrollbar, .mlist::-webkit-scrollbar, .wxlist::-webkit-scrollbar { width: 6px; }
.qlist::-webkit-scrollbar-thumb, .nlist::-webkit-scrollbar-thumb, .flist::-webkit-scrollbar-thumb, .mlist::-webkit-scrollbar-thumb, .wxlist::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }

.qrow, .nrow, .frow, .mrow {
  display: grid; gap: 12px; align-items: center; padding: 12px 16px;
  background: var(--bg-2); transition: background .2s;
}
.qrow:hover, .nrow:hover, .frow:hover, .mrow:hover { background: var(--bg-3); }
.qrow { grid-template-columns: 50px 1fr auto auto; }
.qmag { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; text-align: center; padding: 4px; border-radius: 8px; }
.qmag.lg { background: rgba(251, 113, 133, .15); color: var(--red); }
.qmag.md { background: rgba(245, 212, 114, .15); color: var(--gold); }
.qmag.sm { background: rgba(0, 229, 255, .12); color: var(--cyan); }
.qplace { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qplace b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qplace span { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); }
.qtime, .ftime { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); white-space: nowrap; }
.qdepth { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--cyan); padding: 3px 8px; background: rgba(0, 229, 255, .08); border-radius: 6px; }

.nrow { grid-template-columns: auto 1fr auto; }
.nsrc { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; color: var(--ink-mute); padding: 4px 8px; background: rgba(255, 255, 255, .04); border-radius: 4px; text-transform: uppercase; align-self: start; }
.ntitle { font-size: 13px; color: var(--ink); line-height: 1.4; }
.ntitle a { color: inherit; transition: color .2s; }
.ntitle a:hover { color: var(--cyan); }

.frow { grid-template-columns: auto 1fr auto auto auto; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.frow .call { font-weight: 700; color: var(--ink); }
.frow .cc { font-size: 9px; padding: 2px 6px; background: rgba(255, 255, 255, .06); border-radius: 4px; color: var(--ink-dim); }
.frow .alt, .frow .spd, .frow .hdg { color: var(--ink-dim); }
.frow .hdg { color: var(--cyan); }

.mrow { grid-template-columns: auto 1fr auto auto auto; }
.mrow .sym { font-weight: 700; color: var(--ink); font-size: 13px; min-width: 60px; }
.mrow .name { font-size: 12px; color: var(--ink-dim); }
.mrow .px { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--ink); }
.mrow .chg { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 8px; border-radius: 4px; min-width: 70px; text-align: center; }
.mrow .chg.up { background: rgba(52, 211, 153, .12); color: var(--green); }
.mrow .chg.down { background: rgba(251, 113, 133, .12); color: var(--red); }
.mrow .ath { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-mute); }

/* WEATHER list — color-coded by condition */
.wxrow { display: grid; grid-template-columns: 24px 1fr auto auto 1fr; gap: 12px; align-items: center; padding: 12px 16px; background: var(--bg-2); transition: background .2s; border-left: 3px solid transparent; }
.wxrow:hover { background: var(--bg-3); }
.wxrow.wx--sun { border-left-color: var(--gold); }
.wxrow.wx--cloud { border-left-color: var(--ink-mute); }
.wxrow.wx--rain { border-left-color: #0ea5e9; }
.wxrow.wx--snow { border-left-color: #93c5fd; }
.wxrow.wx--storm { border-left-color: var(--purple); }
.wxflag { font-size: 16px; line-height: 1; }
.wxname { font-size: 13px; color: var(--ink); font-weight: 500; }
.wxicon { font-size: 18px; line-height: 1; }
.wxt { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 600; color: var(--ink); min-width: 48px; text-align: right; }
.wxcond { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); letter-spacing: .04em; }

/* BOTTOM TABBAR (mobile only) */
.bot {
  display: none;
  position: fixed; bottom: 8px; left: 8px; right: 8px; z-index: 300;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(15, 14, 24, .78);
  backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.05);
  border: 1px solid var(--line-2); border-radius: 999px;
  justify-content: space-around; gap: 2px;
}
.bot__btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px; color: var(--ink-mute); border-radius: 999px; transition: color .2s, background .2s;
  font-size: 10px; letter-spacing: .04em; min-height: 50px;
}
.bot__btn svg { opacity: .7; transition: opacity .2s; }
.bot__btn.is-on { color: var(--bg); background: linear-gradient(135deg, #00e5ff, #ff2d8a); }
.bot__btn.is-on svg { opacity: 1; }

/* FOOTER */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center;
  padding: 20px var(--pad) calc(100px + env(safe-area-inset-bottom));
  font-size: 11px; color: var(--ink-mute); text-align: center;
}
.foot strong { color: var(--ink); font-weight: 600; }
.foot__sep { color: var(--ink-mute); opacity: .5; }
.foot a { color: var(--ink); border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.foot a:hover { color: var(--cyan); border-color: var(--cyan); }

/* RESPONSIVE */
@media (max-width: 1180px) {
  .top__tabs { display: none; }
  .top { grid-template-columns: 1fr auto; }
  .ccol { order: 1; }
  .lcol { order: 2; }
  .rcol { order: 3; }
  /* Bottom tabbar appears whenever top nav tabs are hidden */
  .bot { display: flex; }
  .grid { grid-template-columns: 1fr; grid-template-areas: "ccol" "lcol" "rcol" "full"; }
  /* On mobile: side columns always visible (counters + markets are essential first-load info). */
  /* A `.full` section is shown only when activated via tab (`.is-on` toggle from JS). */
}
@media (max-width: 880px) {
  .top { padding: 8px var(--pad); margin: 8px 12px 0; }
  .top__txt i { display: none; }
  .top__status { display: none; }
  .grid { padding-bottom: 100px; gap: 10px; padding-left: 12px; padding-right: 12px; }
  .counters { grid-template-columns: repeat(2, 1fr); display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
  .counter { grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .counter__v { font-size: 18px; }
  .qrow { grid-template-columns: 42px 1fr; gap: 8px; }
  .qrow .qtime, .qrow .qdepth { grid-column: 2; justify-self: start; }
  .nrow { grid-template-columns: 1fr; }
  .nrow .nsrc { justify-self: start; }
  .frow { grid-template-columns: 1fr 1fr; gap: 6px; }
  .frow .call { grid-column: 1 / -1; }
  .mrow { grid-template-columns: 1fr 1fr; }
  .mrow .sym, .mrow .name { grid-column: 1 / -1; }
  .wxrow { grid-template-columns: 24px 1fr auto; }
  .wxrow .wxcond { grid-column: 1 / -1; font-size: 10px; }
  .globe { max-width: 360px; }
  .globe__hint { font-size: 9px; padding: 6px 10px; }
}
@media (max-width: 480px) {
  .globe { max-width: 100%; aspect-ratio: 1; }
  .ip__grid { grid-template-columns: 1fr; }
  .desk__counts { grid-template-columns: repeat(3, 1fr); }
  .panel { padding: 14px; }
  .counters { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .globe .paris-pulse { animation: none; }
  .dot--live { animation: none; }
}

/* ============================================================
   MY MODE — Malaysia-only intelligence
   ============================================================ */

/* MY mode toggle tab (in top nav) */
.tab--mode {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
}
.tab--mode .tab__flag { display: inline-flex; align-items: center; }
.tab--mode .tab__flag svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.tab--mode .tab__mode-txt {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: .12em;
  color: var(--ink-mute);
}
.tab--mode.is-on {
  background: rgba(255, 45, 138, .14);
  border-color: rgba(255, 45, 138, .35);
  box-shadow: 0 0 0 1px rgba(255, 45, 138, .25), 0 4px 16px -4px rgba(255, 45, 138, .35);
}
.tab--mode.is-on .tab__mode-txt { color: var(--magenta); }

/* hide MY section in global mode */
.myOnly { display: none; }
html.mode-my .myOnly { display: block; }

/* MY state borders on globe */
.my-state {
  fill: rgba(255, 45, 138, .14);
  stroke: #ff2d8a;
  stroke-width: 1.2;
  stroke-linejoin: round;
  pointer-events: auto;
  cursor: pointer;
  transition: fill .2s var(--ease);
}
.my-state:hover { fill: rgba(0, 229, 255, .25); stroke: #00e5ff; }

/* MY capitals: cyan dots, airports: green squares */
.my-cap { filter: drop-shadow(0 0 4px rgba(0, 229, 255, .8)); }
.my-airport { filter: drop-shadow(0 0 3px rgba(52, 211, 153, .7)); }

/* 16 NEGERI grid */
.mygrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px 0;
}
.mycard {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: transform .25s var(--ease-out), border-color .25s var(--ease), background .25s var(--ease);
  overflow: hidden;
}
.mycard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 200px 100px at 0% 0%, rgba(0, 229, 255, .08), transparent 60%);
  opacity: 0; transition: opacity .25s var(--ease);
}
.mycard:hover { transform: translateY(-2px); border-color: rgba(255, 45, 138, .35); }
.mycard:hover::before { opacity: 1; }
.mycard--east-msia {
  border-left: 3px solid var(--cyan);
}
.mycard--central {
  border-left: 3px solid var(--gold);
}
.mycard--peninsular {
  border-left: 3px solid var(--magenta);
}
.mycard__h { display: flex; align-items: center; gap: 10px; }
.mycard__code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--ink);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-2);
  padding: 3px 6px;
  border-radius: 4px;
}
.mycard--east-msia .mycard__code { color: var(--cyan); border-color: rgba(0, 229, 255, .35); }
.mycard--central .mycard__code { color: var(--gold); border-color: rgba(245, 212, 114, .35); }
.mycard--peninsular .mycard__code { color: var(--magenta); border-color: rgba(255, 45, 138, .35); }
.mycard__name { display: flex; flex-direction: column; line-height: 1.15; }
.mycard__name b { font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.mycard__name i { font-style: normal; font-size: 11px; color: var(--ink-mute); letter-spacing: .04em; }
.mycard__body { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.mycard__row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.mycard__row span { color: var(--ink-mute); letter-spacing: .04em; }
.mycard__row b { font-family: 'Space Grotesk', sans-serif; font-weight: 500; color: var(--ink); }
.mycard__row b.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.mycard__ft { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.mycard__wx { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--cyan); }
.mycard__live {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .12em; color: var(--magenta);
  display: inline-flex; align-items: center; gap: 4px;
}
.mycard__live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 0 3px rgba(255, 45, 138, .2); animation: pulse 1.6s var(--ease) infinite; }

/* panel__h--sub for nested subheaders */
.panel__h--sub { padding: 8px 0 0; font-size: 11px; }

/* responsive MY grid */
@media (max-width: 680px) {
  .mygrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .mycard { padding: 12px; }
  .mycard__name b { font-size: 14px; }
  .mycard__row { font-size: 11px; }
  .tab--mode .tab__mode-txt { display: none; }
  .tab--mode { padding: 6px 8px; }
}
@media (max-width: 420px) {
  .mygrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mycard__body { padding: 6px 0; }
  .mycard__row { font-size: 10px; }
}

/* MY mode active state for globe in mobile */
@media (max-width: 680px) {
  html.mode-my .panel--map { min-height: 60vh; }
}