﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WORLD MONITOR TERMINAL â€” Live multiview intelligence desk
   Super-responsive Â· self-explaining Â· self-maintaining
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

:root {
  /* Original soft terminal palette (sharp type, not high-contrast) */
  --bg-0: #07080b;
  --bg-1: #0b0d12;
  --bg-2: #11141b;
  --bg-3: #181c26;
  --bg-4: #222733;
  --border: #2a3140;
  --border-hi: #3d4658;
  --amber: #f5a623;
  --amber-dim: #b87a12;
  --amber-glow: rgba(245, 166, 35, 0.14);
  --orange: #ff6b1a;
  --green: #00c853;
  --green-dim: #1a7a3c;
  --red: #ff3b30;
  --blue: #4a9eff;
  --cyan: #00d4ff;
  --purple: #b388ff;
  --yellow: #ffd60a;
  --text: #e8eaed;
  --text-dim: #9aa3b5;
  --text-mute: #5a6275;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 5px;
  --topbar-h: 44px;
  --context-h: 40px;
  --ticker-h: 78px;
  --bottom-h: 200px;
  --side-w: 128px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --widget-min-h: 120px;
  --ease: 0.12s ease;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

.mono { font-family: var(--mono); }
.accent { color: var(--amber); }
em { font-style: normal; font-family: var(--mono); color: var(--amber); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--amber); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  color: var(--text);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 2px var(--amber-glow);
}

/* â”€â”€â”€ Shell â”€â”€â”€ */
.terminal {
  display: grid;
  grid-template-rows: var(--topbar-h) var(--context-h) 1fr var(--bottom-h);
  height: 100dvh;
  width: 100vw;
  max-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 40% at 50% -10%, rgba(245, 166, 35, 0.05), transparent 55%),
    var(--bg-0);
}

.body-row {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 0;
  overflow: hidden;
}
.main-col {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* â”€â”€â”€ Top bar â”€â”€â”€ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-bottom: 1px solid var(--border);
  z-index: 40;
  min-width: 0;
}

.topbar-left, .topbar-right, .topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-center { flex: 1; justify-content: center; max-width: 640px; margin: 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Modern timeless mark: globe + amber lens */
.brand-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #c5cae9;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(74,158,255,0.08));
  border: 1px solid rgba(74, 158, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset, 0 2px 10px rgba(0, 0, 0, 0.25);
}
.brand-logo svg {
  display: block;
  width: 22px;
  height: 22px;
}
.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  line-height: 1.15;
}
.brand-name .accent {
  color: var(--amber);
  font-weight: 700;
}
.brand-name-sep { letter-spacing: 0.1em; }
/* Blue blinking terminal cursor (replaces green LIVE chip) */
.brand-live {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-left: 2px;
  height: 14px;
  padding: 0 1px;
}
.brand-cursor {
  display: block;
  width: 7px;
  height: 13px;
  background: #4a9eff;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(74, 158, 255, 0.65);
  animation: cursor-blink 1.05s step-end infinite;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-0);
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.view-tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all var(--ease);
}
.tab:hover { color: var(--text); background: var(--bg-3); }
.tab.active { color: var(--bg-0); background: var(--amber); }
.tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 120px;
  max-width: 280px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 8px;
  height: 30px;
}
.search-box:focus-within { border-color: var(--amber-dim); }
.search-ico { color: var(--text-mute); font-size: 14px; }
.search-box input {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  font-size: 11px;
  box-shadow: none !important;
}
.search-box input::placeholder { color: var(--text-mute); }

.time-range {
  display: flex;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.time-range button {
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
}
.time-range button:hover { color: var(--amber); background: var(--bg-3); }
.time-range button.active {
  color: var(--amber);
  background: var(--amber-glow);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.feed-health {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-0);
  cursor: pointer;
}
.fh-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-mute);
}
.fh-dot.ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.fh-dot.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.fh-dot.err { background: var(--red); box-shadow: 0 0 6px var(--red); }
.fh-count { color: var(--text-mute); }

.status-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: #4a9eff;
  letter-spacing: 0.1em;
}
.pulse {
  width: 2px;
  height: 11px;
  border-radius: 1px;
  background: #4a9eff;
  box-shadow: 0 0 6px rgba(74, 158, 255, 0.7);
  animation: cursor-blink 1.05s step-end infinite;
}

.clock-block { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock-label { font-size: 8px; color: var(--text-mute); font-family: var(--mono); letter-spacing: 0.1em; }
.clock { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--amber); }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-0);
  color: var(--text-dim);
  font-size: 14px;
  transition: all var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover, .icon-btn[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--amber-dim);
  background: var(--amber-glow);
}

/* â”€â”€â”€ Flash + Indices (two full-width rows â€” nothing clipped) â”€â”€â”€ */
.ticker-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  min-height: var(--ticker-h);
  height: auto;
  overflow: visible;
  flex-shrink: 0;
}

.flash-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  height: 36px;
  min-height: 36px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.indices-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  height: 42px;
  min-height: 42px;
  min-width: 0;
}

.ticker-label,
.indices-label {
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  z-index: 2;
  flex-shrink: 0;
}
.ticker-label { background: var(--red); }
.indices-label {
  background: #1565c0;
  letter-spacing: 0.06em;
}

.ticker {
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.ticker-track {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  animation: scroll-ticker 70s linear infinite;
  width: max-content;
  padding: 0 16px;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  font-family: var(--mono);
  font-size: 11px;
  color: #ffb74d;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 480px;
}
.ticker-item .t-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
  color: #ffb74d;
}
.ticker-item:has(.sev.crit),
.ticker-item.brk {
  background: rgba(120, 12, 12, 0.65);
  padding: 2px 8px;
  border-radius: 2px;
}
.ticker-item:has(.sev.crit) .t-txt {
  color: #ffd54f;
  font-weight: 600;
}
.ticker-item .sev { font-weight: 700; flex-shrink: 0; }
.ticker-item .sev.crit { color: var(--red); }
.ticker-item .sev.high { color: var(--orange); }
.ticker-item .sev.med { color: var(--amber); }
.ticker-item .sev.info { color: var(--blue); }
.ticker-item .tag {
  color: #ff8f00;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
}
.brk-flag {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffd54f;
  background: #8b0000;
  padding: 1px 4px;
  border-radius: 1px;
  flex-shrink: 0;
}

.macro-strip {
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  -webkit-overflow-scrolling: touch;
}
.macro-chip {
  background: var(--bg-1);
  padding: 4px 10px;
  min-width: 92px;
  cursor: pointer;
  transition: background var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  border-right: 1px solid rgba(42, 49, 64, 0.6);
}
.macro-chip:hover, .macro-chip.active { background: var(--bg-3); }
.macro-chip.active { box-shadow: inset 0 -2px 0 var(--amber); }
.macro-chip .ms-sym {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.macro-chip .ms-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  white-space: nowrap;
}
.macro-chip .ms-chg {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.ms-chg.up { color: var(--green); }
.ms-chg.down { color: var(--red); }
.ms-chg.flat { color: var(--text-mute); }

/* â”€â”€â”€ Workspace / widgets â”€â”€â”€ */
.workspace {
  min-height: 0;
  overflow: auto;
  position: relative;
  padding: 6px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

.layout-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--amber-glow);
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-dim);
  position: sticky;
  top: 0;
  z-index: 15;
}
/* Must win over display:flex so DONE fully hides the bar */
.layout-banner[hidden] {
  display: none !important;
}
.layout-banner strong {
  font-family: var(--mono);
  color: var(--amber);
  letter-spacing: 0.08em;
  font-size: 10px;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(0, auto);
  grid-auto-flow: dense;
  gap: 6px;
  align-content: start;
  align-items: start; /* don't stretch short panels into black voids */
}
.widget-grid.auto-arrange {
  grid-auto-flow: dense;
  align-items: start;
}

.widget {
  --w-accent: var(--amber);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    opacity var(--ease),
    min-height 0.18s ease;
  grid-column: span 4;
  grid-row: span 2;
  /* Soft depth — less “OS chrome”, more terminal panel */
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  align-self: start;
}
.widget:hover {
  border-color: var(--border-hi);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.widget.collapsed { min-height: 0; height: auto; grid-row: span 1 !important; }
.widget.collapsed .widget-body,
.widget.collapsed .widget-resize { display: none !important; }

/* Auto-arrange: empty windows = header chip only (no black body) */
.widget.is-empty {
  min-height: 0 !important;
  height: auto !important;
  grid-row: span 1 !important;
  opacity: 0.78;
  border-style: dashed;
  border-color: var(--border);
  box-shadow: none;
  align-self: start;
}
.widget.is-empty .widget-body {
  display: none !important;
  min-height: 0 !important;
  max-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: none !important;
}
.widget.is-empty .w-empty { display: none !important; }
.widget.is-empty .widget-resize { display: none !important; }
.widget.is-empty .widget-head {
  padding: 5px 8px;
  background: var(--bg-1);
  border-bottom: none;
}
.widget.is-empty .widget-title {
  color: var(--text-mute) !important;
  font-weight: 600 !important;
}
.widget.is-filled {
  opacity: 1;
  border-style: solid;
  min-height: 0 !important;
  height: auto;
  align-self: start;
}
/* Content-sized body — no flex-grown empty black band */
.widget.is-filled .widget-body {
  flex: 0 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: auto;
}
/* Map keeps a real footprint */
.widget[data-id="map"].is-filled {
  min-height: min(42vh, 320px) !important;
  align-self: stretch;
}
.widget[data-id="map"].is-filled .widget-body {
  flex: 1 1 auto !important;
  min-height: 260px !important;
}

/* Size presets via data-w / data-h — heights are soft (content wins) */
.widget[data-w="3"] { grid-column: span 3; }
.widget[data-w="4"] { grid-column: span 4; }
.widget[data-w="5"] { grid-column: span 5; }
.widget[data-w="6"] { grid-column: span 6; }
.widget[data-w="8"] { grid-column: span 8; }
.widget[data-w="12"] { grid-column: span 12; }
.widget[data-h="1"] { grid-row: span 1; min-height: 0; }
.widget[data-h="2"] { grid-row: span 2; min-height: 0; }
.widget[data-h="3"] { grid-row: span 3; min-height: 0; }
.widget[data-h="4"] { grid-row: span 4; min-height: 0; }
.widget[data-h="5"] { grid-row: span 5; min-height: 0; }
/* Only map / edit mode keep stronger floor heights */
.widget-grid[data-edit="true"] .widget[data-h="1"] { min-height: 72px; }
.widget-grid[data-edit="true"] .widget[data-h="2"] { min-height: var(--widget-min-h); }
.widget-grid[data-edit="true"] .widget[data-h="3"] { min-height: 200px; }
.widget-grid[data-edit="true"] .widget[data-h="4"] { min-height: 280px; }

.widget-grid[data-edit="true"] .widget {
  cursor: grab;
  border-style: dashed;
}
.widget-grid[data-edit="true"] .widget:active { cursor: grabbing; }
.widget-grid[data-edit="true"] .widget-grip { color: var(--amber); }

.widget-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px 6px;
  /* Coloured top of each window (original soft look) */
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--w-accent) 14%, var(--bg-3)), var(--bg-2) 55%, var(--bg-1));
  border-bottom: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--w-accent) 35%, transparent),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  user-select: none;
  position: relative;
}
.widget-head::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--w-accent),
    color-mix(in srgb, var(--w-accent) 40%, transparent) 70%,
    transparent
  );
  pointer-events: none;
}
.widget-grip {
  color: var(--text-mute);
  font-size: 12px;
  cursor: grab;
  padding: 0 2px;
}
.widget-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.widget-help, .widget-collapse {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-mute);
  border-radius: var(--radius);
  font-size: 11px;
  flex-shrink: 0;
}
.widget-help:hover, .widget-collapse:hover { color: var(--amber); background: var(--bg-3); }

.widget-body {
  flex: 0 1 auto; /* content-sized — avoid empty black growth */
  min-height: 0;
  height: auto;
  overflow: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.widget-resize {
  position: absolute;
  right: 0; bottom: 0;
  width: 14px; height: 14px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, var(--border-hi) 50%);
  opacity: 0;
  transition: opacity var(--ease);
}
.widget:hover .widget-resize,
.widget-grid[data-edit="true"] .widget-resize { opacity: 1; }

/* Widget content primitives */
.w-empty {
  display: grid;
  place-items: center;
  text-align: center;
  height: auto;
  min-height: 0;
  color: var(--text-mute);
  font-size: 11px;
  padding: 10px 8px;
  gap: 4px;
}
.w-empty strong { color: var(--text-dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }

.layer-list { display: flex; flex-direction: column; gap: 2px; }
.layer-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: var(--radius); cursor: pointer;
}
.layer-item:hover { background: var(--bg-3); }
.layer-item .swatch { width: 8px; height: 8px; border-radius: 1px; flex-shrink: 0; }
.layer-item .lname { flex: 1; font-size: 11px; }
.layer-item .lcount { font-family: var(--mono); font-size: 10px; color: var(--text-mute); }
.layer-item .toggle {
  width: 28px; height: 14px; background: var(--bg-4);
  border: 1px solid var(--border-hi); border-radius: 7px; position: relative; flex-shrink: 0;
}
.layer-item .toggle::after {
  content: ""; position: absolute; top: 1px; left: 1px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--text-mute); transition: all var(--ease);
}
.layer-item.on .toggle { background: var(--amber-glow); border-color: var(--amber-dim); }
.layer-item.on .toggle::after { left: 15px; background: var(--amber); }
.layer-item:not(.on) .lname { color: var(--text-mute); }
.layer-item:not(.on) .swatch { opacity: 0.35; }

.theater-row, .alert-row, .news-row, .quake-row, .log-row {
  display: grid;
  gap: 2px 8px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(42, 49, 64, 0.45);
  cursor: pointer;
  transition: background var(--ease);
}
.theater-row:hover, .alert-row:hover, .news-row:hover, .quake-row:hover { background: var(--bg-3); }

.theater-row {
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 4px 8px;
  padding: 8px 6px;
}
.theater-row .tname { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; }
.tposture {
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: 0.04em; padding: 1px 5px; border-radius: var(--radius); align-self: start;
}
.tposture.critical { color: #fff; background: var(--red); }
.tposture.elevated { color: var(--bg-0); background: var(--orange); }
.tposture.watch { color: var(--bg-0); background: var(--amber); }
.tposture.stable { color: var(--green); background: rgba(0, 200, 83, 0.12); border: 1px solid var(--green-dim); }
.tmeta { grid-column: 1 / -1; font-family: var(--mono); font-size: 9px; color: var(--text-mute); line-height: 1.35; }
.theater-signals {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 2px;
}
.theater-signals span {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}
.theater-signals span.hot { color: var(--orange); border-color: rgba(255, 107, 26, 0.35); }
.theater-signals span.news { color: var(--cyan); border-color: rgba(0, 188, 212, 0.3); }
.theater-signals span.ship { color: #82b1ff; border-color: rgba(130, 177, 255, 0.3); }
.theater-signals span.risk { color: var(--amber); }
.theater-headlines {
  grid-column: 1 / -1;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
  margin-top: 2px;
}
.theater-headlines em {
  font-style: normal;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 8px;
  margin-right: 4px;
}
.theater-updated {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-mute);
  margin-top: 1px;
}

.alert-row { grid-template-columns: 8px 1fr; align-items: start; }
.a-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; }
.a-dot.crit { background: var(--red); box-shadow: 0 0 6px var(--red); }
.a-dot.high { background: var(--orange); }
.a-dot.med { background: var(--amber); }
.a-title { font-size: 11px; font-weight: 500; }
.a-sub { font-family: var(--mono); font-size: 9px; color: var(--text-mute); }

.news-row { grid-template-columns: 1fr; }
.news-src {
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--cyan);
}
.news-title { font-size: 11px; font-weight: 500; line-height: 1.35; }
.news-meta { font-family: var(--mono); font-size: 9px; color: var(--text-mute); }
.news-row.flash .news-title { color: var(--amber); }

.hot-row { margin-bottom: 8px; cursor: pointer; }
.hot-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.hot-name { font-size: 11px; font-weight: 500; }
.hot-score { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.hot-bar { height: 3px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.hot-bar > i { display: block; height: 100%; border-radius: 2px; }
.hot-delta { font-family: var(--mono); font-size: 9px; color: var(--text-mute); margin-top: 2px; }
.hot-delta.up { color: var(--red); }
.hot-delta.down { color: var(--green); }

.market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  margin: -8px;
}
.mkt-cell { background: var(--bg-1); padding: 8px 10px; min-height: 52px; }
.m-sym { font-family: var(--mono); font-size: 9px; color: var(--text-mute); letter-spacing: 0.06em; }
.m-val { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.m-chg { font-family: var(--mono); font-size: 10px; }
.m-chg.up { color: var(--green); }
.m-chg.down { color: var(--red); }

.ind-intro {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: var(--amber-glow);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: var(--radius);
}
.ind-grid { display: flex; flex-direction: column; gap: 8px; }
.ind-card {
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.ind-card:hover { border-color: var(--amber-dim); background: var(--bg-3); }
.ind-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.ind-name { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--amber); }
.ind-label { font-size: 10px; color: var(--text-mute); margin-bottom: 4px; }
.ind-val { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.ind-desc, .ind-read { font-size: 10px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }
.ind-desc strong, .ind-read strong { color: var(--text-mute); font-weight: 600; }
.ind-delta { font-size: 9px; color: var(--text-mute); margin-top: 4px; }
.ind-explain, .ind-read-line { font-size: 11px; color: var(--text-dim); line-height: 1.45; margin: 6px 0; }
.ind-bar { height: 4px; background: var(--bg-4); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.ind-bar > i { display: block; height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.ind-spark {
  display: flex; align-items: flex-end; gap: 2px; height: 24px; margin-top: 6px;
}
.ind-spark span {
  flex: 1; background: var(--amber-dim); border-radius: 1px 1px 0 0; min-height: 2px;
  opacity: 0.7;
}

.cii-row {
  display: grid; grid-template-columns: 56px 1fr 28px; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 11px;
}
.ccode { font-family: var(--mono); font-weight: 600; color: var(--text-dim); }
.cii-bar { height: 4px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.cii-bar > i { display: block; height: 100%; }
.cval { font-family: var(--mono); font-size: 10px; font-weight: 600; text-align: right; }

.infra-row {
  display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 4px 0;
}
.i-name { flex: 1; color: var(--text-dim); }
.i-stat {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; padding: 1px 5px; border-radius: var(--radius);
}
.i-stat.ok { color: var(--green); background: rgba(0, 200, 83, 0.1); }
.i-stat.warn { color: var(--amber); background: var(--amber-glow); }
.i-stat.crit { color: var(--red); background: rgba(255, 59, 48, 0.12); }

/* Map */
.map-wrap {
  position: relative;
  height: 100%;
  min-height: 200px;
  background: radial-gradient(ellipse at 50% 55%, #0d1520, var(--bg-0));
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
}
#worldMap { width: 100%; height: 100%; display: block; min-height: 200px; }
.map-land { fill: #1a2332; stroke: #2a3a50; stroke-width: 0.6; }
.map-ocean { fill: #0a1018; }
.marker { cursor: pointer; }
.marker.dimmed { opacity: 0.15; pointer-events: none; }
.marker-pulse { animation: marker-pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes marker-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}
.map-coords {
  position: absolute; bottom: 6px; right: 6px;
  font-family: var(--mono); font-size: 9px; color: var(--text-mute);
  background: rgba(8, 9, 12, 0.8); padding: 3px 6px; border: 1px solid var(--border);
}
.map-legend {
  position: absolute; bottom: 6px; left: 6px;
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--mono); font-size: 8px; color: var(--text-dim);
  background: rgba(8, 9, 12, 0.85); padding: 5px 7px; border: 1px solid var(--border);
}
.map-legend i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px;
}

.quake-row { grid-template-columns: 40px 1fr; }
.q-mag {
  font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--orange);
}
.q-place { font-size: 11px; }
.q-meta { font-family: var(--mono); font-size: 9px; color: var(--text-mute); }

.health-list { display: flex; flex-direction: column; gap: 4px; }
.health-row {
  display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center;
  font-size: 11px; padding: 4px 0;
}
.health-row .dot { width: 7px; height: 7px; border-radius: 50%; }
.health-row .name { color: var(--text-dim); }
.health-row .age { font-family: var(--mono); font-size: 9px; color: var(--text-mute); }
.health-row .st { font-family: var(--mono); font-size: 9px; font-weight: 700; }

/* â”€â”€â”€ Bottom multiview / vertical tape â”€â”€â”€ */
.bottom-bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  min-height: 0;
  padding-bottom: var(--safe-b);
}

.stream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  min-width: 0;
}
.stream-hint {
  font-size: 8px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  padding-right: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stream-tabs {
  display: flex; gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stream-tabs .st {
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.stream-tabs .st:hover { color: var(--text); }
.stream-tabs .st.active { color: var(--amber); border-bottom-color: var(--amber); }

/* Single-column vertical tape */
.stream-pane.vertical-tape.single-col,
.stream-pane.list-mode {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 0;
  background: var(--bg-0);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

/* Multiview â€” 4 equal columns (real terminal tape) */
.stream-pane.multiview-tape {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  overflow: hidden;
  min-height: 0;
}

.mv-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-0);
  overflow: hidden;
}
.mv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mv-head span {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.mv-head em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-mute);
}
.mv-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  -webkit-overflow-scrolling: touch;
}
.mv-col[data-col="news"] .mv-head span { color: var(--cyan); }
.mv-col[data-col="markets"] .mv-head span { color: #82b1ff; }
.mv-col[data-col="events"] .mv-head span { color: var(--orange); }
.mv-col[data-col="disasters"] .mv-head span { color: #80cbc4; }



.vt-row {
  display: grid;
  grid-template-columns: 40px 52px 1fr;
  gap: 4px 6px;
  align-items: start;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(42, 49, 64, 0.4);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease);
  font-size: 10px;
  line-height: 1.3;
}
.multiview-tape .vt-row {
  grid-template-columns: 36px 48px 1fr;
  font-size: 10px;
}
.vt-row:hover { background: var(--bg-3); }
.vt-row.crit { border-left-color: var(--red); }
.vt-row.high { border-left-color: var(--orange); }
.vt-row.med { border-left-color: var(--amber); }
.vt-row.info { border-left-color: var(--blue); }
.vt-row.answer { border-left-color: var(--green); }
.vt-time { color: var(--text-mute); font-size: 9px; padding-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-src {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-top: 2px;
}
.vt-title {
  color: #ffb74d; /* amber/orange headline â€” high readability */
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
}
.vt-title b { color: #ffcc80; font-weight: 700; }
/* Breaking / critical: dark-red rail + amber text on deep red wash */
.vt-row.crit {
  background: linear-gradient(90deg, rgba(120, 12, 12, 0.55), rgba(40, 8, 8, 0.35));
  border-left-color: #ff1744;
}
.vt-row.crit .vt-title {
  color: #ffd54f;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 60, 40, 0.25);
}
.vt-row.crit .vt-src { color: #ff8a80; }
.vt-row.high .vt-title { color: #ff9800; }
.vt-row.info .vt-title { color: #ffb74d; }
.vt-row.med .vt-title { color: #ffc107; }
.vt-row.answer .vt-title { color: #69f0ae; }

/* News panels (main widgets) same language */
.news-title {
  color: #ffb74d !important;
  font-weight: 500;
}
.news-row.flash {
  background: linear-gradient(90deg, rgba(120, 12, 12, 0.45), transparent);
  border-left: 3px solid #ff1744;
  padding-left: 6px;
}
.news-row.flash .news-title {
  color: #ffd54f !important;
  font-weight: 600;
}
.news-src { color: #ff8f00 !important; }
.vt-empty {
  padding: 12px 8px;
  text-align: center;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 9px;
}

.event-card, .stream-news-card { display: none; }

@media (max-width: 1100px) {
  .stream-pane.multiview-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .stream-pane.multiview-tape {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow-y: auto;
  }
  .mv-col { min-height: 120px; max-height: 160px; }
}

.func-keys {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 4px 10px;
  background: var(--bg-0);
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 9px; color: var(--text-mute);
}
.func-keys kbd {
  display: inline-block; padding: 1px 4px;
  background: var(--bg-3); border: 1px solid var(--border-hi);
  border-radius: 2px; color: var(--amber); font-family: var(--mono); font-size: 8px; margin-right: 2px;
}
.fk-right { margin-left: auto; }
.dev-credit {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  opacity: 0.55;
  white-space: nowrap;
  user-select: none;
}
.dev-credit:hover { opacity: 0.85; color: var(--text-dim); }

@media (max-width: 900px) {
  .dev-credit { display: none; } /* keep footer clean on small screens; still in HTML source */
}

/* â”€â”€â”€ Buttons â”€â”€â”€ */
.btn-amber {
  background: var(--amber); color: var(--bg-0);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; padding: 6px 12px; border-radius: var(--radius);
}
.btn-amber:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.btn-ghost:hover { color: var(--amber); border-color: var(--amber-dim); }
.btn-ghost.danger:hover { color: var(--red); border-color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* â”€â”€â”€ Drawer â”€â”€â”€ */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(380px, 100vw);
  background: rgba(12, 14, 19, 0.98);
  border-left: 1px solid var(--amber-dim);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  z-index: 55;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--amber); letter-spacing: 0.06em;
}
#drawerClose { width: 28px; height: 28px; font-size: 20px; color: var(--text-mute); display: grid; place-items: center; }
#drawerClose:hover { color: var(--text); }
.drawer-body { padding: 14px; overflow-y: auto; flex: 1; }
.drawer-body .d-type { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: var(--amber); margin-bottom: 4px; }
.drawer-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.drawer-body .d-meta {
  display: grid; grid-template-columns: 90px 1fr; gap: 4px 8px;
  font-family: var(--mono); font-size: 10px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.drawer-body .d-meta span:nth-child(odd) { color: var(--text-mute); }
.drawer-body p { color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; }
.d-sev {
  display: inline-block; padding: 2px 8px; font-family: var(--mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; border-radius: var(--radius); margin-bottom: 10px;
}
.d-sev.critical { background: var(--red); color: #fff; }
.d-sev.high { background: var(--orange); color: #fff; }
.d-sev.elevated { background: var(--amber); color: var(--bg-0); }
.d-sev.watch { background: var(--blue); color: #fff; }
.d-sev.info { background: var(--bg-4); color: var(--text-dim); }
.drawer-body a { color: var(--cyan); }

/* â”€â”€â”€ Modal â”€â”€â”€ */
.modal {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, 0.65);
  display: grid; place-items: center; padding: 16px;
}
.modal[hidden] { display: none !important; }
.modal-card {
  width: min(640px, 100%);
  max-height: min(88dvh, 800px);
  background: var(--bg-1);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.modal-head h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--amber);
}
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.settings-sec { margin-bottom: 20px; }
.settings-sec h3 {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 10px;
}
.settings-grid {
  display: grid; grid-template-columns: 1fr 100px; gap: 8px; align-items: center;
}
.settings-grid label { font-size: 11px; color: var(--text-dim); }
.hint { font-size: 11px; color: var(--text-mute); margin-top: 10px; line-height: 1.5; }
.dev-credit-settings {
  opacity: 0.65;
  font-size: 10px !important;
  letter-spacing: 0.03em;
}

/* About â€” what / for / do / why */
.about-block {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(74, 158, 255, 0.06), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--blue);
}
.about-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin: 10px 0 6px;
}
.about-title:first-child { margin-top: 0; }
.about-block p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 4px;
}
.about-list {
  margin: 6px 0 8px 18px;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
}
.about-list li { margin-bottom: 4px; }
.about-privacy {
  margin-top: 10px !important;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius);
  font-size: 11px !important;
  color: var(--text-mute) !important;
}
.about-privacy strong { color: var(--cyan); }

/* Help / tour disclaimer */
.disclaimer-foot {
  margin-top: 14px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-mute);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.disclaimer-foot strong {
  color: var(--text-dim);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}
.tour-disclaimer {
  margin-top: 12px;
  margin-bottom: 0;
  padding: 8px 10px;
  font-size: 9px;
  text-align: center;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.feed-toggles { display: flex; flex-direction: column; gap: 4px; }
.feed-tog {
  display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 4px 0; cursor: pointer;
}
.feed-tog input { accent-color: var(--amber); }

.ind-edit {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-bottom: 8px;
}
.ind-edit .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px;
}
.ind-edit .weights { display: grid; grid-template-columns: 1fr 60px; gap: 6px; font-size: 10px; }
.ind-edit .weights label { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); gap: 8px; }
.ind-edit input[type="range"] { width: 100%; accent-color: var(--amber); }

/* â”€â”€â”€ Tour â”€â”€â”€ */
.tour-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  display: grid; place-items: end center;
  padding: 24px;
  padding-bottom: max(24px, var(--safe-b));
}
.tour-overlay[hidden] { display: none !important; }
.tour-card {
  width: min(420px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.tour-step { font-family: var(--mono); font-size: 9px; color: var(--amber); letter-spacing: 0.1em; margin-bottom: 6px; }
.tour-card h3 { font-size: 15px; margin-bottom: 8px; }
.tour-card p { color: var(--text-dim); font-size: 12px; line-height: 1.5; margin-bottom: 14px; }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* â”€â”€â”€ Tooltip / toast â”€â”€â”€ */
.tooltip {
  position: fixed; z-index: 90;
  max-width: 260px;
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text);
  line-height: 1.4;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.tooltip[hidden] { display: none !important; }

.toast {
  position: fixed; bottom: calc(var(--bottom-h) + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--amber-dim);
  color: var(--amber); font-family: var(--mono); font-size: 11px;
  padding: 8px 16px; border-radius: var(--radius); z-index: 100;
  box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
.toast[hidden] { display: none !important; }

/* Streaming highlight for new items */
@keyframes flash-in {
  0% { background: var(--amber-glow); }
  100% { background: transparent; }
}
.flash-in { animation: flash-in 1.2s ease; }

/* â”€â”€â”€ Responsive â”€â”€â”€ */
@media (max-width: 1100px) {
  .widget[data-w="3"], .widget[data-w="4"], .widget[data-w="5"] { grid-column: span 6; }
  .widget[data-w="6"], .widget[data-w="8"] { grid-column: span 12; }
  :root { --bottom-h: 190px; --ticker-h: 78px; }
  .macro-chip { min-width: 84px; padding: 4px 8px; }
}

@media (max-width: 768px) {
  .terminal {
    grid-template-rows: auto auto 1fr auto;
    height: 100dvh;
  }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px;
    gap: 8px;
  }
  .topbar-center {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
  .topbar-left { flex: 1; min-width: 0; }
  .brand-name { display: none; }
  .search-box { max-width: none; flex: 1; }
  .time-range button { padding: 5px 6px; }
  .widget-grid { grid-template-columns: 1fr; }
  .widget, .widget[data-w="3"], .widget[data-w="4"],
  .widget[data-w="5"], .widget[data-w="6"], .widget[data-w="8"],
  .widget[data-w="12"] {
    grid-column: span 1 !important;
  }
  .widget[data-h="3"], .widget[data-h="4"] { grid-row: span 2; min-height: 220px; }
  :root { --bottom-h: 180px; --ticker-h: 72px; }
  .ticker-item { font-size: 10px; }
  .ticker-item .t-txt { max-width: 220px; }
  .indices-label, .ticker-label { font-size: 7px; }
  .func-keys span:not(.fk-right) { display: none; }
  .func-keys .fk-right { margin-left: 0; }
  .drawer { width: 100vw; }
  .market-grid { grid-template-columns: 1fr 1fr; }
  .status-live span:last-child { display: none; }
  .clock-label { display: none; }
}

@media (max-width: 420px) {
  .view-tabs .tab { padding: 5px 7px; font-size: 8px; }
  .fh-count, #fhLabel { display: none; }
  .event-card, .stream-news-card { flex: 0 0 200px; }
}

@media (min-width: 1600px) {
  .widget-grid { gap: 10px; }
  html { font-size: 13px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .pulse, .marker-pulse, .brand-cursor { animation: none !important; }
  .brand-cursor, .pulse { opacity: 1 !important; }
  * { transition-duration: 0.01ms !important; }
}

/* Print */
@media print {
  .topbar, .ticker-wrap, .bottom-bar, .drawer, .modal, .tour-overlay { display: none !important; }
  .terminal { display: block; height: auto; }
  .workspace { overflow: visible; }
}

/* --- V3 PROFESSIONAL SHELL --- */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; gap: 1px; }
.brand-sub {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.context-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  min-width: 0;
  z-index: 30;
}
.ctx-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ctx-group.grow { flex: 1; min-width: 120px; max-width: 220px; }
.ctx-group.grow select { width: 100%; }
.ctx-label {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  white-space: nowrap;
}
.domain-pills { display: flex; gap: 3px; flex-wrap: nowrap; }
.domain-pill {
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-0);
  white-space: nowrap;
}
.domain-pill:hover { color: var(--amber); border-color: var(--amber-dim); }
.domain-pill.active {
  color: var(--bg-0);
  background: var(--amber);
  border-color: var(--amber);
}
.ctx-focus-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--amber-glow);
  border: 1px solid var(--amber-dim);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  white-space: nowrap;
}
.ctx-focus-chip button {
  width: 18px; height: 18px;
  border-radius: 50%;
  color: var(--text-mute);
}
.ctx-focus-chip button:hover { color: var(--red); background: var(--bg-3); }

/* Side nav — pre-configured desks (scrollable list) */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 5px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
#deskNav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-align: left;
  border: 1px solid transparent;
  transition: all var(--ease);
  width: 100%;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: var(--amber-glow);
  border-color: var(--amber-dim);
  color: var(--amber);
}
.nav-ico { font-size: 11px; opacity: 0.9; line-height: 1; }
.nav-txt {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.nav-foot {
  margin-top: auto;
  padding: 8px 6px 4px;
  font-size: 9px;
  color: var(--amber);
  border-top: 1px solid var(--border);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 8px;
  flex-wrap: wrap;
}
.view-header h1 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber);
}
.view-header p {
  font-size: 11px;
  color: var(--text-mute);
  max-width: 560px;
  margin-top: 2px;
}
.view-header-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-ghost.sm {
  padding: 3px 8px;
  font-size: 9px;
}
.pill {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--amber);
  color: var(--bg-0);
}
.pill.soft {
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* Map 3D */
.widget[data-id="map"] .widget-body {
  padding: 0;
  overflow: hidden;
}
.map-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 0;
  overflow: hidden;
  background: #05070b;
}
#maplibre-root { width: 100%; height: 100%; }
.map3d-ctrl {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.map3d-ctrl button {
  width: 28px; height: 28px;
  background: rgba(12,14,19,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
}
.map3d-ctrl button:hover,
.map3d-ctrl button.active {
  color: var(--amber);
  border-color: var(--amber-dim);
}
.map3d-badge {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  background: rgba(12,14,19,0.88);
  border: 1px solid var(--border);
  color: var(--cyan);
  border-radius: var(--radius);
}
.maplibregl-ctrl-attrib {
  font-size: 9px !important;
  background: rgba(8,9,12,0.75) !important;
}
.svg-fallback .map3d-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
}

/* KMRI hero */
.kmri-hero { cursor: pointer; }
.kmri-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}
.kmri-val {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin: 4px 0;
}
.kmri-delta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.ind-bar.big { height: 6px; margin-bottom: 10px; }
.driver-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-bottom: 8px;
}
.driver {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 10px;
  color: var(--text-mute);
}
.driver b { color: var(--text); font-family: var(--mono); }
.driver em { margin-left: auto; font-style: normal; color: var(--text-mute); font-family: var(--mono); font-size: 9px; }
.ind-card.flagship {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 1px var(--amber-glow);
}

/* Briefs */
.brief-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.brief-title .mono { color: var(--text-mute); font-size: 11px; margin-left: 6px; }
.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.brief-grid > div {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}
.brief-grid span {
  display: block;
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text-mute);
  letter-spacing: 0.06em;
}
.brief-grid b { font-size: 13px; }
.brief-list { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.6; }
.brief-list em { font-style: normal; font-size: 9px; margin-left: 4px; }
.btn-ghost.full { width: 100%; margin-top: 6px; }

.transport-row, .ins-row, .politics-row, .wx-row {
  padding: 7px 4px;
  border-bottom: 1px solid rgba(42,49,64,0.45);
  cursor: pointer;
}
.transport-row:hover, .wx-row:hover { background: var(--bg-3); }
.tr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tr-name, .ins-name, .wx-name { font-size: 11px; font-weight: 500; }
.wx-world-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(420px, 50vh);
  overflow-y: auto;
  scrollbar-width: thin;
}
.wx-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(42, 49, 64, 0.4);
  cursor: pointer;
}
.wx-row:hover, .wx-row.active {
  background: rgba(0, 212, 255, 0.08);
}
.wx-row.active {
  border-left: 3px solid var(--cyan);
  padding-left: 4px;
}
.wx-temp {
  font-size: 16px;
  font-weight: 700;
  color: #80d8ff;
  text-align: right;
  line-height: 1.1;
}
.wx-name { font-size: 12px; font-weight: 500; }
.wx-code {
  font-size: 9px;
  color: var(--text-mute);
  font-weight: 600;
}
.wx-vals { font-size: 10px; color: var(--text-mute); }
.wx-row .i-stat { align-self: center; }
.mini-note {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mute);
}
.mkt-cell.focused {
  outline: 1px solid var(--amber-dim);
  background: var(--amber-glow) !important;
}
.health-detail {
  font-size: 9px;
  color: var(--text-mute);
  margin: -2px 0 6px 18px;
  font-family: var(--mono);
}
.scenario-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.scenario-btn {
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-2);
}
.scenario-btn:hover { border-color: var(--amber-dim); color: var(--text); }
.scenario-btn.active {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-glow);
}
.model-cat-row {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--bg-2);
}
.model-cat-row.flagship { border-color: var(--amber-dim); }
.model-cat-row strong { color: var(--amber); font-family: var(--mono); }

.settings-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.stab {
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  border-bottom: 2px solid transparent;
}
.stab.active { color: var(--amber); border-bottom-color: var(--amber); }
.modal-card.wide { width: min(720px, 100%); }
.drawer-foot {
  font-size: 10px !important;
  color: var(--text-mute) !important;
  font-family: var(--mono) !important;
}

.search-suggest {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  z-index: 50;
}
.search-box { position: relative; }

@media (max-width: 1100px) {
  :root { --side-w: 72px; }
  .nav-txt { display: none; }
  .nav-item { align-items: center; }
  .brand-sub { display: none; }
}
@media (max-width: 768px) {
  .terminal {
    grid-template-rows: auto auto 1fr auto;
  }
  .body-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 6px;
  }
  .nav-item { flex-direction: row; gap: 4px; padding: 6px 8px; flex-wrap: wrap; }
  .nav-txt { display: inline; font-size: 8px; white-space: nowrap; }
  .nav-hint, .nav-section, .nav-foot { display: none; }
  .context-bar { flex-wrap: wrap; height: auto; padding: 6px 8px; gap: 8px; }
  .ctx-group.grow { max-width: none; flex: 1 1 140px; }
  .domain-pills { max-width: 100%; overflow-x: auto; }
  .main-col { grid-template-rows: auto 1fr; }
  :root { --bottom-h: 200px; --ticker-h: 72px; --side-w: 0px; }
  .kmri-val { font-size: 32px; }
  .triad-board { grid-template-columns: 1fr; }
  .triad-x { display: none; }
  .radar-wrap { grid-template-columns: 1fr; }
  .pulse-grid { grid-template-columns: repeat(3, 1fr); }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   V4 â€” WORLD INTELLIGENCE TERMINAL
   Answer Desk Â· Positive Paths Â· Hybrid map Â· Model radar
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

:root {
  --side-w: 148px;
  --glow-green: rgba(0, 200, 83, 0.12);
  --glow-cyan: rgba(0, 212, 255, 0.1);
}

.terminal {
  background:
    radial-gradient(ellipse 70% 35% at 12% -8%, rgba(0, 212, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 30% at 88% 0%, rgba(245, 166, 35, 0.06), transparent 45%),
    var(--bg-0);
}

/* Side nav sections */
.nav-section {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-mute);
  padding: 8px 8px 4px;
}
.nav-item {
  position: relative;
  padding: 8px 10px;
}
.nav-hint {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.nav-item.active .nav-hint { color: rgba(245, 166, 35, 0.7); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--amber);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--amber);
}

.view-path {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 4px;
  opacity: 0.9;
}
.view-header-main { min-width: 0; }

/* Widget accent stripe */
.widget::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--w-accent, var(--border-hi)), transparent);
  opacity: 0.7;
  pointer-events: none;
}
.widget[data-id="answers"],
.widget[data-id="implications"] {
  border-color: rgba(0, 200, 83, 0.25);
  background:
    linear-gradient(180deg, var(--glow-green), transparent 48px),
    var(--bg-1);
}
.widget[data-id="map"] {
  border-color: rgba(0, 212, 255, 0.22);
}
.widget[data-id="kmri"],
.widget[data-id="radar"],
.widget[data-id="indicators"] {
  border-color: rgba(245, 166, 35, 0.22);
}

/* Layout edit UX */
body.layout-edit .widget-head { cursor: grab; }
body.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}
/* Do NOT set pointer-events:none on widgets â€” breaks drop hit-testing */

.widget-ghost {
  position: fixed;
  z-index: 250;
  pointer-events: none;
  padding: 10px 14px;
  border: 1px solid var(--amber);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--amber-glow);
  border-radius: var(--radius);
  background: rgba(18, 21, 28, 0.96);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.widget-ghost .ghost-hint {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.widget.dragging {
  opacity: 0.45;
  border-style: dashed !important;
  border-color: var(--amber-dim) !important;
}
.widget.drag-over {
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 2px var(--amber-glow), inset 0 0 0 1px rgba(245,166,35,0.35);
  background: rgba(245, 166, 35, 0.06) !important;
}
.widget.drop-before::before,
.widget.drop-after::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px;
  height: 3px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  z-index: 5;
  border-radius: 2px;
  pointer-events: none;
}
.widget.drop-before::before { top: 2px; }
.widget.drop-after::after { bottom: 2px; }

.widget-grid[data-edit="true"] {
  outline: 1px dashed rgba(245, 166, 35, 0.25);
  outline-offset: 2px;
  border-radius: var(--radius);
  padding: 2px;
}
.widget-grid[data-edit="true"] .widget.editable .widget-head {
  cursor: grab;
  background: linear-gradient(180deg, rgba(245,166,35,0.1), var(--bg-2));
}
.widget-grid[data-edit="true"] .widget-grip {
  color: var(--amber);
  padding: 2px 6px;
  border-radius: var(--radius);
  background: var(--amber-glow);
}
.widget-grid[data-edit="true"] .widget-resize {
  opacity: 1;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 45%, var(--amber) 45%);
}

/* Map basemap switch */
.map-basemap-switch {
  display: flex;
  gap: 2px;
  background: rgba(12, 14, 19, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.map-basemap-switch button {
  width: auto !important;
  min-width: 0;
  height: 24px !important;
  padding: 0 7px !important;
  font-family: var(--mono);
  font-size: 8px !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  border: none !important;
  background: transparent !important;
  border-radius: 2px;
}
.map-basemap-switch button:hover { color: var(--text) !important; }
.map-basemap-switch button.active {
  color: var(--bg-0) !important;
  background: var(--cyan) !important;
}
.map3d-ctrl {
  flex-wrap: wrap;
  max-width: calc(100% - 50px);
  gap: 5px;
}

/* Answer Desk */
.answer-list { display: flex; flex-direction: column; gap: 8px; }
.answer-card {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.answer-card:hover {
  background: var(--bg-3);
  border-color: var(--green-dim);
  transform: translateX(2px);
}
.answer-q {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.aq-ico {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--green);
  color: var(--bg-0);
  border-radius: 3px;
}
.answer-a {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}
.answer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.answer-foot .conf {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--green);
  font-weight: 600;
}
.answer-foot .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}
.answer-foot .tags em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  padding: 2px 5px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-mute);
}
.answer-go {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  color: var(--green);
  background: var(--glow-green);
}
.answer-go:hover { background: rgba(0, 200, 83, 0.22); }

/* Positive Paths / Implications */
.impl-intro {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 10px;
  padding: 6px 8px;
  background: var(--glow-green);
  border: 1px solid rgba(0, 200, 83, 0.25);
  border-radius: var(--radius);
}
.impl-list { display: flex; flex-direction: column; gap: 10px; }
.impl-card {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 2px solid var(--green);
}
.impl-card.sev-critical { border-top-color: var(--red); }
.impl-card.sev-high { border-top-color: var(--orange); }
.impl-card.sev-elevated { border-top-color: var(--amber); }
.impl-card.sev-watch { border-top-color: var(--blue); }
.impl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.impl-topic {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.impl-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.impl-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
  padding: 4px 0;
  border-top: 1px solid rgba(42, 49, 64, 0.4);
}
.impl-row .il {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  padding-top: 2px;
}
.impl-row.path .il { color: var(--cyan); }
.impl-row.out {
  background: var(--glow-green);
  margin: 4px -4px 0;
  padding: 6px 4px;
  border-radius: var(--radius);
  border-top: none;
}
.impl-row.out .il { color: var(--green); }
.impl-row.out span:last-child { color: var(--text); font-weight: 500; }
.impl-row.mon .il { color: var(--amber); }

/* Triad board */
.triad-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 6px;
  align-items: stretch;
}
.triad-node {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  min-width: 0;
}
.tn-label {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.triad-node strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.25;
}
.triad-node em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.35;
}
.triad-x {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--amber);
  font-weight: 700;
  opacity: 0.7;
}
.triad-blurb {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 6px;
  padding: 8px;
  background: rgba(179, 136, 255, 0.06);
  border: 1px solid rgba(179, 136, 255, 0.2);
  border-radius: var(--radius);
}
.triad-kmri {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.08em;
}

/* World Pulse */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.pulse-cell {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 6px;
  text-align: center;
  transition: border-color var(--ease);
}
.pulse-cell:hover { border-color: var(--border-hi); }
.pc-k {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.pc-v {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

/* Model Radar */
.radar-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 8px;
  align-items: center;
  min-height: 180px;
}
.radar-svg {
  width: 100%;
  max-height: 220px;
  overflow: visible;
}
.radar-label {
  font-family: var(--mono);
  font-size: 7px;
  fill: var(--text-mute);
  font-weight: 600;
}
.radar-legend { display: flex; flex-direction: column; gap: 4px; }
.rl-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 10px;
}
.rl-row span {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.rl-row b {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10px;
  color: var(--text-dim);
}
.rl-row em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

/* Lens picker */
.lens-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.lens-btn {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--ease);
}
.lens-btn strong {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.lens-btn span {
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.35;
}
.lens-btn:hover {
  border-color: var(--amber-dim);
  background: var(--bg-3);
}
.lens-btn.active {
  border-color: var(--amber);
  background: var(--amber-glow);
}
.lens-btn.active strong { color: var(--amber); }
.lens-btn.active span { color: var(--text-dim); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   HD market board Â· mountain charts Â· impact Â· grocery
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.tooltip.rich {
  max-width: 300px;
  padding: 0;
  overflow: hidden;
  border-color: var(--amber-dim);
  background: rgba(12, 14, 19, 0.98);
}
.tooltip.rich .tip-win {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--bg-0);
  background: var(--amber);
  padding: 5px 10px;
}
.tooltip.rich .tip-body {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
}

.panel-banner {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.panel-banner b { color: var(--amber); font-weight: 600; }

/* HD mountain chart canvas */
.bb-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 40px;
  background: linear-gradient(180deg, #0a1228 0%, #060a14 100%);
  border-radius: 2px;
}
.bb-chart-host {
  height: 56px;
  margin: 6px 0 4px;
  border: 1px solid rgba(41, 98, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
  background: #060a14;
}
.bb-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.bb-board.compact {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.bb-board-card {
  background: linear-gradient(180deg, #0d1528 0%, #0a0e18 100%);
  border: 1px solid #1a2744;
  border-radius: 3px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.bb-board-card:hover {
  border-color: #2962ff;
  box-shadow: 0 0 0 1px rgba(41, 98, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.bb-board-card.focused {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-glow);
}
.bb-board-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.bb-sym {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e8eaed;
}
.bb-sym i { color: var(--cyan); font-style: normal; font-size: 9px; }
.bb-name {
  font-size: 10px;
  color: #6b7388;
  margin-top: 2px;
  line-height: 1.25;
}
.bb-px { text-align: right; }
.bb-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.bb-val.xl { font-size: 28px; }
.bb-chg {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.bb-chg.up { color: #00e676; }
.bb-chg.down { color: #ff5252; }
.bb-chg.flat { color: #8b93a7; }
.bb-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8px;
  color: #5a6275;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mkt-board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.mkt-board-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #82b1ff;
}
.mkt-board-sub {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}
.mkt-board-sub b { color: var(--text-dim); }
.mkt-board-count {
  font-size: 10px;
  color: #2962ff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bb-hero {
  background: linear-gradient(180deg, #0c1428 0%, #070b14 100%);
  border: 1px solid #1a2744;
  border-radius: 4px;
  padding: 12px 14px;
  cursor: pointer;
  min-height: 180px;
}
.bb-hero.empty {
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-family: var(--mono);
}
.bb-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.bb-hero-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}
.bb-hero-sub { font-size: 10px; color: #6b7388; margin-top: 2px; }
.bb-hero-px { text-align: right; }
.bb-hero-chart {
  height: 140px;
  border: 1px solid rgba(41, 98, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  background: #050914;
  box-shadow: inset 0 0 40px rgba(41, 98, 255, 0.08);
}
.bb-hero-note {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #4a5570;
}

.mkt-cell .m-spark {
  margin-top: 6px;
  height: 28px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(41, 98, 255, 0.2);
}
.market-grid .mkt-cell {
  min-height: 72px;
  padding: 10px;
}
.market-grid .m-val { font-size: 15px; }

/* Grocery / daily life */
.grocery-hero {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.grocery-hero.firmer {
  background: rgba(255, 82, 82, 0.08);
  border-color: rgba(255, 82, 82, 0.3);
}
.grocery-hero.easier {
  background: rgba(0, 230, 118, 0.08);
  border-color: rgba(0, 230, 118, 0.3);
}
.grocery-hero.mixed {
  background: var(--amber-glow);
  border-color: rgba(245, 166, 35, 0.3);
}
.gh-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.gh-head {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 4px;
}
.gh-sub { font-size: 10px; color: var(--text-mute); line-height: 1.4; }
.grocery-list { display: flex; flex-direction: column; gap: 4px; }
.grocery-row {
  display: grid;
  grid-template-columns: 56px 100px 1fr;
  gap: 4px 10px;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(42, 49, 64, 0.4);
  font-size: 11px;
}
.grocery-row .g-sym { font-weight: 700; color: var(--amber); }
.grocery-row .g-val { color: var(--text); }
.grocery-row .g-val i { font-style: normal; margin-left: 4px; }
.grocery-row .g-val i.up { color: #ff5252; }
.grocery-row .g-val i.down { color: #00e676; }
.grocery-row .g-shop { grid-column: 1 / -1; color: var(--text-dim); font-size: 10px; }
.grocery-row .g-pos {
  grid-column: 1 / -1;
  color: var(--green);
  font-size: 10px;
  line-height: 1.35;
}

/* Climate */
.climate-list { display: flex; flex-direction: column; gap: 8px; }
.climate-card {
  padding: 10px;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.04), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 4px;
}
.cl-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cl-top strong { font-size: 12px; }
.climate-card p { font-size: 11px; color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }
.cl-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px;
  font-size: 10px;
  padding: 3px 0;
  color: var(--text-dim);
}
.cl-row span {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  padding-top: 2px;
}
.cl-row.pos { background: var(--glow-green); margin: 4px -4px 0; padding: 6px 4px; border-radius: 3px; }
.cl-row.pos span { color: var(--green); }
.cl-row.pos b { color: var(--text); font-weight: 500; }
.cl-reg { font-size: 9px; color: var(--text-mute); margin-top: 6px; }

/* Impact monitor */
.impact-board { display: flex; flex-direction: column; gap: 8px; }
.impact-focus {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 2px;
}
.impact-block {
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.impact-block .ib-k {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.impact-block p { font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.impact-block.pol { border-left: 3px solid var(--orange); }
.impact-block.geo { border-left: 3px solid #2962ff; }
.impact-block.day { border-left: 3px solid var(--amber); }
.impact-block.pos {
  border-left: 3px solid var(--green);
  background: var(--glow-green);
}
.impact-block.pos p { color: var(--text); }
.impact-tape {
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  padding: 6px 0 0;
  border-top: 1px solid var(--border);
}

/* Chips & data centers brief */
.tech-brief { display: flex; flex-direction: column; gap: 8px; }
.tb-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64ffda;
}
.tb-block {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-2);
  border-left: 3px solid #64ffda;
}
.tb-block span {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.tb-block p { font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.tb-block.pos {
  border-left-color: var(--green);
  background: var(--glow-green);
}
.tb-block.pos p { color: var(--text); }

.widget[data-id="metals"] {
  border-color: rgba(255, 215, 64, 0.3);
}
.widget[data-id="semiconductors"],
.widget[data-id="datacenters"],
.widget[data-id="techbrief"] {
  border-color: rgba(100, 255, 218, 0.28);
}
.widget[data-id="afford"],
.widget[data-id="affordRank"],
.widget[data-id="affordEdu"],
.widget[data-id="affordHome"],
.widget[data-id="affordMove"] {
  border-color: rgba(0, 200, 83, 0.3);
}

/* Affordability */
.afford-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.af-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green);
  margin-bottom: 4px;
}
.af-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.af-note { font-size: 11px; color: var(--text-dim); line-height: 1.4; max-width: 420px; }
.af-score-box {
  text-align: center;
  padding: 10px 14px;
  border: 2px solid var(--green);
  border-radius: 6px;
  background: var(--glow-green);
  min-width: 88px;
}
.af-score-n {
  display: block;
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.af-score-l {
  font-size: 9px;
  color: var(--text-mute);
  font-family: var(--mono);
  line-height: 1.3;
}
.afford-legend {
  font-size: 9px;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.afford-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.afford-cat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
}
.ac-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
}
.ac-top b { font-family: var(--mono); }
.ac-bar {
  height: 5px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.ac-bar > i { display: block; height: 100%; border-radius: 3px; }
.ac-bar.grow { flex: 1; margin: 0 8px; }
.ac-tip { font-size: 9px; color: var(--text-mute); line-height: 1.3; }
.afford-foot {
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.4;
}
.afford-rank-list { display: flex; flex-direction: column; gap: 3px; }
.ar-row {
  display: grid;
  grid-template-columns: 28px 1fr 32px 48px;
  gap: 6px;
  align-items: center;
  padding: 6px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--bg-2);
  text-align: left;
  width: 100%;
  color: inherit;
  cursor: pointer;
}
.ar-row:hover, .ar-row.active {
  border-color: var(--green-dim);
  background: var(--glow-green);
}
.ar-rank { font-size: 10px; color: var(--text-mute); }
.ar-name { font-size: 11px; font-weight: 500; }
.ar-score { font-size: 12px; font-weight: 700; text-align: right; }
.ar-bar {
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
}
.ar-bar > i { display: block; height: 100%; }
.afford-edu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ae-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
}
.ae-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.ae-top span { font-family: var(--mono); font-weight: 700; }
.ae-card p { font-size: 10px; color: var(--text-dim); margin-top: 6px; line-height: 1.35; }
.ae-read { color: var(--text-mute) !important; font-style: normal; }
.afford-home { display: flex; flex-direction: column; gap: 8px; }
.ah-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.ah-row > span { min-width: 140px; color: var(--text-dim); }
.ah-row b { font-family: var(--mono); min-width: 24px; text-align: right; }

@media (max-width: 700px) {
  .afford-edu { grid-template-columns: 1fr; }
  .afford-hero { flex-direction: column; }
  .ah-row { flex-wrap: wrap; }
  .ah-row > span { min-width: 100%; }
}

/* HD widget polish */
.widget[data-id="mktboard"],
.widget[data-id="mkthero"],
.widget[data-id="currencies"],
.widget[data-id="markets"],
.widget[data-id="commodities"],
.widget[data-id="energy"] {
  border-color: rgba(41, 98, 255, 0.28);
  background: linear-gradient(180deg, rgba(12, 20, 40, 0.9), var(--bg-1));
}
.widget[data-id="grocery"],
.widget[data-id="impact"] {
  border-color: rgba(0, 200, 83, 0.28);
}
.widget[data-id="climate"] {
  border-color: rgba(0, 212, 255, 0.28);
}
.widget[data-id="newsfocus"] {
  border-color: rgba(0, 212, 255, 0.22);
}

.side-nav .nav-item {
  border-radius: 4px;
}
.side-nav .nav-item:hover {
  border-color: rgba(245, 166, 35, 0.25);
}

/* How-to modal */
.howto-card .modal-body { max-height: min(78dvh, 720px); }
.howto-nav-map {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}
.hnm-item {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hnm-item b {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.08em;
}
.hnm-item span { font-size: 11px; color: var(--text-dim); }
.howto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.howto-step {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--amber);
}
.howto-step h4 {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.howto-step p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.howto-h3 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin: 8px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.howto-models {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.howto-ind {
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
}
.howto-ind strong {
  font-family: var(--mono);
  color: var(--amber);
  margin-right: 6px;
}
.howto-ind .hi-label { color: var(--text-mute); font-size: 10px; }
.howto-ind p { color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.howto-ind p.muted { color: var(--text-mute); font-size: 10px; }
.howto-ind p.read { color: var(--green); font-size: 10px; }
.howto-ind em { font-style: normal; font-weight: 700; color: var(--text-mute); }

@media (max-width: 700px) {
  .howto-grid, .howto-models { grid-template-columns: 1fr; }
  .howto-nav-map { grid-template-columns: 1fr 1fr; }
  .vt-row { grid-template-columns: 40px 56px 1fr; gap: 6px; font-size: 10px; }
  .stream-hint { display: none; }
  .context-bar { gap: 6px; }
  .domain-pill { padding: 4px 6px; font-size: 8px; }
  .bb-board { grid-template-columns: 1fr; }
  .bb-val.xl { font-size: 22px; }
  .bb-hero-chart { height: 100px; }
  .view-header h1 { font-size: 12px; }
  .grocery-row { grid-template-columns: 48px 1fr; }
}

/* Extra mobile safety for full terminal shell */
@media (max-width: 520px) {
  .topbar-right .status-live,
  .topbar-right .clock-label { display: none; }
  .func-keys span:not(.fk-right) { display: none; }
  .func-keys .fk-right { display: inline; font-size: 8px; }
  .howto-nav-map { grid-template-columns: 1fr; }
  :root { --bottom-h: 220px; }
}

/* Context bar: more selectors */
.context-bar {
  gap: 10px;
  scrollbar-width: thin;
}
.ctx-group.grow { max-width: 200px; }
.ctx-group select {
  font-size: 11px;
  padding: 5px 6px;
  min-height: 28px;
}

/* Smoother widget body scroll on touch */
.widget-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Desktop density */
@media (min-width: 1400px) {
  :root { --side-w: 156px; }
  .nav-txt { font-size: 10px; }
  .pulse-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .map-basemap-switch button { padding: 0 5px !important; font-size: 7px !important; }
  .impl-row { grid-template-columns: 1fr; gap: 2px; }
  .impl-row .il { margin-bottom: 0; }
  .nav-hint { display: none; }
  .nav-section { display: none; }
}
@media (max-width: 900px) {
  .triad-board {
    grid-template-columns: 1fr;
  }
  .triad-x { display: none; }
}

/* -----------------------------------------------------------
   FEATURE PACK: trust · compare · inflation · chips · climate
   family afford · move-to · view toggle · PWA · mobile dock
   ----------------------------------------------------------- */

/* View mode toggle */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-2);
  flex-shrink: 0;
}
.vt-btn {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 5px 9px;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.vt-btn:hover { color: var(--text); }
.vt-btn.active {
  background: linear-gradient(135deg, #1a3a6a, #0d2244);
  color: #7ec8ff;
  box-shadow: inset 0 0 0 1px rgba(74, 158, 255, 0.35);
}
.install-btn {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--amber) !important;
  border-color: rgba(245, 166, 35, 0.4) !important;
}
.install-btn:hover { background: rgba(245, 166, 35, 0.12) !important; }

/* Trust badges */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.trust-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tc-badge {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid;
}
.tc-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.tc-detail {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
  flex: 1;
}
.tc-meta {
  font-size: 9px;
  color: var(--text-mute);
}

/* Country compare */
.compare-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.cmp-pick {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 9px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  min-width: 140px;
  flex: 1;
}
.cmp-pick select {
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 8px;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 34px;
}
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 420px;
}
.compare-table th,
.compare-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--amber);
  position: sticky;
  top: 0;
}
.compare-table td:first-child,
.compare-table th:first-child {
  color: var(--text-mute);
  font-size: 10px;
  white-space: nowrap;
  width: 120px;
}
.compare-table tr:hover td { background: rgba(74, 158, 255, 0.04); }
.cmp-note {
  font-size: 10px !important;
  color: var(--text-dim) !important;
  line-height: 1.3;
  max-width: 160px;
}
/* Compare deltas — green better · red worse (vs first country) */
.cmp-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cmp-delta {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}
.cmp-delta.good { color: var(--green); }
.cmp-delta.bad { color: var(--red); }
.cmp-delta.flat { color: var(--text-mute); font-weight: 600; }
.cmp-delta.base {
  color: var(--text-mute);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.compare-table td.cmp-best .cmp-val { text-shadow: 0 0 12px rgba(0, 200, 83, 0.2); }
.compare-table td.cmp-worst .cmp-val { opacity: 0.95; }

/* Inflation · growth */
.infl-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.infl-stat {
  background: linear-gradient(160deg, rgba(255, 107, 26, 0.08), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.infl-stat.growth {
  background: linear-gradient(160deg, rgba(105, 240, 174, 0.07), var(--bg-1));
}
.infl-k {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}
.infl-v {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.infl-v.soft { font-size: 20px; opacity: 0.92; }
.infl-v small { font-size: 14px; margin-left: 2px; opacity: 0.7; }
.infl-s {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.3;
}
.infl-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.infl-chart-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.infl-chart-h {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.series-bars {
  width: 100%;
  height: 64px;
  display: block;
  border-radius: 4px;
  background: #050a16;
}
.infl-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--text-mute);
  margin-top: 4px;
  gap: 2px;
}
.infl-labels span { flex: 1; text-align: center; }

/* Chip supply chain */
.chip-chain {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.chip-node {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cn-stage {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.cn-where {
  font-size: 9px;
  color: var(--text-mute);
}
.chip-node p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
  flex: 1;
}
.cn-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.chip-sym {
  font-size: 9px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
}
.chip-sym i { font-style: normal; opacity: 0.85; }

/* Climate ? food */
.cf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.cf-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.cf-card.tip {
  border-color: rgba(0, 212, 255, 0.35);
  background: linear-gradient(160deg, rgba(0, 212, 255, 0.06), var(--bg-1));
}
.cf-k {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #00d4ff;
  margin-bottom: 4px;
}
.cf-card p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.cf-live {
  font-size: 9px;
  color: var(--text-mute);
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}
.cf-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cf-tick {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 72px;
  font-size: 11px;
}
.cf-tick b { font-size: 10px; color: var(--text-mute); }
.cf-tick i { font-style: normal; font-size: 9px; }

/* Family profile */
.fam-pills, .move-prios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.fam-pill, .move-prio {
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s;
}
.fam-pill:hover, .move-prio:hover {
  border-color: rgba(74, 158, 255, 0.5);
  color: var(--text);
}
.fam-pill.active, .move-prio.active {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.18), rgba(0, 200, 83, 0.05));
  border-color: rgba(0, 200, 83, 0.55);
  color: #69f0ae;
  font-weight: 600;
}
.afford-hero.compact { margin-bottom: 8px; }
.afford-grid.tight {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}

/* Power for AI */
.power-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.power-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}
.power-card:hover {
  border-color: rgba(24, 255, 255, 0.45);
  transform: translateY(-1px);
}
.pc-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
}
.pc-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}
.pc-name {
  font-size: 9px;
  color: var(--text-mute);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-chart { height: 40px; }
.pc-chart .bb-chart { width: 100%; height: 40px; }

/* ═══════════════════════════════════════════════════════════
   PHONE / TOUCH VIEW — responsive nav + thumb-first dock
   ═══════════════════════════════════════════════════════════ */
body.view-mobile {
  --side-w: 0px;
  --bottom-h: min(28vh, 200px);
  --ticker-h: 64px;
  --mobile-dock-h: 118px;
  --topbar-h: 52px;
  --context-h: auto;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.view-mobile .terminal {
  grid-template-columns: 1fr;
  grid-template-rows: var(--topbar-h) auto 1fr var(--bottom-h);
  height: 100dvh;
  height: var(--vv-h, 100dvh);
  max-height: 100dvh;
  max-height: var(--vv-h, 100dvh);
  padding-bottom: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
body.view-mobile .side-nav { display: none !important; }
body.view-mobile .body-row {
  display: block;
  min-height: 0;
  overflow: hidden;
}
body.view-mobile .main-col {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.view-mobile .workspace {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--mobile-dock-h) + 8px);
  scroll-padding-bottom: calc(var(--mobile-dock-h) + 12px);
}

/* Compact top bar */
body.view-mobile .topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 8px;
  gap: 6px;
  align-items: center;
}
body.view-mobile .brand-sub,
body.view-mobile .topbar-right .status-live,
body.view-mobile .topbar-right .clock-block,
body.view-mobile .topbar-right #btnLayout {
  display: none !important;
}
body.view-mobile .brand-name { font-size: 11px; }
body.view-mobile .topbar-center { max-width: none; flex: 1; min-width: 0; }
body.view-mobile .search-box { width: 100%; }
body.view-mobile .search-box input {
  font-size: 16px;
  min-height: 40px;
  padding: 8px 10px 8px 32px;
  border-radius: 12px;
}
body.view-mobile .icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  font-size: 16px;
}
body.view-mobile .view-toggle { border-radius: 12px; }
body.view-mobile .vt-btn {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 10px;
}
body.view-mobile .feed-health {
  padding: 6px 8px;
  min-height: 36px;
}
body.view-mobile .feed-health #fhLabel { display: none; }
body.view-mobile .install-btn {
  min-height: 36px;
  padding: 0 8px;
  font-size: 9px !important;
}

/* Horizontal filter chips — swipeable */
body.view-mobile .context-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: linear-gradient(180deg, #0a1020, var(--bg-0));
  border-bottom: 1px solid rgba(74, 158, 255, 0.22);
  height: auto;
  max-height: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
body.view-mobile .context-bar::-webkit-scrollbar { display: none; }
body.view-mobile .ctx-group {
  flex: 0 0 auto;
  max-width: none !important;
  min-width: 132px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  scroll-snap-align: start;
}
body.view-mobile .ctx-group.grow { max-width: none !important; min-width: 148px; }
body.view-mobile .ctx-label {
  font-size: 9px;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}
body.view-mobile .ctx-group select {
  width: 100%;
  min-height: 40px;
  font-size: 15px;
  border-radius: 10px;
  padding: 8px 10px;
}
body.view-mobile .domain-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  max-width: 70vw;
  scrollbar-width: none;
}
body.view-mobile .domain-pills::-webkit-scrollbar { display: none; }
body.view-mobile .domain-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 11px;
  min-height: 40px;
  border-radius: 999px;
}
body.view-mobile .time-range { display: flex; gap: 4px; }
body.view-mobile .time-range button {
  min-height: 40px;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
}
body.view-mobile .ctx-focus-chip {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 12px;
  padding: 8px 10px;
  align-self: center;
}

body.view-mobile .view-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(74, 158, 255, 0.14), transparent 55%),
    var(--bg-0);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
body.view-mobile .view-header h1 {
  font-size: 18px;
  letter-spacing: 0.04em;
}
body.view-mobile .view-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
body.view-mobile .view-header-meta .btn-ghost {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
}
body.view-mobile .widget-grid {
  grid-template-columns: 1fr !important;
  gap: 12px;
  padding: 10px 10px 24px;
}
body.view-mobile .widget {
  grid-column: 1 / -1 !important;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(74, 158, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
body.view-mobile .widget[data-id] { width: 100% !important; }
body.view-mobile .widget-head {
  padding: 12px 14px;
  min-height: 48px;
  background: linear-gradient(90deg, rgba(26, 58, 106, 0.45), transparent);
  gap: 8px;
}
body.view-mobile .widget-help,
body.view-mobile .widget-collapse {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
}
body.view-mobile .widget-body {
  max-height: none;
  padding: 12px 14px 16px;
}
body.view-mobile .widget-resize { display: none !important; }
body.view-mobile .ticker-wrap {
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
body.view-mobile .flash-row,
body.view-mobile .indices-row { min-height: 40px; }
body.view-mobile .macro-strip { gap: 6px; padding: 4px 0; }
body.view-mobile .macro-chip {
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
}

body.view-mobile .bottom-bar {
  height: var(--bottom-h);
  min-height: var(--bottom-h);
  max-height: var(--bottom-h);
  padding-bottom: 0;
  margin-bottom: var(--mobile-dock-h);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
body.view-mobile .stream-head {
  flex-shrink: 0;
  gap: 6px;
  padding: 4px 6px 0;
}
body.view-mobile .stream-tools {
  flex-wrap: nowrap;
}
body.view-mobile .stool {
  min-height: 32px;
  padding: 0 10px;
  font-size: 9px;
}
/* Usable multiview tape on phones/tablets */
body.view-mobile .stream-pane {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.view-mobile .stream-pane.multiview-tape {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}
body.view-mobile .stream-pane.multiview-tape .mv-col {
  flex: 0 0 min(88vw, 340px);
  max-width: min(88vw, 340px);
  min-width: min(78vw, 300px);
  min-height: 0;
  max-height: none;
  height: 100%;
  scroll-snap-align: start;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
body.view-mobile .stream-pane.multiview-tape .mv-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.view-mobile .stream-pane.single-col {
  overflow-y: auto;
}
body.view-mobile .func-keys { display: none !important; }
body.view-mobile .stream-hint { display: none; }
body.view-mobile .stream-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 4px;
  padding: 4px 6px;
  flex: 1;
  min-width: 0;
}
body.view-mobile .stream-tabs::-webkit-scrollbar { display: none; }
body.view-mobile .stream-tabs .st {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 10px;
}

body.view-mobile .infl-hero { grid-template-columns: 1fr 1fr; }
body.view-mobile .infl-charts,
body.view-mobile .cf-grid,
body.view-mobile .chip-chain { grid-template-columns: 1fr; }
body.view-mobile .chip-chain { grid-auto-flow: row; }
body.view-mobile .rs-strip { grid-template-columns: 1fr 1fr; }
body.view-mobile .warn-panels { grid-template-columns: 1fr; }
body.view-mobile .rc-row {
  grid-template-columns: 1fr auto auto;
  min-height: 48px;
  padding: 10px;
  border-radius: 12px;
}
body.view-mobile .rc-row .rc-tag { display: none; }
body.view-mobile .ar-row {
  min-height: 48px;
  padding: 10px 8px;
}
body.view-mobile .fam-pill,
body.view-mobile .move-prio {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 12px;
}
body.view-mobile .drawer {
  width: 100%;
  max-width: 100%;
  border-radius: 16px 16px 0 0;
}
body.view-mobile .modal-card {
  width: min(100%, 100vw);
  max-height: 92dvh;
  border-radius: 16px;
  margin: 8px;
}
body.view-mobile .modal-card.wide { width: min(100%, 100vw); }

/* Bottom dock */
.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.view-mobile .mobile-dock:not([hidden]) {
  display: flex;
  pointer-events: auto;
}
.mobile-dock[hidden] { display: none !important; }
body.view-desktop .mobile-dock,
body.view-desktop .md-backdrop { display: none !important; }

.md-rail-wrap {
  background: linear-gradient(180deg, transparent 0%, rgba(7, 8, 11, 0.75) 28%, rgba(7, 8, 11, 0.96) 100%);
  padding: 6px 0 0;
}
.md-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 4px 12px 10px;
  scrollbar-width: none;
  touch-action: pan-x;
}
.md-rail::-webkit-scrollbar { display: none; }
.md-desk {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 64px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(74, 158, 255, 0.22);
  background: rgba(14, 18, 30, 0.94);
  color: var(--text-dim);
  cursor: pointer;
  scroll-snap-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.12s ease, border-color 0.12s, background 0.12s, color 0.12s;
}
.md-desk:active { transform: scale(0.96); }
.md-desk.active {
  color: #9ad0ff;
  border-color: rgba(74, 158, 255, 0.75);
  background: linear-gradient(160deg, rgba(30, 70, 130, 0.95), rgba(10, 16, 32, 0.98));
  box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.3), 0 6px 18px rgba(0, 70, 180, 0.28);
}
.md-ico { font-size: 16px; line-height: 1; }
.md-txt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-quick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  gap: 2px;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 8, 12, 0.98);
  border-top: 1px solid rgba(74, 158, 255, 0.28);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
}
.md-q {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.md-q-ico { font-size: 17px; line-height: 1; }
.md-q-lab {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.md-q:active {
  transform: scale(0.96);
  background: rgba(74, 158, 255, 0.12);
  color: #9ad0ff;
}
.md-q.primary { color: #7ec8ff; }
.md-q.primary .md-q-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(26, 70, 140, 0.9), rgba(10, 24, 48, 0.95));
  border: 1px solid rgba(74, 158, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 80, 200, 0.25);
}
.md-q.ready { color: var(--amber); }

.md-backdrop {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.md-backdrop[hidden] { display: none !important; }
.md-sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 6px);
  max-height: min(58dvh, 420px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(74, 158, 255, 0.35);
  background: linear-gradient(180deg, #121826, #0a0e16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  z-index: 2;
  pointer-events: auto;
}
.md-sheet[hidden] { display: none !important; }
.md-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--amber);
}
.md-sheet-x {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}
.md-sheet-hint {
  padding: 8px 14px 0;
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.35;
}
.md-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px 16px;
}
.md-fa {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(74, 158, 255, 0.3);
  background: rgba(20, 32, 56, 0.9);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  -webkit-tap-highlight-color: transparent;
}
.md-fa:active { background: rgba(40, 70, 120, 0.9); }
.md-fa.ghost {
  grid-column: 1 / -1;
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
  font-weight: 500;
}
.md-more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.md-more-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 72px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.md-more-item .md-ico { font-size: 18px; }
.md-more-t {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.md-more-b {
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1.3;
}
.md-more-item.active {
  border-color: rgba(74, 158, 255, 0.65);
  background: linear-gradient(160deg, rgba(26, 58, 106, 0.55), var(--bg-1));
  color: #9ad0ff;
}
.md-more-item:active { transform: scale(0.98); }
body.md-sheet-open { overflow: hidden; }

@media (max-height: 480px) and (orientation: landscape) {
  body.view-mobile {
    --mobile-dock-h: 92px;
    --bottom-h: 96px;
  }
  body.view-mobile .md-rail { display: none; }
  body.view-mobile .md-quick { padding-top: 4px; }
  body.view-mobile .stream-pane { max-height: 48px; }
}

@media (max-width: 900px) {
  .infl-hero { grid-template-columns: 1fr 1fr; }
  .infl-charts { grid-template-columns: 1fr; }
  .chip-chain { grid-template-columns: 1fr 1fr; }
  .cf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .infl-hero { grid-template-columns: 1fr; }
  .chip-chain { grid-template-columns: 1fr; }
}
/* Panel banner shared emphasis */
.panel-banner b { color: var(--amber); font-weight: 600; }

/* Region · economy filters · risk/stability · weather/travel warnings */
.region-country-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 360px;
  overflow-y: auto;
}
.rc-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
}
.rc-row:hover, .rc-row.active {
  border-color: rgba(74, 158, 255, 0.55);
  background: rgba(26, 58, 106, 0.25);
}
.rc-name { font-weight: 600; }
.rc-tag, .ar-name .rc-tag, .ar-name i.rc-tag {
  font-style: normal;
  font-size: 9px;
  color: var(--text-mute);
  font-family: var(--mono);
}
.rc-m { font-size: 10px; min-width: 36px; text-align: right; }
.ar-score.sm { font-size: 9px; min-width: 28px; opacity: 0.9; }

.rs-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}
.rs-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
}
.rs-box.travel.critical { border-color: rgba(255, 59, 48, 0.5); }
.rs-box.travel.high { border-color: rgba(255, 107, 26, 0.5); }
.rs-box.travel.elevated { border-color: rgba(245, 166, 35, 0.45); }
.rs-box.travel.ok { border-color: rgba(0, 200, 83, 0.35); }
.rs-k {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
}
.rs-v {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.rs-v-sm {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.rs-l {
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.3;
}
.rs-peer-h {
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  margin: 8px 0 6px;
}

.warn-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.warn-col {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.warn-col.travel {
  border-color: rgba(255, 107, 26, 0.28);
}
.warn-h {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin-bottom: 6px;
}
.warn-row {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 11px;
}
.warn-row:hover { border-color: rgba(74, 158, 255, 0.5); }
.warn-row.critical { border-left: 3px solid #ff3b30; }
.warn-row.high { border-left: 3px solid #ff6b1a; }
.warn-row.elevated { border-left: 3px solid #f5a623; }
.warn-row.watch { border-left: 3px solid #4a9eff; }
.warn-row b { display: block; margin-bottom: 2px; }
.warn-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  margin-bottom: 2px;
}
.warn-row p {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}
.warn-empty {
  font-size: 11px;
  color: var(--text-mute);
  padding: 8px 0;
}
.wx-eonet {
  font-size: 9px;
  color: var(--text-mute);
  margin-bottom: 8px;
  line-height: 1.4;
}
.wx-travel {
  font-size: 9px;
  margin-top: 2px;
}

body.view-mobile .rs-strip { grid-template-columns: 1fr 1fr; }
body.view-mobile .warn-panels { grid-template-columns: 1fr; }
body.view-mobile .rc-row {
  grid-template-columns: 1fr auto auto;
  gap: 4px;
}
body.view-mobile .rc-row .rc-tag { display: none; }

@media (max-width: 900px) {
  .rs-strip { grid-template-columns: 1fr 1fr; }
  .warn-panels { grid-template-columns: 1fr; }
  .rc-row { grid-template-columns: 1fr auto auto auto; }
}

/* Live / model source tags on market cards */
.bb-foot .live-tag { color: #69f0ae; font-weight: 600; letter-spacing: 0.04em; }
.panel-banner .mono { font-family: var(--mono); }

/* Power mix · telecoms · outages · IIS */
.pm-sum { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.pm-sum b { color: var(--text); }
.pm-grid { display: flex; flex-direction: column; gap: 6px; }
.pm-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.pm-lab { color: var(--text-mute); }
.pm-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}
.pm-bar i { display: block; height: 100%; border-radius: 4px; }

.tel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tel-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.out-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.out-pill {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-1);
}
.out-pill.down { color: #ff5252; border-color: rgba(255,82,82,0.4); }
.out-pill.warn { color: #f5a623; border-color: rgba(245,166,35,0.4); }
.out-pill.up { color: #69f0ae; border-color: rgba(105,240,174,0.35); }
.out-list { display: flex; flex-direction: column; gap: 5px; max-height: 320px; overflow-y: auto; }
.out-row {
  display: grid;
  grid-template-columns: 88px 64px 1fr;
  gap: 8px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text);
  cursor: pointer;
}
.out-row.news { cursor: default; opacity: 0.95; }
.out-row:hover, .out-row.active { border-color: rgba(74,158,255,0.5); }
.out-st {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid;
  text-align: center;
}
.out-type { font-size: 9px; color: var(--text-mute); padding-top: 2px; }
.out-body strong { display: block; font-size: 12px; margin-bottom: 2px; }
.out-meta { font-size: 9px; color: var(--text-mute); font-family: var(--mono); }
.out-body p { font-size: 10px; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.out-news-h {
  margin: 10px 0 6px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.iis-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.iis-score {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-1);
}
.iis-k { font-family: var(--mono); font-size: 10px; color: var(--text-mute); letter-spacing: 0.08em; }
.iis-v { font-family: var(--mono); font-size: 32px; font-weight: 700; line-height: 1.1; }
.iis-l { font-size: 9px; color: var(--text-mute); text-align: center; }
.iis-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.iis-f {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
}
.iis-f b { font-family: var(--mono); color: var(--text); }

@media (max-width: 700px) {
  .tel-grid { grid-template-columns: 1fr; }
  .out-row { grid-template-columns: 72px 1fr; }
  .out-type { display: none; }
  .iis-hero { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   STANDALONE / HOMESCREEN APP MODE (iOS · Android · desktop PWA)
   Entry: https://benjaminkoch.info/wm_terminal.html
   ═══════════════════════════════════════════════════════════ */
html.standalone-app,
body.standalone-app {
  overscroll-behavior: none;
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  html { height: 100%; }
  body {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }
  .terminal {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }
}
/* Installed app + phone layout: keep dock clear of notch / home indicator */
body.standalone-app.view-mobile {
  --mobile-dock-h: 124px;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}
body.standalone-app.view-mobile .topbar {
  padding-top: max(0px, env(safe-area-inset-top, 0px));
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  height: auto;
}
body.standalone-app.view-mobile .mobile-dock {
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}
body.standalone-app.view-mobile .workspace {
  padding-bottom: calc(var(--mobile-dock-h) + env(safe-area-inset-bottom, 0px) + 8px);
}
body.standalone-app.view-mobile .bottom-bar {
  margin-bottom: calc(var(--mobile-dock-h));
}
/* Prefer touch scrolling inside panels in app mode */
body.standalone-app .widget-body,
body.standalone-app .workspace,
body.standalone-app .md-rail,
body.standalone-app .context-bar {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.standalone-app button,
body.standalone-app .md-desk,
body.standalone-app .md-q,
body.standalone-app .domain-pill {
  touch-action: manipulation;
}

/* ═══════════════════════════════════════════════════════════
   CLASSIC POLISH — responsive, collapse, search, HD Bloomberg
   ═══════════════════════════════════════════════════════════ */

/* Hide DESK/PHONE toggle — layout is automatic */
#viewToggle { display: none !important; }

/* Readable HD type */
html, body {
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
.widget-title {
  color: #ffb74d !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
}
.widget-body {
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  color: #d4dae3 !important;
}
.widget-body b, .widget-body strong { color: #fff !important; }
/* Amber/orange headlines (original soft terminal) */
.news-title, .hot-name, .tname, .wx-name, .a-title, .vt-title {
  color: #ffb74d !important;
  font-weight: 600 !important;
}
.bb-sym {
  color: var(--amber) !important;
  font-weight: 700 !important;
}
.news-src, .ctx-label, .ticker-label, .indices-label, .nav-section, .stream-tabs .st.active {
  font-weight: 700 !important;
}
.stream-tabs .st.active {
  color: var(--amber) !important;
}
/* Red / green market deltas (original) */
.bb-chg.up, .ms-chg.up, .m-chg.up, .hot-delta.up { color: var(--green) !important; }
.bb-chg.down, .ms-chg.down, .m-chg.down, .hot-delta.down { color: var(--red) !important; }
/* Hotspot heat rising is risk-up → red; falling → green (original semantics) */
.hot-delta.up { color: var(--red) !important; }
.hot-delta.down { color: var(--green) !important; }
.bb-val, .kmri-val, .wx-temp, .ms-val, .hot-score, .clock {
  font-variant-numeric: tabular-nums !important;
}
.bb-chg.up, .ms-chg.up, .hot-delta.up { color: var(--green) !important; }
.bb-chg.down, .ms-chg.down, .hot-delta.down { color: var(--red) !important; }

/* Search suggest (classic) */
.topbar, .topbar-center, .search-box { overflow: visible !important; }
.search-box { position: relative; z-index: 80; }
.search-suggest {
  position: fixed !important;
  z-index: 500 !important;
  max-height: min(420px, 55vh);
  overflow-y: auto;
  background: #11141b;
  border: 1px solid #3d4658;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  padding: 4px;
  color: var(--text);
  scrollbar-width: thin;
}
.search-suggest[hidden] { display: none !important; }
.sg-group {
  padding: 6px 10px 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
}
.sg-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
}
.sg-item:hover, .sg-item.active {
  background: rgba(245, 166, 35, 0.12);
  outline: 1px solid rgba(245, 166, 35, 0.35);
}
.sg-ico {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-align: center;
}
.sg-title { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.sg-sub { display: block; font-size: 11px; color: var(--text-mute); margin-top: 1px; }
.sg-kind {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sg-hint {
  padding: 6px 10px 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Layout edit / resize */
body.layout-edit .widget-head { cursor: grab !important; background: rgba(245,166,35,0.08); }
.widget.dragging { opacity: 0.55; outline: 1px dashed var(--amber); z-index: 20; }
.widget.drag-over { outline: 2px solid var(--blue); }
.widget-resize {
  width: 16px !important;
  height: 16px !important;
  opacity: 0.5 !important;
  pointer-events: auto !important;
  z-index: 30 !important;
  background: linear-gradient(135deg, transparent 45%, var(--amber) 46%) !important;
}
.widget:hover .widget-resize,
.widget-grid[data-edit="true"] .widget-resize,
body.layout-edit .widget-resize {
  opacity: 1 !important;
}
.widget-ghost {
  position: fixed;
  z-index: 600;
  pointer-events: none;
  background: var(--bg-2);
  border: 1px solid var(--amber);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: var(--shadow);
}

/* Side rail collapse */
.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rail-pin {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.rail-pin:hover { color: var(--amber); border-color: var(--amber-dim); }

body.rail-collapsed {
  --side-w: 52px;
}
body.rail-collapsed .side-nav .nav-txt,
body.rail-collapsed .side-nav .nav-hint,
body.rail-collapsed .side-nav .nav-section span,
body.rail-collapsed .side-nav .nav-foot {
  display: none !important;
}
body.rail-collapsed .side-nav .nav-item {
  justify-content: center;
  padding: 10px 6px;
}
body.rail-collapsed .side-nav .nav-ico {
  margin: 0;
  font-size: 16px;
}
body.rail-collapsed .side-nav .nav-item.active {
  box-shadow: inset 3px 0 0 var(--amber);
  background: rgba(245, 166, 35, 0.12);
}
body.rail-collapsed .side-nav {
  transition: width 0.18s ease;
}
/* Sidebar must stay scrollable through the full desk list */
.side-nav {
  transition: width 0.18s ease, min-width 0.18s ease;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
  min-height: 0;
}
.side-nav .nav-section {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-1);
  padding-bottom: 2px;
}
#deskNav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding-bottom: 4px;
}
.side-nav .nav-foot {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent, var(--bg-1) 28%);
  margin-top: 0;
}

/* Bottom stream collapse modes */
.stream-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.stool {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.stool:hover { color: var(--text); border-color: var(--border-hi); }
.stool.active {
  color: #0a0a0a;
  background: var(--amber);
  border-color: transparent;
}
.stream-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-stream-mode="compact"] {
  --bottom-h: max(16vh, 132px);
}
body[data-stream-mode="hidden"] {
  --bottom-h: 40px;
}
body[data-stream-mode="hidden"] .stream-pane,
body[data-stream-mode="hidden"] .stream-tabs,
body[data-stream-mode="hidden"] .stream-hint {
  display: none !important;
}
body[data-stream-mode="open"] {
  --bottom-h: min(36vh, 260px);
}
.bottom-bar {
  transition: min-height 0.2s ease, max-height 0.2s ease;
  overflow: hidden;
}

/* Pure responsive — tablet icon rail */
@media (max-width: 1200px) and (min-width: 961px) {
  :root { --side-w: 56px; }
  body.view-desktop .side-nav .nav-txt,
  body.view-desktop .side-nav .nav-hint,
  body.view-desktop .side-nav .nav-section span:first-child,
  body.view-desktop .side-nav .nav-foot {
    display: none !important;
  }
  body.view-desktop .side-nav .nav-item {
    justify-content: center;
    padding: 10px 6px;
  }
}

/* HD wide */
@media (min-width: 1600px) {
  :root {
    --side-w: 148px;
    --bottom-h: min(34vh, 280px);
  }
  body { font-size: 13.5px; }
  .widget-body { font-size: 13px !important; }
}

/* Selects readable */
select, .ctx-group select {
  color: var(--text) !important;
  background: var(--bg-0) !important;
  color-scheme: dark;
}
select option, select optgroup {
  background: #0c1018;
  color: #f4f6fb;
}

/* ═══════════════════════════════════════════════════════════
   SHARP · SOFT ORIGINAL · COLOURED WINDOW TOPS · AUTO-ARRANGE
   ═══════════════════════════════════════════════════════════ */
html, body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Soft chrome — no harsh high-contrast frames */
.topbar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1)) !important;
  border-bottom: 1px solid var(--border) !important;
}
.context-bar {
  background: var(--bg-1) !important;
  border-bottom: 1px solid var(--border) !important;
}
.bottom-bar {
  background: var(--bg-1) !important;
  border-top: 1px solid var(--border) !important;
}

/* Window title amber (original) — soft, not neon */
.widget-title {
  color: var(--amber) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-shadow: none;
}
.widget-meta {
  color: var(--text-mute) !important;
  font-weight: 500;
}
.widget-body {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.45;
}

.nav-item.active {
  background: var(--amber-glow) !important;
  border-color: var(--amber-dim) !important;
  color: var(--amber) !important;
}
.nav-item.active .nav-txt,
.nav-item.active .nav-ico {
  color: var(--amber) !important;
}
.nav-foot,
#navFoot {
  color: var(--amber) !important;
}

/* Bottom stream: orange/amber language kept soft */
.stream-tabs .st:hover { color: var(--amber) !important; }
.stream-tabs .st.active {
  color: var(--amber) !important;
  border-bottom-color: var(--amber) !important;
  font-weight: 700 !important;
  text-shadow: none;
}
.stream-hint,
.stream-head .mono,
.bottom-bar .accent {
  color: #ffb74d !important;
}

.vt-title,
.news-title,
.a-title,
.tname,
.hot-name,
.wx-name {
  color: #ffb74d !important;
  font-weight: 600 !important;
}
.vt-title b { color: #ffcc80 !important; }
.vt-row.crit .vt-title { color: #ffd54f !important; }
.vt-row.high .vt-title { color: #ff9800 !important; }
.vt-row.med .vt-title { color: #ffc107 !important; }
.vt-row.info .vt-title { color: #ffb74d !important; }
.vt-row.answer .vt-title { color: #69f0ae !important; }
.news-row.flash .news-title { color: #ffd54f !important; }

.vt-src,
.news-src {
  color: var(--cyan) !important;
  font-weight: 700 !important;
}

.panel-banner b,
.panel-banner em,
.panel-banner .mono {
  color: var(--amber) !important;
}

.clock,
.ind-name,
.view-header h1,
#viewTitle {
  color: var(--amber) !important;
}
.view-path,
#viewPath {
  color: var(--cyan) !important;
}

.pill:not(.soft) {
  background: var(--amber) !important;
  color: var(--bg-0) !important;
}
.pill.soft {
  color: var(--amber) !important;
  border-color: var(--amber-dim) !important;
}
.em, em, .accent, code {
  color: var(--amber) !important;
}

.mv-head span { color: var(--amber) !important; }
.mv-col[data-col="news"] .mv-head span { color: var(--cyan) !important; }
.mv-col[data-col="markets"] .mv-head span { color: #82b1ff !important; }
.mv-col[data-col="events"] .mv-head span { color: var(--orange) !important; }
.mv-col[data-col="disasters"] .mv-head span { color: #80cbc4 !important; }

.domain-pill.active,
.time-range button.active,
.tab.active,
.stool.active {
  color: var(--bg-0) !important;
  background: var(--amber) !important;
}

/* Shadowy filled panels (depth, not OS outline) */
.widget.is-filled {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.widget-grid.auto-arrange .widget.is-filled[data-w="12"] {
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.48),
    0 1px 0 rgba(0, 0, 0, 0.28),
    inset 0 1px 0 color-mix(in srgb, var(--w-accent, var(--amber)) 22%, transparent);
}
.widget-grid[data-edit="true"] .widget.is-empty {
  opacity: 0.9;
  border-style: dashed;
}
@media (max-width: 960px) {
  .widget.is-empty .widget-body { max-height: 40px; }
  .widget-grid { grid-auto-flow: row; }
}

/* Fallback when color-mix unsupported */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .widget-head {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  }
  .widget-head::before {
    background: linear-gradient(90deg, var(--amber), transparent);
  }
}

/* ═══════════════════════════════════════════════════════════
   FULL RESPONSIVE — phone · tablet · landscape · safe areas
   ═══════════════════════════════════════════════════════════ */

/* Prevent horizontal page scroll / iOS bounce issues */
html, body {
  max-width: 100vw;
  overscroll-behavior: none;
}
img, svg, canvas, video {
  max-width: 100%;
}

/* Tables / wide boards: swipe instead of break layout */
body.view-mobile .compare-table-wrap,
body.view-mobile .bb-board,
body.view-mobile .market-grid,
body.view-mobile .wx-world-grid,
body.view-mobile .ind-grid,
body.view-mobile .triad-board {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
body.view-mobile .compare-table {
  min-width: 480px;
}
body.view-mobile .panel-banner {
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}
body.view-mobile .vt-row {
  grid-template-columns: 36px 48px 1fr;
  font-size: 11px;
  padding: 6px 8px;
  min-height: 36px;
}
body.view-mobile .vt-title {
  -webkit-line-clamp: 3;
}

/* Map widget needs real height on phones */
body.view-mobile .widget[data-id="map"] {
  min-height: min(48vh, 360px) !important;
}
body.view-mobile .widget[data-id="map"] .widget-body {
  min-height: min(42vh, 320px) !important;
  height: min(42vh, 320px);
}
body.view-mobile .widget[data-id="map"] .maplibregl-map,
body.view-mobile .widget[data-id="map"] #map3d,
body.view-mobile .widget[data-id="map"] .map-root {
  min-height: min(40vh, 300px);
  height: 100%;
}

/* Drawers / modals as bottom sheets on touch */
body.view-mobile .drawer {
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  max-height: min(88dvh, 720px);
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.view-mobile .modal {
  align-items: flex-end;
  padding: 0;
}
body.view-mobile .modal-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 16px 16px 0 0;
  max-height: min(92dvh, 800px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Compact stream modes on mobile still leave room for dock */
body.view-mobile[data-stream-mode="compact"] {
  --bottom-h: max(18vh, 120px);
}
body.view-mobile[data-stream-mode="hidden"] {
  --bottom-h: 44px;
}
body.view-mobile[data-stream-mode="open"] {
  --bottom-h: min(30vh, 220px);
}

/* —— Tablet portrait / phablet (view-mobile already on) —— */
@media (min-width: 700px) and (max-width: 1100px) {
  body.view-mobile {
    --bottom-h: min(26vh, 240px);
    --mobile-dock-h: 124px;
  }
  body.view-mobile .widget-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  body.view-mobile .widget[data-id="map"],
  body.view-mobile .widget[data-w="12"],
  body.view-mobile .widget.is-filled[data-w="12"] {
    grid-column: 1 / -1 !important;
  }
  body.view-mobile .stream-pane.multiview-tape .mv-col {
    flex: 0 0 min(46vw, 360px);
    max-width: min(46vw, 360px);
    min-width: min(42vw, 320px);
  }
  body.view-mobile .warn-panels {
    grid-template-columns: 1fr 1fr;
  }
  body.view-mobile .rs-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* —— Landscape phone / short height —— */
body.view-mobile.orient-landscape {
  --topbar-h: 44px;
  --bottom-h: min(36vh, 160px);
  --mobile-dock-h: 96px;
  --ticker-h: 48px;
}
body.view-mobile.orient-landscape .brand-text {
  display: none;
}
body.view-mobile.orient-landscape .view-header {
  padding: 6px 10px;
}
body.view-mobile.orient-landscape .view-header h1 {
  font-size: 14px;
}
body.view-mobile.orient-landscape .md-quick {
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
}
body.view-mobile.orient-landscape .md-q {
  min-height: 44px;
}
body.view-mobile.orient-landscape .md-desk {
  min-height: 48px;
  min-width: 56px;
  padding: 6px 10px;
}
body.view-mobile.orient-landscape .widget[data-id="map"] {
  min-height: min(56vh, 280px) !important;
}

/* —— Small phones —— */
@media (max-width: 400px) {
  body.view-mobile {
    --bottom-h: min(32vh, 180px);
  }
  body.view-mobile .brand-name {
    font-size: 10px;
  }
  body.view-mobile .pill {
    font-size: 8px;
    padding: 2px 6px;
  }
  body.view-mobile .md-q-lab {
    font-size: 8px;
  }
  body.view-mobile .stream-pane.multiview-tape .mv-col {
    flex: 0 0 86vw;
    max-width: 86vw;
    min-width: 80vw;
  }
}

/* Desktop still gets media-query help if JS late / print / no class yet */
@media (max-width: 1024px) {
  .side-nav {
    -webkit-overflow-scrolling: touch;
  }
  .workspace {
    -webkit-overflow-scrolling: touch;
  }
  input, select, textarea, button {
    touch-action: manipulation;
  }
  /* Avoid iOS zoom on focus (font-size ≥ 16px) */
  .search-box input,
  .ctx-group select,
  select {
    font-size: max(16px, 1em);
  }
}

/* Prefer reduced motion on mobile scrolls */
@media (prefers-reduced-motion: reduce) {
  body.view-mobile .stream-pane.multiview-tape {
    scroll-snap-type: none;
  }
  body.view-mobile .md-desk,
  body.view-mobile .md-q {
    transition: none;
  }
}

/* Standalone PWA: extra safe area under dock */
body.standalone-app.view-mobile {
  --mobile-dock-h: calc(118px + env(safe-area-inset-bottom, 0px));
}
body.standalone-app.view-mobile .mobile-dock {
  padding-bottom: 0;
}
body.standalone-app.view-mobile .bottom-bar {
  margin-bottom: var(--mobile-dock-h);
}
body.standalone-app.view-mobile .workspace {
  padding-bottom: calc(var(--mobile-dock-h) + 12px);
}

/* Touch devices: larger hit targets even if desktop width (hybrid tablets) */
body.is-touch .nav-item {
  min-height: 44px;
}
body.is-touch .icon-btn,
body.is-touch .rail-pin {
  min-width: 40px;
  min-height: 40px;
}
body.is-touch .stream-tabs .st {
  min-height: 36px;
}
