:root {
  --bg-0: #030611;
  --bg-1: #050814;
  --bg-2: #07101f;
  --panel: rgba(9, 17, 34, 0.78);
  --panel-strong: rgba(12, 22, 45, 0.91);
  --panel-soft: rgba(13, 24, 48, 0.62);
  --line: rgba(96, 165, 250, 0.19);
  --line-2: rgba(148, 163, 184, 0.16);
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --cyan: #17f1cd;
  --cyan-2: #2dd4bf;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --red: #f43f5e;
  --red-2: #be123c;
  --amber: #fbbf24;
  --green: #22c55e;
  --text: #f8fafc;
  --text-2: #aab4c8;
  --muted: #65738d;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.05);
  --maxw: 430px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; margin: 0; background: var(--bg-0); color: var(--text); }
body { overflow-x: hidden; }
button { font: inherit; }

.app-shell {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 8%, rgba(59,130,246,.24), transparent 29%),
    radial-gradient(circle at 105% 18%, rgba(45,212,191,.16), transparent 32%),
    radial-gradient(circle at 55% 110%, rgba(139,92,246,.13), transparent 34%),
    linear-gradient(180deg, #071124 0%, #040713 52%, #030611 100%);
}
.app-shell::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96,165,250,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.10) 42%, rgba(0,0,0,.04));
  z-index: -3;
}
.app-shell::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.20) 0 1px, transparent 1.5px),
    radial-gradient(circle at 77% 18%, rgba(45,212,191,.18) 0 1px, transparent 1.6px),
    radial-gradient(circle at 66% 64%, rgba(96,165,250,.14) 0 1px, transparent 1.7px);
  background-size: 95px 95px, 132px 132px, 118px 118px;
  opacity: .34;
  z-index: -2;
}
.orb { position: absolute; border-radius: 999px; filter: blur(22px); opacity: .45; z-index: -1; pointer-events: none; }
.orb-a { width: 190px; height: 190px; background: rgba(59,130,246,.34); top: 68px; right: -78px; }
.orb-b { width: 150px; height: 150px; background: rgba(45,212,191,.20); top: 285px; left: -68px; }
.orb-c { width: 120px; height: 120px; background: rgba(139,92,246,.18); bottom: 40px; right: 26px; }

.screen-wrap {
  position: relative;
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 92px);
}
.screen { display: none; animation: fadeUp .32s ease both; }
.screen.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.brand-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 24px;
  padding: 12px 14px;
  min-height: 62px;
  background: linear-gradient(135deg, rgba(15,27,55,.92), rgba(7,13,28,.70));
  box-shadow: 0 16px 60px rgba(2,8,23,.42), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(22px);
}
.brand-left { display:flex; align-items:center; gap:12px; min-width: 0; }
.logo-mark { width: 34px; height: 34px; flex: 0 0 34px; filter: drop-shadow(0 0 12px rgba(96,165,250,.34)); }
.logo-title { font-weight: 800; letter-spacing: .01em; font-size: 17px; line-height: 1.05; }
.logo-sub { margin-top: 3px; font-size: 9px; color: var(--text-2); text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }
.wave-mini { width: 54px; height: 32px; opacity: .85; filter: drop-shadow(0 0 10px rgba(139,92,246,.45)); }

.pill-row { display: flex; gap: 10px; margin: 16px 0 10px; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  padding: 0 14px; border-radius: 999px;
  background: rgba(6, 12, 27, .72);
  border: 1px solid rgba(96,165,250,.22);
  color: var(--text); font-size: 11px; font-weight: 850; letter-spacing: .045em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 30px rgba(0,0,0,.22);
}
.pill.live { border-color: rgba(23,241,205,.45); color: #dffef8; }
.pill.fresh { border-color: rgba(23,241,205,.45); color: #dffef8; }
.pill.confirm { border-color: rgba(167,139,250,.34); }
.pill.waiting { border-color: rgba(251,191,36,.36); color: #ffdfa0; }
.pill.stale { border-color: rgba(248,113,113,.48); color: #fecaca; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.dot.amber { background: var(--amber); box-shadow: 0 0 16px var(--amber); }

.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 25, 50, .88), rgba(8, 15, 31, .76));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events:none;
  background: radial-gradient(circle at 74% 4%, rgba(23,241,205,.12), transparent 30%), linear-gradient(180deg, rgba(255,255,255,.055), transparent 18%);
}

.hero-card { padding: 26px 24px 18px; margin-top: 10px; }
.hero-top { display:flex; justify-content: space-between; align-items:flex-start; gap: 18px; position:relative; z-index:1; }
.signal-pair { font-size: clamp(42px, 11vw, 54px); font-weight: 900; letter-spacing: .025em; line-height: .9; }
.signal-sub { color: var(--text-2); margin-top: 10px; font-size: 14px; font-weight: 700; }
.direction-chip {
  margin-top: 2px; padding: 13px 18px; border-radius: 16px;
  background: linear-gradient(135deg, #fb4868, #c41448 68%, #861136);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 45px rgba(244,63,94,.28), inset 0 1px 0 rgba(255,255,255,.18);
  font-weight: 950; letter-spacing: .05em;
}
.timer-confidence { display:flex; align-items:center; justify-content:space-between; gap: 16px; margin-top: 28px; position:relative; z-index:1; }
.timer-label { color: var(--text-2); font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.timer-main { font-size: clamp(62px, 18vw, 76px); font-weight: 950; letter-spacing: -.045em; line-height: .98; margin-top: 5px; }
.timer-bar { width: 76px; height: 5px; border-radius: 99px; margin-top: 10px; background: linear-gradient(90deg, var(--cyan), var(--blue-2)); box-shadow: 0 0 18px rgba(23,241,205,.36); }
.confidence-ring {
  --p: 82;
  width: 106px; height: 106px; border-radius: 50%; display:grid; place-items:center; flex: 0 0 106px;
  background:
    radial-gradient(circle at center, #07101f 0 55%, transparent 56%),
    conic-gradient(var(--cyan) calc(var(--p)*1%), rgba(96,165,250,.16) 0);
  box-shadow: 0 0 28px rgba(23,241,205,.27), inset 0 0 20px rgba(0,0,0,.48);
  position: relative;
}
.confidence-ring::after { content:""; position:absolute; inset: 8px; border-radius:50%; border:1px solid rgba(255,255,255,.08); }
.conf-number { font-size: 27px; font-weight: 950; line-height: .95; }
.conf-label { color: var(--text-2); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; text-align:center; }
.strategy-source {
  margin-top: 18px; display:flex; align-items:center; gap:10px; position:relative; z-index:1;
  min-height: 42px; padding: 8px 12px; border-radius: 999px;
  background: rgba(3,7,18,.62); border: 1px solid rgba(148,163,184,.16);
}
.strategy-source strong { display:block; font-size: 12px; letter-spacing:.02em; }
.strategy-source span { display:block; color: var(--muted); font-size: 10px; margin-top:1px; }
.source-icon { width: 26px; height: 26px; border-radius:50%; display:grid; place-items:center; background: linear-gradient(135deg, rgba(139,92,246,.45), rgba(59,130,246,.22)); border:1px solid rgba(167,139,250,.36); }

.chart-card { padding: 16px; margin-top: 14px; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap: 10px; margin-bottom: 8px; position:relative; z-index:1; }
.section-title { font-size: 16px; font-weight: 850; letter-spacing:.01em; }
.section-note { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing:.08em; text-transform: uppercase; }
.chart-svg { width: 100%; height: 160px; display:block; position:relative; z-index:1; }
.badge-row { display:flex; align-items:center; gap:8px; }
.badge { font-size: 10px; font-weight: 900; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(96,165,250,.26); color: #dbeafe; background: rgba(2,6,23,.42); }
.badge.live { border-color: rgba(23,241,205,.45); color: #d7fff7; }
.price-badge { color:#031019; background:#14F1C8; border-color:rgba(20,241,200,.72); box-shadow:0 0 18px rgba(20,241,200,.22); font-variant-numeric:tabular-nums; }

.stats-row { display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat-card { border-radius: 18px; border: 1px solid var(--line-2); background: rgba(7,14,29,.72); padding: 16px 12px; min-height: 76px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 40px rgba(0,0,0,.18); }
.stat-value { font-size: 22px; font-weight: 950; line-height: 1; }
.stat-label { margin-top: 8px; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 850; letter-spacing:.08em; }

.why { margin-top: 22px; }
.why-card { padding: 14px; margin-top: 10px; }
.reason { display:flex; gap: 12px; padding: 10px 8px; position:relative; z-index:1; }
.reason + .reason { border-top: 1px solid rgba(148,163,184,.10); }
.reason-num { width: 28px; height: 28px; border-radius: 11px; display:grid; place-items:center; flex:0 0 28px; background: linear-gradient(135deg, #2f80ff, #1d4ed8); box-shadow: 0 8px 22px rgba(37,99,235,.33); font-weight: 900; }
.reason-title { font-weight: 850; font-size: 13px; }
.reason-copy { color: var(--text-2); font-size: 11px; margin-top: 2px; line-height:1.38; }
.cta-row { display:grid; grid-template-columns: 1fr 50px; gap: 10px; margin-top: 14px; }
.cta {
  border:0; color:white; cursor:pointer; min-height: 54px; border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #2563eb 35%, #06b6d4 120%);
  box-shadow: 0 16px 46px rgba(37,99,235,.38), inset 0 1px 0 rgba(255,255,255,.17);
  font-weight: 950; font-size: 13px; letter-spacing:.04em;
}
.cta span { display:block; color: rgba(255,255,255,.72); font-size: 10px; margin-top: 3px; font-weight: 700; letter-spacing:0; }
.bell-btn { min-height:54px; border-radius:18px; border:1px solid rgba(96,165,250,.24); background:rgba(7,14,29,.76); color:#dbeafe; display:grid; place-items:center; }

.bottom-nav {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 10px); transform: translateX(-50%);
  width: min(calc(100vw - 28px), 398px); height: 72px; z-index: 30;
  display:grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px;
  padding: 8px 8px 7px;
  border-radius: 24px;
  border: 1px solid rgba(148,163,184,.16);
  background: linear-gradient(180deg, rgba(9,17,34,.86), rgba(3,7,18,.90));
  box-shadow: 0 18px 60px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(24px);
}
.nav-item { color: var(--muted); border:0; background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size: 10px; font-weight: 850; cursor:pointer; }
.nav-item.is-active { color: #dbeafe; }
.nav-icon { width: 22px; height: 22px; position:relative; display:block; }
.nav-icon::before, .nav-icon::after { content:""; position:absolute; inset:3px; border:2px solid currentColor; border-radius: 6px; opacity:.75; }
.nav-icon.pulse::before { border:0; height:2px; top:10px; background:currentColor; box-shadow: -6px 0 0 currentColor, 6px 0 0 currentColor; }
.nav-icon.pulse::after { border:0; inset:0; background: linear-gradient(45deg, transparent 42%, currentColor 43% 48%, transparent 49%), linear-gradient(-45deg, transparent 46%, currentColor 47% 52%, transparent 53%); opacity:.9; }
.nav-icon.radar::before { border-radius:50%; } .nav-icon.radar::after { inset:8px; border-radius:50%; }
.nav-icon.log::before { border-radius:3px; } .nav-icon.log::after { inset:7px 6px auto; height:2px; background:currentColor; border:0; box-shadow: 0 5px 0 currentColor; }
.nav-icon.gear::before { border-radius:50%; } .nav-icon.gear::after { inset:8px; border-radius:50%; background: currentColor; border:0; }
.nav-item.is-active .nav-icon { color: var(--blue-2); filter: drop-shadow(0 0 12px rgba(96,165,250,.8)); }

.dashboard-hero, .analytics-hero { padding: 22px; margin-top: 12px; }
.big-title { font-size: 38px; line-height: .98; font-weight: 950; letter-spacing: -.03em; margin: 0; }
.subtitle { color: var(--text-2); line-height: 1.5; margin-top: 12px; font-size: 14px; }
.scan-visual { margin-top: 18px; height: 140px; border-radius: 22px; border: 1px solid rgba(96,165,250,.16); background: radial-gradient(circle at 50% 55%, rgba(96,165,250,.30), transparent 12%), radial-gradient(ellipse at center, rgba(59,130,246,.16), transparent 60%); overflow:hidden; position:relative; }
.scan-visual::before { content:""; position:absolute; inset: 18px 24px; border-radius:50%; border:1px solid rgba(96,165,250,.40); box-shadow: 0 0 0 18px rgba(96,165,250,.05), 0 0 0 42px rgba(45,212,191,.025); transform: perspective(160px) rotateX(58deg); }
.regime, .strategy-list, .candidates, .sentiment, .filter-card { margin-top: 14px; padding: 18px; }
.chips { display:grid; grid-template-columns: repeat(3,1fr); gap:8px; margin-top: 14px; }
.chip { border:1px solid rgba(148,163,184,.13); border-radius:14px; padding:10px; color:var(--text-2); font-size:10px; font-weight:800; }
.strategy-row, .candidate-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:14px 0; position:relative; z-index:1; }
.strategy-row + .strategy-row, .candidate-row + .candidate-row { border-top:1px solid rgba(148,163,184,.10); }
.mini-spark { width:90px; height:22px; }
.score { color: var(--cyan); font-weight:950; }
.sentiment-bar { display:grid; grid-template-columns:23fr 42fr 35fr; gap:3px; height:8px; border-radius:999px; overflow:hidden; margin: 14px 0 10px; }
.sentiment-bar > span:nth-child(1){background:var(--red);} .sentiment-bar > span:nth-child(2){background:#94a3b8;} .sentiment-bar > span:nth-child(3){background:var(--green);}

@media (min-width: 700px) { .app-shell { width: var(--maxw); min-height: 860px; border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); } }

/* Minimal production-safe fixes over Vic's reference base.
   Do not globally compress/stretch the design. Only prevent real mobile clipping. */
.app-shell {
  width: 100%;
  max-width: var(--maxw);
}
.screen-wrap {
  padding-bottom: calc(env(safe-area-inset-bottom) + 108px);
}
.hero-top {
  gap: 12px;
}
.hero-top > div:first-child,
.strategy-row > div:first-child,
.candidate-row > * {
  min-width: 0;
}
.signal-pair {
  font-size: clamp(40px, 10.2vw, 50px);
  letter-spacing: .015em;
}
.direction-chip {
  padding: 12px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.timer-confidence {
  gap: 14px;
}
.confidence-ring {
  width: 100px;
  height: 100px;
  flex-basis: 100px;
}
.candidate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 58px 58px;
  align-items: center;
}
.section-note,
.badge {
  white-space: nowrap;
}
.bottom-nav {
  width: min(calc(100% - 28px), 398px);
}
@media (max-width: 390px) {
  .screen-wrap { padding-left: 16px; padding-right: 16px; }
  .signal-pair { font-size: 39px; }
  .direction-chip { padding: 11px 12px; font-size: 12px; }
  .confidence-ring { width: 94px; height: 94px; flex-basis: 94px; }
  .timer-main { font-size: clamp(56px, 16vw, 68px); }
}

/* Redo pass: keep first viewport clean. Extra bottom cards caused visual clipping in Telegram preview. */
#screen-analytics .filter-card,
#screen-log .filter-card,
#screen-settings .sentiment {
  display: none;
}
#screen-dashboard .strategy-list,
#screen-signal .why,
#screen-analytics .sentiment,
#screen-log .strategy-list,
#screen-settings .strategy-list {
  margin-bottom: 22px;
}
@media (max-height: 940px) {
  .chart-svg { height: 146px; }
  .scan-visual { height: 126px; }
  .dashboard-hero, .analytics-hero { padding-bottom: 18px; }
}

/* Dashboard hero visual replacement: readable market map + chart */
.market-map-visual {
  height: 176px;
  margin-top: 20px;
  border-radius: 24px;
  background:
    radial-gradient(160px 90px at 72% 34%, rgba(59,130,246,.24), transparent 68%),
    radial-gradient(190px 105px at 42% 76%, rgba(23,241,205,.16), transparent 72%),
    linear-gradient(180deg, rgba(4,11,28,.88), rgba(3,7,18,.72));
  border-color: rgba(96,165,250,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 14px 40px rgba(0,0,0,.28);
}
.market-map-visual::before { display:none; }
.market-map-visual svg {
  position: absolute;
  inset: 8px 9px 8px 9px;
  width: calc(100% - 18px);
  height: calc(100% - 16px);
  overflow: visible;
}
.market-map-visual .map-grid path {
  stroke: rgba(96,165,250,.14);
  stroke-width: 1;
}
.market-map-visual .world path {
  fill: rgba(37,99,235,.28);
  stroke: rgba(96,165,250,.54);
  stroke-width: 1.4;
  filter: drop-shadow(0 0 10px rgba(59,130,246,.38));
}
.market-map-visual .world circle {
  fill: #17f1cd;
  filter: drop-shadow(0 0 8px rgba(23,241,205,.9));
}
.market-map-visual .orbit {
  fill: none;
  stroke: rgba(96,165,250,.48);
  stroke-width: 1.25;
  stroke-dasharray: 5 8;
}
.market-map-visual .orbit-2 { stroke: rgba(23,241,205,.33); }
.market-map-visual .price-line {
  fill: none;
  stroke: url(#dashLine);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#dashGlow);
}
.market-map-visual .dash-candles line,
.market-map-visual .dash-candles rect {
  stroke: url(#dashCandle);
  fill: url(#dashCandle);
  stroke-width: 2;
  filter: drop-shadow(0 0 9px rgba(96,165,250,.75));
}
.market-map-visual .labels text {
  fill: rgba(219,234,254,.72);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}
.scan-badge {
  position: absolute;
  right: 13px;
  bottom: 13px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(6,12,27,.72);
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.08;
  text-transform: uppercase;
  font-weight: 850;
  backdrop-filter: blur(14px);
}
.scan-badge b {
  display: block;
  margin-top: 3px;
  color: #dbeafe;
  font-size: 16px;
  letter-spacing: 0;
}
@media (max-width: 390px) {
  .market-map-visual { height: 158px; }
  .scan-badge { right: 10px; bottom: 10px; }
}

/* Step 1 — Telegram Mini App shell/layout stabilization.
   No visual redesign: keep current Signal components, only fix viewport, centering, safe areas, and nav clearance. */
html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}
.app-shell {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: visible;
}
.screen-wrap {
  width: min(100vw, var(--maxw));
  max-width: var(--maxw);
  margin-inline: auto;
  padding-top: max(16px, calc(env(safe-area-inset-top) + 14px));
  padding-bottom: calc(env(safe-area-inset-bottom) + 118px);
}
#screen-signal {
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
#screen-signal .cta-row,
#screen-signal .why {
  scroll-margin-bottom: calc(env(safe-area-inset-bottom) + 112px);
}
.bottom-nav {
  left: 50%;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(calc(100vw - 28px), 398px);
}
@media (min-width: 700px) {
  .app-shell {
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    border-left: 0;
    border-right: 0;
  }
  .screen-wrap {
    width: var(--maxw);
  }
}

/* Step 2 — Live Signal typography + spacing cleanup only.
   Keep the reference structure; improve readability, rhythm, and touch comfort without redesigning. */
#screen-signal .brand-header {
  margin-bottom: 0;
}
#screen-signal .pill-row {
  margin: 14px 0 10px;
  gap: 8px;
}
#screen-signal .pill {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 10px;
  letter-spacing: .055em;
}
#screen-signal .hero-card {
  margin-top: 8px;
  padding: 24px 22px 18px;
}
#screen-signal .hero-top {
  align-items: flex-start;
  gap: 14px;
}
#screen-signal .signal-pair {
  font-size: clamp(42px, 10.8vw, 50px);
  letter-spacing: -.018em;
  line-height: .93;
}
#screen-signal .signal-sub {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.25;
  color: #aeb8ca;
}
#screen-signal .direction-chip {
  margin-top: 0;
  padding: 12px 15px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1;
}
#screen-signal .timer-confidence {
  margin-top: 24px;
  gap: 14px;
}
#screen-signal .timer-label {
  font-size: 10px;
  letter-spacing: .14em;
}
#screen-signal .timer-main {
  font-size: clamp(60px, 16.4vw, 70px);
  letter-spacing: -.05em;
  line-height: .94;
}
#screen-signal .confidence-ring {
  width: 100px;
  height: 100px;
  flex-basis: 100px;
}
#screen-signal .conf-number {
  font-size: 25px;
}
#screen-signal .conf-label {
  font-size: 7.5px;
  color: #9da8bb;
}
#screen-signal .strategy-source {
  margin-top: 16px;
  padding: 9px 12px;
  border-radius: 18px;
}
#screen-signal .strategy-source strong {
  font-size: 12.5px;
  line-height: 1.2;
}
#screen-signal .strategy-source span {
  font-size: 10.5px;
  line-height: 1.25;
}
#screen-signal .chart-card {
  margin-top: 12px;
  padding: 15px;
}
#screen-signal .section-head {
  margin-bottom: 9px;
}
#screen-signal .section-title {
  font-size: 15px;
  letter-spacing: -.01em;
}
#screen-signal .section-note {
  font-size: 10px;
}
#screen-signal .chart-svg {
  height: 152px;
}
#screen-signal .stats-row {
  gap: 9px;
  margin-top: 12px;
}
#screen-signal .stat-card {
  min-height: 70px;
  padding: 14px 10px;
  display: flex;
  align-items: center;
}
#screen-signal .stat-value {
  font-size: 21px;
}
#screen-signal .stat-label {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: .075em;
}
#screen-signal .why {
  margin-top: 18px;
}
#screen-signal .why-card {
  margin-top: 9px;
  padding: 13px;
}
#screen-signal .reason {
  gap: 11px;
  padding: 9px 6px;
}
#screen-signal .reason-title {
  font-size: 12.5px;
  line-height: 1.25;
}
#screen-signal .reason-copy {
  font-size: 10.8px;
  line-height: 1.4;
}
#screen-signal .cta-row {
  margin-top: 13px;
  gap: 9px;
}
#screen-signal .cta {
  min-height: 54px;
  font-size: 12.5px;
}
#screen-signal .cta span {
  font-size: 9.8px;
}
@media (max-width: 390px) {
  #screen-signal .hero-card { padding: 22px 19px 17px; }
  #screen-signal .signal-pair { font-size: 40px; }
  #screen-signal .timer-main { font-size: 58px; }
  #screen-signal .confidence-ring { width: 94px; height: 94px; flex-basis: 94px; }
  #screen-signal .chart-svg { height: 144px; }
}

/* Step 3 — Live Signal card hierarchy pass only.
   Clarify primary/secondary surfaces and reduce competing glow without changing layout or data. */
#screen-signal .card {
  border-color: rgba(96,165,250,.17);
  background: linear-gradient(180deg, rgba(12, 23, 48, .86), rgba(7, 14, 30, .76));
  box-shadow: 0 18px 52px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.045);
}
#screen-signal .card::before {
  background: radial-gradient(circle at 78% 0%, rgba(23,241,205,.08), transparent 28%), linear-gradient(180deg, rgba(255,255,255,.04), transparent 16%);
}
#screen-signal .hero-card {
  border-color: rgba(96,165,250,.24);
  background:
    radial-gradient(220px 120px at 82% 6%, rgba(23,241,205,.12), transparent 65%),
    linear-gradient(180deg, rgba(17, 31, 62, .92), rgba(8, 15, 32, .82));
  box-shadow: 0 24px 72px rgba(0,0,0,.40), 0 0 0 1px rgba(255,255,255,.025) inset, inset 0 1px 0 rgba(255,255,255,.07);
}
#screen-signal .hero-card::before {
  background:
    linear-gradient(135deg, rgba(96,165,250,.13), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(23,241,205,.10), transparent 30%);
}
#screen-signal .direction-chip {
  background: linear-gradient(135deg, #ef3f5c, #be123c 72%);
  box-shadow: 0 12px 30px rgba(244,63,94,.22), inset 0 1px 0 rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.13);
}
#screen-signal .strategy-source {
  background: rgba(4, 10, 23, .56);
  border-color: rgba(148,163,184,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
#screen-signal .chart-card {
  border-color: rgba(96,165,250,.18);
  background: linear-gradient(180deg, rgba(10, 20, 42, .82), rgba(5, 11, 25, .74));
  box-shadow: 0 16px 42px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.045);
}
#screen-signal .chart-card .section-title {
  color: #e7efff;
}
#screen-signal .stats-row .stat-card {
  border-color: rgba(96,165,250,.14);
  background: linear-gradient(180deg, rgba(10, 20, 42, .76), rgba(5, 11, 25, .66));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 28px rgba(0,0,0,.18);
}
#screen-signal .stats-row .stat-card:first-child {
  border-color: rgba(23,241,205,.22);
  background: linear-gradient(180deg, rgba(12, 30, 48, .78), rgba(5, 16, 30, .68));
}
#screen-signal .stat-value {
  color: #eef6ff;
}
#screen-signal .stats-row .stat-card:first-child .stat-value {
  color: #d9fff8;
  text-shadow: 0 0 18px rgba(23,241,205,.18);
}
#screen-signal .why-card {
  border-color: rgba(148,163,184,.13);
  background: linear-gradient(180deg, rgba(10, 20, 42, .70), rgba(5, 11, 25, .62));
  box-shadow: 0 12px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
}
#screen-signal .reason-num {
  background: linear-gradient(135deg, rgba(59,130,246,.95), rgba(29,78,216,.92));
  box-shadow: 0 8px 20px rgba(37,99,235,.24);
}
#screen-signal .reason + .reason {
  border-top-color: rgba(148,163,184,.09);
}
#screen-signal .cta {
  background: linear-gradient(135deg, #2563eb, #2f7df6 58%, #0ea5e9 120%);
  box-shadow: 0 15px 38px rgba(37,99,235,.30), inset 0 1px 0 rgba(255,255,255,.15);
}
#screen-signal .bell-btn {
  background: linear-gradient(180deg, rgba(10,20,42,.78), rgba(5,11,25,.68));
  border-color: rgba(96,165,250,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 28px rgba(0,0,0,.20);
}

/* Step 3 minor fixes — calm stats and increase Signal bottom breathing room */
#screen-signal .stats-row .stat-card,
#screen-signal .stats-row .stat-card:first-child {
  border-color: rgba(96,165,250,.13);
  background: linear-gradient(180deg, rgba(8, 17, 36, .70), rgba(5, 11, 25, .62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 8px 22px rgba(0,0,0,.15);
}
#screen-signal .stats-row .stat-card:first-child .stat-value {
  color: #eef6ff;
  text-shadow: none;
}
#screen-signal .why {
  margin-bottom: 34px;
}
#screen-signal .cta-row {
  margin-bottom: 12px;
}
.screen-wrap {
  padding-bottom: calc(env(safe-area-inset-bottom) + 128px);
}

/* Step 3 overflow fix — avoid 100vw scrollbar clipping on Chromium/Telegram webview */
.app-shell {
  width: 100%;
  max-width: none;
}
.screen-wrap {
  width: min(100%, var(--maxw));
}
.bottom-nav {
  width: min(calc(100% - 28px), 398px);
}
#screen-signal .card,
#screen-signal .stats-row,
#screen-signal .cta-row {
  max-width: 100%;
}

/* Meaningful hero visuals — replace generic decorative placeholders only */
.meaningful-market-visual .market-badges,
.radar-filter-visual .radar-stats {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  z-index: 2;
}
.meaningful-market-visual .market-badges span,
.radar-filter-visual .radar-stats span {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid rgba(96,165,250,.18);
  background: rgba(3, 7, 18, .62);
  color: #dbeafe;
  font-size: 9px;
  line-height: 1.05;
  font-weight: 850;
  text-align: center;
  backdrop-filter: blur(12px);
  white-space: nowrap;
}
.radar-filter-visual {
  height: 156px;
  background:
    radial-gradient(circle at 50% 50%, rgba(23,241,205,.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(59,130,246,.14), transparent 62%),
    linear-gradient(180deg, rgba(4,11,28,.82), rgba(3,7,18,.68));
}
.radar-filter-visual::before { display: none; }
.radar-filter-visual svg {
  position: absolute;
  inset: 3px 8px 26px;
  width: calc(100% - 16px);
  height: calc(100% - 29px);
}
.radar-grid circle,
.radar-grid path {
  fill: none;
  stroke: rgba(96,165,250,.24);
  stroke-width: 1;
}
.radar-sweep {
  fill: url(#sweep);
  opacity: .85;
  filter: drop-shadow(0 0 10px rgba(23,241,205,.34));
}
.radar-core {
  fill: url(#radarCore);
  filter: drop-shadow(0 0 16px rgba(23,241,205,.55));
}
.radar-ai {
  fill: #031019;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
}
.radar-dots circle {
  fill: #17f1cd;
  filter: drop-shadow(0 0 8px rgba(23,241,205,.85));
}
.radar-dots circle:nth-child(2),
.radar-dots circle:nth-child(4) { fill: #60a5fa; }
.radar-filter-visual .radar-stats span b {
  color: #f8fafc;
  font-size: 11px;
}
.settings-summary-visual {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(96,165,250,.16);
  background:
    radial-gradient(120px 80px at 88% 12%, rgba(23,241,205,.10), transparent 70%),
    rgba(3, 7, 18, .40);
}
.settings-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid rgba(148,163,184,.11);
  background: rgba(7,14,29,.58);
}
.settings-summary-item span {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 760;
}
.settings-summary-item b {
  color: #dffef8;
  font-size: 11px;
  font-weight: 920;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.settings-summary-item:first-child b {
  color: var(--cyan);
}
@media (max-width: 390px) {
  .meaningful-market-visual .market-badges span,
  .radar-filter-visual .radar-stats span { font-size: 8px; padding-inline: 5px; }
  .settings-summary-item { min-height: 32px; }
}

/* Meaningful hero pass: keep last visible sections clear of fixed bottom nav */
#screen-dashboard .strategy-list,
#screen-analytics .sentiment,
#screen-settings .strategy-list {
  margin-bottom: 48px;
}

/* Final fit for meaningful blocks in 430x932 Telegram preview */
#screen-dashboard .meaningful-market-visual { height: 162px; }
#screen-analytics .radar-filter-visual { height: 146px; }
#screen-analytics .analytics-status-row .pill {
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
  padding-inline: 10px;
}
#screen-settings .settings-hero { padding-bottom: 16px; }
#screen-settings .settings-summary-visual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  margin-top: 14px;
}
#screen-settings .settings-summary-item {
  min-height: 31px;
  padding: 0 8px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}
#screen-settings .settings-summary-item:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
#screen-settings .settings-summary-item span { font-size: 10px; }
#screen-settings .settings-summary-item b { font-size: 10px; }
#screen-settings .strategy-list { padding: 15px; }
#screen-settings .strategy-row { padding: 11px 0; }

/* Dashboard hero visual block replacement only: clean AI market scanning panel */
#screen-dashboard .dashboard-scan-panel {
  height: 168px;
  margin-top: 20px;
  border-radius: 24px;
  border-color: rgba(96,165,250,.20);
  background:
    radial-gradient(180px 86px at 72% 34%, rgba(59,130,246,.20), transparent 68%),
    radial-gradient(150px 90px at 26% 75%, rgba(23,241,205,.10), transparent 70%),
    linear-gradient(180deg, rgba(5,12,28,.88), rgba(3,7,18,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 14px 38px rgba(0,0,0,.26);
}
#screen-dashboard .dashboard-scan-panel::before { display: none; }
#screen-dashboard .dashboard-scan-panel svg {
  position: absolute;
  inset: 8px 10px 38px;
  width: calc(100% - 20px);
  height: calc(100% - 46px);
  overflow: visible;
}
#screen-dashboard .scan-grid path {
  stroke: rgba(96,165,250,.12);
  stroke-width: 1;
}
#screen-dashboard .topology path {
  fill: none;
  stroke: rgba(148,163,184,.13);
  stroke-width: 1.1;
  stroke-linecap: round;
}
#screen-dashboard .scan-routes path {
  fill: none;
  stroke: rgba(23,241,205,.28);
  stroke-width: 1.1;
  stroke-dasharray: 4 7;
  stroke-linecap: round;
}
#screen-dashboard .scan-routes path:first-child {
  stroke: rgba(96,165,250,.34);
}
#screen-dashboard .scan-trend {
  fill: none;
  stroke: url(#scanTrend);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#scanGlow);
}
#screen-dashboard .scan-nodes circle {
  fill: #17f1cd;
  stroke: rgba(3,7,18,.75);
  stroke-width: 2;
  filter: drop-shadow(0 0 9px rgba(23,241,205,.75));
}
#screen-dashboard .scan-nodes circle:nth-child(2),
#screen-dashboard .scan-nodes circle:nth-child(3) {
  fill: #60a5fa;
  filter: drop-shadow(0 0 9px rgba(96,165,250,.70));
}
#screen-dashboard .scan-candles line,
#screen-dashboard .scan-candles rect {
  stroke: url(#scanCandle);
  fill: url(#scanCandle);
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(96,165,250,.54));
}
#screen-dashboard .dashboard-scan-panel .scan-status-chips {
  left: 12px;
  right: 12px;
  bottom: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#screen-dashboard .dashboard-scan-panel .scan-status-chips span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  border-color: rgba(96,165,250,.18);
  background: rgba(5,12,28,.68);
  color: #dbeafe;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
#screen-dashboard .dashboard-scan-panel .scan-status-chips span:nth-child(2) {
  border-color: rgba(23,241,205,.28);
  color: #ddfff8;
}
@media (max-width: 390px) {
  #screen-dashboard .dashboard-scan-panel { height: 156px; }
  #screen-dashboard .dashboard-scan-panel .scan-status-chips span { font-size: 8.5px; }
}

/* Dashboard hero replacement: Home command/status center only */
#screen-dashboard .bot-status-hero {
  padding: 22px;
  margin-top: 12px;
  overflow: hidden;
}
#screen-dashboard .bot-status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
  position: relative;
  z-index: 1;
}
#screen-dashboard .bot-status-row div,
#screen-dashboard .bot-metrics div {
  border: 1px solid rgba(96,165,250,.15);
  background: rgba(5,12,28,.58);
  border-radius: 15px;
  padding: 10px;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
#screen-dashboard .bot-status-row span,
#screen-dashboard .bot-metrics span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#screen-dashboard .bot-status-row b,
#screen-dashboard .bot-metrics b {
  display: block;
  margin-top: 5px;
  color: #eef6ff;
  font-size: 12px;
  font-weight: 920;
  white-space: nowrap;
}
#screen-dashboard .bot-status-row div:first-child b {
  color: var(--cyan);
}
#screen-dashboard .system-core-panel {
  margin-top: 14px;
  height: 168px;
  border-radius: 24px;
  border: 1px solid rgba(96,165,250,.17);
  background:
    radial-gradient(150px 100px at 50% 48%, rgba(23,241,205,.12), transparent 65%),
    radial-gradient(210px 120px at 72% 25%, rgba(59,130,246,.12), transparent 70%),
    linear-gradient(180deg, rgba(4,11,28,.74), rgba(3,7,18,.54));
  position: relative;
  overflow: hidden;
  z-index: 1;
}
#screen-dashboard .system-core-panel svg {
  width: 100%;
  height: 100%;
  display: block;
}
#screen-dashboard .core-grid path {
  stroke: rgba(96,165,250,.10);
  stroke-width: 1;
}
#screen-dashboard .module-lines path {
  fill: none;
  stroke: url(#coreLine);
  stroke-width: 1.5;
  stroke-opacity: .42;
  stroke-dasharray: 5 7;
}
#screen-dashboard .core-halo {
  fill: url(#corePulse);
  filter: drop-shadow(0 0 16px rgba(23,241,205,.34));
}
#screen-dashboard .core-dot {
  fill: rgba(23,241,205,.92);
  filter: url(#coreGlow);
}
#screen-dashboard .core-ai {
  fill: #031019;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .03em;
}
#screen-dashboard .module rect {
  fill: rgba(7,14,29,.78);
  stroke: rgba(96,165,250,.22);
  stroke-width: 1;
}
#screen-dashboard .module text {
  fill: #dbeafe;
  font-size: 12px;
  font-weight: 850;
}
#screen-dashboard .module circle {
  fill: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(23,241,205,.70));
}
#screen-dashboard .module-analytics circle { fill: var(--blue-2); }
#screen-dashboard .module-journal circle { fill: var(--violet-2); }
#screen-dashboard .bot-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}
#screen-dashboard .bot-metrics div {
  padding: 9px 10px;
  border-radius: 14px;
}
#screen-dashboard .bot-metrics b {
  font-size: 11px;
}
#screen-dashboard .bot-hint {
  margin-top: 12px;
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border-radius: 15px;
  border: 1px solid rgba(23,241,205,.16);
  background: rgba(23,241,205,.055);
  color: #c8fff5;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 760;
}
@media (max-width: 390px) {
  #screen-dashboard .bot-status-hero { padding: 20px; }
  #screen-dashboard .bot-status-row b,
  #screen-dashboard .bot-metrics b { font-size: 10px; }
  #screen-dashboard .system-core-panel { height: 154px; }
}

/* Dashboard System / Source Control: markets availability block */
#screen-dashboard .markets-now-card {
  margin-top: 14px;
  padding: 18px;
}
#screen-dashboard .markets-now-card .section-head {
  align-items: flex-start;
  margin-bottom: 12px;
}
#screen-dashboard .market-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
#screen-dashboard .market-summary-row span {
  min-width: 0;
  padding: 9px 8px;
  border-radius: 13px;
  border: 1px solid rgba(96,165,250,.14);
  background: rgba(5,12,28,.54);
  color: var(--muted);
  font-size: 9px;
  font-weight: 820;
  line-height: 1.18;
}
#screen-dashboard .market-summary-row b {
  display: block;
  margin-top: 2px;
  color: #eaf2ff;
  font-size: 10px;
  white-space: nowrap;
}
#screen-dashboard .market-cards {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}
#screen-dashboard .market-card {
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.13);
  background: linear-gradient(180deg, rgba(7,14,29,.72), rgba(4,9,21,.62));
  padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 28px rgba(0,0,0,.16);
}
#screen-dashboard .market-card.is-active {
  border-color: rgba(23,241,205,.26);
  background:
    radial-gradient(150px 78px at 90% 4%, rgba(23,241,205,.10), transparent 70%),
    linear-gradient(180deg, rgba(7,24,36,.76), rgba(4,12,24,.64));
}
#screen-dashboard .market-card.is-unavailable {
  border-color: rgba(251,191,36,.18);
}
#screen-dashboard .market-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#screen-dashboard .market-name {
  color: #f8fafc;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: .02em;
  line-height: 1;
}
#screen-dashboard .market-status {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
#screen-dashboard .market-label {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(3,7,18,.42);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
#screen-dashboard .market-card.is-active .market-label {
  border-color: rgba(23,241,205,.30);
  color: #dffef8;
  background: rgba(23,241,205,.07);
}
#screen-dashboard .market-card.is-unavailable .market-label {
  border-color: rgba(251,191,36,.24);
  color: #ffe3a8;
  background: rgba(251,191,36,.055);
}
#screen-dashboard .market-card p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.42;
}
#screen-dashboard .market-metrics {
  display: grid;
  grid-template-columns: .65fr 1.35fr .8fr;
  gap: 7px;
  margin-top: 12px;
}
#screen-dashboard .market-metrics div {
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(96,165,250,.10);
  background: rgba(3,7,18,.34);
  padding: 8px;
}
#screen-dashboard .market-metrics span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
#screen-dashboard .market-metrics b {
  display: block;
  margin-top: 4px;
  color: #eaf2ff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
#screen-dashboard .market-card.is-active .market-metrics b:last-child {
  color: #dffef8;
}
@media (max-width: 390px) {
  #screen-dashboard .market-summary-row { grid-template-columns: 1fr; }
  #screen-dashboard .market-metrics { grid-template-columns: 1fr; }
}

/* Dashboard hero cleanup: remove duplicated source/status metrics, focus hero on system core */
#screen-dashboard .bot-status-hero .bot-status-row,
#screen-dashboard .bot-status-hero .bot-metrics {
  display: none;
}
#screen-dashboard .system-core-panel-clean {
  height: 216px;
  margin-top: 20px;
  border-color: rgba(96,165,250,.18);
  background:
    radial-gradient(190px 130px at 50% 52%, rgba(23,241,205,.13), transparent 68%),
    radial-gradient(240px 150px at 70% 22%, rgba(59,130,246,.12), transparent 72%),
    linear-gradient(180deg, rgba(4,11,28,.76), rgba(3,7,18,.56));
}
#screen-dashboard .system-core-panel-clean svg {
  height: calc(100% - 38px);
}
#screen-dashboard .core-ring {
  fill: none;
  stroke: rgba(96,165,250,.18);
  stroke-width: 1.2;
  stroke-dasharray: 5 8;
}
#screen-dashboard .module-lines .pulse-route {
  stroke: rgba(23,241,205,.20);
  stroke-width: 1;
  stroke-dasharray: 3 9;
}
#screen-dashboard .core-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 15px;
  border: 1px solid rgba(96,165,250,.13);
  background: rgba(3,7,18,.48);
  backdrop-filter: blur(12px);
}
#screen-dashboard .core-caption span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#screen-dashboard .core-caption b {
  color: #dffef8;
  font-size: 12px;
  font-weight: 900;
}
#screen-dashboard .bot-hint {
  margin-top: 12px;
}
@media (max-width: 390px) {
  #screen-dashboard .system-core-panel-clean { height: 202px; }
  #screen-dashboard .core-caption b { font-size: 11px; }
}

/* Settings cleanup: remove duplicated summary block from hero, keep filters below as source of truth */
#screen-settings .settings-hero {
  padding-bottom: 24px;
}

/* Compact highlighted hero blocks: Settings + Journal only */
#screen-settings .settings-hero,
#screen-log .dashboard-hero {
  padding: 18px 22px;
  min-height: 0;
}
#screen-settings .settings-hero .big-title,
#screen-log .dashboard-hero .big-title {
  font-size: clamp(34px, 8.8vw, 42px);
  line-height: .95;
  letter-spacing: -.04em;
}
#screen-settings .settings-hero .subtitle,
#screen-log .dashboard-hero .subtitle {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.42;
  max-width: 310px;
}
#screen-log .dashboard-hero .stats-row {
  margin-top: 14px;
  gap: 8px;
}
#screen-log .dashboard-hero .stat-card {
  min-height: 58px;
  padding: 12px 10px;
  border-radius: 16px;
}
#screen-log .dashboard-hero .stat-value {
  font-size: 25px;
}
#screen-log .dashboard-hero .stat-label {
  margin-top: 6px;
  font-size: 9px;
}
@media (max-width: 390px) {
  #screen-settings .settings-hero,
  #screen-log .dashboard-hero { padding: 16px 20px; }
  #screen-settings .settings-hero .big-title,
  #screen-log .dashboard-hero .big-title { font-size: 32px; }
  #screen-log .dashboard-hero .stat-card { min-height: 54px; }
}

/* Hard compact pass: Settings + Journal hero blocks must be ~2x shorter on phone */
#screen-settings .settings-hero,
#screen-log .dashboard-hero {
  padding: 14px 18px !important;
  margin-top: 10px !important;
  border-radius: 22px !important;
}
#screen-settings .settings-hero .big-title,
#screen-log .dashboard-hero .big-title {
  font-size: clamp(25px, 6.4vw, 31px) !important;
  line-height: .92 !important;
  letter-spacing: -.04em !important;
  margin: 0 !important;
}
#screen-settings .settings-hero .subtitle,
#screen-log .dashboard-hero .subtitle {
  margin-top: 7px !important;
  font-size: 11px !important;
  line-height: 1.32 !important;
  max-width: 300px !important;
}
#screen-log .dashboard-hero .stats-row {
  margin-top: 10px !important;
  gap: 7px !important;
}
#screen-log .dashboard-hero .stat-card {
  min-height: 44px !important;
  padding: 8px 9px !important;
  border-radius: 14px !important;
}
#screen-log .dashboard-hero .stat-value {
  font-size: 20px !important;
  line-height: 1 !important;
}
#screen-log .dashboard-hero .stat-label {
  margin-top: 4px !important;
  font-size: 7.5px !important;
  letter-spacing: .09em !important;
}
#screen-settings .strategy-list,
#screen-log .strategy-list {
  margin-top: 12px !important;
}
@media (max-width: 390px) {
  #screen-settings .settings-hero,
  #screen-log .dashboard-hero { padding: 12px 16px !important; }
  #screen-settings .settings-hero .big-title,
  #screen-log .dashboard-hero .big-title { font-size: 24px !important; }
  #screen-settings .settings-hero .subtitle,
  #screen-log .dashboard-hero .subtitle { font-size: 10.5px !important; }
  #screen-log .dashboard-hero .stat-card { min-height: 40px !important; padding: 7px 8px !important; }
}

/* Hard compact pass: first hero blocks on Dashboard / Signals / Analytics */
#screen-dashboard .bot-status-hero,
#screen-signal .hero-card,
#screen-analytics .analytics-hero {
  padding: 14px 18px !important;
  margin-top: 10px !important;
  border-radius: 22px !important;
}
#screen-dashboard .bot-status-hero .big-title,
#screen-analytics .analytics-hero .big-title {
  font-size: clamp(25px, 6.4vw, 31px) !important;
  line-height: .92 !important;
  letter-spacing: -.04em !important;
  margin: 0 !important;
}
#screen-dashboard .bot-status-hero .subtitle,
#screen-analytics .analytics-hero .subtitle {
  margin-top: 7px !important;
  font-size: 11px !important;
  line-height: 1.32 !important;
  max-width: 310px !important;
}
#screen-dashboard .bot-status-hero .system-core-panel-clean,
#screen-dashboard .bot-status-hero .system-core-panel {
  height: 126px !important;
  margin-top: 10px !important;
  border-radius: 18px !important;
}
#screen-dashboard .system-core-panel-clean svg {
  height: calc(100% - 28px) !important;
}
#screen-dashboard .module rect {
  height: 34px !important;
  rx: 13px;
}
#screen-dashboard .module text {
  font-size: 10px !important;
}
#screen-dashboard .core-caption {
  left: 10px !important;
  right: 10px !important;
  bottom: 8px !important;
  padding: 6px 9px !important;
  border-radius: 12px !important;
}
#screen-dashboard .core-caption span { font-size: 8px !important; }
#screen-dashboard .core-caption b { font-size: 10px !important; }
#screen-dashboard .bot-hint {
  margin-top: 8px !important;
  padding: 8px 10px !important;
  border-radius: 13px !important;
  font-size: 10.5px !important;
  line-height: 1.28 !important;
}

#screen-signal .hero-card .signal-pair {
  font-size: clamp(30px, 7.8vw, 38px) !important;
  line-height: .92 !important;
  letter-spacing: -.025em !important;
}
#screen-signal .hero-card .signal-sub {
  margin-top: 5px !important;
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}
#screen-signal .hero-card .direction-chip {
  padding: 9px 11px !important;
  border-radius: 13px !important;
  font-size: 11px !important;
}
#screen-signal .hero-card .timer-confidence {
  margin-top: 12px !important;
  gap: 10px !important;
}
#screen-signal .hero-card .timer-label {
  font-size: 8px !important;
  letter-spacing: .12em !important;
}
#screen-signal .hero-card .timer-main {
  font-size: clamp(42px, 11.5vw, 52px) !important;
  line-height: .94 !important;
  margin-top: 3px !important;
}
#screen-signal .hero-card .timer-bar {
  width: 62px !important;
  height: 4px !important;
  margin-top: 7px !important;
}
#screen-signal .hero-card .confidence-ring {
  width: 74px !important;
  height: 74px !important;
  flex-basis: 74px !important;
}
#screen-signal .hero-card .confidence-ring::after { inset: 6px !important; }
#screen-signal .hero-card .conf-number { font-size: 18px !important; }
#screen-signal .hero-card .conf-label { font-size: 6px !important; margin-top: 2px !important; }
#screen-signal .hero-card .strategy-source {
  margin-top: 10px !important;
  min-height: 34px !important;
  padding: 6px 9px !important;
  border-radius: 14px !important;
}
#screen-signal .hero-card .source-icon {
  width: 22px !important;
  height: 22px !important;
  flex-basis: 22px !important;
}
#screen-signal .hero-card .source-icon .logo-mark { width: 18px !important; height: 18px !important; }
#screen-signal .hero-card .strategy-source strong { font-size: 10.5px !important; }
#screen-signal .hero-card .strategy-source span { font-size: 8.5px !important; }

#screen-analytics .analytics-hero .radar-filter-visual {
  height: 104px !important;
  margin-top: 10px !important;
  border-radius: 18px !important;
}
#screen-analytics .analytics-hero .radar-filter-visual svg {
  inset: 2px 8px 22px !important;
  height: calc(100% - 24px) !important;
}
#screen-analytics .analytics-hero .radar-stats {
  left: 9px !important;
  right: 9px !important;
  bottom: 7px !important;
  gap: 5px !important;
}
#screen-analytics .analytics-hero .radar-stats span {
  padding: 5px 5px !important;
  font-size: 7.5px !important;
  border-radius: 10px !important;
}
#screen-analytics .analytics-hero .radar-stats span b {
  font-size: 9px !important;
}
#screen-dashboard .markets-now-card,
#screen-signal .chart-card,
#screen-analytics .candidates {
  margin-top: 12px !important;
}
@media (max-width: 390px) {
  #screen-dashboard .bot-status-hero,
  #screen-signal .hero-card,
  #screen-analytics .analytics-hero { padding: 12px 16px !important; }
  #screen-dashboard .bot-status-hero .big-title,
  #screen-analytics .analytics-hero .big-title { font-size: 24px !important; }
  #screen-signal .hero-card .signal-pair { font-size: 29px !important; }
  #screen-signal .hero-card .timer-main { font-size: 40px !important; }
}

/* Second hard compact pass: Dashboard / Signals / Analytics first hero blocks */
#screen-dashboard .bot-status-hero,
#screen-signal .hero-card,
#screen-analytics .analytics-hero {
  padding: 10px 15px !important;
  margin-top: 8px !important;
}
#screen-dashboard .bot-status-hero .big-title,
#screen-analytics .analytics-hero .big-title {
  font-size: clamp(22px, 5.7vw, 27px) !important;
}
#screen-dashboard .bot-status-hero .subtitle,
#screen-analytics .analytics-hero .subtitle {
  margin-top: 5px !important;
  font-size: 9.8px !important;
  line-height: 1.25 !important;
}
#screen-dashboard .bot-status-hero .system-core-panel-clean,
#screen-dashboard .bot-status-hero .system-core-panel {
  height: 96px !important;
  margin-top: 8px !important;
  border-radius: 16px !important;
}
#screen-dashboard .system-core-panel-clean svg { height: calc(100% - 24px) !important; }
#screen-dashboard .core-caption { padding: 5px 8px !important; bottom: 6px !important; }
#screen-dashboard .core-caption span { font-size: 7px !important; }
#screen-dashboard .core-caption b { font-size: 9px !important; }
#screen-dashboard .bot-hint {
  margin-top: 7px !important;
  padding: 7px 9px !important;
  font-size: 9.5px !important;
}
#screen-signal .hero-card .signal-pair {
  font-size: clamp(25px, 6.7vw, 32px) !important;
}
#screen-signal .hero-card .signal-sub { font-size: 9px !important; margin-top: 4px !important; }
#screen-signal .hero-card .direction-chip { padding: 7px 9px !important; font-size: 9.5px !important; border-radius: 11px !important; }
#screen-signal .hero-card .timer-confidence { margin-top: 9px !important; }
#screen-signal .hero-card .timer-label { font-size: 7px !important; }
#screen-signal .hero-card .timer-main { font-size: clamp(34px, 9.4vw, 43px) !important; }
#screen-signal .hero-card .timer-bar { width: 52px !important; margin-top: 5px !important; }
#screen-signal .hero-card .confidence-ring {
  width: 60px !important;
  height: 60px !important;
  flex-basis: 60px !important;
}
#screen-signal .hero-card .conf-number { font-size: 15px !important; }
#screen-signal .hero-card .conf-label { font-size: 5px !important; }
#screen-signal .hero-card .strategy-source {
  margin-top: 8px !important;
  min-height: 28px !important;
  padding: 5px 8px !important;
  gap: 7px !important;
}
#screen-signal .hero-card .source-icon { width: 18px !important; height: 18px !important; flex-basis: 18px !important; }
#screen-signal .hero-card .source-icon .logo-mark { width: 14px !important; height: 14px !important; }
#screen-signal .hero-card .strategy-source strong { font-size: 9px !important; }
#screen-signal .hero-card .strategy-source span { font-size: 7.5px !important; }
#screen-analytics .analytics-hero .radar-filter-visual {
  height: 82px !important;
  margin-top: 8px !important;
  border-radius: 16px !important;
}
#screen-analytics .analytics-hero .radar-filter-visual svg { inset: 1px 8px 19px !important; height: calc(100% - 20px) !important; }
#screen-analytics .analytics-hero .radar-stats { bottom: 5px !important; gap: 4px !important; }
#screen-analytics .analytics-hero .radar-stats span { padding: 4px !important; font-size: 6.8px !important; }
#screen-analytics .analytics-hero .radar-stats span b { font-size: 8px !important; }
@media (max-width: 390px) {
  #screen-dashboard .bot-status-hero,
  #screen-signal .hero-card,
  #screen-analytics .analytics-hero { padding: 9px 14px !important; }
  #screen-signal .hero-card .signal-pair { font-size: 24px !important; }
  #screen-signal .hero-card .timer-main { font-size: 33px !important; }
}

/* Safe-area after compacting first heroes */
.screen-wrap {
  padding-bottom: calc(env(safe-area-inset-bottom) + 148px) !important;
}
#screen-dashboard .strategy-list,
#screen-signal .why,
#screen-analytics .sentiment {
  margin-bottom: 58px !important;
}

/* Revert over-compact first heroes: restore block sizes, reduce only typography */
#screen-dashboard .bot-status-hero,
#screen-signal .hero-card,
#screen-analytics .analytics-hero {
  padding: 22px !important;
  margin-top: 12px !important;
  border-radius: 24px !important;
}
#screen-dashboard .bot-status-hero .big-title,
#screen-analytics .analytics-hero .big-title {
  font-size: clamp(31px, 8vw, 36px) !important;
  line-height: .95 !important;
  letter-spacing: -.04em !important;
  margin: 0 !important;
}
#screen-dashboard .bot-status-hero .subtitle,
#screen-analytics .analytics-hero .subtitle {
  margin-top: 10px !important;
  font-size: 12.5px !important;
  line-height: 1.42 !important;
  max-width: 330px !important;
}
#screen-dashboard .bot-status-hero .system-core-panel-clean,
#screen-dashboard .bot-status-hero .system-core-panel {
  height: 216px !important;
  margin-top: 20px !important;
  border-radius: 24px !important;
}
#screen-dashboard .system-core-panel-clean svg {
  height: calc(100% - 38px) !important;
}
#screen-dashboard .core-caption {
  left: 14px !important;
  right: 14px !important;
  bottom: 12px !important;
  padding: 10px 12px !important;
  border-radius: 15px !important;
}
#screen-dashboard .core-caption span { font-size: 9px !important; }
#screen-dashboard .core-caption b { font-size: 11px !important; }
#screen-dashboard .bot-hint {
  margin-top: 12px !important;
  padding: 10px 12px !important;
  border-radius: 15px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

#screen-signal .hero-card {
  padding: 24px 22px 18px !important;
}
#screen-signal .hero-card .signal-pair {
  font-size: clamp(36px, 9.3vw, 44px) !important;
  line-height: .93 !important;
  letter-spacing: -.025em !important;
}
#screen-signal .hero-card .signal-sub {
  margin-top: 7px !important;
  font-size: 12px !important;
  line-height: 1.24 !important;
}
#screen-signal .hero-card .direction-chip {
  padding: 11px 14px !important;
  border-radius: 15px !important;
  font-size: 12px !important;
}
#screen-signal .hero-card .timer-confidence {
  margin-top: 22px !important;
  gap: 14px !important;
}
#screen-signal .hero-card .timer-label {
  font-size: 9.5px !important;
  letter-spacing: .13em !important;
}
#screen-signal .hero-card .timer-main {
  font-size: clamp(54px, 14.6vw, 64px) !important;
  line-height: .95 !important;
  margin-top: 4px !important;
}
#screen-signal .hero-card .timer-bar {
  width: 72px !important;
  height: 5px !important;
  margin-top: 9px !important;
}
#screen-signal .hero-card .confidence-ring {
  width: 100px !important;
  height: 100px !important;
  flex-basis: 100px !important;
}
#screen-signal .hero-card .confidence-ring::after { inset: 8px !important; }
#screen-signal .hero-card .conf-number { font-size: 23px !important; }
#screen-signal .hero-card .conf-label { font-size: 7px !important; margin-top: 3px !important; }
#screen-signal .hero-card .strategy-source {
  margin-top: 16px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  gap: 10px !important;
  border-radius: 18px !important;
}
#screen-signal .hero-card .source-icon {
  width: 26px !important;
  height: 26px !important;
  flex-basis: 26px !important;
}
#screen-signal .hero-card .source-icon .logo-mark { width: 22px !important; height: 22px !important; }
#screen-signal .hero-card .strategy-source strong { font-size: 11.5px !important; }
#screen-signal .hero-card .strategy-source span { font-size: 9.5px !important; }

#screen-analytics .analytics-hero .radar-filter-visual {
  height: 146px !important;
  margin-top: 18px !important;
  border-radius: 22px !important;
}
#screen-analytics .analytics-hero .radar-filter-visual svg {
  inset: 3px 8px 26px !important;
  width: calc(100% - 16px) !important;
  height: calc(100% - 29px) !important;
}
#screen-analytics .analytics-hero .radar-stats {
  left: 12px !important;
  right: 12px !important;
  bottom: 10px !important;
  gap: 7px !important;
}
#screen-analytics .analytics-hero .radar-stats span {
  padding: 7px 8px !important;
  font-size: 8.5px !important;
  border-radius: 12px !important;
}
#screen-analytics .analytics-hero .radar-stats span b {
  font-size: 10px !important;
}
#screen-dashboard .markets-now-card,
#screen-signal .chart-card,
#screen-analytics .candidates {
  margin-top: 14px !important;
}
@media (max-width: 390px) {
  #screen-dashboard .bot-status-hero,
  #screen-analytics .analytics-hero { padding: 20px !important; }
  #screen-signal .hero-card { padding: 22px 19px 17px !important; }
  #screen-dashboard .bot-status-hero .big-title,
  #screen-analytics .analytics-hero .big-title { font-size: 29px !important; }
  #screen-signal .hero-card .signal-pair { font-size: 34px !important; }
  #screen-signal .hero-card .timer-main { font-size: 52px !important; }
  #screen-signal .hero-card .confidence-ring { width: 94px !important; height: 94px !important; flex-basis: 94px !important; }
}

/* Bottom nav icon polish: product-style fintech icons */
.nav-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: block;
  color: currentColor;
}
.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  opacity: .86;
}
/* Dashboard: command grid */
.nav-icon.home::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 8px;
}
.nav-icon.home::after {
  inset: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  box-shadow: 6px 0 0 -4px currentColor, 0 6px 0 -4px currentColor;
  opacity: .62;
}
/* Signals: clean trading pulse line */
.nav-icon.pulse::before {
  left: 2px;
  right: 2px;
  top: 12px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  opacity: .56;
}
.nav-icon.pulse::after {
  left: 3px;
  top: 5px;
  width: 18px;
  height: 14px;
  border: 0;
  background: none;
  clip-path: polygon(0 58%, 24% 58%, 36% 20%, 52% 88%, 65% 44%, 100% 44%, 100% 58%, 72% 58%, 52% 100%, 36% 42%, 28% 72%, 0 72%);
  background-color: currentColor;
  opacity: .9;
}
/* Analytics: radar scanner */
.nav-icon.radar::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.nav-icon.radar::after {
  left: 11px;
  top: 4px;
  width: 9px;
  height: 13px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 0 12px;
  transform: rotate(-42deg);
  transform-origin: 1px 10px;
  opacity: .72;
}
/* Journal: compact ledger */
.nav-icon.log::before {
  inset: 3px 5px;
  border: 2px solid currentColor;
  border-radius: 5px;
}
.nav-icon.log::after {
  left: 9px;
  right: 8px;
  top: 8px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
  opacity: .72;
}
/* Settings: calibrated control ring, not generic target */
.nav-icon.gear::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(96,165,250,.08);
}
.nav-icon.gear::after {
  left: 10px;
  top: 2px;
  width: 4px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -7px 7px 0 -1px currentColor, 7px 7px 0 -1px currentColor;
  opacity: .58;
}
.nav-item.is-active .nav-icon {
  color: var(--blue-2);
  filter: drop-shadow(0 0 12px rgba(96,165,250,.72));
}
.nav-item.is-active .nav-icon::before,
.nav-item.is-active .nav-icon::after {
  opacity: .96;
}

/* Bottom nav SVG icon system — replaces rough CSS pseudo-icons */
.nav-item .nav-icon { display: none !important; }
.nav-svg {
  width: 24px;
  height: 24px;
  display: block;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .74;
  transition: opacity .18s ease, filter .18s ease, transform .18s ease;
}
.nav-item.is-active .nav-svg {
  opacity: 1;
  color: var(--blue-2);
  filter: drop-shadow(0 0 10px rgba(96,165,250,.72));
  transform: translateY(-1px);
}
.nav-item:active .nav-svg { transform: translateY(0) scale(.96); }
.nav-svg rect,
.nav-svg circle,
.nav-svg path {
  vector-effect: non-scaling-stroke;
}
.nav-item span:last-child {
  margin-top: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom nav SVG icon final weight tuning */
.nav-svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.95;
  opacity: .78;
}
.nav-item[data-nav="dashboard"] .nav-svg,
.nav-item[data-nav="signal"] .nav-svg {
  stroke-width: 2.05;
}
.nav-item[data-nav="analytics"] .nav-svg rect {
  fill: rgba(96,165,250,.08);
}
.nav-item.is-active .nav-svg {
  filter: drop-shadow(0 0 11px rgba(96,165,250,.74));
}

/* Bottom nav final balance */
.nav-item[data-nav="analytics"] .nav-svg rect { fill: none; }
.nav-item[data-nav="analytics"] .nav-svg circle {
  fill: rgba(3,7,18,.92);
  stroke: currentColor;
}
.bottom-nav {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  width: min(calc(100% - 34px), 430px) !important;
}

/* Detailed TradeIQ logo rendering */
.logo-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  filter: drop-shadow(0 0 14px rgba(96,165,250,.36));
}
.brand-header .logo-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}
.source-icon .logo-mark {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}
#screen-signal .hero-card .source-icon .logo-mark {
  width: 22px !important;
  height: 22px !important;
}
@media (max-width: 390px) {
  .brand-header .logo-mark { width: 38px; height: 38px; flex-basis: 38px; }
}

/* Logo sharp candlestick revision: reduce muddy glow */
.logo-mark,
.brand-header .logo-mark {
  filter: drop-shadow(0 0 7px rgba(96,165,250,.28)) !important;
}
.source-icon .logo-mark {
  filter: none !important;
}

/* Logo final clarity pass: stronger mark, no badge-like container around logo usages */
.brand-header .logo-mark {
  width: 44px !important;
  height: 44px !important;
  flex-basis: 44px !important;
  filter: drop-shadow(0 0 6px rgba(96,165,250,.24)) !important;
}
.source-icon:has(.logo-mark) {
  background: transparent !important;
  border: 0 !important;
  width: 32px !important;
  height: 32px !important;
  flex-basis: 32px !important;
}
.source-icon:has(.logo-mark) .logo-mark,
#screen-signal .hero-card .source-icon:has(.logo-mark) .logo-mark {
  width: 30px !important;
  height: 30px !important;
  flex-basis: 30px !important;
  filter: drop-shadow(0 0 4px rgba(96,165,250,.20)) !important;
}
@media (max-width: 390px) {
  .brand-header .logo-mark { width: 42px !important; height: 42px !important; flex-basis: 42px !important; }
}

/* Logo reference adjustment: centered candles inside hex */
.brand-header .logo-mark {
  width: 46px !important;
  height: 46px !important;
  flex-basis: 46px !important;
}
.source-icon:has(.logo-mark) .logo-mark,
#screen-signal .hero-card .source-icon:has(.logo-mark) .logo-mark {
  width: 32px !important;
  height: 32px !important;
  flex-basis: 32px !important;
}

/* Logo cleanup: mono candles, sharper frame, less neon blur */
.logo-mark,
.brand-header .logo-mark,
.source-icon .logo-mark {
  filter: none !important;
}
.brand-header .logo-mark {
  width: 44px !important;
  height: 44px !important;
  flex-basis: 44px !important;
}
.source-icon:has(.logo-mark) .logo-mark,
#screen-signal .hero-card .source-icon:has(.logo-mark) .logo-mark {
  width: 30px !important;
  height: 30px !important;
  flex-basis: 30px !important;
}

/* Dashboard/Analytics content relocation */
#screen-dashboard .dashboard-radar-hero {
  margin-top: 12px;
}
#screen-dashboard .dashboard-radar-hero .radar-filter-visual {
  height: 146px !important;
  margin-top: 18px !important;
  border-radius: 22px !important;
}
#screen-analytics .analytics-strategy-list {
  margin-top: 14px;
}
#screen-dashboard .markets-now-card {
  margin-top: 14px !important;
}

/* Relocation pass: dashboard bottom clearance after removing strategies */
#screen-dashboard .regime {
  margin-bottom: 72px !important;
}

/* Dashboard radar hero: active scanning animation + stats moved below radar */
#screen-dashboard .dashboard-radar-hero .radar-filter-visual {
  height: 184px !important;
  margin-top: 18px !important;
  padding: 10px 12px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
#screen-dashboard .dashboard-radar-hero .radar-filter-visual svg {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 124px !important;
  flex: 0 0 124px !important;
  overflow: visible;
}
#screen-dashboard .dashboard-radar-hero .radar-stats {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 8px !important;
  z-index: 2 !important;
}
#screen-dashboard .dashboard-radar-hero .radar-stats span {
  min-height: 30px !important;
  padding: 0 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: rgba(3,7,18,.58) !important;
  border-color: rgba(96,165,250,.16) !important;
  font-size: 9px !important;
  line-height: 1 !important;
}
#screen-dashboard .dashboard-radar-hero .radar-stats span b {
  font-size: 10px !important;
  margin-right: 3px;
}
#screen-dashboard .dashboard-radar-hero .radar-sweep {
  transform-origin: 180px 76px;
  animation: tradeiqRadarSweep 4.2s linear infinite;
}
#screen-dashboard .dashboard-radar-hero .radar-core {
  animation: tradeiqCorePulse 2.2s ease-in-out infinite;
}
#screen-dashboard .dashboard-radar-hero .radar-dots circle {
  animation: tradeiqDotPulse 2.6s ease-in-out infinite;
}
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(2) { animation-delay: .35s; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(3) { animation-delay: .7s; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(4) { animation-delay: 1.05s; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(5) { animation-delay: 1.4s; }
#screen-dashboard .dashboard-radar-hero .radar-grid circle {
  animation: tradeiqRingBreathe 3.6s ease-in-out infinite;
}
#screen-dashboard .dashboard-radar-hero .radar-grid circle:nth-child(2) { animation-delay: .4s; }
#screen-dashboard .dashboard-radar-hero .radar-grid circle:nth-child(3) { animation-delay: .8s; }
@keyframes tradeiqRadarSweep {
  from { transform: rotate(0deg); opacity: .50; }
  50% { opacity: .82; }
  to { transform: rotate(360deg); opacity: .50; }
}
@keyframes tradeiqCorePulse {
  0%, 100% { transform: scale(1); opacity: .78; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes tradeiqDotPulse {
  0%, 100% { opacity: .52; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.18); }
}
@keyframes tradeiqRingBreathe {
  0%, 100% { stroke-opacity: .16; }
  50% { stroke-opacity: .32; }
}
@media (prefers-reduced-motion: reduce) {
  #screen-dashboard .dashboard-radar-hero .radar-sweep,
  #screen-dashboard .dashboard-radar-hero .radar-core,
  #screen-dashboard .dashboard-radar-hero .radar-dots circle,
  #screen-dashboard .dashboard-radar-hero .radar-grid circle {
    animation: none !important;
  }
}

/* Dashboard radar: blips appear/disappear like real radar objects, not bouncing dots */
#screen-dashboard .dashboard-radar-hero .radar-dots circle {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(23,241,205,.85));
  animation-name: tradeiqRadarBlip !important;
  animation-timing-function: ease-out !important;
  animation-iteration-count: infinite !important;
}
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(1) { animation-duration: 5.8s !important; animation-delay: .15s !important; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(2) { animation-duration: 6.6s !important; animation-delay: 1.05s !important; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(3) { animation-duration: 5.2s !important; animation-delay: 2.10s !important; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(4) { animation-duration: 7.1s !important; animation-delay: 3.05s !important; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(5) { animation-duration: 6.1s !important; animation-delay: 4.00s !important; }
@keyframes tradeiqRadarBlip {
  0%, 18% { opacity: 0; transform: scale(.45); }
  22% { opacity: .95; transform: scale(1); }
  28% { opacity: .45; transform: scale(1.55); }
  36%, 100% { opacity: 0; transform: scale(1.95); }
}
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(1) { cx: 116; cy: 54; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(2) { cx: 240; cy: 44; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(3) { cx: 253; cy: 103; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(4) { cx: 139; cy: 112; }
#screen-dashboard .dashboard-radar-hero .radar-dots circle:nth-child(5) { cx: 205; cy: 122; }

/* Dashboard radar: keep center neon core fixed/static */
#screen-dashboard .dashboard-radar-hero .radar-core {
  animation: none !important;
  transform: none !important;
  opacity: .92 !important;
}
#screen-dashboard .dashboard-radar-hero .radar-ai {
  transform: none !important;
}

/* Live adapter polish: prevent cramped dynamic labels */
#screen-analytics .candidate-row .badge {
  flex: 0 0 auto;
}
#screen-analytics .candidate-row span:last-child {
  min-width: 42px;
  text-align: right;
  white-space: nowrap;
}
#screen-signal .why {
  padding-bottom: 88px;
}

/* Telegram Mini App hardening: prevent narrow mobile viewport crop/overflow */
@media (max-width: 600px) {
  html,
  body,
  .app-shell {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .screen-wrap {
    width: min(100%, 390px) !important;
    max-width: 390px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-bottom: calc(env(safe-area-inset-bottom) + 138px) !important;
  }

  .bottom-nav {
    left: 14px !important;
    right: 14px !important;
    transform: none !important;
    width: auto !important;
    max-width: 390px !important;
    height: 68px !important;
  }

  .brand-header,
  .card,
  .pill-row,
  .stats-row,
  .cta-row,
  .bottom-nav {
    max-width: 100% !important;
  }

  .brand-header {
    padding: 10px 11px !important;
    gap: 8px !important;
  }
  .brand-left { gap: 8px !important; }
  .logo-title { font-size: 15px !important; }
  .logo-sub { font-size: 7px !important; letter-spacing: .12em !important; }
  .wave-mini { width: 42px !important; min-width: 42px !important; }

  .pill-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  .pill {
    min-width: 0 !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 0 7px !important;
    font-size: 8.7px !important;
    letter-spacing: .035em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .big-title {
    font-size: clamp(30px, 8.8vw, 35px) !important;
    line-height: 1.02 !important;
  }
  .subtitle {
    font-size: 12px !important;
  }

  #screen-dashboard .dashboard-radar-hero,
  #screen-analytics .candidates,
  #screen-analytics .strategy-list,
  #screen-settings .settings-hero,
  #screen-settings .strategy-list {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  #screen-signal .hero-card {
    padding-left: 17px !important;
    padding-right: 17px !important;
  }
  #screen-signal .hero-top {
    gap: 8px !important;
  }
  #screen-signal .hero-card .signal-pair {
    font-size: clamp(28px, 8.4vw, 36px) !important;
    overflow-wrap: anywhere !important;
  }
  #screen-signal .hero-card .direction-chip {
    flex: 0 0 auto !important;
    max-width: 92px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #screen-analytics .candidate-row {
    grid-template-columns: minmax(0, 1fr) 34px 50px 44px !important;
    gap: 8px !important;
  }
  #screen-analytics .candidate-row b,
  .strategy-row b {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #screen-signal .why {
    padding-bottom: 112px !important;
  }
}

/* Telegram Mini App final nav constraint: avoid fixed-position stretch in Chromium/TG webviews */
@media (max-width: 600px) {
  .bottom-nav {
    left: 8px !important;
    right: auto !important;
    transform: none !important;
    width: min(calc(100% - 16px), 390px) !important;
    max-width: 390px !important;
  }
}

/* Telegram Mini App release polish: fixed nav clearance + dynamic text wrapping */
.screen > :last-child {
  margin-bottom: calc(env(safe-area-inset-bottom) + 132px) !important;
}
#screen-dashboard .regime,
#screen-signal .why,
#screen-analytics .analytics-strategy-list,
#screen-settings .strategy-list {
  margin-bottom: calc(env(safe-area-inset-bottom) + 140px) !important;
}
#screen-dashboard .market-card p,
#screen-dashboard .market-label,
#screen-dashboard .market-status,
#screen-signal .stat-label,
#screen-signal .stat-value,
#screen-analytics .candidate-row span,
#screen-settings .reason-copy {
  overflow-wrap: anywhere;
  word-break: normal;
}
#screen-signal .stat-card {
  min-width: 0;
}
#screen-signal .stat-value {
  font-size: clamp(15px, 4.2vw, 20px) !important;
  line-height: 1.05 !important;
}
#screen-signal .stat-label {
  font-size: 8.5px !important;
  line-height: 1.15 !important;
}
@media (max-width: 600px) {
  #screen-dashboard .market-card p {
    font-size: 10.5px !important;
    line-height: 1.32 !important;
  }
  #screen-dashboard .market-metrics {
    gap: 6px !important;
  }
  #screen-dashboard .market-metrics b {
    font-size: 11px !important;
  }
  #screen-signal .stats-row {
    gap: 7px !important;
  }
  #screen-signal .stat-card {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* Functional live state polish: make no-signal/bot-active state explicit */
.live-status-line,
.empty-live-state {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
}
.empty-live-state {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(96,165,250,.16);
  background: rgba(3,7,18,.38);
}
.cta.is-loading {
  opacity: .78;
  pointer-events: none;
}
.cta.is-loading::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.38);
  border-top-color: #fff;
  animation: tradeiqSpin .8s linear infinite;
}
@keyframes tradeiqSpin { to { transform: rotate(360deg); } }
#screen-signal .signal-pair {
  max-width: 100%;
}
#screen-signal .signal-pair:has(+ .signal-sub) {
  word-break: keep-all;
}

/* Signal screen: remove duplicated top cycle timer pill */
#screen-signal .signal-status-row {
  grid-template-columns: 1fr !important;
}
#screen-signal .signal-status-row .pill {
  width: min(100%, 240px) !important;
}

/* Signal hero: search ring is not confidence; phase is shown as top indicator */
#screen-signal .signal-status-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
}
#screen-signal .signal-status-row .pill.phase-only {
  width: auto !important;
  min-width: 104px !important;
  color: #aab4c8 !important;
  border-color: rgba(96,165,250,.18) !important;
  background: rgba(3,7,18,.46) !important;
}
#screen-signal .confidence-ring.is-search {
  background:
    radial-gradient(circle at center, rgba(3,7,18,.94) 0 48%, transparent 49%),
    conic-gradient(from -25deg, rgba(96,165,250,.22) 0 18%, rgba(96,165,250,.055) 18% 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.12), 0 0 22px rgba(37,99,235,.10) !important;
  filter: saturate(.75) brightness(.82) !important;
}
#screen-signal .confidence-ring.is-search::before {
  opacity: .26 !important;
  background: radial-gradient(circle, rgba(96,165,250,.16), transparent 66%) !important;
}
#screen-signal .confidence-ring.is-search .conf-number {
  font-size: 27px !important;
  color: rgba(219,234,254,.72) !important;
  text-shadow: none !important;
  letter-spacing: .04em !important;
}
#screen-signal .confidence-ring.is-search .conf-label {
  color: rgba(148,163,184,.72) !important;
}
#screen-signal .confidence-ring.is-confidence {
  filter: none;
}
@media (max-width: 600px) {
  #screen-signal .signal-status-row .pill.phase-only {
    min-width: 86px !important;
    font-size: 8.5px !important;
  }
}

/* Signal countdown progress bar: longer and bound to remaining cycle time */
#screen-signal .timer-bar {
  width: min(226px, 56vw) !important;
  height: 8px !important;
  margin-top: 9px !important;
  border-radius: 999px !important;
  background: rgba(15,23,42,.72) !important;
  border: 1px solid rgba(96,165,250,.16) !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 18px rgba(96,165,250,.10) !important;
}
#screen-signal .timer-bar span {
  display: block !important;
  width: var(--time-left, 100%) !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #17F1CD 0%, #60A5FA 78%, #A78BFA 100%) !important;
  box-shadow: 0 0 16px rgba(23,241,205,.55) !important;
  transition: width .55s linear !important;
}
#screen-signal .timer-bar::before,
#screen-signal .timer-bar::after {
  display: none !important;
}
@media (max-width: 600px) {
  #screen-signal .timer-bar {
    width: min(228px, 61vw) !important;
  }
}

/* Override old pseudo timer bar width rules so fill can actually shrink */
#screen-signal .hero-card .timer-bar {
  width: min(226px, 56vw) !important;
  max-width: min(226px, 56vw) !important;
}
#screen-signal .hero-card .timer-bar span {
  width: var(--time-left, 100%) !important;
  max-width: 100% !important;
}
@media (max-width: 600px) {
  #screen-signal .hero-card .timer-bar {
    width: min(228px, 61vw) !important;
    max-width: min(228px, 61vw) !important;
  }
}

/* Signal timer bar: match the exact visual width of countdown digits */
#screen-signal .timer-main-wrap {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: fit-content !important;
  max-width: 100% !important;
}
#screen-signal .timer-main-wrap .timer-main {
  display: block !important;
  width: auto !important;
}
#screen-signal .hero-card .timer-main-wrap .timer-bar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
}
#screen-signal .hero-card .timer-main-wrap .timer-bar span {
  width: var(--time-left, 100%) !important;
  max-width: 100% !important;
}

/* Signal timer bar: fixed track length, only fill changes */
#screen-signal .timer-main-wrap {
  width: 188px !important;
  min-width: 188px !important;
  max-width: 188px !important;
  align-items: stretch !important;
}
#screen-signal .timer-main-wrap .timer-main {
  width: 100% !important;
  text-align: left !important;
  font-variant-numeric: tabular-nums !important;
}
#screen-signal .hero-card .timer-main-wrap .timer-bar {
  width: 188px !important;
  min-width: 188px !important;
  max-width: 188px !important;
}
#screen-signal .hero-card .timer-main-wrap .timer-bar span {
  width: var(--time-left, 100%) !important;
  max-width: 100% !important;
}
@media (max-width: 360px) {
  #screen-signal .timer-main-wrap,
  #screen-signal .hero-card .timer-main-wrap .timer-bar {
    width: 176px !important;
    min-width: 176px !important;
    max-width: 176px !important;
  }
}

/* Signal hero direction: muted during scanning, keep last direction after signal until next cycle */
#screen-signal .hero-card .direction-chip.scan-muted {
  opacity: .34 !important;
  filter: saturate(.55) brightness(.72) !important;
  background: rgba(244,63,94,.10) !important;
  border-color: rgba(244,63,94,.18) !important;
  box-shadow: none !important;
}
#screen-signal .hero-card .direction-chip.held-direction {
  opacity: .86 !important;
  background: linear-gradient(135deg, rgba(20,241,200,.18), rgba(59,130,246,.16)) !important;
  border-color: rgba(20,241,200,.38) !important;
  color: #DDFDF7 !important;
  box-shadow: 0 0 20px rgba(20,241,200,.16) !important;
}
#screen-signal .hero-card .direction-chip.active {
  opacity: 1 !important;
}

/* Signal scanning state: outline-only direction placeholder */
#screen-signal .hero-card .direction-chip.scan-muted {
  opacity: .42 !important;
  color: rgba(191,219,254,.40) !important;
  background: transparent !important;
  border: 2px solid rgba(244,63,94,.38) !important;
  box-shadow: none !important;
  filter: saturate(.45) brightness(.78) !important;
}

/* Signal top action: replace phase pill with compact Pocket Option opener */
#screen-signal .signal-status-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}
#screen-signal .pocket-open-btn {
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(96,165,250,.28) !important;
  background: linear-gradient(135deg, rgba(37,99,235,.32), rgba(20,241,200,.16)) !important;
  color: #DBEAFE !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  box-shadow: 0 10px 28px rgba(37,99,235,.18), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
#screen-signal .pocket-open-btn:active {
  transform: translateY(1px) scale(.99) !important;
  filter: brightness(1.12) !important;
}
#screen-signal .why .live-status-line {
  margin-top: 12px !important;
}
@media (max-width: 370px) {
  #screen-signal .pocket-open-btn {
    padding: 0 11px !important;
    font-size: 9px !important;
  }
}

/* Analytics strategy cards: show each strategy as its own engine with direction. */
.section-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 760;
}
.analytics-strategy-cards {
  padding: 16px;
}
.strategy-card-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.strategy-card {
  --strategy-accent: var(--blue-2);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 18px;
  padding: 12px;
  background:
    radial-gradient(130px 72px at 102% 0%, color-mix(in srgb, var(--strategy-accent) 24%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(8,17,36,.78), rgba(4,9,21,.58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.strategy-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 8px 8px 0;
  background: var(--strategy-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--strategy-accent) 58%, transparent);
}
.strategy-card-top {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.strategy-icon-dot {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--strategy-accent) 58%, #020617), rgba(15,23,42,.74));
  border: 1px solid color-mix(in srgb, var(--strategy-accent) 44%, rgba(148,163,184,.18));
  box-shadow: 0 0 20px color-mix(in srgb, var(--strategy-accent) 26%, transparent);
}
.strategy-main { min-width: 0; }
.strategy-main b {
  display: block;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-main span {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 780;
}
.strategy-direction {
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
  color: #dbeafe;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.72);
  white-space: nowrap;
}
.strategy-direction.up {
  color: #dcfce7;
  border-color: rgba(34,197,94,.30);
  background: rgba(22,101,52,.20);
}
.strategy-direction.down {
  color: #ffe4e6;
  border-color: rgba(244,63,94,.32);
  background: rgba(159,18,57,.22);
}
.strategy-direction.wait {
  color: #fde68a;
  border-color: rgba(251,191,36,.26);
  background: rgba(120,53,15,.18);
}
.strategy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}
.strategy-metrics div {
  border: 1px solid rgba(148,163,184,.10);
  border-radius: 13px;
  padding: 8px 7px;
  background: rgba(2,6,23,.36);
}
.strategy-metrics span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 880;
}
.strategy-metrics b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-note {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.35;
}
@media (max-width: 390px) {
  .analytics-strategy-cards { padding: 14px; }
  .strategy-card { padding: 11px; }
  .strategy-card-top { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; }
  .strategy-icon-dot { width: 28px; height: 28px; }
  .strategy-direction { padding: 6px 8px; font-size: 9.5px; }
}

/* Journal stats: daily Top 1 and per-strategy accumulation. */
.journal-hero { overflow: hidden; }
.journal-top1-card,
.journal-strategy-section,
.journal-recent-list { padding: 16px; }
.journal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.journal-kpi {
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 17px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(15,23,42,.66), rgba(2,6,23,.38));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.journal-kpi.primary {
  border-color: rgba(96,165,250,.22);
  background: linear-gradient(180deg, rgba(15,23,42,.76), rgba(2,6,23,.44));
}
.journal-kpi span,
.journal-strategy-stats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.journal-kpi b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.journal-kpi em {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 760;
}
.journal-strategy-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.journal-strategy-card {
  border: 1px solid rgba(96,165,250,.13);
  border-radius: 18px;
  padding: 12px;
  background: rgba(3,7,18,.46);
}
.main-strategy-control { position: relative; padding-right: 42px; }
.strategy-control-delete {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,.36);
  background: rgba(127,29,29,.22);
  color: #fecaca;
  font-size: 18px;
  line-height: 20px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}
.strategy-control-delete:active { transform: scale(.96); }
.strategy-control-delete.is-loading { opacity: .55; pointer-events: none; }
.journal-strategy-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.journal-strategy-head b { display:block; font-size: 13px; line-height: 1.15; }
.journal-strategy-head span { display:block; margin-top: 3px; color: var(--text-2); font-size: 10px; font-weight: 780; text-transform: capitalize; }
.journal-mini-badge {
  border: 1px solid rgba(96,165,250,.22);
  border-radius: 999px;
  padding: 6px 8px;
  color: #dbeafe;
  background: rgba(37,99,235,.10);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
}
.journal-strategy-meter {
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(148,163,184,.13);
  overflow: hidden;
}
.journal-strategy-meter span {
  display: block;
  width: var(--wr, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  box-shadow: none;
}
.journal-strategy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.journal-strategy-stats div {
  border-radius: 12px;
  padding: 8px 6px;
  background: rgba(2,6,23,.36);
  border: 1px solid rgba(148,163,184,.08);
}
.journal-strategy-stats b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.journal-strategy-note {
  margin-top: 9px;
  color: var(--text-2);
  font-size: 10.5px;
}
.journal-trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(148,163,184,.10);
}
.journal-trade-row:first-of-type { border-top: 0; }
.journal-trade-row b { font-size: 13px; }
.journal-result {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .03em;
}
.journal-result.win { color: var(--green); }
.journal-result.loss { color: var(--red); }
.journal-result.open { color: var(--amber); }
.journal-result.neutral { color: var(--text-2); }
@media (max-width: 390px) {
  .journal-kpi-grid { gap: 8px; }
  .journal-kpi { padding: 10px; }
  .journal-kpi b { font-size: 20px; }
  .journal-strategy-stats { gap: 5px; }
  .journal-strategy-stats div { padding: 7px 5px; }
}

/* Journal market/date controls. */
.journal-switch-card,
.journal-archive-card { padding: 16px; }
.journal-market-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.journal-market-toggle button,
.journal-date-row button {
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 15px;
  color: var(--text-2);
  background: rgba(2,6,23,.38);
  padding: 10px 11px;
  font-weight: 950;
  text-align: left;
}
.journal-market-toggle button span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 850;
}
.journal-market-toggle button.is-active,
.journal-date-row button.is-active {
  color: var(--text);
  border-color: rgba(96,165,250,.30);
  background: rgba(37,99,235,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.journal-market-note {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.4;
}
.journal-date-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 2px;
  scrollbar-width: none;
}
.journal-date-row::-webkit-scrollbar { display: none; }
.journal-date-row button {
  flex: 0 0 auto;
  min-width: 68px;
  text-align: center;
  padding: 9px 10px;
}
.journal-archive-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.journal-archive-summary div {
  border-radius: 13px;
  padding: 8px 6px;
  background: rgba(2,6,23,.36);
  border: 1px solid rgba(148,163,184,.09);
}
.journal-archive-summary span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 900;
}
.journal-archive-summary b {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 390px) {
  .journal-archive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Signal tab dual market overview. */
.market-signal-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}
.market-signal-mini { padding: 14px; }
.market-signal-mini.real {
  border-color: rgba(167,139,250,.22);
  background: radial-gradient(150px 80px at 100% 0%, rgba(167,139,250,.14), transparent 70%), var(--panel);
}
.market-signal-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.market-signal-line b { display:block; font-size: 14px; }
.market-signal-line span { display:block; margin-top:3px; color: var(--text-2); font-size: 10.5px; font-weight: 760; }
.mini-chart-wrap {
  margin-top: 10px;
  height: 116px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.10);
  background: rgba(2,6,23,.26);
}
.mini-chart-wrap .chart-svg { height: 116px; width: 100%; display: block; }

/* Signal tab market switch (replaces duplicated OTC/REAL mini blocks). */
.signal-market-switch { padding: 10px; margin-bottom: 12px; }
.signal-market-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.signal-market-toggle button {
  border: 1px solid rgba(148,163,184,.15);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--text-2);
  background: rgba(2,6,23,.42);
  font-weight: 950;
  text-align: left;
}
.signal-market-toggle button span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 850;
}
.signal-market-toggle button.is-active {
  color: var(--text);
  border-color: rgba(23,241,205,.34);
  background: radial-gradient(120px 70px at 100% 0%, rgba(23,241,205,.18), transparent 70%), rgba(14,165,233,.13);
}

/* Autotrader Analytics card: dedicated layout, no candidate-row overflow */
.chart-card + .autotrader-analytics-card {
  margin-top: 22px;
}
.autotrader-analytics-card {
  overflow: hidden;
  border-color: rgba(96,165,250,.22);
  padding: 14px;
  margin-bottom: 14px;
}
.autotrader-analytics-card.is-open {
  border-color: rgba(20,241,200,.36);
}
.real-executor-card {
  border-color: rgba(96,165,250,.22);
  background: linear-gradient(180deg, rgba(10,22,45,.78), rgba(4,10,24,.78));
}
.real-executor-card.is-open {
  border-color: rgba(20,241,200,.36);
}
.real-executor-card .section-title {
  color: var(--text);
}
.autotrader-head {
  display: block;
  margin-bottom: 10px;
}
.autotrader-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.autotrader-analytics-card .section-title {
  font-size: 20px;
  line-height: 1.03;
  letter-spacing: -.02em;
}
.autotrader-analytics-card .section-subtitle {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.24;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-analytics-card .badge {
  font-size: 9px;
  padding: 4px 8px;
}
.autotrader-deal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 14px;
  background: rgba(2,6,23,.32);
}
.autotrader-lanes-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.autotrader-lanes-head b {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}
.autotrader-lanes-head.carry {
  margin-top: 9px;
  opacity: .74;
}
.autotrader-lanes {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
}
.autotrader-lanes.carry .autotrader-lane {
  background: rgba(15,23,42,.26);
  border-color: rgba(148,163,184,.10);
}
.autotrader-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 12px;
  background: rgba(2,6,23,.34);
}
.autotrader-lane-main,
.autotrader-lane-meta {
  min-width: 0;
}
.autotrader-main span,
.autotrader-exp span,
.autotrader-pnl span,
.autotrader-lane-main span,
.autotrader-lane-meta span,
.autotrader-metric span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.autotrader-lane-main b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: clamp(15px, 4.2vw, 19px);
  line-height: 1.05;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-lane-main em,
.autotrader-lane-meta em {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
  font-size: 9.5px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-lane-meta {
  text-align: right;
}
.autotrader-lane-meta b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.05;
  font-weight: 950;
  white-space: nowrap;
}
.autotrader-main b {
  display: block;
  margin-top: 4px;
  font-size: clamp(19px, 5vw, 24px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-main em {
  display: block;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-exp,
.autotrader-pnl {
  min-width: 78px;
  text-align: right;
}
.autotrader-exp b,
.autotrader-pnl b {
  display: block;
  margin-top: 4px;
  font-size: clamp(15px, 4.3vw, 20px);
  line-height: 1.05;
  font-weight: 950;
  white-space: nowrap;
}
.autotrader-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.autotrader-metric {
  min-width: 0;
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 13px;
  background: rgba(7,14,29,.62);
  padding: 9px;
}
.autotrader-metric b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.05;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-metric em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autotrader-foot {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 760;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.autotrader-foot span {
  min-width: 0;
  white-space: nowrap;
}
/* Telegram/webview nav occlusion fix: do not paint a tall bottom veil.
   The previous fixed pseudo-gradient masked too much of the viewport and made
   the lower screen look like a crude dark rectangle. Content clearance is
   handled by screen padding; the nav itself just needs a denser glass panel. */
.bottom-nav {
  isolation: isolate;
  background: linear-gradient(180deg, rgba(9,17,34,.94), rgba(3,7,18,.975)) !important;
}

@media (max-width: 600px) {
  .autotrader-analytics-card {
    padding: 12px;
    margin-bottom: 18px;
  }
  .autotrader-analytics-card .section-head {
    gap: 0;
  }
  .autotrader-analytics-card .section-title {
    font-size: 18px;
  }
  .autotrader-analytics-card .section-subtitle {
    font-size: 10.5px;
    max-width: none;
  }
  .autotrader-analytics-card .badge-row {
    flex: 1 1 132px;
    justify-content: flex-end;
    gap: 5px;
  }
  .autotrader-analytics-card .badge {
    font-size: 8.5px;
    padding: 3px 7px;
  }
  .autotrader-deal {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 8px;
    padding: 9px;
  }
  .autotrader-lane {
    grid-template-columns: minmax(0, 1fr) 78px;
    padding: 8px;
  }
  .autotrader-lane-main b {
    font-size: clamp(14px, 4vw, 17px);
  }
  .autotrader-lane-meta b {
    font-size: 14px;
  }
  .autotrader-main b {
    font-size: clamp(19px, 5.2vw, 22px);
  }
  .autotrader-main em {
    font-size: 10px;
  }
  .autotrader-exp,
  .autotrader-pnl {
    min-width: 76px;
  }
  .autotrader-exp b,
  .autotrader-pnl b {
    font-size: clamp(14px, 3.9vw, 17px);
  }
  .autotrader-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .autotrader-metric {
    padding: 8px;
  }
  .autotrader-metric b {
    font-size: 15px;
  }
  .autotrader-foot {
    font-size: 9.5px;
  }
}

/* Journal control clarity pass: remove green/cyan haze from strategy controls. */
.journal-strategy-section::before,
.journal-strategy-card::before,
.strategy-policy-toggle button::before {
  display: none !important;
}
.journal-strategy-section {
  background: linear-gradient(180deg, rgba(9,18,38,.88), rgba(5,11,25,.78)) !important;
}
.strategy-policy-toggle button.is-active {
  border-color: rgba(96,165,250,.30) !important;
  background: rgba(37,99,235,.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.strategy-policy-toggle button.is-disabled,
.strategy-policy-toggle button:disabled {
  opacity: .52;
  cursor: not-allowed;
  color: rgba(148,163,184,.82) !important;
  border-color: rgba(148,163,184,.12) !important;
  background: rgba(2,6,23,.30) !important;
  box-shadow: none !important;
}

/* Strategy policy buttons: compact one-row controls for TERMINAL/DEMO/REAL. */
.strategy-policy-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 7px !important;
  margin-top: 10px !important;
}
.strategy-policy-toggle button {
  min-width: 0;
  min-height: 44px;
  border-radius: 13px !important;
  padding: 8px 7px !important;
  font-size: clamp(10.5px, 2.8vw, 13px) !important;
  line-height: 1.05;
  letter-spacing: .02em;
  text-align: center !important;
}
.strategy-policy-toggle button span {
  margin-top: 3px !important;
  font-size: 8.5px !important;
  letter-spacing: .04em;
}


/* Timeframe Pattern Lab */
.lab-hero { overflow: hidden; }
.lab-pipeline-visual { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:10px; margin-top:18px; }
.lab-pipeline-visual > div { border:1px solid rgba(96,165,250,.18); background:linear-gradient(180deg, rgba(15,23,42,.72), rgba(15,23,42,.34)); border-radius:18px; padding:12px; min-height:86px; position:relative; overflow:hidden; }
.lab-pipeline-visual > div::after { content:""; position:absolute; inset:auto -20% -45% -20%; height:70%; background:radial-gradient(circle, rgba(23,241,205,.18), transparent 62%); }
.lab-pipeline-visual span, .lab-pipeline-visual em { display:block; color:var(--text-2); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.08em; }
.lab-pipeline-visual b { display:block; margin:7px 0 4px; color:var(--text); font-size:15px; line-height:1.15; word-break:break-word; }
.lab-candidate-card { border:1px solid rgba(148,163,184,.14); background:rgba(2,6,23,.34); border-radius:20px; padding:14px; }
.lab-candidate-card .reason-copy { margin:10px 0 0; }
.journal-mini-badge.win { color:#17f1cd; border-color:rgba(23,241,205,.32); }
.journal-mini-badge.loss { color:#fbbf24; border-color:rgba(251,191,36,.32); }
@media (max-width: 520px) {
  .lab-pipeline-visual { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bottom-nav { gap: 2px; }
  .nav-item { gap: 3px; }
  .nav-item span { font-size: 8px; }
  .nav-svg { width: 23px; height: 23px; }
}

.journal-market-toggle button.danger { border-color: rgba(248,113,113,.34); color:#fecaca; background:rgba(127,29,29,.28); }
.journal-market-toggle button.danger.is-loading { opacity:.65; }

.lab-backtest-card { border:1px solid rgba(96,165,250,.16); background:rgba(2,6,23,.38); border-radius:20px; padding:14px; }
.lab-chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.lab-chip-row span { border:1px solid rgba(148,163,184,.16); background:rgba(15,23,42,.55); border-radius:999px; padding:6px 8px; color:var(--text-2); font-size:10px; font-weight:800; }
.lab-chip-row b { color:var(--text); }
