:root {
  --bg0: #050b16;
  --bg1: #0a1224;
  --bg2: #101c34;
  --panel: rgba(10, 18, 36, 0.82);
  --panel-solid: rgba(12, 20, 38, 0.94);
  --border: rgba(56, 189, 248, 0.18);
  --border-strong: rgba(34, 211, 238, 0.42);
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --cyan-dim: #0891b2;
  --neon: #00f2ff;
  --green: #34d399;
  --green-bright: #00e676;
  --red: #f87171;
  --amber: #fbbf24;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --glow: 0 0 24px rgba(0, 242, 255, 0.22);
  --glow-strong: 0 0 40px rgba(0, 242, 255, 0.35);
  --font-ui: "IBM Plex Sans", sans-serif;
  --font-display: "Orbitron", sans-serif;
  --radius: 12px;
  --gap: 12px;
  --panel-pad: 14px;
  --row-min-neural: 420px;
  --row-min-intel: 260px;
  --row-min-ops: 280px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(14, 165, 233, 0.16), transparent 55%),
    radial-gradient(900px 480px at 92% 0%, rgba(99, 102, 241, 0.1), transparent 50%),
    radial-gradient(700px 400px at 50% 40%, rgba(34, 211, 238, 0.04), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 42%, #05080f);
  color: var(--text);
  font-family: var(--font-ui);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

/* Ambient HUD grid across the whole app, not just inside one card — ties
   every panel to the same "sci-fi console" backdrop instead of Neural
   Shell being the only place with this texture. Fixed + very low opacity
   so it reads as atmosphere, not noise, and never competes with content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, #000 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.aqb-app { position: relative; z-index: 1; }

.aqb-app {
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px 28px;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* —— Top bar —— */
.aqb-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 46, 0.96), rgba(11, 17, 32, 0.88));
  backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.04), 0 8px 32px rgba(0, 0, 0, 0.25);
  position: relative;
  /* backdrop-filter creates its own stacking context — without an explicit
     z-index here, .notif-panel's z-index:50 only competes with siblings
     inside this bar, not with .status-bar right below (which also has
     backdrop-filter and comes later in DOM order, so it painted on top,
     covering the notifications dropdown). This puts the whole topbar's
     stacking context above every section that follows it. */
  z-index: 100;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.06);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.brand {
  display: flex; gap: 10px; align-items: center;
  text-decoration: none; color: inherit;
}
.brand:hover .brand-title {
  filter: brightness(1.08);
}
html { scroll-behavior: smooth; }
#market, #neural, #signals, #positions, #portfolio, #exchange, #risk, #news,
#sec-risk, #sec-exchange, #sec-mode, #sec-bot, #sec-prefs, #sec-watchlist, #sec-ui {
  scroll-margin-top: 72px;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(8, 145, 178, 0.35), rgba(34, 211, 238, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: var(--glow);
  overflow: hidden;
}
.brand-mark svg { display: block; }
.brand-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, #e2e8f0, var(--cyan-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { color: var(--muted); font-size: 10px; letter-spacing: 0.02em; }

.aqb-nav {
  display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: center;
}
.aqb-nav a {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.aqb-nav a.active {
  color: var(--neon);
  border-color: rgba(0, 242, 255, 0.45);
  background: rgba(0, 242, 255, 0.1);
  box-shadow: 0 0 16px rgba(0, 242, 255, 0.22), inset 0 0 12px rgba(0, 242, 255, 0.06);
  text-shadow: 0 0 12px rgba(0, 242, 255, 0.45);
}
.aqb-nav a:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.06);
}
.nav-mobile-extra { display: none; }
.nav-more {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-more[hidden] { display: none !important; }
.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.nav-more-btn:hover,
.nav-more.open .nav-more-btn {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.06);
}
.nav-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 40;
  flex-direction: column;
  gap: 2px;
}
.nav-more.open .nav-more-menu { display: flex; }
.nav-more-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  border-bottom: none !important;
  white-space: nowrap;
}
.nav-more-menu a.active,
.nav-more-menu a:hover {
  background: rgba(34, 211, 238, 0.08);
  border-bottom: none !important;
}

.aqb-top-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
}
.locale-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.locale-opt {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--bg2);
  text-decoration: none;
}
.locale-opt:hover { color: var(--text); }
.locale-opt.active {
  color: var(--cyan-bright, #67e8f9);
  background: rgba(34, 211, 238, 0.12);
}
.locale-opt + .locale-opt { border-left: 1px solid var(--border); }
.search-wrap { position: relative; }
.search {
  width: 210px;
  max-width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px 7px 30px;
  font-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236794a8' stroke-width='1.8'%3E%3Ccircle cx='6.5' cy='6.5' r='4.5'/%3E%3Cpath d='M10 10l2.5 2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px 50%;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 180px;
  max-height: 240px;
  overflow: auto;
  z-index: 50;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  padding: 4px;
}
.search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.search-item:hover { background: rgba(34, 211, 238, 0.08); color: var(--cyan); }
.search-empty { padding: 10px; color: var(--muted); font-size: 12px; }
.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.05);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--border-strong); }
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  font-weight: 600;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, 86vw);
  max-height: 360px;
  overflow: auto;
  z-index: 50;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  padding: 10px;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.notif-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 12px;
}
.notif-item strong { color: var(--text); font-size: 11px; letter-spacing: 0.02em; }
.notif-item span { color: var(--muted); }
.notif-item em { color: var(--muted); font-style: normal; font-size: 10px; opacity: 0.8; }
.notif-item.level-risk strong,
.notif-item.level-error strong,
.notif-item.level-warn strong { color: var(--amber); }
.notif-empty { color: var(--muted); font-size: 12px; padding: 8px; }
.clock, .avatar {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.35;
  gap: 0;
}
.clock-date { opacity: 0.75; }
.clock-time { font-variant-numeric: tabular-nums; }
.avatar {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
}
.avatar-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  min-width: 0;
}
.avatar-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.avatar-role {
  font-size: 10px;
  color: var(--muted);
}
.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-bright);
  background: linear-gradient(145deg, rgba(8, 145, 178, 0.45), rgba(34, 211, 238, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
  flex-shrink: 0;
}
.logout-link {
  font-size: 11px;
  color: var(--cyan);
  opacity: 0.85;
}
.logout-link:hover { opacity: 1; text-decoration: underline; }

/* —— Status bar (exchanges + bot) —— */
.status-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12, 22, 42, 0.88), rgba(8, 14, 28, 0.78));
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0, 242, 255, 0.06);
}
.status-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.55) 30%, rgba(52, 211, 153, 0.35) 60%, transparent);
}
.status-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.ex-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ex-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  min-width: 148px;
  text-transform: none;
  letter-spacing: 0;
}
.ex-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ex-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.08);
  font-size: 11px;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.08);
}
.ex-badge.is-offline {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.06);
  box-shadow: none;
}
.ex-badge .ex-name { color: var(--text); font-weight: 500; }
.ex-badge .ex-latency { color: var(--muted); }
.ex-badge .ex-conn {
  display: none;
}
.ex-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.ex-dot.ok {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.bot-pill {
  display: inline-flex; gap: 8px; align-items: center;
  border: 1px solid rgba(52, 211, 153, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 95, 70, 0.22));
  color: var(--green-bright);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.28);
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}
.bot-pill:not(.on) {
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
  box-shadow: none;
  text-shadow: none;
}
.bot-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.bot-pill.on .dot {
  background: var(--green-bright);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.bot-chevron { display: none; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.btn-close-pos {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  cursor: pointer;
  font-size: 12px;
}
.btn-close-pos:hover { background: rgba(248, 113, 113, 0.22); }

/* —— Metrics —— */
.metric-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}
.metric-card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--panel-pad);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 28px rgba(0, 0, 0, 0.22);
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.panel:hover {
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 24px rgba(0, 0, 0, 0.35), var(--glow);
  transform: translateY(-1px);
}
/* HUD corner brackets — a light sci-fi touch shared by every card. Skipped
   on .neural-panel, which already owns ::before for its background texture
   and gets a stronger dedicated treatment instead (see below). */
.panel:not(.neural-panel):not(.neural-hero)::before,
.panel:not(.neural-panel):not(.neural-hero)::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.25s;
}
.panel:not(.neural-panel):not(.neural-hero):hover::before,
.panel:not(.neural-panel):not(.neural-hero):hover::after {
  opacity: 0.9;
}
.panel:not(.neural-panel):not(.neural-hero)::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  border-top-left-radius: 4px;
}
.panel:not(.neural-panel):not(.neural-hero)::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
  border-bottom-right-radius: 4px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
}
.metric-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 0 20px rgba(0, 242, 255, 0.12);
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.45), transparent);
}
.metric-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.metric-ico {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 12px;
}
.mi-blue { color: var(--cyan-bright); background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.3); }
.mi-purple { color: #c4b5fd; background: rgba(168, 85, 247, 0.14); border: 1px solid rgba(168, 85, 247, 0.3); }
.mi-green { color: var(--green); background: rgba(52, 211, 153, 0.14); border: 1px solid rgba(52, 211, 153, 0.3); }
.mi-cyan { color: var(--neon); background: rgba(0, 242, 255, 0.1); border: 1px solid rgba(0, 242, 255, 0.3); }
.mi-red { color: var(--red); background: rgba(248, 113, 113, 0.14); border: 1px solid rgba(248, 113, 113, 0.3); }
.metric-label { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
}
.metric-main { min-width: 0; flex: 1 1 auto; }
.metric-value {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.metric-delta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.gauge-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }

/* —— Ticker —— */
.ticker-strip {
  display: flex; gap: 0; overflow-x: auto; align-items: stretch;
  margin-top: var(--gap);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(8, 14, 28, 0.72);
  scrollbar-width: thin;
}
.ticker-item {
  flex: 1 1 0;
  min-width: 150px;
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px;
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(56, 189, 248, 0.12);
  background: transparent;
  font-size: 12px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}
.ti-ico {
  align-self: center;
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 10px; font-weight: 700;
  font-family: var(--font-display);
}
.ti-ico.ti-amber  { color: var(--amber);  background: rgba(251, 191, 36, 0.16); }
.ti-ico.ti-blue   { color: var(--cyan-bright); background: rgba(56, 189, 248, 0.16); }
.ti-ico.ti-purple { color: #c4b5fd; background: rgba(168, 85, 247, 0.16); }
.ti-ico.ti-green  { color: var(--green); background: rgba(52, 211, 153, 0.16); }
.ti-ico.ti-red    { color: var(--red); background: rgba(248, 113, 113, 0.16); }
.ticker-item:hover,
.ticker-item.active {
  border-color: transparent;
  background: rgba(0, 242, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--neon);
}
.ticker-item em { font-style: normal; }
.ticker-watch {
  flex: 0 0 auto;
  margin: 6px 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px dashed rgba(0, 242, 255, 0.4);
  background: rgba(0, 242, 255, 0.05);
  color: var(--neon);
  font-size: 12px;
  cursor: pointer;
  align-self: center;
  white-space: nowrap;
}
.ticker-watch:hover { background: rgba(0, 242, 255, 0.12); }
.pair-select-wrap { display: inline-flex; }
.pair-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  max-width: 140px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Dashboard rows (12-col aligned tracks) —— */
.dash-row {
  display: grid;
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: stretch;
  width: 100%;
}
.dash-row[hidden] { display: none !important; }
.dash-row > .panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.dash-row > .panel > .panel-head {
  flex: 0 0 auto;
  align-items: center;
  margin-bottom: 12px;
  min-height: 28px;
}
.dash-row > .panel > .panel-head h2 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.panel-fill {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-foot-sticky {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 10px;
}

/* Feature Stream (left) + Market Overview (center) — equal width, per
   explicit request — + stacked side column: Regime Detection → Sentiment &
   News. All three stretch to the same row height so bottoms align. */
.main-grid {
  grid-template-columns: minmax(0, 4.4fr) minmax(0, 4.4fr) minmax(0, 3.6fr);
  align-items: stretch;
}
.main-grid .chart-panel {
  min-height: 0;
  height: 100%;
}
.main-grid .feature-stream-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* Full row height now (was a short, wide card stacked in the side column) —
   stack chart above stats to make full use of that height, same "hero
   chart" shape as Market Overview's own candle chart next to it. */
.main-grid .feature-stream-panel .feature-stream-body {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}
.main-grid .feature-stream-panel .feature-chart-wrap {
  min-height: 140px;
}
.main-grid .feature-stream-panel .feature-side-stats {
  grid-template-columns: repeat(2, 1fr);
}
.main-grid .chart-panel > .panel-fill {
  flex: 1 1 auto;
  min-height: 0;
}
.main-grid .candle-chart-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.main-grid .candle-chart-wrap[hidden] { display: none !important; }
.market-side-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  min-height: 100%;
  height: 100%;
  align-self: stretch;
}
.market-side-col > .panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: auto;
}
.market-side-col .regime-panel {
  flex: 1 1 0;
}
.market-side-col .sentiment-panel {
  flex: 1.05 1 0;
}
.candle-chart {
  flex: 1 1 auto;
  min-height: 300px;
  height: 380px;
}
.main-grid .candle-chart {
  height: 100%;
  min-height: 280px;
}
/* Lightweight Charts v4.2+ auto-injects this attribution link into whatever
   host element createChart() was given (#tv-attr-logo, id set by the
   library itself — not app markup). Hidden per explicit user request, across
   every chart instance in the app (Market Overview, Market Detail,
   Derivatives, Portfolio equity — see pages.js/dashboard.js createChart()
   calls). The free-tier license requires this attribution to stay visible,
   so hiding it carries that licensing risk knowingly, on the user's own call. */
#candleChart #tv-attr-logo,
#mdChart #tv-attr-logo,
#derivChart #tv-attr-logo,
#portEquityChart #tv-attr-logo { display: none !important; }

.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 10px; padding-bottom: 9px;
  background-image: linear-gradient(90deg, rgba(56, 189, 248, 0.4), transparent 75%);
  background-repeat: no-repeat;
  background-position: bottom left;
  background-size: 100% 1px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-ico { color: var(--cyan); font-size: 11px; opacity: 0.9; }
.badge {
  color: var(--cyan);
  font-size: 10px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.06);
  white-space: nowrap;
}
.pair-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.pair-meta strong { color: var(--text); }
/* Shown only when the exchange's real API didn't respond and the chart is
   plotting BasePublicConnector's synthetic fallback candles — never leave
   fake prices looking indistinguishable from a real market chart. */
.fallback-badge {
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
}

.chart-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mode-tabs, .tf-tabs { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.mode-tabs button, .tf-tabs button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 11px;
}
.mode-tabs button.active,
.mode-tabs button:hover,
.tf-tabs button.active,
.tf-tabs button:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}
.candle-chart-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
}
.candle-chart {
  width: 100%;
  height: 340px;
  min-height: 220px;
  position: relative;
  border-radius: 8px;
  background: rgba(6, 10, 20, 0.45);
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
  pointer-events: none;
  z-index: 2;
  background: rgba(8, 12, 24, 0.62);
  border-radius: 8px;
}
.chart-empty[hidden] { display: none !important; }

/* Order book ladder + depth (blueprint §12) */
.orderbook-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 340px;
  min-height: 220px;
}
.orderbook-wrap[hidden] { display: none !important; }
.ob-stats {
  display: flex;
  gap: 22px;
  font-size: 11px;
  color: var(--muted);
}
.ob-stats strong { display: block; color: var(--text); font-size: 14px; font-family: var(--font-display), monospace; }
.ob-stat-label { text-transform: uppercase; letter-spacing: 0.06em; }
.ob-imbalance-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(248, 113, 113, 0.35);
  overflow: hidden;
}
.ob-imbalance-bar > i { display: block; height: 100%; background: var(--green); width: 50%; }
.ob-ladder {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: hidden;
}
.ob-side { display: flex; flex-direction: column; min-height: 0; }
.ob-side-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 6px 4px;
}
.ob-rows { overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 1px; }
.ob-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 1;
}
.ob-row::before {
  content: "";
  position: absolute;
  inset: 0;
  right: auto;
  border-radius: 3px;
  z-index: -1;
  width: var(--depth, 0%);
}
.ob-bids .ob-row::before { background: rgba(52, 211, 153, 0.16); }
.ob-asks .ob-row::before { background: rgba(248, 113, 113, 0.16); }
.ob-bids .ob-row .ob-price { color: var(--green); }
.ob-asks .ob-row .ob-price { color: var(--red); }
.ob-row.large { outline: 1px solid var(--amber); }
.ob-row.large .ob-price { color: var(--amber); }
.ob-hint { font-size: 11px; color: var(--muted); margin: 0; }

/* Correlation matrix (Risk page) */
#correlationTable th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
#correlationTable td { text-align: center; font-variant-numeric: tabular-nums; }
#correlationTable .corr-high { background: rgba(248, 113, 113, 0.28); color: var(--red); font-weight: 600; }
#correlationTable .corr-mid { background: rgba(251, 191, 36, 0.18); color: var(--amber); }
#correlationTable .corr-low { color: var(--muted); }
#correlationTable .corr-neg { background: rgba(52, 211, 153, 0.2); color: var(--green); }

/* Close Position form: percent slider + close button */
.close-pos-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.close-pct-slider { width: 64px; accent-color: var(--cyan); }
.close-pct-label { font-size: 11px; color: var(--muted); min-width: 32px; font-variant-numeric: tabular-nums; }
.btn-trailing { font-size: 11px; padding: 4px 8px; }

/* Sub-screen tabs for the 6 dedicated blueprint pages */
.subtabs { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs button {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(10, 16, 30, 0.5);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.subtabs button.active, .subtabs button:hover {
  color: var(--cyan);
  border-color: var(--border-strong);
  background: rgba(34, 211, 238, 0.08);
}
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-tile {
  background: rgba(10, 16, 30, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.stat-tile .metric-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.stat-tile .metric-value { font-size: 18px; font-family: var(--font-display), monospace; }
.badge-stub { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: rgba(251, 191, 36, 0.15); color: var(--amber); margin-left: 6px; }

.chart-panel { position: relative; }
.chart-panel .panel-head { flex-wrap: wrap; }
.pnl-chart-wrap {
  position: relative;
  width: 100%;
  height: 160px;
}
.spark-wrap {
  position: relative;
  width: 72px;
  height: 36px;
  flex: 0 0 auto;
  margin-top: 0;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
.table-scroll .aqb-table { min-width: 480px; }
.table-scroll .aqb-table.compact { min-width: 340px; }

/* —— Neural Shell —— */
/* —— Neural Shell hero banner —— */
.neural-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(0, 242, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 35% at 72% 30%, rgba(99, 102, 241, 0.12), transparent 60%),
    radial-gradient(ellipse 45% 40% at 50% 48%, rgba(251, 191, 36, 0.06), transparent 65%),
    linear-gradient(180deg, rgba(8, 14, 28, 0.2), transparent 40%),
    var(--panel);
  border-color: rgba(0, 242, 255, 0.32);
  box-shadow: var(--glow-strong), inset 0 0 80px rgba(0, 242, 255, 0.05);
}
.neural-hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) minmax(0, 5.2fr) minmax(260px, 2.8fr);
  gap: 20px;
  align-items: stretch;
  min-height: 420px;
  position: relative;
  z-index: 1;
}
.neural-hero-brand h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, #f8fafc, var(--neon));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.35));
}
.neural-hero-brand p {
  margin: 3px 0 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  text-transform: uppercase;
}
.neural-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 255, 0.16);
  background: rgba(8, 16, 32, 0.55);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.neural-feature-list li:hover {
  border-color: rgba(0, 242, 255, 0.45);
  background: rgba(8, 16, 32, 0.78);
  box-shadow: 0 0 16px rgba(0, 242, 255, 0.1);
}
/* Reflects PipelineStageService — the real stage that last ran, polled from
   /api/pipeline-stage (see initPipelineStage in dashboard.js). Not a timed
   decoration: this class only appears while that stage is actually active. */
.neural-feature-list li.stage-active {
  border-color: rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.28);
  animation: neural-stage-pulse 1.3s ease-in-out infinite;
}
.neural-feature-list li.stage-active .nf-ico {
  color: #1a1206;
  background: #fbbf24;
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.neural-feature-list li.stage-done {
  opacity: 0.5;
}
.neural-feature-list li.stage-done .nf-ico {
  color: rgba(34, 211, 238, 0.5);
}
@keyframes neural-stage-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.18); }
  50% { box-shadow: 0 0 24px rgba(251, 191, 36, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .neural-feature-list li.stage-active { animation: none; }
}
.proc-card {
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 255, 0.22);
  background: rgba(6, 12, 24, 0.72);
  padding: 14px;
  box-shadow: inset 0 0 30px rgba(0, 242, 255, 0.04);
}
.proc-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan-bright);
  text-shadow: 0 0 12px rgba(0, 242, 255, 0.3);
}
.neural-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 75%);
  pointer-events: none;
  opacity: 0.7;
}
/* Static glow rim, breathing gently — the visual cue that this is the hero
   card. (A rotating conic-gradient version of this looked like a spinning
   box on a rectangular panel — replaced with a still diagonal gradient that
   just pulses in intensity instead.) Ring stays flush with the panel edge
   (mask-composite carves the middle out) so overflow:hidden above doesn't
   clip it. */
.neural-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1.5px;
  background: linear-gradient(135deg,
    rgba(34, 211, 238, 0.9), rgba(56, 189, 248, 0.35), rgba(251, 191, 36, 0.6),
    rgba(56, 189, 248, 0.35), rgba(34, 211, 238, 0.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: neural-rim-breathe 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes neural-rim-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.neural-hero-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.neural-hero-brand { display: flex; align-items: center; gap: 12px; }
.neural-feature-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
}
.neural-feature-list .nf-ico {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  font-size: 13px;
}
.neural-feature-list strong { display: block; font-size: 12px; color: var(--text); }
.neural-feature-list small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* —— Orbit labels around the brain —— */
.orbit-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.orbit-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--cyan-bright);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(8, 14, 28, 0.72);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
  animation: orbit-label-float 4.5s ease-in-out infinite;
  pointer-events: auto;
  cursor: default;
}
.orbit-label::before {
  content: "◆";
  color: var(--amber);
  font-size: 7px;
  margin-right: 5px;
}
/* Real, not decorative: dims when this group has zero computed features for
   the pair currently on screen (FeatureEngineService::featureGroups()) — a
   genuinely stubbed group (e.g. Sentiment & On-chain with no provider
   configured) reads as dim rather than glowing the same as everything else. */
.orbit-label.og-dim {
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(8, 14, 28, 0.55);
  box-shadow: none;
  opacity: 0.6;
}
.orbit-label.og-dim::before { color: rgba(148, 163, 184, 0.6); }
.ol-1  { top: 5%;  left: 50%; animation-delay: 0s; }
.ol-2  { top: 11%; left: 75%; animation-delay: 0.25s; }
.ol-3  { top: 28%; left: 93%; animation-delay: 0.5s; }
.ol-4  { top: 50%; left: 97%; animation-delay: 0.75s; }
.ol-5  { top: 70%; left: 87%; animation-delay: 1s; }
.ol-6  { top: 83%; left: 66%; animation-delay: 1.25s; }
.ol-7  { top: 84%; left: 40%; animation-delay: 1.5s; }
.ol-8  { top: 74%; left: 17%; animation-delay: 1.75s; }
.ol-9  { top: 55%; left: 4%;  animation-delay: 2s; }
.ol-10 { top: 33%; left: 5%;  animation-delay: 2.25s; }
.ol-11 { top: 15%; left: 19%; animation-delay: 2.5s; }
@keyframes orbit-label-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); opacity: 0.85; }
  50% { transform: translate(-50%, -50%) translateY(-4px); opacity: 1; }
}
.orbit-label.og-dim { animation: none; opacity: 0.55; }

/* Real, not decorative: applied only while this exact group is the
   pipeline's current stage (PipelineStageService — see initFeatureOrbit's
   pollStage()), so it lights up for as long as that computation genuinely
   takes and no longer. Distinct hot amber/white from both the default
   cyan "has data" look and the gray "og-dim" no-data look. */
.orbit-label.og-active {
  color: #fff;
  border-color: rgba(251, 191, 36, 0.9);
  background: rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.55);
  animation: orbit-label-active-pulse 0.9s ease-in-out infinite;
}
.orbit-label.og-active::before { color: #fff; }
@keyframes orbit-label-active-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.35); }
  50% { box-shadow: 0 0 22px rgba(251, 191, 36, 0.85); }
}

/* Spark that travels from a just-activated orbit label to the brain core —
   "sending data to the brain". Spawned in a short staggered burst (see
   spawnBeam() in dashboard.js) per real stage transition, never left
   running idle. Slowed down and enlarged from the first version, which was
   a single 900ms/7px dot — real but easy to miss entirely. */
.orbit-pulse {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #fbbf24 50%, transparent 72%);
  pointer-events: none;
  z-index: 4;
  animation: orbit-beam-travel 2000ms cubic-bezier(0.3, 0.05, 0.45, 1) forwards;
}
@keyframes orbit-beam-travel {
  0% { transform: translate(-50%, -50%) translate(0, 0) scale(0.7); opacity: 0; box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) translate(calc(var(--bx) * 0.1), calc(var(--by) * 0.1)) scale(1.15); }
  55% { box-shadow: 0 0 20px 6px rgba(251, 191, 36, 0.95); }
  82% { opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--bx), var(--by)) scale(0.6); opacity: 0; box-shadow: 0 0 6px 2px rgba(251, 191, 36, 0.3); }
}
@media (prefers-reduced-motion: reduce) {
  .orbit-label.og-active { animation: none; }
  .orbit-pulse { display: none; }
}

.orbit-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(6, 12, 24, 0.95);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  font-size: 10.5px;
  pointer-events: none;
}
.orbit-tooltip strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan-bright);
  margin-bottom: 5px;
}
.orbit-tooltip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 160px; overflow-y: auto; }
.orbit-tooltip li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.orbit-tooltip .otd { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: rgba(148, 163, 184, 0.4); }
.orbit-tooltip li.ot-computed .otd { background: var(--green); box-shadow: 0 0 5px rgba(52, 211, 153, 0.7); }
.orbit-tooltip li.ot-computed { color: var(--text); }
.orbit-tooltip li.ot-stub .otd { background: var(--amber); }

.neural-hero-center { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.neural-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
}

.neural-hero-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  justify-content: center;
}
.proc-card {
  flex: 0 0 auto;
}
.proc-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}

.brain-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 340px;
}
.brain-wrap {
  position: relative;
  text-align: center;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  animation: brain-float 5.5s ease-in-out infinite;
}
.brain-aura {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.brain-aura.a1 {
  inset: 12%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), rgba(14, 116, 233, 0.18) 42%, transparent 68%);
  filter: blur(14px);
  animation: aura-pulse 2.4s ease-in-out infinite;
}
.brain-aura.a2 {
  inset: 0;
  background: radial-gradient(circle, transparent 40%, rgba(56, 189, 248, 0.14) 55%, transparent 72%);
  animation: aura-spin 14s linear infinite;
}
.brain-aura.a3 {
  inset: 22%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.22), transparent 70%);
  filter: blur(10px);
  animation: aura-pulse 1.8s ease-in-out infinite reverse;
}
.brain-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.brain {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.brain-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 22px rgba(0, 210, 255, 0.5));
}
.brain-svg .orbit {
  transform-origin: 120px 118px;
  animation: spin 12s linear infinite;
}
.brain-svg .orbit.o2 {
  animation-duration: 18s;
  animation-direction: reverse;
}
.brain-svg .orbit.o3 {
  animation-duration: 9s;
}
.light-rays {
  transform-origin: 120px 118px;
  animation: rays-spin 40s linear infinite;
  mix-blend-mode: screen;
}
.ray {
  transform-origin: 120px 118px;
  animation: ray-pulse 3.2s ease-in-out infinite;
}
.brain-photo-group {
  transform-origin: 120px 118px;
  animation: core-breathe 4.4s ease-in-out infinite;
}
.brain-photo {
  filter: saturate(1.15) brightness(1.05) drop-shadow(0 0 14px rgba(56, 189, 248, 0.55));
}
.ray-0 { animation-delay: 0s; }
.ray-1 { animation-delay: -0.8s; }
.ray-2 { animation-delay: -1.6s; }
.ray-3 { animation-delay: -2.4s; }
.flare-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: flare-twinkle 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
}
.flare-star.fs2 { animation-delay: 0.7s; animation-duration: 3.1s; }
.flare-star.fs3 { animation-delay: 1.4s; animation-duration: 2.2s; }
.brain-mesh {
  transform-origin: 120px 118px;
  animation: mesh-breathe 3.6s ease-in-out infinite;
}
.mesh-line {
  stroke-dasharray: 6 10;
  animation: mesh-dash 3.2s linear infinite;
}
.mesh-line.m2 { animation-duration: 4s; animation-delay: -0.4s; }
.mesh-line.m3 { animation-duration: 3.5s; animation-delay: -0.8s; }
.mesh-line.m4 { animation-duration: 4.5s; animation-delay: -1.2s; }
.mesh-line.m5 { animation-duration: 2.8s; }
.mesh-line.m6 { animation-duration: 3.8s; animation-delay: -0.6s; }
.mesh-line.m7 { animation-duration: 3.8s; animation-delay: -1s; }
.mesh-line.m8 { animation-duration: 2.6s; }
.mesh-line.m9 { animation-duration: 3s; animation-delay: -0.5s; }

.synapse {
  animation: synapse-fire 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.synapse.s2 { animation-delay: 0.2s; }
.synapse.s3 { animation-delay: 0.4s; }
.synapse.s4 { animation-delay: 0.55s; }
.synapse.s5 { animation-delay: 0.7s; }
.synapse.s6 { animation-delay: 0.9s; }
.synapse.s7 { animation-delay: 1.1s; }
.synapse.s8 { animation-delay: 0.3s; }
.synapse.s9 { animation-delay: 0.85s; }
.synapse.s10 { animation-delay: 1.3s; }
.synapse.s11 { animation-delay: 0.15s; }
.synapse.s12 { animation-delay: 1.5s; }
.synapse.s13 { animation-delay: 0.65s; }
.synapse.s14 { animation-delay: 1.05s; }
.synapse.s15 { animation-delay: 0.45s; animation-duration: 1.6s; }
.synapse.s16 { animation-delay: 0.95s; }
.synapse.s17 { animation-delay: 1.25s; }
.synapse.s18 { animation-delay: 1.7s; }

.ai-core {
  transform-origin: 120px 118px;
  animation: core-breathe 2.2s ease-in-out infinite;
}
.core-halo {
  animation: core-halo-pulse 2.2s ease-in-out infinite;
  transform-origin: 120px 118px;
}
.core-orb {
  animation: core-orb-pulse 2.2s ease-in-out infinite;
  transform-origin: 120px 118px;
}
.core-ring {
  transform-origin: 120px 118px;
}
.core-ring.r-a { animation: spin 8s linear infinite; }
.core-ring.r-b { animation: spin 11s linear infinite reverse; }
.core-label {
  paint-order: stroke fill;
  stroke: rgba(15, 23, 42, 0.35);
  stroke-width: 0.6px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

@keyframes brain-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes aura-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes aura-spin {
  to { transform: rotate(360deg); }
}
@keyframes mesh-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.025); }
}
@keyframes mesh-dash {
  to { stroke-dashoffset: -64; }
}
@keyframes synapse-fire {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1.45); }
  60% { opacity: 0.85; transform: scale(1.1); }
}
@keyframes core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes core-halo-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}
@keyframes core-orb-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rays-spin {
  to { transform: rotate(360deg); }
}
@keyframes ray-pulse {
  0%, 100% { opacity: 0.10; transform: scaleY(0.72); }
  50% { opacity: 0.45; transform: scaleY(1); }
}
@keyframes outline-glow {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
@keyframes flare-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(25deg); }
}

.neural-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
  padding: 0 4px;
  position: relative;
  z-index: 1;
}
.n-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.12);
  background: rgba(6, 12, 24, 0.5);
}
.n-gauge-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.35));
}
.n-gauge-svg.spinning .n-gauge-arc {
  animation: gauge-spin-glow 3s linear infinite;
  transform-origin: 40px 40px;
}
.n-gauge-arc.consensus {
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.4));
}
@keyframes gauge-spin-glow {
  0% { filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.3)); }
  50% { filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.75)); }
  100% { filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.3)); }
}
.n-gauge-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.n-gauge-meta strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--cyan-bright);
}
.n-gauge:last-child .n-gauge-meta strong { color: var(--green); }
.n-gauge-meta span {
  font-size: 9.5px;
  color: var(--muted);
  line-height: 1.25;
}

.flow-step {
  animation: flow-step-glow 3.2s ease-in-out infinite;
}
.flow-step:nth-child(1) { animation-delay: 0s; }
.flow-step:nth-child(3) { animation-delay: 0.8s; }
.flow-step:nth-child(5) { animation-delay: 1.6s; }
.flow-step:nth-child(7) { animation-delay: 2.4s; }
.flow-arr {
  color: var(--cyan-bright);
  opacity: 0.55;
  margin: 0 2px;
}
@keyframes flow-step-glow {
  0%, 100% { opacity: 0.55; text-shadow: none; }
  40%, 55% { opacity: 1; text-shadow: 0 0 12px rgba(0, 210, 255, 0.8); color: #67e8f9; }
}

@media (prefers-reduced-motion: reduce) {
  .brain-wrap, .brain-aura, .brain-mesh, .mesh-line, .synapse, .ai-core,
  .core-halo, .core-orb, .core-ring, .orbit, .pipe-beam, .pipe-dot,
  .brain-outline, .light-rays, .ray, .flare-star, .brain-photo-group,
  .flow-bars span, .flow-step, .n-gauge-svg.spinning .n-gauge-arc,
  .proc-wave .w1, .proc-wave .w2, .proc-wave .w3, .live-dot, .proc-checklist li.active .proc-ico,
  .neural-panel::after, .neural-head .badge::before {
    animation: none !important;
  }
}

/* —— Analysis —— */
.sentiment { text-align: center; margin-bottom: 4px; }
.sent-label {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px currentColor;
}
.sentiment.bullish .sent-label { color: var(--green); }
.sentiment.bearish .sent-label { color: var(--red); }
.sentiment.neutral .sent-label { color: var(--amber); }
.gauge { position: relative; width: 148px; margin: 4px auto 0; }
.gauge-val {
  position: absolute; left: 0; right: 0; bottom: 18px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--cyan-bright);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}
.gauge-caption {
  position: absolute; left: 0; right: 0; bottom: 2px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.analysis-stats { display: grid; gap: 7px; margin: 12px 0; }
.analysis-stats > div {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--muted);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.analysis-stats strong { color: var(--text); }
.analysis-stats strong.long { color: var(--green); }
.analysis-stats strong.short { color: var(--red); }
.drivers h3 { margin: 0 0 6px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.drivers ul { margin: 0; padding-left: 16px; color: var(--text); font-size: 12px; line-height: 1.55; }
.reco {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.12), rgba(34, 211, 238, 0.04));
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.06);
}
.reco-label {
  display: block;
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* —— Bottom / ops / portfolio —— */
.bottom-grid {
  /* Matches the reference layout's measured proportions (~31:36:32) —
     Active Positions still edges out the other two (densest table, 8
     columns incl. interactive close controls), but Exchange Status isn't
     starved the way an earlier, more aggressive split had it. */
  grid-template-columns: minmax(0, 3.1fr) minmax(0, 3.6fr) minmax(0, 3.2fr);
  min-height: var(--row-min-ops);
}
.portfolio-grid {
  /* Allocation's legend needs less width than its 4-6 rows suggest at an
     even split; Real-time P&L's chart benefits from the room. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.trading-grid {
  grid-template-columns: minmax(0, 1fr);
}
.btn-trade {
  background: rgba(52, 211, 153, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: var(--green) !important;
}
.btn-watch {
  background: transparent !important;
  border-color: rgba(34, 211, 238, 0.35) !important;
  color: var(--muted) !important;
}
.empty-row { text-align: center; color: var(--muted); padding: 16px !important; }
.exec-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.exec-title-row .exec-title { margin-bottom: 0; }
.exec-status-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #f87171; background: rgba(248, 113, 113, 0.1);
}
.exec-status-badge.ok {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--green); background: rgba(52, 211, 153, 0.12);
}
.ex-uptime-cell { display: flex; align-items: center; gap: 6px; }
.uptime-spark { width: 48px; height: 14px; flex-shrink: 0; opacity: 0.9; }

/* —— Neural Processing / Output / Intel —— */
.neural-grid {
  /* Neural Shell is the hero of this row — 2.5 | 7 | 2.5 instead of an even
     3|6|3 split, so the brain animation gets noticeably more room without
     starving the process-checklist/output side panels (their text still
     fits, just wraps to 2 lines occasionally instead of 1). */
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 7fr) minmax(0, 2.5fr);
  min-height: var(--row-min-neural);
}
.intel-grid {
  display: none;
}
.market-side-col .sent-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
}
.market-side-col .fg-meta strong { font-size: 18px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
  padding: 3px 8px; border-radius: 999px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.pair-tag { color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }

.proc-checklist {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 5px;
  flex: 1 1 auto;
}
.proc-checklist li {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted);
  padding: 6px 7px; border-radius: 8px;
  transition: color 0.45s ease, background-color 0.45s ease;
}
.proc-checklist li.done { color: var(--text); }
.proc-checklist li.active {
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.06);
}
.proc-step-label { flex: 1 1 auto; min-width: 0; }
.proc-step-bar {
  width: 56px; height: 4px; border-radius: 999px; flex-shrink: 0;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}
.proc-step-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan-bright));
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.6);
  transition: background 0.45s ease;
}
/* pending step: bar not lit yet, matches the icon's neutral gray */
.proc-checklist li:not(.done):not(.active) .proc-step-bar i {
  background: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}
.proc-step-pct {
  width: 30px; flex-shrink: 0; text-align: right;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--cyan-bright);
  transition: color 0.45s ease;
}
.proc-checklist li:not(.done):not(.active) .proc-step-pct { color: var(--muted); }
.proc-ico {
  width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, 0.12);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.2);
  transition: background-color 0.45s ease, box-shadow 0.45s ease;
}
/* done: solid green checkmark, settled — no pulse, it already finished */
.proc-checklist li.done .proc-ico {
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}
.proc-checklist li.done .proc-ico::after {
  content: "✓";
  font-size: 10px;
  font-weight: 700;
  color: #04120c;
}
/* active: distinct cyan "in progress" ring, pulsing — visually different from
   the settled green checkmark of a done step, per (contoh: warna berubah). */
.proc-checklist li.active .proc-ico {
  background: var(--cyan-bright);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.85);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.proc-checklist li.active .proc-ico::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #041a1f;
}
.proc-wave {
  margin: 12px 0 8px; height: 28px;
  border-radius: 6px;
  background: rgba(6, 12, 24, 0.5);
  border: 1px solid rgba(34, 211, 238, 0.1);
  overflow: hidden;
}
.proc-wave svg { width: 100%; height: 100%; display: block; }
.proc-wave .w1, .proc-wave .w2, .proc-wave .w3 {
  stroke-dasharray: 8 6;
  animation: mesh-dash 2.4s linear infinite;
}
.proc-wave .w2 { animation-duration: 3.2s; }
.proc-wave .w3 { animation-duration: 2.8s; animation-direction: reverse; }
.proc-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--cyan); letter-spacing: 0.06em;
  margin-bottom: 6px; font-family: var(--font-display);
}
.proc-bar {
  height: 8px; border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden; border: 1px solid rgba(34, 211, 238, 0.2);
}
.proc-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #0891b2, #22d3ee, #67e8f9);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
  transition: width 0.6s ease;
}

.prob-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.prob-row {
  display: grid;
  grid-template-columns: 64px 1fr 52px;
  gap: 8px; align-items: center;
  font-size: 12px;
}
.prob-label { color: var(--muted); }
.prob-track {
  height: 10px; border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden;
}
.prob-fill {
  display: block; height: 100%; border-radius: 999px;
  transition: width 0.5s ease;
}
.prob-fill.long { background: linear-gradient(90deg, #0891b2, #22d3ee); box-shadow: 0 0 8px rgba(34,211,238,0.5); }
.prob-fill.short { background: linear-gradient(90deg, #b91c1c, #ff4b4b); box-shadow: 0 0 8px rgba(255,75,75,0.45); }
.prob-fill.wait { background: linear-gradient(90deg, #334155, #64748b); }
.prob-val { text-align: right; font-size: 12px; }
.conf-block { margin-bottom: 14px; }
.conf-head {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--muted); margin-bottom: 6px;
}
.conf-head strong { color: var(--cyan-bright); }
.conf-track {
  height: 12px; border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  overflow: hidden; border: 1px solid rgba(34, 211, 238, 0.2);
}
.conf-track span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #0e7490, #22d3ee);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
  transition: width 0.5s ease;
}
.output-stats {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.output-stats > div {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--muted);
  padding: 8px 10px; border-radius: 8px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.output-stats strong { color: var(--text); }

/* —— Neural Output — full-width strip below the hero (moved out of the
   hero's right column, which was too narrow for the P(Long/Short/Wait)
   bars to be visible) —— */
.neural-output-compact { display: flex; flex-direction: column; gap: 10px; }
.noc-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.noc-head .live-pill { margin-left: auto; }
.noc-body {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}
.noc-probs { display: grid; gap: 6px; min-width: 0; }
.noc-prob-row {
  display: grid;
  grid-template-columns: 46px 1fr 42px;
  gap: 8px; align-items: center;
  font-size: 11px;
}
.noc-stat {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--muted);
  padding: 8px 10px; border-radius: 8px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.08);
}
.noc-stat strong { font-size: 14px; color: var(--text); }
.noc-conf-head { display: flex; justify-content: space-between; }
.noc-conf-head strong { font-size: 12px; color: var(--cyan-bright); }
.sig-lg {
  font-family: var(--font-display);
  font-size: 16px; letter-spacing: 0.08em;
}
.sig-lg.long { color: var(--green); }
.sig-lg.short { color: #ff4b4b; }
.sig-lg.wait { color: var(--amber); }

.feature-stream-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.feature-chart-wrap {
  position: relative;
  height: 100%;
  min-height: 180px;
  background: rgba(6, 10, 20, 0.4);
  border-radius: 8px;
}
.feature-side-stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.feature-side-stats li {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11px; color: var(--muted);
}
.feature-side-stats em { display: block; font-style: normal; font-size: 10px; }
.feature-side-stats strong { display: block; color: var(--text); font-size: 12px; margin-top: 1px; }
.feature-side-stats small { font-size: 10px; }
.fs-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
}
.fs-dot.c-price { background: #22d3ee; box-shadow: 0 0 6px #22d3ee; }
.fs-dot.c-vol { background: #34d399; box-shadow: 0 0 6px #34d399; }
.fs-dot.c-fund { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.fs-dot.c-oi { background: #a78bfa; box-shadow: 0 0 6px #a78bfa; }

.regime-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  /* minmax(0, 1fr) row — without it, the grid's single implicit row sizes
     to its content's natural min-height (the legend's 4 rows), which can
     exceed the flex-determined 144px this box actually gets, pushing the
     donut/legend past the card's bottom border. This clamps the row to
     the box's real height so children (height:100%/stretch) can't outgrow
     it — same fix as the .main-grid column-overflow bug elsewhere. */
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.regime-donut-wrap {
  position: relative;
  height: 100%;
}
.regime-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; gap: 2px;
}
.regime-center strong {
  font-family: var(--font-display); font-size: 22px; color: var(--green);
}
.regime-center small { font-size: 10px; color: var(--muted); text-align: center; max-width: 90px; }
.regime-legend {
  list-style: none; margin: 0; padding: 0;
  display: grid; align-content: center; gap: 8px; font-size: 12px; color: var(--muted);
}
.regime-legend li { display: flex; align-items: center; gap: 8px; }
.regime-legend em { margin-left: auto; font-style: normal; color: var(--text); }
.rg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rg-dot.bull { background: #34d399; }
.rg-dot.range { background: #22d3ee; }
.rg-dot.bear { background: #fb923c; }
.rg-dot.vol { background: #ff4b4b; }

.sent-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.fg-gauge-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.fg-gauge { width: 100%; max-width: min(220px, 100%); height: auto; }
.fg-meta { margin-top: -6px; }
.fg-meta strong {
  display: block; font-family: var(--font-display);
  font-size: 22px; color: var(--green);
}
.fg-meta span { display: block; font-size: 12px; color: var(--green); }
.fg-meta small { color: var(--muted); font-size: 10px; }
.sent-metrics {
  /* flex column + space-between (not a grid with a fixed gap) so the 5 rows
     always distribute across whatever height sent-body actually has —
     they can never add up to more than the card and spill past its
     border, unlike a fixed gap/padding tuned for one assumed height. */
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  height: 100%;
  font-size: 12px; color: var(--muted);
}
.sent-metrics li {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px;
  background: rgba(8, 15, 28, 0.35);
}
.sent-metrics strong { margin-left: auto; color: var(--text); }
.sent-ico {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.sent-ico.ok { background: rgba(52, 211, 153, 0.2); color: var(--green); }
.sent-ico.warn { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.sent-ico.stub { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
.sent-metrics strong.muted { color: var(--muted); font-weight: 500; font-style: italic; }
.hint-stub { font-size: 9px; color: var(--muted); opacity: 0.7; margin-left: 2px; }
.amber { color: #fbbf24 !important; }

.aqb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.aqb-table th, .aqb-table td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
}
.aqb-table th { color: var(--muted); font-weight: 500; font-size: 11px; }
.aqb-table.compact td, .aqb-table.compact th { padding: 5px 4px; }
.sig {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.sig.long { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.sig.short { color: var(--red); background: rgba(248, 113, 113, 0.12); }
.sig.wait { color: var(--amber); background: rgba(251, 191, 36, 0.12); }

/* Live vs. simulasi — a live position/order trades real capital, so it gets
   a deliberately louder, warm badge instead of blending in with everything
   else; simulasi stays a quiet neutral pill. */
.mode-summary { display: inline-flex; gap: 6px; margin-left: auto; }
.mode-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}
.mode-badge.live {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}
.mode-badge.sim {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
tr.row-live { background: rgba(251, 191, 36, 0.04); }
.btn-mini, .btn-primary {
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.btn-primary { padding: 8px 14px; }
.btn-mini:hover, .btn-primary:hover { box-shadow: var(--glow); }

.alloc-wrap { position: relative; height: 170px; }
.alloc-center {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 2px;
}
.alloc-center small {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alloc-center strong {
  font-family: var(--font-display);
  font-size: 14px;
}
.alloc-legend {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  font-size: 11px; color: var(--muted);
}
.alloc-legend li { display: flex; gap: 6px; align-items: center; }
.alloc-legend span {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--cyan);
}
.alloc-legend li:nth-child(2) span { background: #34d399; }
.alloc-legend li:nth-child(3) span { background: #60a5fa; }
.alloc-legend li:nth-child(4) span { background: #a78bfa; }
.alloc-legend li:nth-child(5) span { background: #fbbf24; }
.alloc-legend li:nth-child(6) span { background: #fb7185; }
.alloc-legend em { margin-left: auto; font-style: normal; color: var(--text); }

.pnl-foot, .exec-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.pnl-foot strong, .exec-stats strong { display: block; margin-top: 2px; color: var(--text); font-size: 13px; }

.exec-block {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.exec-title {
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  font-family: var(--font-display);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--red);
}
.status-pill.ok { color: var(--green); }

.mode-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.mode-banner strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}
.mode-banner.mode-info {
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
}
.mode-banner.mode-warning {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.mode-banner.mode-danger {
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
}
.mode-banner em { font-style: normal; opacity: 0.85; font-size: 11px; }

.live-settings {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.trading-grid .live-settings {
  display: grid;
  gap: 4px;
}
.output-panel .panel-fill {
  justify-content: space-between;
}
.mode-switch-row, .cred-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.mode-switch-row select,
.cred-form select,
.cred-form input {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  min-width: 120px;
}
.cred-form input { flex: 1; min-width: 140px; }
.risk-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.hint-muted {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 10px;
}
.go-live-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 12px;
}
.go-live-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
  color: var(--muted);
}
.go-live-list li.done { color: var(--green); }
.go-live-list .chk { width: 1.1em; flex-shrink: 0; }
.go-live-list em { font-style: normal; font-size: 10px; opacity: 0.7; margin-left: 4px; }
.cred-masked {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.positions-row { margin-top: 12px; }
.panel.wide { width: 100%; }

/* —— Footer —— */
.aqb-footer {
  margin-top: 12px;
  display: grid;
  /* plain `1fr` tracks keep an implicit min-width:auto, so a wide nowrap
     child (the news marquee) forces the track wider than the grid and
     bleeds into the next column — minmax(0, ...) is what actually caps it. */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 10px;
}
.agent-box, .news-box {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
  backdrop-filter: blur(10px);
}
.agent-box label, .news-box label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.news-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.news-head label { margin-bottom: 0; }
.news-all {
  font-size: 11px;
  color: var(--cyan);
  opacity: 0.85;
}
.news-all:hover { opacity: 1; }
.agent-row { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
}
.agent-row .btn-primary { flex-shrink: 0; }
.agent-reply {
  margin: 10px 0 0;
  min-height: 64px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text);
  background: rgba(8, 15, 28, 0.65);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}
.news-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.news-list .news-empty {
  color: var(--muted);
  font-size: 12px;
}
.news-dot {
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--muted);
}
.news-dot.up { background: var(--green); }
.news-dot.down { background: var(--red); }
.news-item-body { min-width: 0; }
.news-item-body a,
.news-item-title {
  display: block;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.news-item-body a:hover { color: var(--cyan); }
.news-item-body small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* —— Tablet / mid desktop: ~768–1200px —— */
@media (max-width: 1200px) {
  .aqb-app { padding: 12px 12px 24px; }
  :root {
    --row-min-neural: 0;
    --row-min-intel: 0;
    --row-min-ops: 0;
  }

  .aqb-topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 10px 12px;
  }
  .brand { grid-area: brand; }
  .aqb-nav { grid-area: nav; justify-content: flex-start; }
  .aqb-top-actions { grid-area: actions; }
  .nav-toggle { display: none; }

  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Neural: shell + processing side-by-side, output full width below */
  .neural-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }
  .neural-grid .output-panel {
    grid-column: 1 / -1;
  }

  .neural-body {
    grid-template-columns: 1fr auto 1fr;
    min-height: 220px;
  }
  .brain-wrap { width: 190px; height: 190px; }

  /* Analytics: feature full, regime + sentiment half */
  .intel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .intel-grid .feature-stream-panel {
    grid-column: 1 / -1;
  }

  /* Ops: signals + positions, exchange full */
  .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bottom-grid #exchange {
    grid-column: 1 / -1;
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aqb-footer {
    grid-template-columns: 1fr 1fr;
  }

  .search { width: 110px; }
  .candle-chart { height: 300px; }
}

/* —— Narrow tablet: ~768–980px —— */
@media (max-width: 980px) {
  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-grid,
  .neural-grid,
  .intel-grid,
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .neural-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .neural-grid .output-panel,
  .intel-grid .feature-stream-panel,
  .bottom-grid #exchange {
    grid-column: auto;
  }

  .neural-body {
    grid-template-columns: 1fr auto 1fr;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clock { display: none; }
  .aqb-nav a { font-size: 11px; padding: 5px 7px; }
  .avatar-role { display: none; }
  .search { width: 150px; }
}

/* —— Mobile: <768px —— */
@media (max-width: 767px) {
  .aqb-app { padding: 10px 10px 20px; }

  .aqb-topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand toggle"
      "actions actions"
      "nav nav";
    gap: 10px;
  }
  .nav-toggle {
    display: flex;
    grid-area: toggle;
  }
  .aqb-nav {
    display: none;
    grid-area: nav;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 0 2px;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
  }
  .aqb-nav.open { display: flex; }
  .aqb-nav a {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    border-bottom: none;
  }
  .aqb-nav a.active,
  .aqb-nav a:hover {
    background: rgba(34, 211, 238, 0.08);
    border-bottom: none;
  }
  .nav-more { display: none !important; }
  .aqb-top-actions {
    grid-area: actions;
    justify-content: stretch;
    width: 100%;
  }
  .aqb-top-actions .search { flex: 1 1 120px; width: auto; min-width: 0; }
  .avatar { margin-left: auto; }

  .status-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .bot-pill { justify-content: center; width: 100%; font-size: 11px; }

  .metric-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .metric-value { font-size: 15px; }

  .ticker-strip {
    gap: 0;
    margin-top: 8px;
  }
  .ticker-item {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 7px 10px;
    font-size: 11px;
  }
  .avatar-wrap { gap: 6px; }
  .avatar-name { font-size: 11px; }
  .logout-link { display: none; }

  .main-grid,
  .neural-grid,
  .intel-grid,
  .bottom-grid,
  .portfolio-grid,
  .aqb-footer,
  .neural-body,
  .feature-stream-body,
  .regime-body,
  .sent-body {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-controls { align-items: stretch; }
  .mode-tabs, .tf-tabs { justify-content: flex-start; }
  .candle-chart { height: 260px; }

  .pipeline.left li { justify-content: flex-start; text-align: left; }
  .pipeline.left .pipe-check { order: 0; }
  .pipeline.left .pipe-beam { order: 0; display: none; }
  .pipeline.right .pipe-beam { display: none; }
  .neural-body { min-height: 0; gap: 12px; }
  .brain-wrap { width: 180px; height: 180px; }
  .neural-gauges { grid-template-columns: 1fr; }
  .flow { font-size: 9px; letter-spacing: 0.06em; }
  .feature-chart-wrap { height: 160px; }
  .regime-donut-wrap { height: 150px; }

  .alloc-wrap { height: 150px; }
  .alloc-legend { grid-template-columns: 1fr; }
  .pnl-chart-wrap { height: 140px; }

  .agent-row { flex-direction: column; }
  .agent-row .btn-primary { width: 100%; }

  .brand-title { font-size: 12px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
}

/* —— Small phones: <480px —— */
@media (max-width: 480px) {
  .metric-row { grid-template-columns: 1fr; }
  .pnl-foot, .exec-stats { grid-template-columns: 1fr; }
  .pair-meta { flex-wrap: wrap; }
  .candle-chart { height: 220px; }
  .bot-pill .bot-label { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ex-badge .ex-conn { display: none; }
}

/* —— Settings page —— */
.settings-app .settings-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: var(--gap);
  padding: 4px 2px 2px;
}
.settings-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #e2e8f0, var(--cyan-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.settings-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 52ch;
}
.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.settings-card .settings-msg {
  min-height: 2.5rem;
  margin-top: 10px;
}
.env-flag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 28, 0.55);
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.env-flag strong { font-family: var(--font-display); letter-spacing: 0.04em; }
.env-flag.ok strong { color: var(--green); }
.env-flag.warn strong { color: var(--amber); }
.settings-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.captcha-img {
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1321;
  display: block;
}
.captcha-row input {
  width: 110px;
  text-transform: uppercase;
}
.settings-kv {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.settings-kv li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 12px;
  color: var(--muted);
}
.settings-kv strong { color: var(--text); }
.settings-kv strong.muted { color: var(--muted); font-weight: 500; }
.risk-limit-input {
  width: 90px;
  text-align: right;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
}
/* Live, per-field — computed client-side from Order size/Leverage/
   Concentration/Exchange exposure as you type (see checkRiskLimitContradiction
   in settings.js), not just discovered after a trade gets silently rejected. */
.settings-kv li.field-warning {
  display: block;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.4;
  margin-top: -4px;
}
.prefs-form {
  display: grid;
  gap: 10px;
}
.prefs-form label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.prefs-form input,
.prefs-form select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.watchlist-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.watchlist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 15, 28, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 13px;
}
.watchlist-list strong { color: var(--text); letter-spacing: 0.02em; }
.watchlist-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.watchlist-add input {
  flex: 1;
  min-width: 120px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.btn-danger {
  background: rgba(248, 113, 113, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
  color: #f87171 !important;
}
.settings-deeplink {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.settings-deeplink .btn-ghost {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-hero h1 { font-size: 18px; }
}

/* —— Thin dedicated pages —— */
.page-grid {
  align-items: stretch;
}
.page-span-2 { grid-column: span 2; }
.page-span-full { grid-column: 1 / -1; }
.page-metrics {
  margin-bottom: 12px;
}
.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 1200px) {
  .page-span-2 { grid-column: span 1; }
}
@media (max-width: 767px) {
  .page-span-2,
  .page-span-full { grid-column: auto; }
}
