* { box-sizing: border-box; font-family: system-ui, sans-serif; }
body { margin: 0; background: #0f1220; color: #eef2ff; }
main { max-width: 1500px; margin: 24px auto; padding: 0 16px 40px; }
#app-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  color: #9bb0ff;
  font-size: 14px;
}
body.auth-pending #app-loading { display: flex; }
body.auth-pending #auth-screen,
body.auth-pending #app-screen { display: none !important; }
.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #eef2ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-shell { display: flex; flex-direction: column; gap: 16px; }
#page-container { display: flex; flex-direction: column; gap: 16px; }
.app-shell-header { display: flex; flex-direction: column; gap: 10px; }
.app-nav { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0 10px; border-bottom: 1px solid #2c3150; }
.mobile-nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid #2c3150;
  background: #13172c;
  color: #eef2ff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.mobile-nav-toggle:focus-visible { outline: 2px solid #6b8dff; outline-offset: 2px; }
.mobile-nav-icon { font-size: 1.1rem; }
.app-nav .nav-link { border-radius: 999px; border: 1px solid #2c3150; background: #13172c; color: #eef2ff; padding: 8px 16px; font-size: 13px; cursor: pointer; margin-top: 0; }
.app-nav .nav-link.active { background: #315efb; border-color: #315efb; box-shadow: 0 0 18px rgba(49, 94, 251, 0.25); }
.app-nav .nav-link:focus-visible { outline: 2px solid #6b8dff; outline-offset: 2px; }
.app-page { display: none; }
.app-page.active { display: block; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.page-header h2 { margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-actions button { margin-top: 0; }
.trading-status-card pre {
  margin: 0;
  white-space: pre-wrap;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid #2c3150;
  border-radius: 8px;
  background: rgba(10, 14, 30, 0.45);
  font-size: 12px;
  line-height: 1.45;
}
.trading-grid { display: grid; grid-template-columns: minmax(340px, 0.92fr) minmax(620px, 1.68fr); grid-template-areas:
  "panel charts"
  "panel charts"
  "results results"
  "summary summary"; gap: 14px; align-items: stretch; }
#params-card { grid-area: panel; }
#technical-charts-card { grid-area: charts; }
#trading-results-card { grid-area: results; }
#summary { grid-area: summary; }

h1 { margin-bottom: 10px; font-size: 1.7rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
.hero-features { margin: 0 0 8px 0; padding-left: 18px; color: #b8c5ff; font-size: 14px; }
.hero-features li { margin-bottom: 4px; }
.header-right { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.header-quick-actions { margin-left: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.header-quick-actions button { margin-top: 0; }
.upgrade-banner {
  border-radius: 999px;
  padding: 6px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.85);
  animation: upgradePulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}
.upgrade-link {
  color: #ffb347;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}
@keyframes upgradePulse {
  0%, 100% {
    background: rgba(34, 197, 94, 0.12);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
  }
  50% {
    background: rgba(34, 197, 94, 0.32);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
  }
}
.supported-exchanges { display: flex; align-items: center; gap: 16px; padding: 0; border-radius: 12px; border: none; background: transparent; }
.supported-exchanges span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #9bb0ff; }
.exchange-logo { min-width: 150px; height: 56px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; padding: 0 4px; }
.combo-support-logo { height: 56px !important; width: auto; }
.exchange-logo img, .exchange-logo svg { height: 24px; width: auto; }
.exchange-logo--binance text { letter-spacing: 0.25rem; }
.exchange-logo--bybit text { letter-spacing: 0.2rem; }
@media (max-width: 720px) {
  .header-right { flex-direction: column; align-items: stretch; }
  .supported-exchanges { justify-content: center; }
}
form { background: #161a2f; padding: 14px; border-radius: 10px; margin-bottom: 14px; }
.auth-card { max-width: 900px; margin: 40px auto; }
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.auth-logo { width: 30%; min-width: 72px; max-width: 120px; height: auto; border-radius: 8px; border: 0; background: transparent; padding: 0; }
.auth-intro-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-link, .inline-link-row a { color: #9bb0ff; text-decoration: underline; font-size: 13px; }
.inline-link-row { display: flex; justify-content: flex-end; }
.admin-panel-card { max-width: 1200px; }
.admin-header-row { align-items: stretch; flex-wrap: wrap; }
.admin-header-left { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.system-health-indicator {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px 16px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #2c3150;
  background: #11152b;
  color: #eef2ff;
  min-width: 280px;
}
.system-health-indicator .system-health-metric { display: flex; flex-direction: column; gap: 2px; }
.system-health-indicator .metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #9bb0ff; }
.system-health-indicator .metric-value { font-size: 1.35rem; font-weight: 600; color: #eef2ff; }
.system-health-indicator[data-state="error"] .metric-value { color: #ff7676; }
.system-health-indicator[data-state="error"] { opacity: 0.78; }
@media (max-width: 900px) {
  .system-health-indicator {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    width: 100%;
  }
}
@media (max-width: 640px) {
  .admin-header-row { flex-direction: column; }
  .system-health-indicator {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }
}
.admin-actions { flex-wrap: wrap; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-form { background: #13172c; border: 1px solid #2c3150; }
.terms-consent {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2c3150;
  background: #11152b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme-soft .terms-consent {
  background: #f5f7ff;
  border-color: #c8d6ff;
  color: #1c2a45;
}
.terms-consent button {
  align-self: flex-start;
  border-radius: 999px;
  border: none;
  background: #fbbf24;
  color: #071230;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
}
.terms-consent button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.terms-status {
  font-size: 13px;
  color: #fcd34d;
  margin: 0;
}
.terms-status[data-state="accepted"] { color: #4ade80; }
.terms-status[data-state="error"] { color: #f87171; }
.oauth-row { display: flex; gap: 10px; margin-top: 10px; }
.pricing-card h2 { margin-top: 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; }
.pricing-tier { background: #13172c; border: 1px solid #2c3150; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.pricing-tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.pricing-tier h3 { margin: 0; color: #b8c5ff; }
.pricing-price { font-size: 1.4rem; font-weight: 700; color: #eef2ff; }
.pricing-price span { font-size: 0.85rem; font-weight: 500; color: #9bb0ff; margin-left: 2px; }
.pricing-tier ul { margin: 0; padding-left: 18px; flex: 1; }
.pricing-tier li { margin-bottom: 6px; }
.pricing-select-btn { width: 100%; margin-top: 14px; }
.pricing-tier-free { border-color: #4c7dff; }
.header-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.main-title-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.main-logo { width: 30%; min-width: 72px; max-width: 120px; height: auto; border-radius: 8px; border: 0; background: transparent; padding: 0; }
.main-title-row h1 { margin: 0; }
.profile-card { background: #161a2f; border: 1px solid #2c3150; border-radius: 10px; padding: 10px; min-width: 270px; }
.profile-links { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.profile-links a { color: #9bb0ff; text-decoration: underline; cursor: pointer; font-size: 13px; }
.profile-links button { margin-top: 0; }
.theme-switcher { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; color: #b8c5ff; }
.theme-switcher select { padding: 6px 8px; font-size: 12px; }
.profile-grid { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
.exchange-fieldset {
  border: 1px solid #2c3150;
  border-radius: 12px;
  padding: 18px 14px 12px;
  background: #11152b;
  position: relative;
}
.exchange-fieldset legend {
  padding: 0 12px;
  font-weight: 600;
  color: #b8c5ff;
  margin-left: 8px;
  background: #11152b;
  border-radius: 999px;
}
.theme-soft .exchange-fieldset {
  background: #f7f9ff;
  border-color: #c8d6ff;
  color: #1c2a45;
}
.theme-soft .exchange-fieldset legend {
  color: #1c2a45;
  background: #f7f9ff;
}
.theme-replay .exchange-fieldset {
  background: #0b1220;
  border-color: #3c4a7a;
}
.theme-replay .exchange-fieldset legend {
  color: #f0f3ff;
  background: #0b1220;
}
.settings-callout {
  border: 1px solid #3c4370;
  background: rgba(99, 116, 195, 0.15);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  color: #d6defe;
}
.exchange-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.exchange-actions .verify-btn {
  font-size: 12px;
  padding: 6px 10px;
}

.form-hint {
  font-size: 12px;
  color: #9bb0ff;
  margin: 6px 0 0;
}


.perf-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.perf-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.perf-actions button { margin-top: 4px; }
.sp500-pin { border: 1px solid #2c3150; border-radius: 10px; background: #13172c; padding: 10px 12px; min-width: 210px; text-align: right; }
.sp500-pin[role="button"] { cursor: pointer; user-select: none; }
.sp500-pin[role="button"]:hover { border-color: #5b8dff; }
.sp500-pin[role="button"]:focus-visible { outline: 2px solid #6b8dff; outline-offset: 2px; }
.workspace-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.workspace-nav button { border: 1px solid #2c3150; background: #11152b; color: #eef2ff; padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.workspace-nav button:focus-visible { outline: 2px solid #6b8dff; outline-offset: 2px; }
.perf-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-top: 10px; }
.year-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.symbol-group h4 { margin: 0 0 8px 0; color: #b8c5ff; }
.year-row { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 10px; }
.year-card { border: 1px solid #2c3150; border-radius: 10px; padding: 10px; background: #13172c; cursor: pointer; }
.year-card.active { border-color: #5b8dff; box-shadow: 0 0 0 1px #5b8dff inset; }
.year-card .year { font-weight: 700; }
.year-card .ret.good { color: #5ee285; }
.year-card .ret.bad { color: #ff7676; }
.year-mini { width: 100%; height: auto; border: 1px solid #2c3150; border-radius: 6px; margin-top: 6px; }
.year-detail { border: 1px solid #2c3150; border-radius: 10px; padding: 10px; background: #13172c; min-height: 180px; }
.progress-note { color: #9bb0ff; font-size: 12px; }
.top-gainers-table-wrap { max-height: 480px; overflow-y: auto; overflow-x: auto; border: 1px solid #2c3150; border-radius: 8px; scrollbar-color: #7f8cc9 #0b0f1d; scrollbar-width: thin; }
.top-gainers-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; background: #0b0f1d; }
.top-gainers-table-wrap::-webkit-scrollbar-track { background: #0b0f1d; border-left: 1px solid #2c3150; }
.top-gainers-table-wrap::-webkit-scrollbar-thumb { background: #7f8cc9; border-radius: 999px; border: 2px solid #0b0f1d; }
.top-gainers-table-wrap::-webkit-scrollbar-thumb:hover { background: #9bb0ff; }
.top-gainers-table { width: 100%; border-collapse: collapse; }
.top-gainers-table th, .top-gainers-table td { border-bottom: 1px solid #2c3150; padding: 8px; text-align: left; font-size: 13px; }
.top-gainers-table thead th { background: #161a2f; position: sticky; top: 0; z-index: 1; }

.movers-top-card { margin-bottom: 20px; }
.movers-top-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.movers-top-list { display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px 4px; scrollbar-width: thin; scrollbar-color: #7f8cc9 transparent; }
.movers-top-list::-webkit-scrollbar { height: 10px; }
.movers-top-list::-webkit-scrollbar-thumb { background: #7f8cc9; border-radius: 999px; }
.movers-top-list::-webkit-scrollbar-track { background: transparent; }
.mover-card { flex: 0 0 220px; border: 1px solid #1f2542; border-radius: 12px; padding: 14px; background: #0e1224; transition: border-color 0.2s, box-shadow 0.2s; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.mover-card:hover { border-color: #66d9ff; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.mover-card.active { border-color: #66d9ff; box-shadow: 0 6px 18px rgba(102,217,255,0.35); }
.mover-card .mover-symbol { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.mover-card .mover-change { font-weight: 600; }
.mover-card .mover-volume { font-size: 0.85rem; color: #ffffff; }
.movers-cockpit { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; margin-top: 24px; align-items: flex-start; }
.movers-cockpit-left, .movers-cockpit-right { display: flex; flex-direction: column; gap: 18px; }
.movers-left-panel label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 0.95rem; }
.movers-left-panel input, .movers-left-panel select { width: 100%; }
.movers-left-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.movers-status { margin-top: 8px; }
.movers-center-panel { min-height: 420px; }
.movers-chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.movers-chart-metrics { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.movers-chart-controls, .strategy-chart-controls { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.technical-chart-label { margin: 12px 0 6px; font-size: 0.92rem; letter-spacing: 0.01em; }
.movers-chart-controls label, .strategy-chart-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: #94a3b8; min-width: 140px; }
.movers-chart-controls input[type="range"], .strategy-chart-controls input[type="range"] { accent-color: #4f83ff; }
.movers-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: #a0b1d6; margin-bottom: 10px; }
.movers-chart-note { font-size: 0.78rem; color: #94a3b8; margin: -2px 0 4px; }
.movers-chart-timestamp { font-size: 0.78rem; color: #a0b2dc; margin-bottom: 10px; }
.movers-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.movers-legend-dot.legend-delta { background: linear-gradient(90deg, #22c55e, #ef4444); }
.movers-legend-dot.legend-ema-fast { background: #4f83ff; }
.movers-legend-dot.legend-ema-slow { background: #8f6bff; }
.movers-legend-dot.legend-volume { background: #fbbf24; }
.movers-chart-stack { display: flex; flex-direction: column; gap: 14px; }
.movers-chart-pane { width: 100%; height: 230px; border-radius: 12px; background: #050912; border: 1px solid rgba(255,255,255,0.04); }
body.theme-soft .movers-chart-pane { background: rgba(255,255,255,0.96); border-color: rgba(25,39,68,0.12); }
.movers-right-panel { display: flex; flex-direction: column; gap: 18px; }
.movers-performance-card, .movers-info-card { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 14px; background: rgba(13,17,33,0.92); box-shadow: 0 12px 30px rgba(5,7,13,0.45); }
.movers-performance-grid strong { font-size: 1.05rem; }
.movers-info-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.95rem; }
.movers-info-list li { display: flex; justify-content: space-between; gap: 12px; }
.movers-log-card { margin-top: 24px; }
.movers-log { max-height: 260px; overflow-y: auto; padding: 0 8px 0 0; margin: 0; }
.movers-log li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; }
.movers-log li.success { color: #5ee285; }
.movers-log li.error { color: #f87171; }
.movers-log li.warn { color: #fbbf24; }
#movers-chart-change.badge { font-weight: 600; }
#movers-chart-change.good { background: rgba(34,197,94,0.15); color: #5ee285; }
#movers-chart-change.bad { background: rgba(248,113,113,0.18); color: #f87171; }
#movers-chart-change.neutral { background: rgba(148,163,184,0.18); color: #94a3b8; }
@media (max-width: 1200px) {
  .movers-cockpit { grid-template-columns: 1fr; }
  .movers-center-panel { order: 2; }
  .movers-right-panel { order: 3; }
}
@media (max-width: 720px) {
  .mover-card { flex: 0 0 160px; }
  .movers-top-header { flex-direction: column; }
  .movers-left-actions { flex-direction: column; }
  .movers-left-actions button { width: 100%; }
}

.spark-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; }
.spark-track { width: 90px; height: 8px; border-radius: 999px; background: #0f1220; border: 1px solid #2c3150; overflow: hidden; }
.spark-fill { height: 100%; border-radius: 999px; display: block; }
.spark-fill.pos { background: linear-gradient(90deg, #22c55e, #86efac); }
.spark-fill.neg { background: linear-gradient(90deg, #ef4444, #fca5a5); }
.ticker-cell { display: inline-flex; align-items: center; gap: 8px; }
.ticker-logo { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; border: 1px solid #2c3150; background: #0f1220; }

.param-layout { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.param-layout select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.meta-card-stack { display: flex; flex-direction: column; gap: 14px; }
.live-status-panel h3 { margin-top: 0; }
.live-status-panel { font-size: 12px; }
.live-status-panel .status-legend { gap: 4px; }
.live-status-panel .status-legend li { font-size: 12px; }
.param-section { background: #13172c; border: 1px solid #2c3150; border-radius: 10px; padding: 12px; }
.param-section h3 { margin: 0 0 10px 0; font-size: 14px; color: #b8c5ff; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; min-width: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
input, select, button { padding: 8px; border-radius: 8px; border: 1px solid #2f365d; background: #11152b; color: #fff; max-width: 100%; }
input:disabled, select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: saturate(0.85);
}
button { margin-top: 12px; cursor: pointer; background: #315efb; border: none; }
.actions { display: flex; gap: 10px; }
.section-bottom-actions { margin-top: 12px; justify-content: flex-end; }
#terminate-btn { background: #c63b3b; }
#terminate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.card { background: #161a2f; padding: 14px; border-radius: 10px; margin-bottom: 14px; }
.chart-header-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chart-header-row h2 { margin: 0; }
#toggle-technical-charts-btn { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.result-table-wrap {
  max-height: 180px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #2c3150;
  border-radius: 8px;
}
.trade-history-table-wrap { max-height: 480px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #2c3150; padding: 8px; text-align: left; font-size: 13px; }
#results-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #161a2f;
}
.good { color: #5ee285; }
.bad { color: #ff7676; }
.warn { color: #fcd34d; }
.trade-history-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: end; }
.trade-history-controls label { min-width: 180px; }
.trade-history-summary { text-align: right; }
#trade-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #161a2f;
}
#status {
  white-space: pre-wrap;
  color: #9bb0ff;
  font-size: 12px;
  line-height: 1.45;
}
#status[data-tone="trial"] { color: #F3BA2F; }
ul { margin: 0; padding-left: 18px; }
.status-legend { display: grid; gap: 6px; }
.status-legend code { color: #b8c5ff; background: #11152b; border: 1px solid #2c3150; border-radius: 6px; padding: 1px 6px; }
.muted { color: #9bb0ff; font-size: 13px; margin-top: 0; }
.tv-chart { width: 100%; height: 320px; border: 1px solid #2c3150; border-radius: 8px; background: #0f1220; margin-bottom: 10px; position: relative; overflow: hidden; max-width: 100%; }
.tv-chart > div { max-width: 100%; }
.tv-chart-indicator { height: 220px; }
.trade-hover-detail { border: 1px solid #2c3150; border-radius: 8px; background: #13172c; padding: 10px; margin-bottom: 10px; font-size: 13px; }
.ema-indicator-legend { border: 1px solid #2c3150; border-radius: 8px; background: #13172c; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ema-chip { display: inline-flex; align-items: center; gap: 6px; }
.ema-chip-label { color: #b8c5ff; font-weight: 600; }
.ema-chip-value { color: #eef2ff; }
.ema-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ema-sep { color: #56608f; }

.summary-block { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #2c3150; }
.summary-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.summary-report-card { border: 1px solid #2c3150; border-radius: 10px; padding: 10px; background: #13172c; }
.summary-report-card h3 { margin: 0 0 8px 0; font-size: 14px; color: #b8c5ff; }
.summary-report-card p { margin: 0; font-size: 13px; line-height: 1.45; color: #dbe3ff; }

@media (max-width: 1380px) {
  .trading-grid {
    grid-template-columns: minmax(300px, 360px) minmax(360px, 1fr);
    grid-template-areas:
      "panel charts"
      "results results"
      "summary summary";
  }
}

@media (max-width: 960px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .trading-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "panel"
      "charts"
      "results"
      "summary";
  }
  .app-nav { overflow-x: auto; padding-bottom: 14px; }
  .app-nav::-webkit-scrollbar { height: 6px; }
  .app-nav::-webkit-scrollbar-thumb { background: #404776; border-radius: 999px; }
}

@media (max-width: 640px) {
  .mobile-nav-toggle { display: inline-flex; }
  .app-nav { display: none; border-bottom: none; padding: 8px 0 0; }
  .app-nav.open { display: flex; flex-wrap: wrap; border-bottom: 1px solid #2c3150; }
}

@media (max-width: 600px) {
  .page-actions { width: 100%; }
  .page-actions button { flex: 1 1 auto; }
}

@media (max-width: 1020px) {
  main { padding: 0 12px 28px; }
  .param-layout { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .auth-grid { grid-template-columns: 1fr; }
  .header-row { flex-direction: column; }
  .profile-grid { grid-template-columns: 1fr; }
  .perf-header { flex-direction: column; }
  .sp500-pin { text-align: left; width: 100%; min-width: 0; }
  .perf-layout { grid-template-columns: 1fr; }
  .year-cards { grid-template-columns: 1fr; }
  .year-row { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .summary-report-grid { grid-template-columns: 1fr; }
  .actions { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  h1 { font-size: 20px; }
  .header-quick-actions { align-items: stretch; }
  .upgrade-banner { text-align: left; }
  h2 { font-size: 17px; }

  main { margin: 14px auto; padding: 0 10px 20px; }
  .card, form { padding: 10px; border-radius: 8px; }
  .profile-card { min-width: 0; width: 100%; }

  label { font-size: 12px; }
  input, select, button { font-size: 16px; }

  .actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .actions > * { width: 100%; }
  .section-bottom-actions { justify-content: stretch; }

  .oauth-row { flex-direction: column; }
  .profile-links { flex-wrap: wrap; }

  .year-row { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 78px 1fr 64px; font-size: 12px; gap: 6px; }

  th, td { font-size: 12px; padding: 6px; }
  .tv-chart { height: 240px; }
  #status { font-size: 12px; }
}

@media (max-width: 420px) {
  h1 { font-size: 20px; }
  .hero-features { font-size: 12px; }
  .muted { font-size: 12px; }
  .tv-chart { height: 210px; }
}

/* Light theme */
body.theme-light { background: #f3f6fb; color: #1f2a44; }
body.theme-light .card,
body.theme-light form,
body.theme-light .profile-card,
body.theme-light .year-detail,
body.theme-light .summary-report-card,
body.theme-light .year-card,
body.theme-light .auth-form,
body.theme-light .param-section,
body.theme-light .compare-box,
body.theme-light .sp500-pin,
body.theme-light .trade-hover-detail,
body.theme-light .ema-indicator-legend { background: #ffffff; border-color: #d5dfef; color: #1f2a44; }
body.theme-light input,
body.theme-light select,
body.theme-light button,
body.theme-light code { background: #f6f9ff; color: #1f2a44; border-color: #c9d6ee; }
body.theme-light .tv-chart,
body.theme-light .year-mini,
body.theme-light .bar-track,
body.theme-light .top-gainers-table-wrap,
body.theme-light .result-table-wrap { background: #ffffff; border-color: #d5dfef; }
body.theme-light th,
body.theme-light td,
body.theme-light .top-gainers-table th,
body.theme-light .top-gainers-table td,
body.theme-light #results-table thead th,
body.theme-light #trade-history-table thead th { border-bottom-color: #dfe6f3; background: #ffffff; color: #1f2a44; }
body.theme-light .muted,
body.theme-light .profile-links a,
body.theme-light .theme-switcher,
body.theme-light .hero-features,
body.theme-light #status { color: #2f4f7f; }
body.theme-light .param-section h3,
body.theme-light .summary-report-card h3,
body.theme-light .summary-report-card p,
body.theme-light .summary-report-card li,
body.theme-light .symbol-group h4,
body.theme-light .status-legend code,
body.theme-light .progress-note,
body.theme-light .ema-chip-label,
body.theme-light .sp500-pin,
body.theme-light .year-detail h3 { color: #1f3f70; }
body.theme-light .spark-track { background: #edf2fb; border-color: #d5dfef; }
body.theme-light .top-gainers-table-wrap { scrollbar-color: #8aa1cd #eaf0fb; }
body.theme-light .system-health-indicator { background: #ffffff; border-color: #d5dfef; color: #1f2a44; }
body.theme-light .system-health-indicator .metric-label { color: #2f4f7f; }
body.theme-light .system-health-indicator .metric-value { color: #1f2a44; }
body.theme-light .top-gainers-table-wrap::-webkit-scrollbar,
body.theme-light .top-gainers-table-wrap::-webkit-scrollbar-track { background: #eaf0fb; }
body.theme-light .top-gainers-table-wrap::-webkit-scrollbar-thumb { background: #8aa1cd; border-color: #eaf0fb; }

/* Soft Light preview theme (replay-inspired, bright pro dashboard style) */
body.theme-soft {
  background:
    radial-gradient(1200px 620px at 10% -18%, rgba(109, 149, 255, 0.26) 0%, transparent 46%),
    radial-gradient(920px 520px at 98% -10%, rgba(120, 230, 214, 0.18) 0%, transparent 42%),
    #f4f8ff;
  color: #1d2f4f;
}
body.theme-soft main { max-width: 1380px; padding: 0 18px 42px; }
body.theme-soft h1 { letter-spacing: 0.16px; font-weight: 700; }
body.theme-soft h2 { letter-spacing: 0.1px; font-weight: 650; }
body.theme-soft .hero-features li { margin-bottom: 6px; }
body.theme-soft .card,
body.theme-soft form,
body.theme-soft .profile-card,
body.theme-soft .year-detail,
body.theme-soft .summary-report-card,
body.theme-soft .year-card,
body.theme-soft .auth-form,
body.theme-soft .param-section,
body.theme-soft .trade-hover-detail,
body.theme-soft .ema-indicator-legend,
body.theme-soft .sp500-pin {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid #d5e2f6;
  color: #1d2f4f;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(83, 120, 183, 0.12);
}
body.theme-soft .card,
body.theme-soft form { padding: 16px; }
body.theme-soft .summary-report-grid { gap: 14px; }
body.theme-soft input,
body.theme-soft select,
body.theme-soft code {
  background: #f8fbff;
  color: #1d2f4f;
  border-color: #c7d8f2;
}
body.theme-soft input:focus,
body.theme-soft select:focus {
  outline: none;
  border-color: #78a7f7;
  box-shadow: 0 0 0 2px rgba(101, 150, 240, 0.24);
}
body.theme-soft button {
  background: linear-gradient(90deg, #4c87ff, #69a3ff);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 16px rgba(72, 126, 223, 0.26);
}
body.theme-soft button:hover { filter: brightness(1.03); }
body.theme-soft #terminate-btn { background: linear-gradient(90deg, #ed5d68, #df4b58); }
body.theme-soft .muted,
body.theme-soft .profile-links a,
body.theme-soft .theme-switcher,
body.theme-soft .hero-features,
body.theme-soft #status { color: #426289; }
body.theme-soft .param-section h3,
body.theme-soft .summary-report-card h3,
body.theme-soft .summary-report-card p,
body.theme-soft .summary-report-card li,
body.theme-soft .symbol-group h4,
body.theme-soft .status-legend code,
body.theme-soft .progress-note,
body.theme-soft .ema-chip-label,
body.theme-soft .year-detail h3 { color: #26548f; }
body.theme-soft .tv-chart,
body.theme-soft .year-mini,
body.theme-soft .top-gainers-table-wrap,
body.theme-soft .result-table-wrap,
body.theme-soft .bar-track,
body.theme-soft .spark-track {
  background: rgba(250, 252, 255, 0.95);
  border-color: #d5e2f6;
}
body.theme-soft .chart-header-row,
body.theme-soft .perf-header,
body.theme-soft .header-row { margin-bottom: 6px; }
body.theme-soft th,
body.theme-soft td,
body.theme-soft .top-gainers-table th,
body.theme-soft .top-gainers-table td,
body.theme-soft #results-table thead th,
body.theme-soft #trade-history-table thead th {
  border-bottom-color: #dee8f8;
  background: rgba(248, 251, 255, 0.98);
  color: #1d2f4f;
}
body.theme-soft .good { color: #159668; }
body.theme-soft .bad { color: #d9465f; }
body.theme-soft .spark-track { background: #eef4ff; border-color: #d4e1f6; }
body.theme-soft .spark-fill.pos { background: linear-gradient(90deg, #16b985, #7de7c6); }
body.theme-soft .spark-fill.neg { background: linear-gradient(90deg, #f06275, #f9a3b0); }
body.theme-soft .movers-performance-card, body.theme-soft .movers-info-card { background: rgba(255,255,255,0.96); border-color: rgba(25,39,68,0.12); box-shadow: 0 14px 36px rgba(46,64,105,0.18); }
body.theme-soft .movers-performance-card strong, body.theme-soft .movers-info-card strong { color: #1d3557; }
body.theme-soft .movers-info-list li { color: #1f3b63; }
body.theme-soft .movers-info-list span { color: #35527f; }
body.theme-soft .movers-performance-card .muted, body.theme-soft .movers-info-card .muted { color: #4c6fa8; }
body.theme-soft .movers-performance-card .good,
body.theme-soft .movers-info-card .good { color: #159668; }
body.theme-soft .movers-performance-card .bad,
body.theme-soft .movers-info-card .bad { color: #d9465f; }
body.theme-soft .movers-performance-card .warn,
body.theme-soft .movers-info-card .warn { color: #c07600; }
body.theme-soft .movers-chart-controls label, body.theme-soft .strategy-chart-controls label { color: #4c6fa8; }
body.theme-soft .movers-chart-controls input[type="range"], body.theme-soft .strategy-chart-controls input[type="range"] { accent-color: #2a6fdd; }
body.theme-soft .movers-chart-legend { color: #3d5c93; }
body.theme-soft .movers-chart-note { color: #4c6fa8; }
body.theme-soft .movers-chart-timestamp { color: #3d5c93; }
body.theme-soft .top-gainers-table-wrap { scrollbar-color: #8ea9d8 #eaf1ff; }
body.theme-soft .top-gainers-table-wrap::-webkit-scrollbar,
body.theme-soft .top-gainers-table-wrap::-webkit-scrollbar-track { background: #eaf1ff; }
body.theme-soft .top-gainers-table-wrap::-webkit-scrollbar-thumb { background: #8ea9d8; border-color: #eaf1ff; }
body.theme-soft .system-health-indicator { background: rgba(255, 255, 255, 0.9); border-color: #d5e2f6; box-shadow: 0 8px 18px rgba(80, 125, 210, 0.12); color: #1d2f4f; }
body.theme-soft .system-health-indicator .metric-label { color: #4c6fa8; }
body.theme-soft .system-health-indicator .metric-value { color: #16305c; }


/* Replay Dark preview theme (inspired by modern trade-replay UIs) */
body.theme-replay {
  background:
    radial-gradient(1200px 560px at 80% -20%, rgba(60, 130, 255, 0.18) 0%, transparent 45%),
    radial-gradient(860px 460px at 0% 0%, rgba(24, 233, 183, 0.11) 0%, transparent 40%),
    #070d18;
  color: #d8e7ff;
}
body.theme-replay main { max-width: 1500px; padding: 0 18px 42px; }
body.theme-replay h1 { letter-spacing: 0.2px; font-weight: 700; }
body.theme-replay h2 { letter-spacing: 0.15px; font-weight: 650; }
body.theme-replay .hero-features li { margin-bottom: 6px; }
body.theme-replay .card,
body.theme-replay form,
body.theme-replay .profile-card,
body.theme-replay .year-detail,
body.theme-replay .summary-report-card,
body.theme-replay .year-card,
body.theme-replay .auth-form,
body.theme-replay .param-section,
body.theme-replay .trade-hover-detail,
body.theme-replay .ema-indicator-legend {
  background: rgba(11, 20, 36, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid #264062;
  color: #d8e7ff;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(2, 10, 24, 0.46);
}
body.theme-replay .card,
body.theme-replay form { padding: 16px; }
body.theme-replay .summary-report-grid { gap: 14px; }
body.theme-replay input,
body.theme-replay select,
body.theme-replay code {
  background: #0d1a31;
  color: #d8e7ff;
  border-color: #30507a;
}
body.theme-replay input:focus,
body.theme-replay select:focus {
  outline: none;
  border-color: #4d86d4;
  box-shadow: 0 0 0 2px rgba(90, 156, 255, 0.22);
}
body.theme-replay button {
  background: linear-gradient(90deg, #3a7bff, #5a9cff);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 16px rgba(44, 107, 224, 0.35);
}
body.theme-replay button:hover { filter: brightness(1.06); }
body.theme-replay #terminate-btn { background: linear-gradient(90deg, #ef4444, #dc2626); }
body.theme-replay .muted,
body.theme-replay .profile-links a,
body.theme-replay .theme-switcher,
body.theme-replay .hero-features,
body.theme-replay #status { color: #94b6e8; }
body.theme-replay .param-section h3,
body.theme-replay .summary-report-card h3,
body.theme-replay .summary-report-card p,
body.theme-replay .summary-report-card li,
body.theme-replay .symbol-group h4,
body.theme-replay .status-legend code,
body.theme-replay .progress-note,
body.theme-replay .ema-chip-label,
body.theme-replay .year-detail h3 { color: #67d8ff; }
body.theme-replay .tv-chart,
body.theme-replay .year-mini,
body.theme-replay .top-gainers-table-wrap,
body.theme-replay .result-table-wrap,
body.theme-replay .bar-track,
body.theme-replay .spark-track {
  background: rgba(8, 16, 30, 0.92);
  border-color: #264062;
}
body.theme-replay .chart-header-row,
body.theme-replay .perf-header,
body.theme-replay .header-row { margin-bottom: 6px; }
body.theme-replay th,
body.theme-replay td,
body.theme-replay .top-gainers-table th,
body.theme-replay .top-gainers-table td,
body.theme-replay #results-table thead th,
body.theme-replay #trade-history-table thead th {
  border-bottom-color: #1f3555;
  background: rgba(10, 19, 34, 0.96);
  color: #d8e7ff;
}
body.theme-replay .good { color: #2ee6a8; }
body.theme-replay .bad { color: #ff6b8a; }
body.theme-replay .spark-track { background: #0b172b; border-color: #274266; }
body.theme-replay .spark-fill.pos { background: linear-gradient(90deg, #1dd9a2, #6df5cd); }
body.theme-replay .spark-fill.neg { background: linear-gradient(90deg, #ff5d7e, #ff9bb0); }
body.theme-replay .top-gainers-table-wrap { scrollbar-color: #3f6ea8 #0a1629; }
body.theme-replay .top-gainers-table-wrap::-webkit-scrollbar,
body.theme-replay .top-gainers-table-wrap::-webkit-scrollbar-track { background: #0a1629; }
body.theme-replay .top-gainers-table-wrap::-webkit-scrollbar-thumb { background: #3f6ea8; border-color: #0a1629; }
round: #3f6ea8; border-color: #0a1629; }
body.theme-replay .system-health-indicator { background: rgba(8, 16, 30, 0.92); border-color: #264062; color: #d8e7ff; }
body.theme-replay .system-health-indicator .metric-label { color: #94b6e8; }
body.theme-replay .system-health-indicator .metric-value { color: #d8e7ff; }

/* Features page */
.features-body { min-height: 100vh; }
.features-page { max-width: 1000px; margin: 48px auto; padding: 0 16px 80px; display: flex; flex-direction: column; gap: 24px; }
.features-hero { text-align: left; }
.features-hero h1 { margin: 8px 0 12px; font-size: 2rem; }
.features-hero .hero-subtitle { font-size: 1rem; color: #6a7cc5; margin: 0 0 18px; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.primary-link { background: #315efb; color: #fff; box-shadow: 0 6px 16px rgba(49, 94, 251, 0.35); }
.primary-link:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(49, 94, 251, 0.45); }
.secondary-link { border: 1px solid rgba(255,255,255,0.4); color: #1f2a44; background: rgba(255,255,255,0.6); }

.feature-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.feature-card { min-height: 200px; display: flex; flex-direction: column; gap: 10px; border: 1px solid rgba(49, 94, 251, 0.12); box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08); }
.feature-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(49, 94, 251, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.features-bottom-cta { text-align: center; }
.features-bottom-cta h2 { margin-top: 0; }
.features-bottom-cta a { margin-top: 12px; }
.hero-link-row { margin-top: 12px; }

@media (max-width: 640px) {
  .features-page { margin: 24px auto 60px; }
  .features-hero h1 { font-size: 1.6rem; }
  .feature-card-grid { grid-template-columns: 1fr; }
}

.variant-tabs { display: inline-flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.variant-tab { border: 1px solid #2c3150; background: transparent; color: #cfd7ff; padding: 4px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.variant-tab.active { background: #1b2140; border-color: #4d5b94; color: #fff; }
.variant-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.cred-status { font-size: 12px; }
.variant-pane { display: none; }
.variant-pane.active { display: block; }

.admin-log-tail {
  max-height: 200px;
  min-height: 140px;
  overflow-y: auto;
  padding: 12px;
  background: #070b1d;
  border: 1px solid #2c3150;
  border-radius: 10px;
  white-space: pre-wrap;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #fff;
}

#admin-live-log-links {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-log-actions {
  display: flex;
  gap: 6px;
}

.run-mode-notice {
  margin-top: 4px;
  font-size: 12px;
}

.pnl-label-host {
  position: relative;
}
.pnl-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
}
.pnl-label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.65);
}
.pnl-label.loss {
  transform: translate(-50%, 0);
}
.pnl-label.profit {
  color: #22c55e;
}
.pnl-label.loss {
  color: #ef4444;
}

.ai-react-card {
  background: #0f1220;
  color: #f8fafc;
  padding: 24px;
  border-radius: 14px;
  margin-bottom: 24px;
  border: 1px solid #2c3150;
  box-shadow: 0 18px 45px rgba(2, 4, 24, 0.25);
}
.ai-react-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ai-react-symbol-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.ai-react-symbol-picker select {
  margin-top: 4px;
  padding: 6px;
  border-radius: 6px;
  background: rgba(15,23,42,0.4);
  color: inherit;
}
.ai-react-price {
  margin: 4px 0 0;
  font-size: 1rem;
  color: inherit;
  font-weight: 600;
}
.ai-react-chart-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.ai-react-chart-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}
.ai-react-chart-controls select,
.ai-react-chart-controls input[type="range"] {
  margin-left: 6px;
}
.ai-react-chart-controls input[type="range"] {
  width: 120px;
}
.ai-react-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.ai-react-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #0a1224;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
}
.ai-react-chip {
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}
.ai-react-signal {
  background: #020617;
  border-radius: 10px;
  padding: 18px;
}
.ai-react-signal-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.95rem;
}
.ai-react-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 1rem;
}
.ai-react-investment-label {
  display: block;
  margin-top: 16px;
}
.ai-react-investment-label input {
  width: 100%;
  margin-top: 6px;
}
.ai-react-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.ai-react-actions button {
  flex: 1;
}
.ai-react-bullish {
  color: #22c55e;
}
.ai-react-bearish {
  color: #ef4444;
}
.ai-react-neutral {
  color: #f97316;
}

body.theme-light .ai-react-card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #d5dfef;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
}
body.theme-light .ai-react-signal {
  background: #f1f5f9;
}
body.theme-light .ai-react-indicator {
  background: #e2e8f0;
  color: #0f172a;
}
body.theme-light .ai-react-symbol-picker select {
  background: #ffffff;
  color: #0f172a;
}

body.theme-soft .ai-react-card,
body.theme-soft .ai-react-signal,
body.theme-soft .ai-react-indicator,
body.theme-soft .ai-react-execution {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #dbe4ff;
}
body.theme-soft .ai-react-symbol-picker select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #dbe4ff;
}
body.theme-soft .ai-react-signal-row span,
body.theme-soft .ai-react-price {
  color: #0f172a;
}

body.theme-replay .ai-react-card {
  background: #050b19;
  color: #d8e7ff;
  border: 1px solid #0f1a30;
}
body.theme-replay .ai-react-signal {
  background: #0b1220;
}
body.theme-replay .ai-react-indicator {
  background: #061026;
}
body.theme-replay .ai-react-symbol-picker select {
  background: #050c1b;
  color: #d8e7ff;
}

.ai-react-chip {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.ai-react-indicator-value {
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.ai-react-indicator-meta {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 600;
}
.ai-react-indicator-meta strong {
  font-weight: 700;
}
.ai-react-checklist {
  list-style: none;
  margin: 0 0 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-react-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.ai-react-check {
  width: 26px;
  text-align: center;
}
.ai-react-callouts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.ai-react-callout strong {
  margin-left: 6px;
}

.ai-react-status-breakdown {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.ai-react-status-breakdown p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-react-status-dot {
  width: 16px;
  text-align: center;
}

body.theme-light .ai-react-chip,
body.theme-soft .ai-react-chip {
  background: transparent;
  color: #1f2a44;
}
body.theme-light .ai-react-status-breakdown,
body.theme-soft .ai-react-status-breakdown {
  background: #f5f7ff;
  border: 1px solid #dce5ff;
}

.ai-react-chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 8px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-flex;
  margin-right: 4px;
}
.legend-ema9 { background: #60a5fa; }
.legend-ema50 { background: #a855f7; }
.legend-volume { background: #fbbf24; }
.ai-react-price-value {
  font-weight: 600;
}
.ai-react-price-change {
  font-weight: 700;
  margin-left: 4px;
}

.ai-react-actions .ai-react-buy {
  background: #16a34a;
}
.ai-react-actions .ai-react-sell {
  background: #dc2626;
}

.ai-react-ticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.ai-react-ticker-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f8fafc;
}
.ai-react-ticker-symbol {
  font-weight: 600;
}

.ai-react-split {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.ai-react-split > * {
  flex: 1 1 320px;
}
.ai-react-execution {
  background: #020617;
  border-radius: 10px;
  padding: 18px;
}
.ai-react-execution-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.ai-react-execution-grid div {
  flex: 1;
}
.ai-react-execution-grid p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.7;
}
.ai-react-risk {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 16px;
}

body.theme-soft .ai-react-execution {
  border: 1px solid #dbe4ff;
}
body.theme-soft .ai-react-indicator-value,
body.theme-light .ai-react-indicator-value {
  background: transparent;
}

body.theme-light .ai-react-execution {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #d5dfef;
}

.ai-react-order-status {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.ai-react-order-status.buy {
  color: #16a34a;
}
.ai-react-order-status.sell {
  color: #dc2626;
}

@media (max-width: 640px) {
  .ai-react-chart-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .ai-react-chart-controls label {
    width: 100%;
    justify-content: space-between;
  }
  .ai-react-chart-controls input[type="range"] {
    width: 100%;
  }
  .ai-react-chart-legend {
    position: static;
    margin-bottom: 8px;
  }
  .ai-react-split {
    flex-direction: column;
  }
  .ai-react-actions {
    flex-direction: column;
    gap: 10px;
  }
  .ai-react-actions button {
    width: 100%;
  }
}

.ai-react-last-trade {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.9rem;
}
.ai-react-last-trade strong {
  font-weight: 700;
}

.ai-react-profit-positive { color: #16a34a; }
.ai-react-profit-negative { color: #dc2626; }

.ai-react-refresh {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.25);
  color: #f8fafc;
  font-weight: 600;
}
body.theme-soft .ai-react-refresh,
body.theme-light .ai-react-refresh {
  background: rgba(59, 130, 246, 0.15);
  color: #0f172a;
}

.totp-qr-img { width: 210px; height: 210px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.totp-qr-img svg, .totp-qr-img img { width: 200px; height: 200px; border-radius: 8px; border: 1px solid #2c3150; background: #fff; }

.turnstile-field { margin: 12px 0 0; display: flex; justify-content: center; }

.trade-control-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.trade-control-row { align-items: flex-end; }
.trade-control-row label { flex: 1 1 220px; }
.trade-control-buttons { align-items: center; }
.trade-control-buttons button { margin-top: 0; flex: 0 0 auto; }

#auth-hero {
  margin-bottom: 20px;
  padding: 18px;
}

.pricing-hero {
  margin-bottom: 20px;
}
.pricing-select-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7dfbff, #56c2ff);
  color: #04121f;
  font-weight: 600;
  text-decoration: none;
  border: none;
}
.pricing-select-btn:hover {
  transform: translateY(-1px);
}

.hero-auth-actions {
  justify-content: flex-start;
}

.hero-auth-actions .cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7dfbff, #56c2ff);
  color: #04121f;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(87, 184, 255, 0.28);
}

.hero-auth-actions .cta-link:hover {
  transform: translateY(-1px);
}

.auth-links {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
}

.auth-links a {
  color: #7fb5ff;
  font-size: 0.9rem;
}

/* Signal Trading */
.signal-chart-card {
  grid-column: span 2;
}
.signal-chart-wrap {
  display: grid;
  gap: 12px;
}
.signal-chart {
  width: 100%;
  height: 260px;
}
.signal-chart.signal-chart-small {
  height: 140px;
}

.signal-live-run {
  margin-top: 14px;
}
.signal-live-run label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 4px;
}
.signal-live-run select {
  width: 100%;
}

[data-tooltip] {
  position: relative;
}
[data-tooltip]::after,
[data-tooltip]::before {
  content: none !important;
  display: none !important;
}
.section-help-host {
  position: relative;
}
.section-help-trigger {
  all: unset;
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  opacity: 0.9;
}
.section-help-trigger:hover {
  color: #ffffff;
  opacity: 1;
}
.section-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1200;
}
.section-help-overlay.open {
  display: flex;
}
.section-help-card {
  width: min(420px, 100%);
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.5);
  padding: 18px 18px 16px;
  position: relative;
}
.section-help-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 0;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-size: 1rem;
  cursor: pointer;
}
.section-help-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #93c5fd;
}
.section-help-card h3 {
  margin: 0 0 8px;
}
.section-help-what {
  margin: 0 0 14px;
  color: #cbd5e1;
}
.section-help-usage-wrap strong {
  display: block;
  margin-bottom: 8px;
}
.section-help-usage {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
}
.section-help-usage li + li {
  margin-top: 6px;
}
body.theme-soft .section-help-trigger,
body.theme-light .section-help-trigger {
  background: transparent;
  color: #ffffff;
}
body.theme-soft .section-help-card,
body.theme-light .section-help-card {
  background: #ffffff;
  color: #1e293b;
}
body.theme-soft .section-help-what,
body.theme-soft .section-help-usage,
body.theme-light .section-help-what,
body.theme-light .section-help-usage {
  color: #334155;
}
.signal-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  grid-template-areas:
    'config table'
    'insights chart';
  gap: 18px;
  align-items: flex-start;
}
.signal-config {
  grid-area: config;
  min-height: 487.09px;
}
.signal-right-column {
  grid-area: insights;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signal-table-card {
  grid-area: table;
  min-height: 487.09px;
}
.signal-chart-card {
  grid-area: chart;
}
.signal-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.signal-config-actions,
.signal-manual-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.signal-config-actions button,
.signal-manual-actions button { flex: 1; }
.signal-close-position { margin-top: 8px; }
.signal-close-position button { width: 100%; }
.signal-open-position { margin-top: 12px; padding: 8px 12px; border: 1px dashed #2c3150; border-radius: 8px; font-size: 0.9rem; }
.signal-open-position strong { display: block; }
.signal-table-card { overflow: hidden; }
.signal-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  margin-top: 12px;
  max-height: 360px;
  border: 1px solid #2c3150;
  border-radius: 8px;
}
.signal-table-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.signal-table-card th,
.signal-table-card td { text-align: right; padding: 6px 8px; }
.signal-table-card th:first-child,
.signal-table-card td:first-child { text-align: left; }
.signal-right-column { display: flex; flex-direction: column; gap: 12px; }
.signal-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.signal-card-meta { display: flex; gap: 8px; align-items: center; }
.signal-badge {
  font-size: 18px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  text-align: center;
}
.signal-tags { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 6px; }
.signal-tags li { font-size: 12px; }
.trade-preview { margin-top: 12px; border: 1px dashed rgba(255,255,255,0.15); padding: 10px; border-radius: 8px; font-size: 13px; }
.zones-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 10px; }
.pnl-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 8px; }
.pnl-grid strong { font-size: 16px; }
.signal-log { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 8px; }
.signal-log li { padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.signal-log-card.signal-log-embedded { margin-bottom: 0; }
.signal-config .signal-log-card { margin-top: 16px; background: #11152b; border: 1px solid #2c3150; }
.signal-config .signal-log { max-height: 220px; }
.status-pill { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.08); font-size: 13px; }

.nextgen-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  grid-template-areas:
    'topbar topbar'
    'optimizer chart'
    'overview journal'
    'report report';
  gap: 18px;
  align-items: flex-start;
}
.nextgen-control-card { grid-area: topbar; }
.nextgen-topbar-card .nextgen-control-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}
.nextgen-topbar-actions {
  align-items: flex-end;
}
.nextgen-topbar-card .nextgen-live-runs {
  margin-top: 0;
  min-width: 220px;
}
.nextgen-optimizer-card { grid-area: optimizer; min-height: 0; }
.nextgen-chart-card { grid-area: chart; }
.nextgen-overview-card { grid-area: overview; }
.nextgen-journal-card { grid-area: journal; }
.nextgen-report-card { grid-area: report; }
.nextgen-overview-card,
.nextgen-journal-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.card-expanded {
  position: fixed;
  inset: 24px;
  z-index: 60;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.nextgen-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}
.nextgen-optimizer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nextgen-optimizer-meta-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.nextgen-optimizer-scope {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #2c3150;
  border-radius: 10px;
  background: #11152b;
  font-size: 12px;
}
.nextgen-optimizer-log {
  margin: 10px 0 0;
  min-height: 82px;
  max-height: 140px;
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  border: 1px solid #2c3150;
  border-radius: 10px;
  background: rgba(10, 14, 30, 0.45);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.4;
}
.nextgen-optimizer-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nextgen-optimizer-block {
  border: 1px solid #2c3150;
  border-radius: 12px;
  padding: 12px;
  background: #11152b;
}
.nextgen-optimizer-block h4 {
  margin: 0 0 8px;
}
.nextgen-optimizer-content {
  font-size: 0.84rem;
  line-height: 1.45;
}
.nextgen-optimizer-list {
  margin: 0;
  padding-left: 18px;
}
.nextgen-optimizer-list li + li {
  margin-top: 6px;
}
.nextgen-optimizer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nextgen-optimizer-badge.pass {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}
.nextgen-optimizer-badge.reject {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}
.nextgen-optimizer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.nextgen-optimizer-table th,
.nextgen-optimizer-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  text-align: left;
  vertical-align: top;
}
.nextgen-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.nextgen-actions button { margin-top: 0; }
.nextgen-live-runs {
  display: block;
  margin-top: 14px;
}
.nextgen-live-runs select { margin-top: 6px; }
.nextgen-summary-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nextgen-summary-strip > div {
  border: 1px solid #2c3150;
  border-radius: 12px;
  padding: 12px;
  background: #11152b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nextgen-summary-strip strong.good { color: #4ade80; }
.nextgen-summary-strip strong.bad { color: #f87171; }
.nextgen-chart {
  min-height: 500px;
  height: 500px;
}
.nextgen-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 10px;
  font-size: 0.78rem;
  color: #a0b1d6;
}
.nextgen-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-flex;
  margin-right: 6px;
}
.nextgen-legend-dot.legend-ema9 { background: #a78bfa; }
.nextgen-legend-dot.legend-ema12 { background: #60a5fa; }
.nextgen-legend-dot.legend-ema21 { background: #2dd4bf; }
.nextgen-legend-dot.legend-ema34 { background: #f59e0b; }
.nextgen-legend-dot.legend-ema50 { background: #fb7185; }
.nextgen-legend-dot.legend-ema200 { background: #94a3b8; }
.nextgen-legend-dot.legend-volume { background: #fbbf24; }
.nextgen-legend-dot.legend-buy { background: #22c55e; }
.nextgen-legend-dot.legend-sell { background: #ef4444; }
.nextgen-chart-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
}
.nextgen-chart-metric strong {
  font-weight: 700;
}
.nextgen-chart-metric.ema9 strong { color: #a78bfa; }
.nextgen-chart-metric.ema12 strong { color: #60a5fa; }
.nextgen-chart-metric.ema21 strong { color: #2dd4bf; }
.nextgen-chart-metric.ema34 strong { color: #f59e0b; }
.nextgen-chart-metric.ema50 strong { color: #fb7185; }
.nextgen-chart-metric.ema200 strong { color: #94a3b8; }
.nextgen-chart-metric.volume strong { color: #fbbf24; }
body.theme-light .nextgen-chart-legend,
body.theme-soft .nextgen-chart-legend {
  color: #3d5c93;
}
.nextgen-overview-card tbody tr.active {
  background: rgba(49, 94, 251, 0.14);
}
.nextgen-overview-card tbody tr[data-segment-index] {
  cursor: pointer;
}
.nextgen-overview-card tbody tr[data-segment-index]:hover {
  background: rgba(148, 163, 184, 0.12);
}
.nextgen-overview-card tbody tr td:first-child strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nextgen-overview-card tbody tr td:first-child strong::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6b7280;
}
.nextgen-overview-card tbody tr.active td:first-child strong::before {
  background: #3b82f6;
}
.nextgen-overview-journal .signal-log {
  max-height: 520px;
}
.nextgen-overview-card .signal-table-wrap {
  max-height: 320px;
  overflow: auto;
}
.nextgen-journal-card .signal-log,
.nextgen-journal-card .nextgen-trade-log-table-wrap {
  max-height: 320px;
}
.card-expanded .signal-log,
.card-expanded .nextgen-trade-log-table-wrap,
.card-expanded .signal-table-wrap {
  max-height: none;
}
.nextgen-trade-log-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.2);
}
.nextgen-trade-log-table {
  width: 100%;
  min-width: 1800px;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.nextgen-trade-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #11152b;
  color: #dbe3ff;
}
.nextgen-trade-log-table th,
.nextgen-trade-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  white-space: nowrap;
  text-align: left;
  vertical-align: top;
}
.nextgen-trade-log-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}
.nextgen-trade-log-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 1100px) {
  .signal-grid { grid-template-columns: 1fr; }
  .nextgen-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      'topbar'
      'optimizer'
      'chart'
      'overview'
      'journal'
      'report';
  }
  .signal-config,
  .signal-table-card,
  .signal-right-column,
  .signal-chart-card { width: 100%; min-height: auto; }
  .signal-right-column { flex-direction: row; flex-wrap: wrap; }
  .signal-right-column > .card { flex: 1 1 280px; }
  .signal-config-actions,
  .signal-manual-actions { flex-wrap: wrap; }
  .nextgen-control-grid,
  .nextgen-summary-strip,
  .nextgen-optimizer-grid { grid-template-columns: 1fr; }
  .nextgen-chart {
    min-height: 420px;
    height: 420px;
  }
  .nextgen-trade-log-table { min-width: 1400px; }
}
.signal-badge.buy { background: rgba(16, 185, 129, 0.12); color: #8ff2c7; }
.signal-badge.sell { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.signal-badge.flat { background: rgba(148, 163, 184, 0.15); color: #e2e8f0; }

.ai-react-regime-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
@keyframes ai-react-regime-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(15, 23, 42, 0);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(15, 23, 42, 0.18);
  }
}

.ai-react-regime-badge {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #0f172a;
}
.ai-react-regime-badge.ai-react-bull,
.ai-react-regime-badge.ai-react-bear,
.ai-react-regime-badge.ai-react-neutral,
.ai-react-regime-badge.ai-react-partial {
  animation: ai-react-regime-blink 1.15s ease-in-out infinite;
}
.ai-react-regime-badge.ai-react-bull {
  background: rgba(34, 197, 94, 0.2);
  color: #065f46;
}
.ai-react-regime-badge.ai-react-bear {
  background: rgba(239, 68, 68, 0.2);
  color: #7f1d1d;
}
.ai-react-regime-badge.ai-react-neutral {
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
}
.ai-react-regime-badge.ai-react-partial {
  background: rgba(249, 115, 22, 0.22);
  color: #9a3412;
}
#ai-price-chart.ai-react-chart-bull { background: rgba(34, 197, 94, 0.08); }
#ai-price-chart.ai-react-chart-bear { background: rgba(239, 68, 68, 0.08); }
#ai-price-chart.ai-react-chart-neutral { background: rgba(148, 163, 184, 0.12); }
#ai-price-chart.ai-react-chart-partial { background: rgba(249, 115, 22, 0.12); }
#ai-react-chart-pair-label.ai-react-chart-label-bull {
  color: #16a34a;
}
#ai-react-chart-pair-label.ai-react-chart-label-bear {
  color: #dc2626;
}
#ai-react-chart-pair-label.ai-react-chart-label-neutral {
  color: inherit;
}
#ai-react-chart-pair-label.ai-react-chart-label-partial {
  color: #f97316;
  font-weight: 700;
  animation: ai-react-regime-blink 1.15s ease-in-out infinite;
}
