* {
  box-sizing: border-box;
}

:root {
  --bg: #05070c;
  --panel: #090c11;
  --panel-2: #0b0f15;
  --line: #171c24;
  --line-soft: #222833;
  --text: #f3f5f9;
  --muted: #8f97a3;
  --green: #28744e;
  --green-dark: #153a29;
  --red: #921e1e;
  --red-dark: #3c1417;
  --wait: #d7b283;
  --wait-line: #6a5035;
  --track: #191e27;
  --tag-gray-bg: #151922;
  --tag-gray-line: #2b303a;
  --tag-green-bg: #132018;
  --tag-green-line: #2a5a3d;
  --tag-gold-bg: #2a2214;
  --tag-gold-line: #7a6237;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  overflow-y: hidden;
  overflow-x: hidden;
}

.app {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 6px 12px 6px;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* HEADER */
.header-frame {
  display: grid;
  grid-template-columns: 42px 130px 1fr 74px;
  align-items: center;
  padding: 6px 10px 2px;
  gap: 8px;
}

.menu-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #232b36;
  background: #141a22;
  color: #eef2f8;
  font-size: 20px;
  cursor: pointer;
}

.menu-toggle:hover {
  background: #1a2230;
}

.brand-left {
  justify-self: start;
  font-size: 20px;
  font-weight: 700;
  color: #eef2f8;
}

.header {
  justify-self: center;
  font-size: 24px;
  font-weight: 700;
  color: #eef2f8;
}

.header-actions {
  justify-self: end;
}

.header-actions {
  justify-self: end;
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.voice-toggle {
  height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(57, 212, 103, 0.48);
  border-radius: 8px;
  background: rgba(20, 83, 45, 0.32);
  color: #65e98c;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.voice-toggle.is-off {
  border-color: #344153;
  background: #111923;
  color: #8d9aad;
}

.divider {
  height: 1px;
  margin: 6px 16px 12px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(80, 90, 110, 0.35) 12%,
    rgba(110, 120, 140, 0.55) 50%,
    rgba(80, 90, 110, 0.35) 88%,
    transparent 100%
  );
  opacity: 1;
}

.smart-explain-target {
  cursor: pointer;
}

.smart-explain-target:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.smart-explain {
  position: fixed;
  z-index: 99990;
  right: 22px;
  bottom: 22px;
  width: min(310px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(59, 130, 246, 0.14), transparent 44%),
    rgba(8, 15, 24, 0.97);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(59, 130, 246, 0.1);
  backdrop-filter: blur(18px);
}

.smart-explain.hidden {
  display: none !important;
}

.smart-explain-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.smart-explain-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.smart-explain-kicker {
  color: #60a5fa;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.15px;
}

.smart-explain-head strong {
  color: #f6f8fb;
  font-size: 14px;
}

.smart-explain-close {
  width: 25px;
  height: 25px;
  border: 1px solid #2b3949;
  border-radius: 8px;
  background: #101a26;
  color: #aeb9c7;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.smart-explain p {
  margin: 9px 0 8px;
  color: #d4dbe5;
  font-size: 12px;
  line-height: 1.4;
}

.smart-explain-details {
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.07);
  color: #cbd5e1;
  font-size: 10px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.smart-explain-details.hidden {
  display: none;
}

.smart-explain-state {
  display: inline-flex;
  padding: 5px 8px;
  border: 1px solid #3b4654;
  border-radius: 999px;
  color: #b6c0cd;
  background: rgba(20, 29, 40, 0.86);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.55px;
}

.smart-explain-state[data-state="buy"] {
  border-color: rgba(34, 197, 94, 0.48);
  color: #5ee987;
}

.smart-explain-state[data-state="sell"],
.smart-explain-state[data-state="blocked"] {
  border-color: rgba(239, 68, 68, 0.48);
  color: #ff7378;
}

.smart-explain-state[data-state="hold"] {
  border-color: rgba(245, 158, 11, 0.48);
  color: #fbbf24;
}

.smart-explain-state[data-state="executed"] {
  border-color: rgba(34, 211, 238, 0.48);
  color: #67e8f9;
}

.smart-explain-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px 2px;
  gap: 6px;
  flex-wrap: nowrap;
}

.status {
  font-size: 14px;
  font-weight: 700;
  color: #93c5fd;
}

.status.status-live {
  color: #65e98c;
  border-color: rgba(57, 212, 103, 0.48) !important;
  background: rgba(20, 83, 45, 0.22) !important;
}

.status.status-loading {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.44) !important;
  background: rgba(30, 64, 175, 0.18) !important;
}

.status.status-closed {
  color: #f4bd48;
  border-color: rgba(244, 189, 72, 0.5) !important;
  background: rgba(112, 70, 10, 0.25) !important;
}

.status.status-stale {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5) !important;
  background: rgba(120, 53, 15, 0.24) !important;
}

.status.status-error {
  color: #ff7378;
  border-color: rgba(239, 68, 68, 0.5) !important;
  background: rgba(127, 29, 29, 0.26) !important;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbe2ee;
  font-size: 13px;
}

.switch-wrap input {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
}

/* GRID */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0;
}

/* CARD */
.symbol-card {
  position: relative;
  min-height: 300px;
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(to bottom, #090c11 0%, #070a0f 100%);
  border: 1px solid #1a1f29;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  isolation: isolate;
}

.card-outer-glow {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  pointer-events: none;
  z-index: 0;
}

.eurusd-card {
  border-color: #253041;
}

.eurusd-card .card-outer-glow {
  box-shadow:
    0 0 0 1px rgba(31, 42, 59, 0.95) inset,
    0 0 18px rgba(9, 13, 20, 0.55);
}

.gold-card {
  border-color: #3c301b;
}

.gold-card .card-outer-glow {
  box-shadow:
    0 0 0 1px rgba(58, 45, 24, 0.95) inset,
    0 0 18px rgba(14, 12, 8, 0.55);
}

.top-wash,
.top-cap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 86px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(12, 15, 21, 0.95) 0%,
    rgba(12, 15, 21, 0.9) 45%,
    rgba(12, 15, 21, 0.18) 100%
  );
}

.card-header,
.signal-shell,
.metric-label,
.bar-wrap,
.tags-row,
.buttons-row {
  position: relative;
  z-index: 1;
}

/* CARD HEADER */
.card-header {
  padding: 18px 28px 10px;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title {
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
}

.eurusd-title {
  color: #f2f5ff;
}

.gold-title {
  color: #f5f0dc;
}

.symbol-icon {
  object-fit: contain;
  display: block;
  filter: none;
}

.eurusd-icon {
  width: 40px;
  height: 40px;
}

.gold-icon {
  width: 35px;
  height: 35px;
}

/* SIGNAL */
.signal-shell {
  margin: 0 28px 14px;
  border-radius: 22px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.signal-box {
  min-height: 92px;
  border-radius: 20px;
  border: 1.5px solid var(--line-soft);
  background: #0d1117;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: none;
}

.signal-text {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: none;
}

.signal-freshness-note {
  margin: -2px 0 8px;
  color: #8fa6bf;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.25px;
  text-align: center;
}

.signal-freshness-note.hidden {
  display: none;
}

.main-signal-note {
  margin: -7px 0 10px;
  font-size: 10px;
}

.signal-buy {
  background: transparent;
  box-shadow: none;
}

.signal-border-buy {
  border-color: var(--green);
}

.buy-text {
  color: #22c55e !important;
  text-shadow: none !important;
}

.signal-sell {
  background: transparent;
  box-shadow: none;
}

.signal-border-sell {
  border-color: var(--red);
}

.sell-text {
  color: #ef4444 !important;
  text-shadow: none !important;
}

.signal-wait {
  background: transparent;
  box-shadow: none;
}

.signal-border-wait {
  border-color: var(--wait-line);
}

.wait-text {
  color: #f59e0b !important;
  text-shadow: none !important;
}

.signal-no-data {
  background: transparent;
  box-shadow: none;
}

.signal-border-no-data {
  border-color: #303641;
}

.no-data-text {
  color: #9ca3af;
}

/* LABELS */
.metric-label {
  font-size: 18px;
  font-weight: 700;
  color: #f4f6fa;
  padding: 2px 30px 8px;
}

.conf-label {
  font-size: 17px;
  font-weight: 400;
}

/* BARS */
.bar-wrap {
  padding: 0 28px;
  margin-bottom: 16px;
}

.conf-wrap {
  margin-bottom: 18px;
}

.glow-bar {
  position: relative;
  height: 16px;
  border-radius: 12px;
  background: linear-gradient(to bottom, #1b2029 0%, #161b23 100%);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35);
}

.glow-bar::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 2px;
}

.conf-bar {
  height: 14px;
}

.glow-fill,
.main-fill {
  position: absolute;
  left: 0;
  width: 0%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

.glow-fill {
  top: 0;
  height: 100%;
  z-index: 1;
}

.main-fill {
  top: 0;
  height: 100%;
  z-index: 2;
}

.buy-glow {
  background: #347c57;
  box-shadow: none;
}

.buy-main {
  background: #3f9c6c;
  box-shadow: none;
}

.sell-glow {
  background: #631921;
  box-shadow: none;
}

.sell-main {
  background: var(--red);
  box-shadow: none;
}

.conf-glow {
  background: #2a2e38;
  box-shadow: none;
}

.conf-main {
  background: #8aa1bf;
  box-shadow: none;
}

/* TAGS */
.tags-row {
  display: flex;
  gap: 12px;
  padding: 0 28px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.symbol-card .tags-row {
  display: none;
}

.glow-tag {
  min-height: 38px;
  border-radius: 18px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--tag-gray-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.glow-tag.neutral {
  background: var(--tag-gray-bg);
  border-color: var(--tag-gray-line);
  color: #eef2f6;
}

.glow-tag.green {
  background: var(--tag-green-bg);
  border-color: var(--tag-green-line);
  color: #edf9f1;
  box-shadow: none;
}

.glow-tag.gold {
  background: var(--tag-gold-bg);
  border-color: var(--tag-gold-line);
  color: #f3d58f;
}

.glow-tag.gray {
  background: #161920;
  border-color: #2a2f39;
  color: #eef2f6;
}

/* BUTTONS */
.buttons-row {
  display: flex;
  gap: 24px;
  padding: 0 28px;
}

.button-shell {
  flex: 1;
  border-radius: 20px;
  padding: 1px;
}

.buy-shell {
  background: #102016;
  box-shadow:
    0 0 10px rgba(10, 14, 11, 0.28),
    inset 0 0 0 1px rgba(53, 197, 106, 0.03);
}

.sell-shell {
  background: #180d0f;
  box-shadow:
    0 0 10px rgba(14, 10, 10, 0.28),
    inset 0 0 0 1px rgba(255, 58, 58, 0.03);
}

.glow-button {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
}

.glow-button:hover {
  transform: translateY(-1px);
}

.buy-button {
  background: #143223;
  border: 1px solid var(--green);
  box-shadow: none;
}

.buy-button:hover {
  background: #173a29;
}

.sell-button {
  background: #3b1417;
  border: 1px solid var(--red);
  box-shadow: none;
}

.sell-button:hover {
  background: #45181b;
}

/* FOOTER */
.footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 24px 10px;
}

.utc-label {
  font-size: 14px;
  color: var(--muted);
}

/* MODAL */
.trade-modal.hidden {
  display: none;
}

.trade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 20px 20px;
}

.trade-modal-box {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(to bottom, #0c1016 0%, #090c11 100%);
  border: 1px solid #1d2430;
  border-radius: 18px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  padding: 22px 20px 18px;
}

.trade-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #eef2f8;
  margin-bottom: 10px;
}

.trade-modal-text {
  font-size: 15px;
  color: #cdd5df;
  line-height: 1.45;
  margin-bottom: 18px;
}

.trade-modal-actions {
  display: flex;
  gap: 12px;
}

.trade-modal-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
}

.trade-modal-btn:hover {
  transform: translateY(-1px);
}

.broker-settings-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: #050a10;
}

.broker-settings-shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background:
    radial-gradient(circle at 65% 12%, rgba(24, 101, 86, 0.11), transparent 28%),
    linear-gradient(180deg, #060b12 0%, #04080e 100%);
  color: #f8fafc;
}

.broker-settings-sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  background: linear-gradient(180deg, rgba(10, 18, 27, 0.98), rgba(6, 12, 20, 0.98));
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.broker-settings-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 34px;
  font-size: 28px;
  font-weight: 900;
}

.broker-settings-logo .logo-wave {
  color: #22c55e;
  font-size: 30px;
}

.broker-settings-nav {
  display: grid;
  gap: 8px;
}

.broker-settings-nav-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  font-size: 16px;
  text-align: left;
}

.broker-settings-nav-row.active {
  background: rgba(22, 163, 74, 0.16);
  color: #4ade80;
}

.broker-settings-subnav {
  margin: 8px 0 10px 28px;
  display: grid;
  gap: 4px;
  border-left: 1px solid rgba(148, 163, 184, 0.14);
  padding-left: 12px;
}

.broker-settings-subnav span,
.broker-settings-subnav strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
}

.broker-settings-subnav strong {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.14);
}

.broker-settings-logout {
  margin-top: auto;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #ff646b;
  font-size: 16px;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.broker-settings-content {
  min-width: 0;
  padding: 0 26px 30px;
  overflow-y: auto;
}

.broker-settings-topbar {
  height: 70px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.broker-settings-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.broker-voice-chip,
.broker-lang-chip,
.broker-avatar-chip {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: #f8fafc;
  background: rgba(8, 14, 23, 0.82);
  font-weight: 800;
}

.broker-voice-chip {
  color: #22ff86;
  border-color: rgba(34, 197, 94, 0.65);
}

.broker-avatar-chip {
  width: 42px;
  justify-content: center;
  color: #22c55e;
}

.broker-settings-header {
  padding: 26px 0 28px;
}

.broker-settings-header h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 30px;
}

.broker-settings-header p {
  margin: 0;
  color: #b9c4d2;
  font-size: 16px;
}

.broker-connection-card,
.broker-accounts-card,
.broker-active-card,
.broker-side-actions,
.broker-about-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(35, 80, 120, 0.08), transparent 34%),
    rgba(9, 16, 25, 0.88);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.broker-connection-card {
  min-height: 136px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(440px, 0.95fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 28px;
}

.broker-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 900;
}

.broker-connected-badge,
.broker-count-pill {
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.broker-connected-badge.disconnected {
  background: rgba(239, 68, 68, 0.12);
  color: #ff646b;
}

.broker-account-status,
.broker-authorized-text {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 16px;
}

.broker-account-status strong {
  color: #4ade80;
}

.broker-account-status.error {
  color: #ff646b;
}

.broker-account-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.broker-action-btn,
.broker-side-btn,
.broker-row-action {
  min-height: 56px;
  border-radius: 8px;
  background: rgba(8, 14, 23, 0.78);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.broker-action-btn.connect-btn {
  border-color: rgba(34, 197, 94, 0.55);
}

.broker-action-btn.disconnect-btn {
  border-color: rgba(239, 68, 68, 0.55);
}

.broker-action-btn.refresh-btn {
  border-color: rgba(96, 165, 250, 0.65);
  color: #93c5fd;
}

.broker-settings-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}

.broker-accounts-card,
.broker-about-card {
  padding: 20px;
}

.broker-accounts-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.broker-count-pill {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.broker-account-label,
.broker-account-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.broker-account-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.broker-account-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  color: #e5e7eb;
}

.broker-account-table th,
.broker-account-table td {
  padding: 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  font-size: 15px;
  vertical-align: middle;
}

.broker-account-table th {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 800;
}

.broker-account-table tr.active {
  background: rgba(45, 212, 105, 0.08);
  box-shadow: inset 3px 0 0 #22c55e;
}

.broker-account-table tr.unavailable {
  color: #fca5a5;
}

.broker-account-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 12px;
  background: #64748b;
}

.broker-account-dot.active,
.broker-account-dot.available {
  background: #22c55e;
}

.broker-account-dot.unavailable {
  background: #ff5b62;
}

.broker-type-pill,
.broker-active-pill,
.broker-status-text {
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}

.broker-type-pill {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.24);
}

.broker-status-text.available,
.broker-status-text.active {
  color: #4ade80;
  background: transparent;
}

.broker-status-text.unavailable {
  color: #ff646b;
  background: transparent;
}

.broker-active-pill {
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.1);
}

.broker-row-action {
  min-height: 38px;
  padding: 0 14px;
  color: #f8fafc;
}

.broker-row-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.broker-row-reason {
  color: #ff646b;
  font-size: 13px;
  padding-top: 8px;
}

.broker-right-panel {
  display: grid;
  gap: 26px;
  align-content: start;
}

.broker-active-card,
.broker-side-actions {
  padding: 22px;
}

.broker-active-title {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 28px;
}

.broker-active-card strong {
  display: block;
  color: #4ade80;
  font-size: 24px;
  margin-bottom: 8px;
}

.broker-active-card span {
  display: block;
  color: #cbd5e1;
  margin-bottom: 24px;
}

.broker-side-btn {
  width: 100%;
}

.broker-side-actions h3 {
  margin: 0 0 18px;
  font-size: 20px;
}

.broker-side-action {
  width: 100%;
  min-height: 74px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  background: rgba(8, 14, 23, 0.72);
  color: #f8fafc;
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.broker-action-btn:disabled,
.broker-side-btn:disabled,
.broker-row-action:disabled,
.broker-side-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.broker-side-action strong,
.broker-side-action span {
  display: block;
}

.broker-side-action span {
  margin-top: 6px;
  color: #9ca3af;
}

#clearAllBrokerAccountsBtn strong {
  color: #ff646b;
}

.broker-about-card {
  margin-top: 28px;
  color: #b9c4d2;
}

.broker-about-title {
  color: #93c5fd;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 14px;
}

.broker-about-card p {
  margin: 8px 0 0;
  font-size: 15px;
}

/* Broker Accounts layout polish */
.broker-settings-modal {
  overflow: auto;
}

.broker-settings-content {
  padding: 34px 26px 30px !important;
}

.broker-settings-topbar {
  min-height: 48px !important;
  height: auto !important;
  margin-bottom: 6px;
}

.broker-settings-header {
  padding: 16px 0 26px !important;
}

.broker-settings-header h2 {
  font-size: 28px !important;
  line-height: 1.16 !important;
}

.broker-settings-main {
  grid-template-columns: minmax(0, 1fr) 300px !important;
}

.broker-account-table {
  min-width: 760px !important;
  table-layout: fixed;
}

.broker-account-table th,
.broker-account-table td {
  padding: 15px 10px !important;
  font-size: 14px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broker-account-table th {
  font-size: 12px !important;
}

.broker-account-table th:nth-child(1),
.broker-account-table td:nth-child(1) {
  width: 18%;
}

.broker-account-table th:nth-child(2),
.broker-account-table td:nth-child(2) {
  width: 17%;
}

.broker-account-table th:nth-child(3),
.broker-account-table td:nth-child(3) {
  width: 12%;
}

.broker-account-table th:nth-child(4),
.broker-account-table td:nth-child(4) {
  width: 10%;
}

.broker-account-table th:nth-child(5),
.broker-account-table td:nth-child(5) {
  width: 13%;
}

.broker-account-table th:nth-child(6),
.broker-account-table td:nth-child(6) {
  width: 11%;
}

.broker-account-table th:nth-child(7),
.broker-account-table td:nth-child(7) {
  width: 10%;
}

.broker-account-table th:nth-child(8),
.broker-account-table td:nth-child(8) {
  width: 9%;
}

.broker-account-dot {
  margin-right: 8px !important;
}

.broker-action-btn,
.broker-side-btn,
.broker-row-action {
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .broker-settings-shell {
    grid-template-columns: 1fr;
  }

  .broker-settings-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  }

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

  .broker-settings-group {
    grid-column: 1 / -1;
  }

  .broker-settings-subnav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-right: 8px;
  }

  .broker-connection-card,
  .broker-settings-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .broker-settings-content {
    padding: 0 12px 18px;
  }

  .broker-settings-topbar {
    height: auto;
    padding: 12px 0;
  }

  .broker-settings-top-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .broker-settings-header h2 {
    font-size: 24px;
  }

  .broker-connection-card,
  .broker-accounts-card,
  .broker-active-card,
  .broker-side-actions,
  .broker-about-card {
    padding: 16px;
  }

  .broker-account-actions,
  .broker-settings-nav,
  .broker-settings-subnav {
    grid-template-columns: 1fr;
  }

  .broker-settings-logo {
    padding-bottom: 18px;
    font-size: 24px;
  }
}

/* Performance — visual treatment only */
body[data-active-settings-page="performance"] #statsModal {
  background: rgba(1, 6, 15, 0.82) !important;
  backdrop-filter: blur(10px);
}

body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
  width: min(97vw, 1580px) !important;
  max-width: 1580px !important;
  padding: 24px 28px 26px !important;
  overflow-y: auto !important;
  border: 1px solid #1b293b !important;
  border-radius: 14px !important;
  background:
    radial-gradient(circle at 48% 0%, rgba(47, 46, 112, 0.11), transparent 36%),
    linear-gradient(145deg, #07111e 0%, #050d17 58%, #07121f 100%) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48) !important;
}

body[data-active-settings-page="performance"] .performance-pro-head {
  margin-bottom: 18px;
}

body[data-active-settings-page="performance"] .performance-pro-title > span {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background: rgba(99, 48, 210, 0.18);
  color: #9b5cff;
  font-size: 27px;
}

body[data-active-settings-page="performance"] .performance-pro-title .trade-modal-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

body[data-active-settings-page="performance"] .performance-pro-title p {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 15px;
  font-weight: 550;
}

body[data-active-settings-page="performance"] .performance-pro-actions span {
  padding: 11px 15px;
  border-color: #1b293b;
  background: rgba(5, 13, 23, 0.8);
  font-size: 13px;
}

body[data-active-settings-page="performance"] .performance-pro-actions span::before {
  content: "⟳";
  margin-right: 8px;
  color: #94a3b8;
}

body[data-active-settings-page="performance"] .performance-pro-actions button {
  width: 42px;
  height: 42px;
  border: 1px solid #26364a;
  border-radius: 8px;
  background: #09121f;
}

body[data-active-settings-page="performance"] .performance-pro-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 11px;
}

body[data-active-settings-page="performance"] .performance-metric {
  grid-column: span 4;
  min-height: 150px;
  padding: 17px 15px 42px 62px;
  border: 1px solid #1d2a3a;
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, currentColor 9%, transparent), transparent 24%),
    linear-gradient(145deg, #0c1623, #07101b);
}

body[data-active-settings-page="performance"] .performance-metric:nth-child(n+6):nth-child(-n+9) {
  grid-column: span 5;
}

body[data-active-settings-page="performance"] .performance-metric::before {
  content: attr(data-metric-icon);
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: currentColor;
  font-size: 21px;
  font-style: normal;
  box-shadow: 0 0 18px color-mix(in srgb, currentColor 12%, transparent);
}

body[data-active-settings-page="performance"] .performance-metric span {
  color: #c6d0df;
  font-size: 14px;
  font-weight: 750;
}

body[data-active-settings-page="performance"] .performance-metric strong {
  margin: 6px 0 5px;
  font-size: 25px;
  line-height: 1.05;
}

body[data-active-settings-page="performance"] .performance-metric small {
  color: color-mix(in srgb, currentColor 78%, #aab6c8);
  font-size: 11px;
  font-weight: 650;
}

body[data-active-settings-page="performance"] .performance-metric i {
  left: 13px;
  right: 13px;
  bottom: 12px;
  height: 27px;
  border-radius: 0;
  opacity: 0.8;
  background:
    linear-gradient(180deg, transparent 0%, color-mix(in srgb, currentColor 17%, transparent) 100%),
    linear-gradient(168deg, transparent 0 42%, currentColor 44% 47%, transparent 49% 58%, currentColor 60% 63%, transparent 65%);
  clip-path: polygon(0 75%, 9% 65%, 18% 72%, 28% 52%, 38% 59%, 48% 42%, 58% 53%, 68% 34%, 78% 47%, 88% 23%, 100% 10%, 100% 100%, 0 100%);
}

body[data-active-settings-page="performance"] .performance-symbol-metric {
  display: none;
}

body[data-active-settings-page="performance"] .performance-pro-panels {
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 15px;
}

body[data-active-settings-page="performance"] .performance-pro-panel {
  padding: 11px 12px 12px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(10, 18, 33, 0.96), rgba(6, 14, 25, 0.98));
}

body[data-active-settings-page="performance"] .performance-pro-panel:first-child {
  border-color: rgba(124, 58, 237, 0.42);
}

body[data-active-settings-page="performance"] .performance-pro-panel.platform-panel {
  border-color: rgba(59, 130, 246, 0.42);
}

body[data-active-settings-page="performance"] .performance-pro-panel h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: #dce5f1;
  font-size: 14px;
  letter-spacing: 0.15px;
}

body[data-active-settings-page="performance"] .performance-pro-panel h3 > span {
  color: #9b5cff;
  font-size: 18px;
}

body[data-active-settings-page="performance"] .platform-panel h3 > span {
  color: #3b82f6;
}

body[data-active-settings-page="performance"] .performance-pro-panel > div {
  position: relative;
  min-height: 54px;
  margin-top: 5px !important;
  padding: 8px 12px 8px 54px;
  align-items: center;
  border-color: #1b293b;
  background: rgba(7, 16, 29, 0.72);
}

body[data-active-settings-page="performance"] .performance-pro-panel > div::before {
  content: attr(data-panel-icon);
  position: absolute;
  left: 9px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(124, 58, 237, 0.14);
  color: #a78bfa;
  font-size: 18px;
}

body[data-active-settings-page="performance"] .platform-panel > div::before {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

body[data-active-settings-page="performance"] .performance-pro-panel > div > span {
  color: #eef3f9;
  font-size: 13px;
  font-weight: 750;
}

body[data-active-settings-page="performance"] .performance-pro-panel > div small {
  display: block;
  margin-top: 2px;
  color: #9aa8bc;
  font-size: 10px;
  font-weight: 500;
}

body[data-active-settings-page="performance"] .performance-pro-panel > div strong {
  color: #995cff;
  font-size: 19px;
}

body[data-active-settings-page="performance"] .platform-panel > div strong {
  color: #3b82f6;
}

.performance-lower-grid {
  display: grid;
  grid-template-columns: 1.22fr 0.98fr;
  gap: 13px;
  margin-top: 15px;
}

.performance-equity-card,
.performance-summary-card {
  min-height: 230px;
  padding: 14px 16px;
  border: 1px solid #1d2a3a;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(10, 18, 33, 0.96), rgba(6, 14, 25, 0.98));
}

.performance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.performance-section-head h3,
.performance-summary-card h3 {
  margin: 0;
  color: #eef3f9;
  font-size: 14px;
  text-transform: uppercase;
}

.performance-section-head > span {
  padding: 7px 11px;
  border: 1px solid #26364a;
  border-radius: 7px;
  color: #dbe4ef;
  font-size: 12px;
}

.performance-equity-chart {
  position: relative;
  height: 180px;
  margin-top: 10px;
  overflow: hidden;
}

.equity-grid-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 34px, rgba(148, 163, 184, 0.08) 35px);
}

.performance-equity-chart svg {
  position: absolute;
  inset: 0 0 20px;
  width: 100%;
  height: calc(100% - 20px);
  overflow: visible;
}

.equity-area {
  fill: url(#equityArea);
}

.equity-line {
  fill: none;
  stroke: #8b5cf6;
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.5));
}

.performance-equity-chart circle {
  fill: #e9ddff;
  stroke: #6d28d9;
  stroke-width: 5;
}

.equity-axis {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: #8797ad;
  font-size: 10px;
}

.performance-summary-card > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #172436;
  color: #aebbd0;
  font-size: 13px;
}

.performance-summary-card > div strong {
  color: #e8edf5;
}

.performance-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.performance-footer button {
  min-width: 165px;
  min-height: 48px;
  border: 1px solid #7133e6;
  border-radius: 8px;
  background: linear-gradient(135deg, #5720d5, #7133e6);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(91, 33, 182, 0.22);
}

@media (max-width: 1100px) {
  body[data-active-settings-page="performance"] .performance-pro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-active-settings-page="performance"] .performance-metric,
  body[data-active-settings-page="performance"] .performance-metric:nth-child(n+6):nth-child(-n+9) {
    grid-column: auto;
  }

  body[data-active-settings-page="performance"] .performance-pro-panels,
  .performance-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
    padding: 18px 14px 22px !important;
  }

  body[data-active-settings-page="performance"] .performance-pro-head {
    align-items: flex-start;
  }

  body[data-active-settings-page="performance"] .performance-pro-actions span {
    display: none;
  }

  body[data-active-settings-page="performance"] .performance-pro-grid {
    grid-template-columns: 1fr;
  }

  body[data-active-settings-page="performance"] .performance-metric {
    min-height: 138px;
  }

  .performance-footer button {
    width: 100%;
  }
}

/* Flow Assistant — compact, viewport-fitting presentation */
body[data-active-settings-page="assistant"] #assistantModal {
  padding: var(--app-sidebar-top) 0 0 var(--app-sidebar-width) !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-active-settings-page="assistant"] #assistantModal .assistant-modal-box {
  position: fixed !important;
  top: var(--app-sidebar-top) !important;
  left: var(--app-sidebar-width) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(100vw - var(--app-sidebar-width)) !important;
  max-width: none !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  max-height: var(--app-panel-height) !important;
  padding: 16px 18px 14px !important;
  overflow: hidden !important;
  border: 1px solid #1b293b !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(60, 40, 140, 0.11), transparent 34%),
    linear-gradient(145deg, #07111e 0%, #050d17 62%, #07121f 100%) !important;
  box-shadow: none !important;
}

body[data-active-settings-page="assistant"] .assistant-panel-head {
  min-height: 58px;
  margin: 0 0 10px;
  padding: 0 2px 10px;
  align-items: center;
  border-bottom: 1px solid #172436;
}

body[data-active-settings-page="assistant"] .assistant-pro-title {
  gap: 12px;
}

body[data-active-settings-page="assistant"] .assistant-pro-title > span {
  width: 44px;
  height: 44px;
  border: 2px solid #7141ee;
  border-radius: 50%;
  background: rgba(80, 43, 181, 0.13);
  color: #9a6cff;
  font-size: 22px;
}

body[data-active-settings-page="assistant"] #assistantPanelKicker {
  display: none;
}

body[data-active-settings-page="assistant"] #assistantModalTitle {
  margin: 0;
  color: #f5f7fb;
  font-size: 24px;
  font-weight: 900;
}

body[data-active-settings-page="assistant"] .assistant-pro-title p {
  margin: 2px 0 0;
  color: #a9b6ca;
  font-size: 13px;
  font-weight: 500;
}

body[data-active-settings-page="assistant"] .assistant-panel-close {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 25px;
}

body[data-active-settings-page="assistant"] .assistant-pro-grid {
  display: grid !important;
  grid-template-columns: minmax(235px, 0.92fr) minmax(260px, 1.08fr) minmax(285px, 1.2fr) !important;
  grid-template-rows: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas:
    "voice streamer triggers"
    "voice behavior advanced";
  gap: 10px !important;
  height: calc(100% - 126px);
  min-height: 0;
}

body[data-active-settings-page="assistant"] #flowAssistantSettings {
  grid-area: voice;
}

body[data-active-settings-page="assistant"] #streamerVoiceMenu {
  grid-area: streamer;
}

body[data-active-settings-page="assistant"] .assistant-trigger-card {
  grid-area: triggers;
}

body[data-active-settings-page="assistant"] .assistant-behavior-card {
  grid-area: behavior;
}

body[data-active-settings-page="assistant"] .assistant-advanced-card {
  grid-area: advanced;
}

body[data-active-settings-page="assistant"] .assistant-pro-card {
  min-width: 0;
  min-height: 0;
  padding: 11px 12px !important;
  overflow: hidden;
  border: 1px solid #1b293b !important;
  border-radius: 9px !important;
  background:
    radial-gradient(circle at 96% 0%, rgba(80, 43, 181, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(11, 21, 35, 0.97), rgba(6, 15, 27, 0.98)) !important;
}

body[data-active-settings-page="assistant"] .assistant-settings-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin: -1px -2px 8px;
  padding: 0 2px 7px;
  border-bottom: 1px solid #172436;
  color: #9467ff;
  font-size: 12px;
  text-transform: uppercase;
}

body[data-active-settings-page="assistant"] .assistant-settings-heading span {
  color: #8b5cf6;
  font-size: 15px;
}

body[data-active-settings-page="assistant"] .assistant-setting-toggle,
body[data-active-settings-page="assistant"] .assistant-test-voice,
body[data-active-settings-page="assistant"] .streamer-voice-edit-btn {
  min-height: 36px;
  border-radius: 7px;
  font-size: 12px;
}

body[data-active-settings-page="assistant"] .assistant-setting-toggle {
  margin-bottom: 8px;
}

body[data-active-settings-page="assistant"] .assistant-setting-field {
  display: grid;
  gap: 5px;
  margin: 5px 0;
  color: #c8d2e0;
  font-size: 11px;
  font-weight: 650;
}

body[data-active-settings-page="assistant"] .assistant-setting-field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

body[data-active-settings-page="assistant"] .assistant-setting-field select {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #26364a;
  border-radius: 7px;
  background: #08121f;
  color: #edf2f8;
  font-size: 11px;
}

body[data-active-settings-page="assistant"] .assistant-setting-field input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: #7c3aed;
}

body[data-active-settings-page="assistant"] .assistant-popup-setting {
  min-height: 34px;
  margin: 5px 0;
  padding: 0 4px;
  color: #c8d2e0;
  font-size: 11px;
}

body[data-active-settings-page="assistant"] .assistant-popup-setting input,
body[data-active-settings-page="assistant"] .assistant-trigger-card input {
  width: 38px;
  height: 20px;
  accent-color: #7c3aed;
}

body[data-active-settings-page="assistant"] .streamer-voice-menu {
  display: block;
}

body[data-active-settings-page="assistant"] .streamer-voice-menu > p {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 11px;
}

body[data-active-settings-page="assistant"] .assistant-preview {
  max-height: 110px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: hidden;
  border-radius: 7px;
  color: #bec9d8;
  font-size: 10px;
  line-height: 1.55;
}

body[data-active-settings-page="assistant"] .streamer-voice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 132px;
  margin-top: 7px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #7041dc #101a2a;
}

body[data-active-settings-page="assistant"] .streamer-voice-row {
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 5px 6px;
  border-color: rgba(148, 163, 184, 0.17);
}

body[data-active-settings-page="assistant"] .streamer-voice-row kbd {
  min-width: 48px;
  min-height: 25px;
  font-size: 11px;
}

body[data-active-settings-page="assistant"] .streamer-voice-input {
  min-height: 27px;
  padding-inline: 8px;
  font-size: 11px;
  font-weight: 650;
}

body[data-active-settings-page="assistant"] .assistant-trigger-card label {
  min-height: 31px;
  padding: 3px 1px;
  color: #d7e0eb;
  font-size: 11px;
  font-weight: 650;
}

body[data-active-settings-page="assistant"] .assistant-behavior-card .assistant-setting-field,
body[data-active-settings-page="assistant"] .assistant-behavior-card .assistant-setting-field {
  margin: 9px 1px;
}

body[data-active-settings-page="assistant"] .assistant-advanced-card .assistant-setting-field {
  grid-template-columns: minmax(85px, 0.8fr) minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  margin: 5px 1px;
}

body[data-active-settings-page="assistant"] .assistant-advanced-card .assistant-setting-field > span {
  display: block;
}

body[data-active-settings-page="assistant"] .assistant-advanced-card .assistant-setting-field select {
  min-height: 31px;
}

body[data-active-settings-page="assistant"] .assistant-pro-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 10px 0 0;
  padding: 10px 2px 0;
  border-top: 1px solid #172436;
}

.assistant-pro-actions-right {
  display: flex;
  gap: 9px;
}

body[data-active-settings-page="assistant"] .assistant-pro-actions button {
  min-width: 145px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 12px;
}

body[data-active-settings-page="assistant"] .assistant-save-btn {
  min-width: 175px !important;
}

@media (max-width: 920px) {
  body[data-active-settings-page="assistant"] #assistantModal .assistant-modal-box {
    overflow-y: auto !important;
  }

  body[data-active-settings-page="assistant"] .assistant-pro-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto !important;
    grid-template-areas:
      "voice triggers"
      "streamer streamer"
      "behavior advanced";
    height: auto;
  }
}

/* Keep navigation crisp and freeze the dashboard behind attached menu pages. */
body.menu-drawer-open[data-active-settings-page] {
  height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.menu-drawer-open[data-active-settings-page] #mainApp {
  height: 100dvh !important;
  overflow: hidden !important;
}

body.menu-drawer-open[data-active-settings-page] > #mainApp > #sideMenu,
body.menu-drawer-open[data-active-settings-page] > #mainApp > #sideMenu .side-menu-inner {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-active-settings-page="settings:risk"] #settingsModal,
body[data-active-settings-page="settings:general"] #settingsModal,
body[data-active-settings-page="settings:notifications"] #settingsModal,
body[data-active-settings-page="settings:strategy"] #settingsModal,
body[data-active-settings-page="performance"] #statsModal,
body[data-active-settings-page="broker-accounts"] #brokerAccountsModal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.fit-mode.menu-drawer-open[data-active-settings-page] #mainApp::after,
body.fit-mode #mainApp.app.menu-drawer-open[data-active-settings-page]::after {
  left: var(--app-sidebar-width) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (max-width: 640px) {
  body[data-active-settings-page="assistant"] #assistantModal {
    padding: 0 !important;
  }

  body[data-active-settings-page="assistant"] #assistantModal .assistant-modal-box {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 12px !important;
  }

  body[data-active-settings-page="assistant"] .assistant-pro-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "voice"
      "streamer"
      "triggers"
      "behavior"
      "advanced";
  }

  body[data-active-settings-page="assistant"] .assistant-pro-actions,
  .assistant-pro-actions-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body[data-active-settings-page="assistant"] .assistant-pro-actions > button {
    grid-column: 1 / -1;
  }

  body[data-active-settings-page="assistant"] .assistant-pro-actions button {
    min-width: 0 !important;
    width: 100%;
  }
}

.cancel-btn {
  background: #171c24;
  border: 1px solid #2a313d;
  color: #d7dee8;
}

.confirm-btn {
  background: #143223;
  border: 1px solid #2fa36a;
  color: #eefaf3;
}

.confirm-btn.sell-mode {
  background: #3b1417;
  border-color: #d64545;
  color: #fff1f1;
}

/* CHART */
.chart-header {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.chart-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #2a2f39;
  background: #12161d;
  color: #e5eaf2;
  cursor: pointer;
  font-weight: 600;
}

.chart-btn:hover {
  background: #1a2028;
}

/* DASHBOARD LAYOUT */
.dashboard-grid{
    display:grid;
    grid-template-columns: 260px 420px 1fr;
    gap:12px;
    height: calc(100vh - 120px);
}

.signals-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.chart-panel{
    display:flex;
    flex-direction:column;
    height:100%;
}

.chart-wrap{
    display:flex;
    flex-direction:column;
    height:100%;
}

.chart-section {
  margin: 0;
  padding: 6px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#chartContainer{
    flex:1;
    min-height:300px;
}

.structure-panel{
    margin-top:10px;
}

.history-section{
    margin-top:10px;
}

.history-section {
  height: 28%;
  overflow: hidden;
}

.history-table-wrap {
  height: 100%;
  overflow-y: auto;
}

/* VIEW BUTTON */
#viewToggleBtn,
#adminUnlockBtn {
  min-width: 120px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

#langSelect {
  min-width: 72px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-weight: 700;
  padding: 0 8px;
}

#feedbackBtn {
  min-width: 110px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

#adminUnlockBtn.locked {
  background: #3b1417;
  border-color: #7a2a2f;
  color: #fff1f1;
}

#adminUnlockBtn.unlocked {
  background: #143223;
  border-color: #2fa36a;
  color: #eefaf3;
}

/* VIEW MODES */

/* NORMAL MODE
   cards left, chart right
   left side scrolls, chart stays fixed
*/
body.fit-mode {
  overflow: hidden;
}

body.fit-mode .app {
  height: 100vh;
  overflow: hidden;
}

body.fit-mode .dashboard-grid {
  display: grid;
  grid-template-columns: 260px 420px minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 104px);
  padding: 0 10px 6px 10px;
  overflow: hidden;
}

body.fit-mode .signals-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

body.fit-mode .content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0;
}

body.fit-mode .chart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

body.fit-mode .chart-wrap {
  flex: 1;
  min-height: 420px;
}

body.fit-mode .chart-section {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

body.fit-mode #chartContainer {
  height: 300px !important;
  min-height: 300px;
}

body.fit-mode .history-section {
  display: block;
  height: 78px;
  min-height: 78px;
  overflow: hidden;
}

body.fit-mode .history-table-wrap {
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
}

/* FULL MODE
   EURUSD left, GOLD right, chart below
   page can scroll normally
*/
body.scroll-mode {
  overflow-y: auto;
  overflow-x: hidden;
}

body.scroll-mode .app {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body.scroll-mode .dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "eurusd gold"
    "chart chart";
  gap: 12px;
  padding: 0 8px 8px;
  overflow: visible;
}

body.scroll-mode .signals-panel {
  display: contents;
}

body.scroll-mode .content-grid {
  display: contents;
}

body.scroll-mode #eurusd-card {
  grid-area: eurusd;
}

body.scroll-mode #gold-card {
  grid-area: gold;
}

body.scroll-mode .chart-panel {
  grid-area: chart;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.scroll-mode .chart-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 0;
}

body.scroll-mode .chart-section {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.scroll-mode #chartContainer {
  width: 100%;
  height: 420px !important;
  min-height: 420px;
  flex: 0 0 auto;
}

body.scroll-mode .history-section {
  height: 200px;
  min-height: 200px;
  flex: 0 0 auto;
  overflow: hidden;
}

body.scroll-mode .history-table-wrap {
  height: calc(100% - 8px);
  overflow-y: auto;
  overflow-x: auto;
}

#chartContainer {
  width: 100%;
  height: 400px;
}

/* ============================= */
/* HISTORY PANEL */
/* ============================= */

.chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.chart-wrap {
  flex: 1;
  min-height: 0;
}

.history-section {
  height: 28%;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid #161c26;
  padding-top: 8px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #eef2f8;
  letter-spacing: 0.2px;
}

.history-table-wrap {
  height: calc(100% - 28px);
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 12px;
}

.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.history-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #090d14;
  color: #9ca7b8;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 8px 6px;
  border-bottom: 1px solid #1a2230;
  letter-spacing: 0.1px;
}

.history-table tbody td {
  padding: 8px 6px;
  font-size: 11px;
  color: #e8edf7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  text-align: center;
}

.history-row {
  transition: background 0.18s ease;
}

.history-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.history-row-buy td:first-child {
  box-shadow: inset 2px 0 0 rgba(63, 156, 108, 0.9);
}

.history-row-sell td:first-child {
  box-shadow: inset 2px 0 0 rgba(214, 69, 69, 0.9);
}

.history-row-neutral td:first-child {
  box-shadow: inset 2px 0 0 rgba(250, 204, 21, 0.55);
}

.history-time {
  color: #aab4c5;
}

.history-symbol {
  font-weight: 700;
  color: #f4f7fb;
}

.history-confidence {
  color: #c9d5e8;
  font-weight: 600;
}

.history-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1px;
  border: 1px solid transparent;
}

.history-signal-buy {
  background: rgba(63, 156, 108, 0.16);
  color: #7ee2a8;
  border-color: rgba(63, 156, 108, 0.36);
}

.history-signal-sell {
  background: rgba(214, 69, 69, 0.16);
  color: #ff8f8f;
  border-color: rgba(214, 69, 69, 0.36);
}

.history-signal-wait {
  background: rgba(168, 158, 144, 0.12);
  color: #d1c6b7;
  border-color: rgba(168, 158, 144, 0.22);
}

.history-result-win {
  background: rgba(63, 156, 108, 0.16);
  color: #7ee2a8;
  border-color: rgba(63, 156, 108, 0.36);
}

.history-result-loss {
  background: rgba(214, 69, 69, 0.16);
  color: #ff8f8f;
  border-color: rgba(214, 69, 69, 0.36);
}

.history-result-running {
  background: rgba(250, 204, 21, 0.14);
  color: #ffd95a;
  border-color: rgba(250, 204, 21, 0.28);
}

.history-result-closed {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.24);
}

.history-pips-plus {
  color: #7ee2a8;
  font-weight: 700;
}

.history-pips-minus {
  color: #ff8f8f;
  font-weight: 700;
}

.history-pips-flat {
  color: #c7d0df;
  font-weight: 600;
}

.history-empty-row td {
  color: #8d97a8;
  text-align: center;
  padding: 22px 12px;
}

.history-table th:last-child,
.history-table td:last-child {
  padding-right: 16px;
}

.history-table th:first-child,
.history-table td:first-child {
  padding-left: 14px;
}

/* ============================= */
/* COMPACT CARDS — NORMAL MODE */
/* ============================= */

body.fit-mode .panel-card {
  padding: 10px;
}

body.fit-mode .panel-body {
  gap: 6px;
}

body.fit-mode .signal-box {
  min-height: 60px;
}

body.fit-mode .panel-actions button {
  height: 34px;
}

body.fit-mode .indicators {
  gap: 5px;
}

/* ============================= */
/* REAL COMPACT CARDS — FIT MODE */
/* ============================= */

body.fit-mode .symbol-card {
  min-height: 155px;
}

body.fit-mode .card-header {
  padding: 6px 12px 2px;
}

body.fit-mode .card-title {
  font-size: 16px;
}

body.fit-mode .signal-shell {
  margin: 0 12px 5px;
}

body.fit-mode .signal-box {
  min-height: 32px;
}

body.fit-mode .signal-text {
  font-size: 18px;
}

body.fit-mode .metric-label {
  font-size: 10px;
  padding: 1px 12px 2px;
}

body.fit-mode .conf-label {
  font-size: 14px;
}

body.fit-mode .bar-wrap {
  padding: 0 12px;
  margin-bottom: 3px;
}

body.fit-mode .conf-wrap {
  margin-bottom: 12px;
}

body.fit-mode .tags-row {
  gap: 4px;
  padding: 0 12px;
  margin-bottom: 5px;
}

body.fit-mode .glow-tag {
  min-height: 16px;
  padding: 2px 5px;
  font-size: 7px;
}

body.fit-mode .buttons-row {
  gap: 6px;
  padding: 0 12px;
}

body.fit-mode .glow-button {
  min-height: 24px;
  font-size: 10px;
}

.history-time {
  font-size: 10px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-symbol,
.history-confidence {
  font-size: 11px;
}

.history-table {
  table-layout: fixed;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 22%;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 12%;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 14%;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 14%;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: 18%;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 10%;
}

/* ============================== */
/* CHART CONTROLS */
/* ============================== */

.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chart-controls button {
  background: #111827;
  color: #9fb0c8;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  margin-right: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.chart-controls button:hover {
  background: #1f2937;
  color: white;
}

.chart-symbols,
.chart-timeframes {
  display: flex;
  gap: 6px;
}

.chart-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

#langSelect {
  min-width: 72px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #2a313d;
  background: #141a22;
  color: #fff;
  font-weight: 700;
  padding: 0 8px;
}

body.fit-mode .symbol-card {
  min-height: 220px;
}

body.fit-mode .card-header {
  padding: 12px 20px 8px;
}

body.fit-mode .card-title {
  font-size: 21px;
}

body.fit-mode .signal-shell {
  margin: 0 20px 10px;
}

body.fit-mode .signal-box {
  min-height: 30px;
}

body.fit-mode .signal-text {
  font-size: 34px;
}

body.fit-mode .metric-label {
  font-size: 14px;
  padding: 2px 20px 6px;
}

body.fit-mode .bar-wrap {
  padding: 0 20px;
  margin-bottom: 8px;
}

body.fit-mode .tags-row {
  gap: 6px;
  padding: 0 18px;
  margin-bottom: 10px;
}

body.fit-mode .glow-tag {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

body.fit-mode .buttons-row {
  gap: 10px;
  padding: 0 18px;
}

body.fit-mode .glow-button {
  min-height: 36px;
  font-size: 14px;
}

body.fit-mode .dashboard-grid {
  display: grid;
  grid-template-columns: 260px 420px minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 108px);
  padding: 0 10px 6px 10px;
  overflow: hidden;
}

.side-menu.hidden {
  display: none;
}

.side-menu-inner {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

.side-menu {
  position: fixed;
  top: 72px;
  left: 12px;
  width: 155px;
  background: rgba(11, 15, 21, 0.96);
  border: 1px solid #1f2937;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
  z-index: 2000;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.side-menu.hidden {
  display: none;
}

.side-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  gap: 4px;              /* tighter */
}

.side-menu {
  position: fixed;
  top: 72px;
  left: 14px;
  width: 250px;
  max-height: calc(100vh - 88px);
  background: rgba(11, 15, 21, 0.96);
  border: 1px solid #1f2937;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  z-index: 2000;
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.side-menu.hidden {
  display: none;
}

.side-menu-inner {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
}

.menu-row {
  width: 100%;
  min-height: 34px;
  border: none;
  background: transparent;
  color: #eef2f8;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  transition: background 0.15s ease;
  border-radius: 8px;
}

.assistant-settings {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 12px;
  background: rgba(12, 22, 34, 0.82);
}

.assistant-settings.hidden {
  display: none;
}

.assistant-settings-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #eef5ff;
  font-size: 12px;
}

.assistant-settings-heading span {
  color: #60a5fa;
}

.assistant-setting-toggle,
.assistant-test-voice {
  min-height: 32px;
  border: 1px solid rgba(57, 212, 103, 0.4);
  border-radius: 8px;
  background: rgba(20, 83, 45, 0.28);
  color: #70ec95;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.assistant-setting-toggle.is-off {
  border-color: #344153;
  background: #111923;
  color: #8d9aad;
}

.assistant-test-voice {
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
}

.assistant-setting-field {
  display: grid;
  gap: 5px;
  color: #aeb9c8;
  font-size: 10px;
  font-weight: 700;
}

.assistant-setting-field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.assistant-setting-field select {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 8px;
  border: 1px solid #2a394a;
  border-radius: 8px;
  background: #0d1621;
  color: #e5edf7;
  font-size: 10px;
}

.assistant-setting-field input[type="range"] {
  width: 100%;
  accent-color: #60a5fa;
}

.assistant-setting-field output {
  color: #dbeafe;
  font-variant-numeric: tabular-nums;
}

.assistant-popup-setting {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 9px;
  border: 1px solid #2a394a;
  border-radius: 8px;
  background: #0d1621;
  color: #d4deea;
  font-size: 10px;
  font-weight: 800;
}

.assistant-popup-setting input {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}

#assistantModal {
  background: transparent !important;
  backdrop-filter: none !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding: 92px 0 0 14px !important;
  z-index: 1000000 !important;
}

#assistantModal .assistant-modal-box {
  width: 390px !important;
  max-width: calc(100vw - 28px) !important;
  height: auto !important;
  max-height: calc(100vh - 110px) !important;
  padding: 16px !important;
  overflow-y: auto !important;
  border: 1px solid rgba(59, 130, 246, 0.46) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.13), transparent 42%),
    rgba(7, 13, 22, 0.98) !important;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.12),
    0 20px 55px rgba(0, 0, 0, 0.58) !important;
}

.assistant-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.assistant-panel-head span {
  color: #60a5fa;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.15px;
}

.assistant-panel-head .trade-modal-title {
  margin: 3px 0 0;
  font-size: 18px;
}

.assistant-panel-close {
  width: 30px;
  height: 30px;
  border: 1px solid #2b3949;
  border-radius: 9px;
  background: #101a26;
  color: #b7c2d0;
  font-size: 21px;
  cursor: pointer;
}

.streamer-voice-menu {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(168, 85, 247, 0.12), transparent 42%),
    rgba(12, 18, 30, 0.82);
}

.streamer-voice-menu.collapsed {
  gap: 0;
}

.streamer-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.streamer-voice-toggle {
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.streamer-voice-edit-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 31px;
  margin-top: 7px;
  border: 1px solid rgba(96, 165, 250, 0.36);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.streamer-voice-edit-btn.active {
  border-color: rgba(57, 212, 103, 0.42);
  background: rgba(20, 83, 45, 0.28);
  color: #70ec95;
}

.streamer-voice-menu.collapsed .streamer-voice-list {
  display: none;
}

.streamer-voice-menu:not(.collapsed) .streamer-voice-toggle span {
  transform: rotate(90deg);
}

.streamer-voice-list {
  display: grid;
  gap: 6px;
}

.streamer-voice-row {
  display: grid;
  grid-template-columns: 66px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  color: #dce6f3;
  font-size: 10px;
  line-height: 1.25;
}

.streamer-voice-row kbd {
  min-width: 56px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(96, 165, 250, 0.38);
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 900;
}

.streamer-voice-input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.72);
  color: #dce6f3;
  font-size: 10px;
  font-weight: 700;
  outline: none;
}

.streamer-voice-input[readonly] {
  cursor: default;
  color: #aeb9c8;
  background: rgba(8, 13, 24, 0.42);
}

.streamer-voice-input:focus {
  border-color: rgba(96, 165, 250, 0.62);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.14);
}

#assistantModal .assistant-settings {
  box-sizing: border-box;
}

@media (max-width: 700px) {
  #assistantModal {
    padding: 76px 8px 8px !important;
  }

  #assistantModal .assistant-modal-box {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100vh - 84px) !important;
  }
}

.menu-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.menu-row-icon {
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.95;
}

.menu-row-text {
  line-height: 1;
}

.menu-row + .menu-row {
  margin-top: 2px;
}

.feedback-modal-box {
  max-width: 460px;
}

.feedback-textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #2a313d;
  background: #0f141c;
  color: #eef2f8;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  margin-top: 10px;
  margin-bottom: 14px;
}

.feedback-textarea::placeholder {
  color: #7f8a9a;
}

.feedback-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.4);
}

.feedback-success {
  display: none !important;
}

.feedback-success.hidden {
  display: none;
}

.feedback-toast {
  position: fixed !important;
  top: 60px !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;

  z-index: 99999 !important;
  background: rgba(5, 14, 30, 0.809) !important;
  border: 1px solid rgba(245, 244, 244, 0) !important;
  color: #ffffff !important;  
  padding: 12px 18px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;

  box-shadow:
  0 12px 30px rgba(0, 0, 0, 0.18),
  0 2px 6px rgba(232, 4, 4, 0.08) !important;
}

.feedback-toast.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.login-box {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100000;
  width: 100%;
  max-width: 360px;
  transform: translate(-50%, -50%);

  background: rgba(10, 15, 25, 0.6);
  backdrop-filter: blur(12px);

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 24px;

  box-shadow: 0 20px 60px rgba(0,0,0,0.6);

  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-box.hidden {
  display: none !important;
}

.login-box h2 {
  margin: 0 0 8px;
  text-align: center;
  color: #eef2f8;
}

.login-box input {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #2a313d;
  background: #0f1726;
  color: #eef2f8;
  padding: 0 12px;
  outline: none;
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.auth-actions button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

.auth-msg {
  min-height: 20px;
  font-size: 13px;
  text-align: center;
  color: #cdd5df;
}

.app.locked {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #05070c;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.login-box {
  width: 360px;
  max-width: calc(100vw - 32px);
}

.app.locked {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;

  background: 
    linear-gradient(rgba(5, 10, 18, 0.85), rgba(5, 10, 18, 0.95)),
    url("flow.png");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.landing-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 50px;
  align-items: center;
  max-width: 1100px;
  width: 100%;
}

.landing-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.landing-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #dbe7ff;
  font-size: 13px;
  font-weight: 700;
}

.landing-title {
  margin: 0;
  font-size: 64px;
  line-height: 0.95;
  color: #eef2f8;
}

.landing-subtitle {
  margin: 0;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.6;
  color: #aeb8c7;
}

.landing-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.landing-enter-btn {
  min-width: 180px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.landing-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-image {
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  object-fit: cover;
}

.access-modal.hidden {
  display: none;
}

.access-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 360px;

  background: rgba(10, 15, 25, 0.6);
  backdrop-filter: blur(12px);

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 24px;

  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.login-box h2 {
  margin: 0;
  text-align: center;
  color: #eef2f8;
}

.login-box input {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #2a313d;
  background: #0f1726;
  color: #eef2f8;
  padding: 0 12px;
  outline: none;
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.auth-actions button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #2a313d;
  background: #f1f3f5;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

.auth-msg {
  min-height: 20px;
  font-size: 13px;
  text-align: center;
  color: #cdd5df;
}

.app.locked {
  display: none;
}

.landing-title {
  font-size: 64px;
  color: white;
  text-shadow: 0 5px 30px rgba(0,0,0,0.6);
}

.landing-subtitle {
  color: #d0d6e0;
  text-shadow: 0 3px 15px rgba(0,0,0,0.6);
}

@media (max-width: 900px) {

  .landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    width: 100%;
  }

  .landing-left {
    align-items: center;
  }

  .landing-title {
    font-size: 42px;
  }

  .landing-subtitle {
    font-size: 15px;
    max-width: 90%;
  }

  .landing-enter-btn {
    margin-top: 10px;
  }

  /* 👇 THIS IS THE KEY FIX */
  .login-box {
    position: fixed;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 340px;
  }

}

.hidden {
  display: none !important;
}

/* ============================== */
/* CLEAN PHONE MODE */
/* ============================== */
@media (max-width: 700px) {
  .login-box {
    width: calc(100vw - 28px) !important;
    max-width: 360px !important;
    padding: 20px !important;
  }

  .login-box input,
  .auth-actions button {
    min-height: 46px !important;
    font-size: 16px !important;
  }

  body,
  body.fit-mode,
  body.scroll-mode {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #05070c !important;
  }

  .app {
    padding: 12px !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    padding-bottom: 90px !important;
  }

  .header-frame {
    grid-template-columns: 44px 1fr 64px !important;
    position: relative !important;
    gap: 8px !important;
  }

  .menu-toggle {
    width: 40px !important;
    height: 40px !important;
  }

  .brand-left {
    font-size: 20px !important;
  }

  .header {
    position: absolute !important;
    left: 132px !important;
    top: 34px !important;
    font-size: 13px !important;
    opacity: 0.55 !important;
  }

  #langSelect {
    width: 58px !important;
    min-width: 58px !important;
    height: 36px !important;
    font-size: 12px !important;
  }

  .topbar {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .status {
    font-size: 16px !important;
  }

  .controls {
    gap: 8px !important;
    transform: scale(0.88);
    transform-origin: right center;
  }

  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    gap: 18px !important;
  }

  .signals-panel {
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .content-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .symbol-card {
    min-height: auto !important;
    border-radius: 18px !important;
  }

  .card-header {
    padding: 12px 12px 4px !important;
  }

  .card-title {
    font-size: 18px !important;
  }

  .eurusd-icon,
  .gold-icon {
    width: 22px !important;
    height: 22px !important;
  }

  .signal-shell {
    margin: 0 12px 10px !important;
  }

  .signal-box {
    min-height: 60px !important;
    border-radius: 14px !important;
  }

  .signal-text {
    font-size: 32px !important;
  }

  .metric-label {
    font-size: 12px !important;
    padding: 2px 12px 6px !important;
  }

  .bar-wrap {
    padding: 0 12px !important;
    margin-bottom: 10px !important;
  }

  .tags-row {
    padding: 0 12px !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  .glow-tag {
    font-size: 10px !important;
    min-height: 26px !important;
    padding: 4px 8px !important;
  }

  .buttons-row {
    padding: 0 12px 12px !important;
    gap: 8px !important;
  }

  .glow-button {
    min-height: 42px !important;
    font-size: 14px !important;
  }

  .chart-panel,
  .chart-section,
  .chart-wrap {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .chart-controls {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 6px 0 !important;
    overflow-x: auto !important;
  }

  .chart-controls > div {
    display: contents !important;
  }

  .chart-controls button,
  .chart-btn {
    flex: 0 0 auto !important;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    height: 34px !important;
    margin: 0 !important;
    font-size: 12px !important;
  }

  #chartContainer {
    height: 190px !important;
    min-height: 190px !important;
    max-height: 190px !important;
  }

  .history-section {
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
  }
}

.smc-panel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 170, 0, 0.35);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
}

.smc-header {
    font-size: 14px;
    font-weight: bold;
    color: #b388ff;
    margin-bottom: 12px;
}

.smc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.smc-row span:first-child {
    color: #9aa4b2;
    font-size: 13px;
}

.smc-row span:last-child {
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.structure-panel {
  margin-top: 14px;
}

.structure-box {
  background: linear-gradient(180deg, #0a101a 0%, #070c14 100%);
  border: 1px solid rgba(80, 120, 180, 0.15);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 0 12px rgba(0, 80, 180, 0.05);
}

.structure-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.structure-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.structure-row:last-child {
  border-bottom: none;
}

.structure-row span {
  color: #9aa4b2;
  font-size: 13px;
}

.structure-row strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

body.fit-mode .structure-panel {
  height: 175px;
  min-height: 175px;
}
body.fit-mode .structure-box {
  height: 100%;
  padding: 10px 14px;
}

body.fit-mode .structure-title {
  font-size: 12px;
  margin-bottom: 6px;
}

body.fit-mode .structure-row {
  padding: 4px 0;
}

body.fit-mode .structure-row span,
body.fit-mode .structure-row strong {
  font-size: 12px;
}

body.fit-mode .main-trade-panel {
  display: block;
  min-height: 0;
  overflow-y: auto;
}

.main-trade-card {
  border: 1px solid rgba(60, 80, 110, 0.55);
  border-radius: 18px;
  background: linear-gradient(to bottom, #0b111b, #070a10);
  padding: 14px;
  max-height: 720px;
  overflow-y: auto;
}

.main-symbol {
  font-size: 22px;
  font-weight: 800;
}

.main-live {
  color: #00f28b;
  font-size: 12px;
  font-weight: 800;
}

.main-candle-debug {
  margin-top: 4px;
  color: #7f91a8;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.main-candle-debug.is-stale {
  color: #e3b44b;
}

.main-signal-box {
  margin: 12px 0;
  border: 1px solid var(--wait-line);
  border-radius: 18px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wait);
  font-size: 34px;
  font-weight: 900;
}

.main-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(63, 156, 108, 0.35);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
}

.main-metrics div {
  padding: 10px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.main-metrics div:last-child {
  border-right: none;
}

.main-metrics span {
  display: block;
  font-size: 12px;
  color: #c7d0df;
}

.main-metrics strong {
  font-size: 18px;
  color: #00f28b;
}

.bias-only-note {
  margin: -2px 0 10px;
  color: #91a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

.main-buttons-row {
  padding: 12px 0 0;
}

body.fit-mode .structure-grid {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 14px;
  height: 175px;
  overflow: hidden;
}

body.fit-mode .structure-map {
  overflow: hidden;
}

body.fit-mode .structure-data {
  padding-top: 28px;
}

body.fit-mode .smc-svg {
  width: 100%;
  height: 125px;
  display: block;
}

body.fit-mode .structure-panel {
  height: 185px;
  min-height: 185px;
}

.main-tags-row{
    display:flex;
    justify-content:center;
    gap:10px;
    margin:14px 0;
}

.main-last-signal-row{
    display:flex;
    justify-content:space-between;
    margin-top:12px;
    padding:0 10px;
    font-size:13px;
    color:#c7d0df;
}

/* ===== FLOW SIGNAL DESKTOP UI OVERRIDE ===== */

body.fit-mode .app {
  padding: 0;
  background: #05070c;
}

.header-frame {
  height: 58px;
  grid-template-columns: 48px 220px 1fr 90px;
  padding: 0 18px;
  border: 1px solid #17202c;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #0a1018, #06090f);
}

.brand-left {
  font-size: 26px;
  font-weight: 800;
}

.brand-left::before {
  content: "≋ ";
  color: #248bff;
  font-size: 34px;
  vertical-align: -3px;
}

.header {
  font-size: 24px;
  font-weight: 800;
}

.divider {
  display: none;
}

.topbar {
  padding: 12px 22px 8px;
}

.dashboard-grid,
body.fit-mode .dashboard-grid {
  grid-template-columns: 295px 445px minmax(560px, 1fr);
  gap: 16px;
  height: calc(100vh - 112px);
  padding: 0 20px 0;
}

.signals-panel {
  border: 1px solid #17202c;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #080d15, #05080d);
}

.content-grid {
  gap: 16px;
}

body.fit-mode .symbol-card {
  min-height: 315px;
  border-radius: 10px;
}

body.fit-mode .card-header {
  padding: 24px 22px 10px;
}

body.fit-mode .card-title {
  font-size: 26px;
}

body.fit-mode .signal-shell {
  margin: 0 20px 16px;
}

body.fit-mode .signal-box {
  min-height: 44px;
  border-radius: 18px;
}

body.fit-mode .signal-text {
  font-size: 32px;
  color: #c99a4e;
}

body.fit-mode .metric-label {
  font-size: 14px;
  padding: 2px 20px 8px;
}

body.fit-mode .bar-wrap {
  padding: 0 20px;
  margin-bottom: 12px;
}

body.fit-mode .tags-row {
  padding: 0 20px;
  margin-bottom: 12px;
}

body.fit-mode .glow-tag {
  min-height: 30px;
  font-size: 12px;
  padding: 5px 10px;
}

.main-trade-panel {
  min-height: 0;
}

.main-trade-card {
  height: 100%;
  border-radius: 14px;
  border: 1px solid #243246;
  background: linear-gradient(180deg, #0c131d, #070b11);
  padding: 16px;
  overflow: hidden;
}

.main-symbol {
  font-size: 28px;
}

.main-live {
  text-align: right;
  color: #35ff8a;
}

.main-signal-box {
  min-height: 66px;
  border: 1.5px solid #9a6a28;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 12px;
}

.main-signal-box span {
  font-size: 42px;
  font-weight: 900;
  color: #d9a75c;
}

.main-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(30, 180, 110, 0.35);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.main-metrics div {
  text-align: center;
  padding: 12px 6px;
  border-right: 1px solid rgba(255,255,255,.06);
}

.main-metrics div:last-child {
  border-right: none;
}

.main-metrics span {
  display: block;
  font-size: 13px;
  color: #cbd5e1;
}

.main-metrics strong {
  font-size: 22px;
  color: #52ff85;
}

.main-smc-panel {
  border-color: rgba(188, 128, 32, 0.65);
  min-height: 300px;
}

.main-buttons-row {
  margin-top: 16px;
  padding: 0;
}

.main-buttons-row .glow-button {
  min-height: 58px;
  font-size: 22px;
}

.chart-panel {
  min-width: 0;
}

.chart-section {
  padding: 0;
  gap: 10px;
}

.chart-controls {
  height: 44px;
  margin: 0;
}

.chart-controls button {
  min-width: 72px;
  height: 34px;
  border-radius: 8px;
  font-weight: 800;
}

#chartContainer,
body.fit-mode #chartContainer {
  height: 395px !important;
  min-height: 395px;
  border: 1px solid #1b2533;
  border-radius: 10px;
  overflow: hidden;
}

.structure-panel,
body.fit-mode .structure-panel {
  height: 170px;
  min-height: 170px;
  margin-top: 0;
}

.structure-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 0;
}

.structure-box {
  height: 100%;
  padding: 12px;
}

.smc-svg {
  width: 100%;
  height: 120px;
}

.history-section,
body.fit-mode .history-section {
  height: 170px;
  min-height: 170px;
  border: 1px solid #17202c;
  border-radius: 10px;
  padding: 10px;
  background: #070b11;
}

.footer {
  position: fixed;
  bottom: 8px;
  left: 0;
  right: 0;
  justify-content: center;
}

/* ===== MAKE DESKTOP FIT LIKE TARGET IMAGE ===== */

body.fit-mode .dashboard-grid {
  grid-template-columns: 295px 445px minmax(560px, 1fr);
  height: calc(100vh - 96px);
  gap: 14px;
}

body.fit-mode .symbol-card {
  min-height: 0 !important;
  height: 337px !important;
}

body.fit-mode .main-trade-card {
  height: 100%;
  padding: 16px;
}

body.fit-mode .main-signal-box {
  min-height: 64px;
  margin: 14px 0 12px;
}

body.fit-mode .main-signal-box span {
  font-size: 44px;
}

body.fit-mode .main-smc-panel {
  min-height: 270px;
  padding: 12px;
}

body.fit-mode .smc-row {
  padding: 5px 0;
}

body.fit-mode .main-buttons-row {
  margin-top: 16px;
}

body.fit-mode .main-buttons-row .glow-button {
  min-height: 48px;
  font-size: 16px;
}

body.fit-mode #chartContainer {
  height: 395px !important;
  min-height: 395px !important;
}

body.fit-mode .structure-panel {
  height: 175px !important;
  min-height: 175px !important;
}

body.fit-mode .history-section {
  height: 135px !important;
  min-height: 135px !important;
  margin-top: 0;
}

body.fit-mode .chart-section {
  gap: 8px;
}

body.fit-mode .history-header h2 {
  font-size: 17px;
}

body.fit-mode .footer {
  display: none;
}
/* ===== FINAL DESKTOP HEIGHT TUNE ===== */

body.fit-mode #chartContainer {
  height: 365px !important;
  min-height: 365px !important;
}

body.fit-mode .structure-panel {
  height: 160px !important;
  min-height: 160px !important;
}

body.fit-mode .history-section {
  height: 185px !important;
  min-height: 185px !important;
}

body.fit-mode .structure-box {
  padding: 9px 12px !important;
}

body.fit-mode .smc-svg {
  height: 105px !important;
}

body.fit-mode .structure-row {
  padding: 3px 0 !important;
}

body.fit-mode .history-table tbody td,
body.fit-mode .history-table thead th {
  padding: 6px 6px !important;
}

/* ===== LAST VISUAL CLEANUP ===== */

body.fit-mode .symbol-card {
  height: 330px !important;
}

body.fit-mode #chartContainer {
  height: 335px !important;
  min-height: 335px !important;
}

body.fit-mode .structure-panel {
  height: 155px !important;
  min-height: 155px !important;
}

body.fit-mode .history-section {
  height: 215px !important;
  min-height: 215px !important;
}

body.fit-mode .main-smc-panel {
  min-height: 250px !important;
}

body.fit-mode .main-trade-card {
  padding-bottom: 10px !important;
}

body.fit-mode .history-table tbody td {
  font-size: 11px !important;
}

/* ===== PERFECT ALIGNMENT FIX ===== */

body.fit-mode .main-trade-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

body.fit-mode .main-smc-panel {
  min-height: 220px !important;
}

body.fit-mode .smc-row {
  padding: 4px 0 !important;
  font-size: 12px;
}

body.fit-mode .main-metrics strong {
  font-size: 18px;
}

body.fit-mode .main-signal-box span {
  font-size: 38px;
}

body.fit-mode .main-buttons-row {
  margin-top: 12px;
}

body.fit-mode .main-buttons-row .glow-button {
  min-height: 44px;
  font-size: 15px;
}

/* ===== CLEAN SMC STRUCTURE BOX LIKE TARGET ===== */

body.fit-mode .structure-panel {
  height: 165px !important;
  min-height: 165px !important;
  margin-top: 0 !important;
}

.structure-grid-clean {
  display: grid !important;
  grid-template-columns: 58% 42% !important;
  align-items: center !important;
}

.structure-left {
  justify-content: center !important;
  align-items: center !important;
  padding: 10px 8px !important;
}

.smc-svg-clean {
  width: 100% !important;
  height: 140px !important;
  max-width: 320px;
}

.structure-left {
  padding: 10px 14px !important;
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
}

.structure-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #eef2f8 !important;
  margin-bottom: 4px !important;
}

.smc-svg-clean {
  width: 100% !important;
  height: 118px !important;
  display: block !important;
}

.structure-right {
  padding: 12px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 8px !important;
}

.structure-info-row {
  display: grid !important;
  grid-template-columns: 110px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  min-width: 0 !important;
}

.structure-info-row span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.structure-info-row strong {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
}

.structure-info-row span {
  color: #c2cad7 !important;
  font-weight: 700 !important;
}

.structure-info-row strong {
  color: #cdd5e1 !important;
  font-weight: 900 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

#structure-trend {
  color: #facc15 !important;
}

#structure-next {
  color: #4ea1ff !important;
}

.resistance-text {
  color: #ef4444 !important;
}

.support-text {
  color: #22c55e !important;
}

/* Center SMC title like target */
.structure-title {
  width: 100%;
  text-align: center !important;
  margin-bottom: 6px !important;
}

/* ===== SMC FINAL BALANCE ===== */

body.fit-mode .structure-panel {
  height: 160px !important;
  min-height: 160px !important;
}

.structure-left {
  padding: 8px 14px !important;
}

.smc-svg-clean {
  height: 118px !important;
  max-width: 340px !important;
  margin-top: -2px !important;
}

.structure-title {
  margin-bottom: 0 !important;
}

.structure-right {
  padding: 12px 20px !important;
  gap: 7px !important;
}

.structure-info-row {
  font-size: 13px !important;
}

/* ===== FIX CHART HEADER INSIDE CHART ===== */

.chart-box {
  position: relative !important;
  height: 335px !important;
  border: 1px solid #1b2533 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #0b101a !important;
}

.chart-box #chartContainer {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: none !important;
}

#chartContainer a[href*="tradingview.com"],
#chartContainer [aria-label*="TradingView"],
#chartContainer [title*="TradingView"] {
  display: none !important;
  pointer-events: none !important;
}

.chart-overlay-header {
  position: absolute !important;
  top: 12px !important;
  left: 14px !important;
  z-index: 50 !important;
  pointer-events: none !important;
}

.trade-level-drag-layer {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.trade-level-drag-line {
  --level-color: #fff;
  position: absolute;
  left: 0;
  right: 0;
  height: 18px;
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: ns-resize;
  touch-action: none;
  transition: filter 150ms ease;
}

.trade-level-drag-line::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--level-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--level-color) 65%, transparent);
  transition: height 120ms ease, box-shadow 120ms ease;
}

.trade-level-drag-line:hover::before,
.trade-level-drag-line.is-dragging::before {
  height: 3px;
  box-shadow: 0 0 14px var(--level-color);
}

.trade-level-drag-line.is-locked {
  cursor: default;
  pointer-events: none;
}

.trade-level-handle {
  position: absolute;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--level-color);
  border-radius: 50%;
  background: #07101d;
  box-shadow: 0 0 10px color-mix(in srgb, var(--level-color) 70%, transparent);
  opacity: 0;
  transform: scale(.7);
  transition: opacity 120ms ease, transform 120ms ease;
}

.trade-level-handle:first-child { left: 8px; }
.trade-level-handle:nth-child(2) { right: 8px; }

.trade-level-drag-line:hover .trade-level-handle,
.trade-level-drag-line.is-dragging .trade-level-handle {
  opacity: 1;
  transform: scale(1);
}

.trade-level-label {
  position: absolute;
  right: 7px;
  top: -10px;
  min-width: 112px;
  padding: 4px 8px;
  border: 1px solid var(--level-color);
  border-radius: 5px;
  background: color-mix(in srgb, var(--level-color) 18%, #08111f);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .3);
}

.trade-level-preview {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 5px 14px;
  padding: 9px 11px;
  border: 1px solid #2f80ff;
  border-radius: 9px;
  background: rgba(5, 13, 25, .94);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 80, 255, .24);
}

.trade-level-preview strong { color: #fff; }

.trade-level-preview.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.trade-level-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 4, 12, .72);
  backdrop-filter: blur(10px);
}

.trade-level-confirm-card {
  width: min(390px, 100%);
  padding: 22px;
  border: 1px solid #247cff;
  border-radius: 20px;
  background: linear-gradient(145deg, #0b1626, #070d17);
  box-shadow: 0 24px 80px rgba(0, 75, 255, .3);
}

.trade-level-confirm-kicker {
  color: #60a5fa;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.trade-level-confirm-card h3 {
  margin: 7px 0 5px;
  color: #f8fafc;
  font-size: 24px;
}

.trade-level-confirm-card p {
  margin: 0 0 14px;
  color: #9fb0c8;
}

.trade-level-confirm-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.trade-level-confirm-metrics span {
  padding: 9px;
  border: 1px solid #1e3149;
  border-radius: 9px;
  color: #b8c7da;
  font-size: 12px;
}

.trade-level-confirm-metrics strong {
  display: block;
  margin-top: 3px;
  color: #fff;
}

.trade-level-confirm-error {
  margin-bottom: 12px;
  color: #ff6b75;
  font-size: 12px;
  font-weight: 800;
}

.trade-level-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trade-level-confirm-actions button {
  min-height: 44px;
  border: 1px solid #304158;
  border-radius: 11px;
  background: #101a29;
  color: #dce7f5;
  font-weight: 900;
}

#applyTradeLevelChangeBtn {
  border-color: #1976ff;
  background: linear-gradient(135deg, #1269df, #7146e8);
  color: #fff;
}

.hidden { display: none !important; }

#chartOverlayTitle {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #dbe3ef !important;
  margin-bottom: 4px !important;
}

#chartOverlayOhlc {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #b8c2d1 !important;
}

#chartOverlayOhlc span {
  color: #18c999 !important;
}

/* ===== CHART HEADER BREATHING SPACE ===== */

.chart-box {
  height: 350px !important;
}

body.fit-mode .chart-box {
  height: 350px !important;
}

.chart-overlay-header {
  top: 14px !important;
  left: 16px !important;
}

/* ===== CHART HEADER CLEAN FINAL ===== */

.chart-overlay-header {
  background: rgba(8, 13, 22, 0.65);
  padding: 4px 7px;
  border-radius: 6px;
  backdrop-filter: blur(3px);
}

#chartOverlayTitle {
  font-size: 15px !important;
}

#chartOverlayOhlc {
  font-size: 12px !important;
}

/* ===== CENTER PANEL SYMBOL ICON + LAST SIGNAL ===== */

.main-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-symbol-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  vertical-align: middle;
}

.gold-main-icon {
  width: 34px;
  height: 34px;
}

.main-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #aab4c5;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 6px 0;
}

/* ===== MAIN BOTTOM ROW CLEAN ===== */

.main-bottom-row {
  margin-top: 10px;
  padding: 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #aab4c5;
  font-size: 14px;
  font-weight: 700;
}

#main-last-signal {
  color: #cbd5e1;
}

#main-local-time {
  color: #8f97a3;
}

/* ===== CENTER METRICS LIKE SIMULATOR ===== */

.main-metrics {
  margin: 14px 0 18px !important;
  border: 1px solid rgba(38, 166, 154, 0.35) !important;
  border-radius: 12px !important;
  background: rgba(8, 14, 24, 0.72) !important;
  overflow: hidden !important;
}

.main-metrics div {
  position: relative;
  padding: 12px 8px 18px !important;
}

.main-metrics div::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: #22c55e;
}

.main-metrics div:nth-child(2)::after {
  background: #ef4444;
}

.main-metrics div:nth-child(3)::after {
  background: #3b82f6;
}

.main-metrics span {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #d8dee9 !important;
}

.main-metrics strong {
  display: block !important;
  margin-top: 3px !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #61ff8a !important;
}

.main-metrics div:nth-child(2) strong {
  color: #ff4d4d !important;
}

.main-metrics div:nth-child(3) strong {
  color: #4f8cff !important;
}

/* ===== LEFT CARD SIGNAL COLORS ===== */

.symbol-card .signal-box.signal-border-buy {
  border-color: #22c55e !important;
}

.symbol-card .signal-text.buy-text {
  color: #4ade80 !important;
}

.symbol-card .signal-box.signal-border-sell {
  border-color: #ef4444 !important;
}

.symbol-card .signal-text.sell-text {
  color: #ef4444 !important;
}

.symbol-card .signal-box.signal-border-wait {
  border-color: #8a632b !important;
}

.symbol-card .signal-text.wait-text {
  color: #d6a24f !important;
}

/* ===== SMC LINES CONTROL ===== */
.smc-svg-clean path {
  stroke-width: 2 !important;
  opacity: 0.85;
}

.smc-svg-clean text {
  font-size: 15px !important;
  font-weight: 500 !important;
  opacity: 0.75;
}

/* ===== SMC ANIMATION ===== *//* ===== SMC ANIMATION ===== */
@keyframes smcPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.smc-svg-clean path {
  animation: smcPulse 2.5s ease-in-out infinite;
}

.main-live-price {
  font-size: 22px;
  font-weight: 700;
  color: #22c55e;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.main-live-price {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.5px;
  transition: color 0.2s ease, transform 0.1s ease;
}

/* 🔥 FLASH EFFECT */
.price-up {
  transform: scale(1.08);
}

.price-down {
  transform: scale(0.95);
}

/* ===== FIX SMC PLAN TEXT OVERFLOW ===== */

.main-smc-panel {
  padding-bottom: 8px !important;
  overflow: hidden !important;
}

.main-smc-panel .smc-row {
  min-height: 22px !important;
  padding: 3px 0 !important;
  font-size: 13px !important;
}

.entry-strategy-debug {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #203650;
  border-radius: 12px;
  background: rgba(7, 16, 29, .78);
}

.entry-strategy-debug summary {
  cursor: pointer;
  color: #7db7ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  list-style-position: inside;
}

.entry-strategy-debug-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto);
  gap: 5px 10px;
  margin-top: 9px;
  font-size: 11px;
}

.entry-strategy-debug-grid span {
  color: #8fa1b8;
}

.entry-strategy-debug-grid strong {
  min-width: 0;
  color: #dce7f5;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-strategy-debug-grid .check-pass,
.entry-strategy-debug-grid .decision-buy {
  color: #39df83;
}

.entry-strategy-debug-grid .check-fail,
.entry-strategy-debug-grid .decision-sell {
  color: #ff5b66;
}

.entry-strategy-debug-grid .check-waiting {
  color: #f5b84b;
}

.entry-strategy-debug-grid .check-not-checked {
  color: #8fa1b8;
}

.entry-strategy-debug-grid .decision-wait {
  color: #f5b84b;
}

#strategy-debug-block-reason {
  max-width: 190px;
  color: #f5b84b;
}

@media (max-width: 850px) {
  .entry-strategy-debug {
    padding: 8px 9px;
  }

  .entry-strategy-debug-grid {
    font-size: 10px;
  }
}

/* ===== FIX CENTER BUY SELL CONFIDENCE TEXT ===== */

.main-metrics {
  min-height: 64px !important;
  margin: 14px 0 16px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
}

.main-metrics div {
  min-height: 58px !important;
  padding: 8px 8px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

.main-metrics span {
  display: block !important;
  font-size: 13px !important;
  color: #d8dee9 !important;
}

.main-metrics strong {
  display: block !important;
  font-size: 22px !important;
  line-height: 1.1 !important;
}

/* ===== PREMIUM LANDING PAGE ===== */

.auth-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 35%, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at 40% 90%, rgba(0, 100, 255, 0.22), transparent 35%),
    linear-gradient(180deg, #030814 0%, #050816 55%, #02050d 100%);
  overflow: hidden;
}

.landing-pro {
  min-height: 100vh;
  padding: 22px 58px;
  color: #f8fafc;
  position: relative;
}

.landing-pro::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 120px;
  height: 180px;
  background:
    radial-gradient(ellipse at center, rgba(37, 99, 235, 0.45), transparent 58%);
  filter: blur(18px);
  opacity: 0.75;
  pointer-events: none;
}

.landing-nav {
  display: grid;
  grid-template-columns: 260px 1fr 330px;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 900;
}

.logo-wave {
  color: #2f80ff;
  font-size: 42px;
  line-height: 1;
  transform: rotate(90deg);
}

.landing-links {
  display: flex;
  justify-content: center;
  gap: 34px;
  color: #aeb7c6;
  font-size: 15px;
  font-weight: 600;
}

.landing-nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

#landingLang {
  background: transparent;
  color: #dbeafe;
  border: 0;
  font-weight: 800;
}

.landing-login-btn,
.landing-get-btn {
  height: 44px;
  border-radius: 9px;
  padding: 0 26px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.landing-login-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(226,232,240,0.4);
}

.landing-get-btn {
  border: 0;
  background: linear-gradient(135deg, #2f80ff, #1557ff);
  box-shadow: 0 12px 30px rgba(37,99,235,0.35);
}

.hero-section {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 42px;
  align-items: center;
  min-height: 620px;
  position: relative;
  z-index: 2;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59,130,246,0.25);
  color: #2f80ff;
  font-size: 14px;
  font-weight: 700;
}

.hero-pill span {
  color: #22c55e;
}

.hero-left h1 {
  margin: 26px 0 18px;
  font-size: 68px;
  line-height: 1.08;
  letter-spacing: -2px;
}

.hero-left h1 span {
  color: #1f6fff;
}

.hero-left p {
  max-width: 560px;
  color: #a8b3c7;
  font-size: 19px;
  line-height: 1.65;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 18px;
  margin-bottom: 34px;
}

.hero-primary,
.hero-secondary {
  height: 54px;
  border-radius: 9px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
}

.hero-primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, #2f80ff, #1557ff);
  box-shadow: 0 14px 32px rgba(37,99,235,0.38);
}

.hero-secondary {
  background: rgba(255,255,255,0.02);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,0.45);
}

.hero-badges {
  display: flex;
  gap: 34px;
  color: #aeb7c6;
  font-weight: 650;
}

.hero-badges span {
  white-space: nowrap;
}

.hero-right {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-dashboard-img {
  width: 100%;
  max-width: 780px;
  border-radius: 18px;
  border: 1px solid rgba(59,130,246,0.55);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.6),
    0 0 45px rgba(37,99,235,0.28);
  transform: perspective(1100px) rotateY(-7deg) rotateX(2deg);
}

.hero-stats {
  height: 122px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148,163,184,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  z-index: 2;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  border-right: 1px solid rgba(148,163,184,0.18);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats strong {
  color: #2f80ff;
  font-size: 26px;
  font-weight: 950;
}

.hero-stats span {
  color: #a8b3c7;
  font-size: 14px;
}

.trusted-text {
  text-align: center;
  margin-top: 38px;
  color: #64748b;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.trusted-logos {
  display: flex;
  justify-content: center;
  gap: 54px;
  margin-top: 28px;
  color: rgba(148,163,184,0.55);
  font-size: 18px;
  font-weight: 900;
}

/* ===== FIX LANDING PAGE POSITION / OVERFLOW ===== */

#landingPage.landing-pro {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 24px 58px !important;
  transform: none !important;
  position: relative !important;
  left: 0 !important;
  right: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.landing-nav {
  flex: 0 0 auto !important;
}

.hero-section {
  flex: 1 !important;
  min-height: 0 !important;
  grid-template-columns: 42% 58% !important;
}

.hero-left h1 {
  font-size: clamp(48px, 5vw, 72px) !important;
}

.hero-dashboard-img {
  max-width: 720px !important;
}

.hero-stats {
  flex: 0 0 110px !important;
  margin-top: 12px !important;
}

.trusted-text,
.trusted-logos {
  display: none !important;
}

/* ===== FIX: HIDE APP WHILE LANDING PAGE IS OPEN ===== */

#mainApp.locked {
  display: none !important;
}

#authScreen {
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* FIX LOGIN MODAL HIDE */
.auth-screen.hidden,
.login-box.hidden,
.app.hidden,
.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* ensure hidden really hides everything */
.hidden {
  display: none !important;
}

/* make sure the auth overlay can't block when hidden */
.auth-screen.hidden {
  display: none !important;
}

/* ===== FORCE ACCESS / ADMIN POPUPS ON TOP ===== */
#accessBox,
#adminLoginBox {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999999 !important;

  width: 360px !important;
  max-width: calc(100vw - 32px) !important;
}

#accessBox.hidden,
#adminLoginBox.hidden {
  display: none !important;
}

#landingPage {
  position: relative !important;
  z-index: 1 !important;
}

#mainApp.hidden,
#mainApp.locked {
  display: none !important;
}

#landingPage.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#mainApp:not(.hidden) {
  display: flex !important;
}

/* ============================= */
/* CLEAN RESPONSIVE APP LAYOUT */
/* no fit/full mode needed */
/* ============================= */

body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.app {
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
}

/* Normal desktop */
.dashboard-grid {
  display: grid !important;
  grid-template-columns: 300px 430px minmax(520px, 1fr) !important;
  gap: 14px !important;
  height: auto !important;
  overflow: visible !important;
}

/* Medium screen */
@media (max-width: 1250px) {
  .dashboard-grid {
    grid-template-columns: 300px minmax(420px, 1fr) !important;
  }

  .chart-panel {
    grid-column: 1 / -1 !important;
  }

  #chartContainer {
    height: 360px !important;
    min-height: 360px !important;
  }
}

/* Narrow screen */
@media (max-width: 850px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .signals-panel,
  .main-trade-panel,
  .chart-panel {
    width: 100% !important;
  }

  .symbol-card {
    min-height: 260px !important;
  }

  .main-trade-card {
    min-height: 520px !important;
  }

  #chartContainer {
    height: 340px !important;
    min-height: 340px !important;
  }

  .header-frame {
    grid-template-columns: 42px 1fr auto !important;
  }

  .brand-left {
    font-size: 18px !important;
  }

  .header {
    display: none !important;
  }
}

/* ==============================
   COMPACT SMC WHEN MOVED INSIDE MAIN CARD
============================== */
@media (max-width: 850px) {

  .main-trade-card > .structure-panel {
    height: 145px !important;
    min-height: 145px !important;
    margin: 8px 0 10px !important;
  }

  .main-trade-card > .structure-panel .structure-box {
    padding: 8px !important;
    border-radius: 14px !important;
  }

  .main-trade-card > .structure-panel .structure-grid-clean {
    grid-template-columns: 54% 46% !important;
  }

  .main-trade-card > .structure-panel .structure-title {
    font-size: 12px !important;
    margin-bottom: 2px !important;
  }

  .main-trade-card > .structure-panel .smc-svg-clean {
    height: 88px !important;
  }

  .main-trade-card > .structure-panel .structure-right {
    padding: 6px 8px !important;
    gap: 5px !important;
  }

  .main-trade-card > .structure-panel .structure-info-row {
    grid-template-columns: 72px 1fr !important;
    font-size: 11px !important;
    gap: 4px !important;
  }

  .main-trade-card > .structure-panel .structure-info-row span,
  .main-trade-card > .structure-panel .structure-info-row strong {
    font-size: 11px !important;
  }

  .main-smc-panel {
    min-height: 170px !important;
  }
}

/* ==============================
   COMPACT MAIN SMC PANEL
============================== */
@media (max-width: 850px) {

  .main-smc-panel {
    padding: 10px !important;
    min-height: auto !important;
  }

  .main-smc-panel .smc-header {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }

  .main-smc-panel .smc-row {
    padding: 4px 0 !important;
    font-size: 12px !important;
  }

  .main-smc-panel .smc-row span:first-child {
    opacity: 0.7;
  }

  .main-smc-panel .smc-row span:last-child {
    font-weight: 500;
  }

  /* tighten spacing */
  .main-smc-panel .smc-row + .smc-row {
    margin-top: 2px !important;
  }

  /* reduce vertical gaps inside panel */
  .main-smc-panel > * {
    margin-bottom: 6px !important;
  }
}

/* ==============================
   FINAL NARROW MAIN PANEL FIX
============================== */
@media (max-width: 850px) {

  /* remove price */
  #main-live-price {
    display: none !important;
  }

  /* put LIVE beside symbol */
  .main-trade-header > div {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .main-symbol {
    font-size: 22px !important;
  }

  .main-symbol-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .main-live {
    font-size: 11px !important;
    margin-left: auto !important;
  }

  /* smaller WAIT box */
  .main-signal-box {
    min-height: 46px !important;
    margin: 8px 0 !important;
  }

  #main-signal,
  .main-signal-box span {
    font-size: 28px !important;
  }

  /* smaller buy/sell/confidence */
  .main-metrics {
    margin: 8px 0 !important;
  }

  .main-metrics div {
    padding: 6px 4px 11px !important;
  }

  .main-metrics span {
    font-size: 11px !important;
  }

  .main-metrics strong {
    font-size: 17px !important;
  }

  /* compact structure panel */
  .main-trade-card > .structure-panel {
    height: 130px !important;
    min-height: 130px !important;
    margin: 8px 0 !important;
  }

  .main-trade-card > .structure-panel .structure-box {
    padding: 6px !important;
  }

  .main-trade-card > .structure-panel .smc-svg-clean {
    height: 78px !important;
  }

  .main-trade-card > .structure-panel .structure-title {
    font-size: 11px !important;
  }

  .main-trade-card > .structure-panel .structure-info-row {
    grid-template-columns: 65px 1fr !important;
    font-size: 10px !important;
    gap: 3px !important;
  }

  .main-trade-card > .structure-panel .structure-info-row span,
  .main-trade-card > .structure-panel .structure-info-row strong {
    font-size: 10px !important;
  }

  .main-trade-card > .structure-panel .structure-right {
    padding: 5px 6px !important;
    gap: 4px !important;
  }

  /* compact SMC plan */
  .main-smc-panel {
    min-height: auto !important;
    padding: 8px 10px !important;
  }

  .main-smc-panel .smc-header {
    font-size: 12px !important;
    margin-bottom: 5px !important;
  }

  .main-smc-panel .smc-row {
    padding: 3px 0 !important;
  }

  .main-smc-panel .smc-row span {
    font-size: 10.5px !important;
  }

  /* fix buy/sell covered */
  .main-buttons-row {
    margin-top: 8px !important;
    padding-bottom: 12px !important;
  }

  .main-buttons-row .glow-button {
    min-height: 36px !important;
    font-size: 13px !important;
  }

  .main-trade-card {
    overflow-y: auto !important;
    padding-bottom: 18px !important;
  }
}

/* ============================== */
/* PHONE LANDING PAGE FIX */
/* ============================== */
@media (max-width: 700px) {
  .landing-page {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    padding: 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .landing-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 28px !important;
  }

  .landing-logo {
    font-size: 22px !important;
    white-space: nowrap !important;
  }

  .landing-links {
    display: none !important;
  }

  .landing-nav-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
  }

  #landingLang {
    width: 56px !important;
    height: 34px !important;
    font-size: 12px !important;
  }

  .landing-login-btn,
  .landing-get-btn {
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
  }

  .hero-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
    text-align: left !important;
  }

  .hero-left {
    width: 100% !important;
  }

  .hero-pill {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    padding: 10px 12px !important;
    text-align: center !important;
  }

  .hero-left h1 {
    font-size: 48px !important;
    line-height: 0.95 !important;
    margin: 28px 0 18px !important;
  }

  .hero-left p {
    font-size: 16px !important;
    line-height: 1.55 !important;
    max-width: 100% !important;
  }

  .hero-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 22px !important;
  }

  .hero-primary,
  .hero-secondary {
    flex: 1 !important;
    min-height: 54px !important;
    font-size: 14px !important;
    padding: 0 10px !important;
  }

  .hero-badges {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 24px !important;
  }

  .hero-right {
    width: 100% !important;
    margin-top: 8px !important;
  }

  .hero-dashboard-img {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  .hero-stats {
    width: 100% !important;
    margin-top: 28px !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 14px !important;
  }

  .hero-stats div {
    text-align: center !important;
  }

  .trusted-text,
  .trusted-logos {
    display: none !important;
  }
}

/* ===== FINAL MOBILE FOOTER ONLY ===== */
.mobile-footer {
  display: none !important;
}

@media (max-width: 700px) {
  html,
  body,
  body.fit-mode {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  #landingPage.landing-pro {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    padding-bottom: 28px !important;
  }

  .landing-links {
    display: none !important;
  }

  .hero-dashboard-img {
    max-height: 170px !important;
    object-fit: contain !important;
  }

  .mobile-footer {
    display: flex !important;
    position: static !important;
    justify-content: center !important;
    gap: 18px !important;
    margin: 18px 0 22px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
  }

  .mobile-footer a {
    color: #4da3ff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
  }
}

@media (max-width: 700px) {
  .hero-dashboard-img {
    width: 100% !important;
    max-height: 150px !important;
    object-fit: contain !important;
  }
}

/* ===== FINAL MOBILE OVERRIDES (MASTER) ===== */
@media (max-width: 700px) {

  /* HERO STATS FIX */
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .hero-stats strong {
    font-size: 16px !important;
  }

  .hero-stats span {
    font-size: 11px !important;
    opacity: 0.7;
  }

  /* HERO IMAGE FIX */
  .hero-dashboard-img {
    max-height: 180px !important;
  }

}

/* ===== FINAL MOBILE STATS CARD WIDTH FIX ===== */
@media (max-width: 700px) {
  .hero-stats {
    width: 88% !important;
    max-width: 420px !important;
    margin: 14px auto 10px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
  }
}

.plan-buy { color: #22c55e !important; }
.plan-sell { color: #ef4444 !important; }
.plan-exit { color: #f97316 !important; }
.plan-wait { color: #f59e0b !important; }

.buy-text {
  color: #22c55e !important;
  text-shadow: 0 0 18px rgba(34,197,94,0.55);
}

.sell-text {
  color: #ef4444 !important;
  text-shadow: 0 0 18px rgba(239,68,68,0.55);
}

.wait-text {
  color: #f59e0b !important;
  text-shadow: 0 0 18px rgba(245,158,11,0.45);
}

#main-signal,
.signal-text,
.main-signal-text {
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  mix-blend-mode: normal !important;
  -webkit-text-fill-color: currentColor !important;
  background: transparent !important;
}
@media (max-width: 700px) {
  .landing-nav {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 28px 16px 16px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 10px !important;
    overflow: hidden !important;
  }

  .landing-brand-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .landing-brand {
    font-size: 26px !important;
    white-space: nowrap !important;
  }

  .landing-nav-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  #landingLang {
    width: 44px !important;
    min-width: 44px !important;
    font-size: 13px !important;
  }

  #openAdminLoginBtn {
    width: 68px !important;
    height: 42px !important;
    font-size: 14px !important;
    padding: 0 !important;
  }

  #openAccessBtn {
    width: 92px !important;
    height: 42px !important;
    font-size: 14px !important;
    padding: 0 12px !important;
  }
}
@media (max-width: 700px) {

  .hero-primary {
    font-size: 0 !important;
  }

  .hero-primary::after {
    content: "Get Access →";
    font-size: 18px;
    font-weight: 700;
  }

}

@media (max-width: 700px) {
  .landing-nav-actions #openAccessBtn {
    display: inline-flex !important;
  }

  #accessBox,
  #adminLoginBox {
    pointer-events: auto !important;
  }

  #accessBtn,
  #closeAccessBtn,
  #openAccessBtn,
  #openAccessBtnHero {
    pointer-events: auto !important;
    touch-action: manipulation;
  }
}

/* ===== PAPER MODAL WIDE + SCROLL FIX ===== */

.trade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0, 0, 0, 0.72);

  display: flex;
  align-items: flex-end;   /* attach bottom */
  justify-content: flex-start;

  padding: 0;
}

.trade-modal-box {
  width: 290px;            /* thinner like first pic */
  height: 100vh;           /* full height */
  max-width: 290px;

  background: linear-gradient(to bottom, #0c1016 0%, #090c11 100%);
  border: 1px solid #23314a;

  border-radius: 0 18px 18px 0;  /* only right side rounded */

  box-shadow:
    0 0 22px rgba(65, 92, 255, 0.16);

  padding: 16px 14px 12px;

  overflow-y: auto;
}

#paperHistoryList {
  max-height: 260px !important;
  overflow-y: auto !important;
  padding-right: 6px !important;
  overscroll-behavior: contain !important;
}

#liveHistoryList {
  max-height: 320px !important;
  height: clamp(210px, 30vh, 320px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding-right: 6px !important;
  overscroll-behavior: contain !important;
}

/* FORCE HIDDEN MODALS TO STAY HIDDEN */
.trade-modal.hidden {
  display: none !important;
}

/* ===== AUTO TRADE PANEL FINAL CLEAN ===== */
body.paper-open,
body.paper-open .app {
  overflow: hidden !important;
}

#paperModal {
  background: transparent !important;
  backdrop-filter: none !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding: 92px 0 0 14px !important;
  pointer-events: auto !important;
}

#paperModal .trade-modal-box {
  width: 420px !important;
  max-width: 420px !important;
  height: auto !important;
  max-height: calc(100vh - 110px) !important;
  overflow: hidden !important;
  margin: 0 !important;
  border-radius: 24px !important;
  border: 1px solid rgba(99,102,241,.45) !important;
  box-shadow:
    0 0 0 1px rgba(99,102,241,.18),
    0 0 28px rgba(99,102,241,.22),
    0 24px 55px rgba(0,0,0,.55) !important;
}

#paperHistoryList {
  max-height: none !important;
  overflow: visible !important;
}

#paperAutoToggleBtn {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;

  border-radius: 10px !important;

  padding: 0 !important;

  font-size: 11px !important;
  font-weight: 800 !important;

   padding: 0;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: linear-gradient(135deg,#51429d,#513898) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;

  box-shadow:
    0 0 10px rgba(124,77,255,0.35) !important;

  color: white !important;
}

#paperAutoToggleBtn::after {
  display: none !important;
}

#paperModal {
  position: fixed !important;
  inset: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
}

#paperModal .trade-modal-box {
  position: absolute !important;
  left: 14px !important;
  top: 80px !important;      /* start under market closed text */
  bottom: 0 !important;       /* touch screen bottom */

  height: auto !important;
  max-height: none !important;
  margin: 0 !important;

  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#paperHistoryList {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#paperHistoryList > div {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#paperHistoryList > div > div:last-child {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#paperHistoryList > div > div:last-child > div:last-child {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}

body.paper-open,
html.paper-open {
  overflow: hidden !important;
}

html.paper-open,
body.paper-open,
body.paper-open .app {
  overflow: hidden !important;
  height: 100vh !important;
}

html.paper-open,
body.paper-open {
  overflow: hidden !important;
  height: 100vh !important;
  overscroll-behavior: none !important;
}

body.paper-open,
html.paper-open,
body.paper-open .app {
  overflow: hidden !important;
  height: 100vh !important;
  overscroll-behavior: none !important;
}

#paperModal {
  pointer-events: auto !important;
  z-index: 999999 !important;
}

html.paper-open,
body.paper-open {
  overflow: hidden !important;
  height: 100vh !important;
  overscroll-behavior: none !important;
}

body.paper-open .app,
body.paper-open .dashboard-grid {
  overflow: hidden !important;
  height: 100vh !important;
}

#paperModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
}

#paperModal.hidden {
  display: none !important;
}

#paperModal .trade-modal-box {
  pointer-events: auto !important;
  overflow: hidden !important;
}

#paperHistoryList {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.market-data-source-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
  color: #8ea3c7;
  font-size: 10px;
  font-weight: 800;
}

.market-data-source-status span {
  border: 1px solid rgba(120, 150, 255, 0.14);
  background: rgba(15, 23, 42, 0.48);
  border-radius: 7px;
  padding: 3px 7px;
}

.market-data-source-status span.warning {
  color: #ffcf86;
  border-color: rgba(255, 184, 77, 0.24);
  background: rgba(80, 55, 18, 0.28);
}

.auto-trade-status {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 24px;
  margin: -1px 0 8px;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: #9fb3d9;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-trade-status.blocked {
  color: #ffcf86;
  border: 0;
  background: transparent;
}

.auto-trade-status.sent {
  color: #9dffbf;
  border: 0;
  background: transparent;
}

.live-auto-symbol-status {
  display: grid;
  width: 100%;
  gap: 3px;
}

.live-auto-symbol-row {
  padding: 0;
  max-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #dbeafe;
  font-size: 10px;
  font-weight: 800;
}

.auto-trade-details-toggle {
  display: none;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 10px;
  font-weight: 800;
}

.auto-trade-details-toggle summary {
  width: fit-content;
  cursor: pointer;
  color: #fde68a;
}

.auto-trade-details-toggle div {
  margin-top: 3px;
  color: #cbd5e1;
}

.live-auto-symbol-row.blocked {
  border: 0;
  background: transparent;
  color: #fecaca;
}

.live-auto-symbol-row.sent {
  border: 0;
  background: transparent;
  color: #bbf7d0;
}

.live-auto-confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 96px 16px 16px;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(8px);
  border-radius: inherit;
  overflow: hidden;
  animation: liveConfirmFade 0.18s ease both;
}

.live-auto-confirm-overlay.hidden {
  display: none !important;
}

.live-auto-confirm-card {
  width: min(340px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(129, 140, 248, 0.48);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.91));
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.14),
    0 0 28px rgba(59, 130, 246, 0.24),
    0 0 42px rgba(124, 58, 237, 0.18),
    0 20px 60px rgba(0, 0, 0, 0.62);
  padding: 16px;
  animation: liveConfirmScale 0.2s ease both;
}

.live-auto-confirm-title {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.live-auto-confirm-message {
  color: #b9c8e7;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.live-auto-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.live-auto-confirm-btn {
  min-width: 86px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
  color: #e5edf8;
  background: rgba(15, 23, 42, 0.72);
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.live-auto-confirm-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 232, 240, 0.34);
}

.live-auto-confirm-btn.confirm-on {
  color: #ecfdf5;
  border-color: rgba(34, 197, 94, 0.38);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.92), rgba(20, 184, 166, 0.76));
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.22);
}

.live-auto-confirm-btn.confirm-off {
  color: #fff7ed;
  border-color: rgba(251, 146, 60, 0.42);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(249, 115, 22, 0.78));
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.24);
}

@keyframes liveConfirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes liveConfirmScale {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.broker-connection-status {
  display: inline-flex;
  width: fit-content;
  margin: 2px 0 8px;
  border: 1px solid rgba(120, 150, 255, 0.14);
  background: rgba(15, 23, 42, 0.48);
  border-radius: 7px;
  color: #8ea3c7;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
}

.broker-connection-status.connected {
  color: #9dffbf;
  border-color: rgba(53, 255, 138, 0.24);
  background: rgba(21, 93, 52, 0.18);
}

.broker-connection-status.live {
  color: #ffcf86;
  border-color: rgba(255, 184, 77, 0.28);
  background: rgba(80, 55, 18, 0.24);
}

#liveAutoSection {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 44px;
  margin-bottom: 8px;
  padding-right: 218px;
}

#liveAutoSection .trade-modal-btn {
  flex: 0 0 auto;
}

.live-pnl-card-row {
  position: absolute;
  top: 54px;
  right: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 124px));
  gap: 8px;
}

.live-pnl-card {
  width: 100%;
  min-height: 84px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.16), transparent 58%),
    rgba(8, 13, 24, 0.88);
  box-shadow:
    inset 0 0 24px rgba(59, 130, 246, 0.08),
    0 0 22px rgba(124, 58, 237, 0.22);
  color: #dbeafe;
  text-align: center;
  font-weight: 900;
  line-height: 1;
}

.live-pnl-card strong,
.live-pnl-card small {
  display: block;
}

.live-pnl-card strong {
  color: #60a5fa;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.live-pnl-card strong.positive {
  color: #22c55e;
}

.live-pnl-card strong.negative {
  color: #ef4444;
}

.live-pnl-card small {
  margin-bottom: 10px;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 460px) {
  #liveAutoSection {
    padding-right: 178px;
  }

  .live-pnl-card-row {
    right: 12px;
    grid-template-columns: repeat(2, minmax(94px, 1fr));
    gap: 6px;
  }

  .live-pnl-card {
    min-height: 76px;
    padding: 12px 7px;
  }

  .live-pnl-card strong {
    font-size: clamp(15px, 4.5vw, 20px);
  }

  .live-pnl-card small {
    font-size: 9px;
  }
}

.live-active-orders {
  margin-top: 5px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(148,163,184,.14);
}

.live-active-title {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.live-active-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.live-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 4px;
}

.live-stats-row span {
  min-width: 0;
  border-radius: 12px;
  font-weight: 900;
  padding: 7px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.live-stats-row strong,
.live-stats-row small {
  display: block;
}

.live-stats-row strong {
  font-size: 16px;
  line-height: 1;
}

.live-stats-row small {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 800;
}

.live-win-stat {
  color: #22c55e;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.35);
}

.live-loss-stat {
  color: #ef4444;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.35);
}

.live-running-stat {
  color: #facc15;
  background: rgba(250,204,21,.12);
  border: 1px solid rgba(250,204,21,.35);
}

.live-total-stat {
  color: #60a5fa;
  background: rgba(96,165,250,.12);
  border: 1px solid rgba(96,165,250,.35);
}

.live-total-stat.positive {
  color: #22c55e;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.35);
}

.live-total-stat.negative {
  color: #ef4444;
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
}

.trade-history-item,
.live-active-item {
  display: block;
  padding: 0;
  overflow: hidden;
}

.live-active-item {
  margin-bottom: 5px;
  border-radius: 12px;
  background: rgba(30,41,59,.70);
  border: 1px solid rgba(148,163,184,.16);
  font-size: 11px;
  font-weight: 700;
}

.live-active-details {
  width: 100%;
}

.live-active-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 7px;
  cursor: pointer;
  list-style: none;
}

.live-symbol-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 5px 7px;
  gap: 8px;
}

.live-active-item.blocked {
  border-left: 3px solid #f59e0b;
}

.live-active-item.blocked {
  background: rgba(120, 83, 18, .20);
  border-color: rgba(245, 158, 11, .35);
}

.live-blocked-pill {
  color: #facc15;
  background: rgba(250,204,21,.14);
  border: 1px solid rgba(250,204,21,.30);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.live-blocked-reason-inline {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fde68a;
  font-size: 9px;
  font-weight: 800;
}

.live-active-item.running {
  border-left: 3px solid #35ff8a;
}

.live-active-item.closed {
  border-left: 3px solid #94a3b8;
}

.live-active-item .live-side {
  max-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.live-status-reason {
  display: block;
  max-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8ea3c7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.live-active-summary::-webkit-details-marker {
  display: none;
}

.live-compact-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  color: #9fb3d9;
  font-size: 10px;
  font-weight: 900;
}

.live-compact-meta span {
  border: 1px solid rgba(120, 150, 255, 0.12);
  background: rgba(2, 6, 23, 0.25);
  border-radius: 7px;
  padding: 3px 6px;
}

.live-expand-arrow {
  min-width: 20px;
  text-align: center;
  color: #7aa2ff;
  transition: transform 0.18s ease;
}

.live-active-details[open] .live-expand-arrow {
  transform: rotate(180deg);
}

.live-expanded-body {
  padding: 0 9px 7px;
}

.live-target-prices {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
}

.live-target-prices b:first-child {
  color: #facc15;
}

.live-target-prices b:last-child {
  color: #4ade80;
}

.trade-history-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(30,41,59,.70);
  font-size: 12px;
  font-weight: 700;
}

.trade-history-item {
  margin-bottom: 5px;
  border: 1px solid rgba(148,163,184,.16);
}

.live-history-details {
  display: block;
}

.live-history-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.live-history-summary::-webkit-details-marker {
  display: none;
}

.live-active-item.buy {
  border-left: 3px solid #35ff8a;
}

.live-active-item.sell {
  border-left: 3px solid #ff5f5f;
}

.live-empty {
  padding: 14px 12px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.78));
  border: 1px solid rgba(120, 150, 255, 0.16);
  box-shadow: inset 0 0 22px rgba(59, 130, 246, 0.08);
  color: #dbeafe;
}

.live-empty-title {
  font-size: 12px;
  font-weight: 900;
  color: #f8fafc;
}

.live-empty-subtitle {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  color: #8ea3c7;
  font-weight: 700;
}

.live-symbol,
.live-status {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.live-side {
  display: block;
  margin-top: 3px;
  color: #8ea3c7;
  font-size: 11px;
}

.live-active-main {
  min-width: 0;
  flex: 1;
  max-height: 45px;
  overflow: hidden;
}

.live-paper-section {
  margin-top: 5px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(148,163,184,.14);
  height: 100%;
  min-height: 0;
}

.live-recent-scroll {
  max-height: none;
  height: calc(100% - 18px);
  min-height: 170px;
  overflow-y: auto !important;
  padding-right: 3px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
}

.live-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  margin-bottom: 8px;
  max-width: 100%;
}

.live-detail-grid span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid rgba(120, 150, 255, 0.12);
  background: rgba(2, 6, 23, 0.28);
  border-radius: 7px;
  color: #b8c7e6;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  padding: 4px 6px;
}

.live-status {
  color: #7aa2ff;
}

.live-pnl {
  color: #9fb3d9;
}

.live-pnl.positive {
  color: #9dffbf;
}

.live-pnl.negative {
  color: #ff9a9a;
}

.live-meta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: #8ea3c7;
  font-size: 11px;
  font-weight: 700;
}

.live-source-badge {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.live-close-button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.64);
  color: #cbd5e1;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.live-close-button:hover {
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.34);
}

@media (max-width: 560px) {
  .live-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-history-item,
  .live-active-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .live-meta-stack {
    align-items: flex-start;
  }

  .live-auto-confirm-overlay {
    padding: 88px 12px 12px;
    align-items: flex-start;
  }

  .live-auto-confirm-card {
    width: min(100%, 320px);
    padding: 14px;
  }

  .live-auto-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.execution-page-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(120, 150, 255, 0.16);
}

.execution-page-btn {
  flex: 1;
  border: 0;
  border-radius: 11px;
  padding: 9px 12px;
  background: transparent;
  color: #93a4c7;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.execution-page-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.9));
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

@media (max-width: 700px) {

  #paperModal {
    padding: 70px 8px 14px !important;
    align-items: flex-start !important;
  }

  #paperModal .trade-modal-box {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;

    max-height: calc(100dvh - 90px) !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    border-radius: 18px !important;

    padding: 16px !important;
  }

  #paperModal .paper-stats-grid,
  #paperModal .auto-stats,
  #paperModal .paper-stats,
  #paperModal .live-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  #paperModal .paper-trade-card,
  #paperModal .live-trade-card,
  #paperModal .trade-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

@media (max-width: 700px) {
  #paperModal .active-strategies,
  #paperModal .paper-active-box,
  #paperModal .active-strategy-box {
    max-height: 310px !important;
    overflow-y: auto !important;
  }

  #paperModal .recent-trades,
  #paperModal .recent-trades-box,
  #paperModal .paper-history-box {
    min-height: 230px !important;
    max-height: 260px !important;
    overflow-y: auto !important;
  }

  #paperModal .paper-stats-grid {
    margin: 14px 0 !important;
  }
}

/* Live Auto compact active cards + tall recent history override */
#paperModal .trade-modal-box {
  display: flex !important;
  flex-direction: column !important;
}

#liveActiveList {
  flex: 0 0 auto !important;
}

#liveHistoryList {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 220px !important;
  max-height: none !important;
  overflow: hidden !important;
}

#liveHistoryList .live-paper-section {
  height: 100% !important;
  min-height: 0 !important;
}

#liveHistoryList .live-recent-scroll {
  height: calc(100% - 18px) !important;
  min-height: 190px !important;
  max-height: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Absolute final Broker Accounts placement override */
#brokerAccountsModal.trade-modal.broker-settings-modal {
  padding-top: 76px !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
  overflow-y: auto !important;
}

#brokerAccountsModal .broker-settings-shell {
  min-height: calc(100dvh - 76px) !important;
}

#brokerAccountsModal .broker-settings-content {
  padding-top: 22px !important;
}

#brokerAccountsModal .broker-settings-topbar {
  display: none !important;
}

#brokerAccountsModal .broker-settings-header {
  padding-top: 0 !important;
}

#brokerAccountsModal .broker-account-table {
  min-width: 720px !important;
}

#brokerAccountsModal .broker-account-table th,
#brokerAccountsModal .broker-account-table td {
  padding-left: 9px !important;
  padding-right: 9px !important;
}

#brokerAccountsModal .broker-account-table th:nth-child(8),
#brokerAccountsModal .broker-account-table td:nth-child(8) {
  width: 12% !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#brokerAccountsModal .broker-active-pill {
  display: inline-flex !important;
  max-width: none !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
}

/* Absolute final dashboard menu drawer and P/L spacing override */
body.fit-mode .app:not(.locked).menu-drawer-open::after {
  content: "" !important;
  position: fixed !important;
  inset: 164px 0 0 0 !important;
  z-index: 1190 !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu.hidden {
  display: none !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu:not(.hidden) {
  display: block !important;
  position: fixed !important;
  top: 164px !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 250px !important;
  height: calc(100dvh - 164px) !important;
  max-height: none !important;
  border: 0 !important;
  border-right: 1px solid #1b2a3b !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.42) !important;
  overflow-y: auto !important;
  z-index: 1300 !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner {
  min-height: calc(100dvh - 164px) !important;
  align-items: stretch !important;
  gap: 9px !important;
  padding: 28px 12px 18px !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner::before {
  content: "≋  FlowSignal" !important;
  display: block !important;
  margin: 0 12px 36px !important;
  color: #f4f7fb !important;
  font-size: 29px !important;
  font-weight: 900 !important;
}

body.fit-mode .app:not(.locked) > .performance-strip {
  margin: 12px 0 10px 190px !important;
  width: min(1040px, calc(100% - 310px)) !important;
  max-width: calc(100% - 310px) !important;
}

body.fit-mode .app:not(.locked) > .topbar {
  position: absolute !important;
  display: flex !important;
  top: 70px !important;
  left: 16px !important;
  width: 178px !important;
  padding: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  z-index: 30 !important;
}

body.fit-mode .app:not(.locked) > .topbar .controls {
  display: none !important;
}

body.fit-mode .app:not(.locked) > .topbar .status {
  min-width: 178px !important;
  max-width: 178px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
}

body.fit-mode .app:not(.locked) > .dashboard-grid {
  height: calc(100vh - 148px) !important;
  padding-top: 0 !important;
}

body.fit-mode .app.menu-drawer-open #settingsModal,
body.fit-mode .app.menu-drawer-open #statsModal,
body.fit-mode .app.menu-drawer-open #assistantModal {
  padding: 164px 24px 24px 250px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode .app.menu-drawer-open #settingsModal .trade-modal-box,
body.fit-mode .app.menu-drawer-open #statsModal .trade-modal-box,
body.fit-mode .app.menu-drawer-open #assistantModal .trade-modal-box {
  width: calc(100vw - 300px) !important;
  max-width: none !important;
  min-height: calc(100dvh - 164px) !important;
  max-height: calc(100dvh - 164px) !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  overflow-y: auto !important;
}

body.fit-mode .app.menu-drawer-open > #sideMenu.side-menu:not(.hidden) {
  z-index: 10020 !important;
}

/* Absolute final dashboard menu drawer and P/L spacing override */
body.fit-mode .app:not(.locked).menu-drawer-open::after {
  content: "" !important;
  position: fixed !important;
  inset: 164px 0 0 0 !important;
  z-index: 1190 !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu.hidden {
  display: none !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu:not(.hidden) {
  display: block !important;
  position: fixed !important;
  top: 164px !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 250px !important;
  height: calc(100dvh - 164px) !important;
  max-height: none !important;
  border: 0 !important;
  border-right: 1px solid #1b2a3b !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.42) !important;
  overflow-y: auto !important;
  z-index: 1300 !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner {
  min-height: calc(100dvh - 164px) !important;
  align-items: stretch !important;
  gap: 9px !important;
  padding: 28px 12px 18px !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner::before {
  content: "≋  FlowSignal" !important;
  display: block !important;
  margin: 0 12px 36px !important;
  color: #f4f7fb !important;
  font-size: 29px !important;
  font-weight: 900 !important;
}

body.fit-mode .app:not(.locked) > .performance-strip {
  margin: 12px 0 10px 190px !important;
  width: calc(100% - 190px) !important;
  max-width: none !important;
}

body.fit-mode .app:not(.locked) > .topbar {
  position: absolute !important;
  display: flex !important;
  top: 70px !important;
  left: 16px !important;
  width: 178px !important;
  padding: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  z-index: 30 !important;
}

body.fit-mode .app:not(.locked) > .dashboard-grid {
  height: calc(100vh - 148px) !important;
  padding-top: 0 !important;
}

/* Final dashboard drawer + top bar spacing fix */
body.fit-mode .app:not(.locked) {
  padding: 0 16px 10px !important;
}

body.fit-mode .app:not(.locked).menu-drawer-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(0, 0, 0, 0.58);
}

body.fit-mode .app:not(.locked) > .side-menu.hidden {
  display: none !important;
}

body.fit-mode .app:not(.locked) > .side-menu:not(.hidden) {
  display: block !important;
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: 250px !important;
  max-height: none !important;
  height: 100dvh !important;
  border: 0 !important;
  border-right: 1px solid #1b2a3b !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.42) !important;
  overflow-y: auto !important;
  z-index: 1300 !important;
}

body.fit-mode .app:not(.locked) .side-menu-inner {
  min-height: 100dvh !important;
  align-items: stretch !important;
  gap: 9px !important;
  padding: 28px 12px 18px !important;
}

body.fit-mode .app:not(.locked) .side-menu-inner::before {
  content: "≋  FlowSignal";
  display: block;
  margin: 0 12px 36px;
  color: #f4f7fb;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 0;
}

body.fit-mode .app:not(.locked) .menu-row {
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  color: #dce6f3 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  gap: 14px !important;
}

body.fit-mode .app:not(.locked) .menu-row:hover,
body.fit-mode .app:not(.locked) #menuSettingsBtn {
  background: rgba(30, 185, 102, 0.16) !important;
  color: #62f27b !important;
}

body.fit-mode .app:not(.locked) .menu-submenu {
  margin: 4px 0 0 28px !important;
  padding: 0 0 0 12px !important;
  border-left: 1px solid #183042 !important;
}

body.fit-mode .app:not(.locked) .menu-subrow {
  min-height: 38px !important;
  padding: 0 14px !important;
  color: #d3dde9 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

body.fit-mode .app:not(.locked) #menuBrokerAccountsBtn {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #6cf581 !important;
}

body.fit-mode .app:not(.locked) .menu-logout-row {
  margin-top: auto !important;
  color: #ff646b !important;
}

body.fit-mode .app:not(.locked) .menu-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.fit-mode .app:not(.locked) .brand-left {
  visibility: visible !important;
}

body.fit-mode .app:not(.locked) > .header-frame,
body.fit-mode .app:not(.locked) > .topbar,
body.fit-mode .app:not(.locked) > .performance-strip,
body.fit-mode .app:not(.locked) > .dashboard-grid {
  margin-left: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.fit-mode .app:not(.locked) > .header-frame {
  position: relative !important;
  z-index: 20 !important;
}

body.fit-mode .app:not(.locked) > .performance-strip {
  margin: 12px 0 10px !important;
  width: 100% !important;
  max-width: none !important;
}

body.fit-mode .app:not(.locked) > .topbar {
  position: static !important;
  display: flex !important;
  padding: 0 0 12px !important;
  min-height: 0 !important;
  margin: 0 !important;
  z-index: 1 !important;
}

body.fit-mode .app:not(.locked) > .topbar .status {
  min-width: 178px !important;
  max-width: 178px !important;
}

body.fit-mode .app:not(.locked) > .dashboard-grid {
  height: calc(100vh - 178px) !important;
  padding: 0 0 6px !important;
}

.frontend-error-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 85, 99, 0.55);
  border-radius: 8px;
  background: rgba(10, 16, 24, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  color: #e9eef7;
  font-size: 13px;
}

.frontend-error-panel.hidden {
  display: none;
}

.frontend-error-panel strong {
  color: #ff6672;
  font-size: 14px;
}

.frontend-error-panel span {
  color: #b7c3d3;
  overflow-wrap: anywhere;
}

.frontend-error-panel button {
  justify-self: start;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #263446;
  border-radius: 7px;
  background: #111a27;
  color: #f5f8ff;
  font-weight: 800;
  cursor: pointer;
}

.health-page {
  min-height: 100dvh;
  background: #050a10;
  color: #f5f8ff;
}

.health-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.health-shell h1 {
  margin: 0 0 18px;
  font-size: 30px;
  letter-spacing: 0;
}

.health-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #1b2a3c;
  border-radius: 8px;
  background: #09111c;
}

.health-card > div {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) 1fr;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #132234;
}

.health-card > div:last-child {
  border-bottom: 0;
}

.health-card strong {
  color: #9bb7d8;
}

.health-card span {
  color: #5df082;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .health-card > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Final main navigation: use the Broker Accounts sidebar style everywhere */
@media (min-width: 901px) {
  body.fit-mode .app:not(.locked) {
    padding: 0 16px 10px 0 !important;
  }

  body.fit-mode .app:not(.locked) > .side-menu,
  body.fit-mode .app:not(.locked) > .side-menu.hidden {
    display: block !important;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 250px !important;
    max-height: none !important;
    border: 0 !important;
    border-right: 1px solid #1b2a3b !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    overflow-y: auto !important;
    z-index: 1200 !important;
  }

  body.fit-mode .app:not(.locked) .side-menu-inner {
    min-height: 100dvh !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 24px 12px 18px !important;
  }

  body.fit-mode .app:not(.locked) .side-menu-inner::before {
    content: "≋  FlowSignal";
    display: block;
    margin: 4px 12px 36px;
    color: #f4f7fb;
    font-size: 29px;
    font-weight: 900;
    letter-spacing: 0;
  }

  body.fit-mode .app:not(.locked) .menu-row {
    min-height: 42px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    color: #dce6f3 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    gap: 14px !important;
  }

  body.fit-mode .app:not(.locked) .menu-row:hover,
  body.fit-mode .app:not(.locked) #menuSettingsBtn {
    background: rgba(30, 185, 102, 0.16) !important;
    color: #62f27b !important;
  }

  body.fit-mode .app:not(.locked) .menu-row-icon {
    width: 18px !important;
    font-size: 14px !important;
    color: inherit !important;
  }

  body.fit-mode .app:not(.locked) .menu-settings-group {
    margin-top: 8px !important;
  }

  body.fit-mode .app:not(.locked) .menu-submenu {
    position: relative;
    margin: 4px 0 0 28px !important;
    padding: 0 0 0 12px !important;
    border-left: 1px solid #183042 !important;
    gap: 0 !important;
  }

  body.fit-mode .app:not(.locked) .menu-subrow {
    min-height: 38px !important;
    padding: 0 14px !important;
    color: #d3dde9 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
  }

  body.fit-mode .app:not(.locked) .menu-subrow:hover,
  body.fit-mode .app:not(.locked) #menuBrokerAccountsBtn {
    background: rgba(34, 197, 94, 0.14) !important;
    color: #6cf581 !important;
  }

  body.fit-mode .app:not(.locked) .menu-logout-row {
    margin-top: auto !important;
    color: #ff646b !important;
  }

  body.fit-mode .app:not(.locked) > .header-frame,
  body.fit-mode .app:not(.locked) > .topbar,
  body.fit-mode .app:not(.locked) > .performance-strip,
  body.fit-mode .app:not(.locked) > .dashboard-grid {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    box-sizing: border-box !important;
  }

  body.fit-mode .app:not(.locked) > .header-frame {
    border-left: 0 !important;
    border-radius: 0 !important;
  }

  body.fit-mode .app:not(.locked) .menu-toggle {
    display: none !important;
  }

  body.fit-mode .app:not(.locked) .brand-left {
    visibility: hidden !important;
  }

  body.fit-mode .app:not(.locked) > .performance-strip {
    max-width: none !important;
  }
}

.broker-settings-subnav button {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #d3dde9;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.broker-settings-subnav button:hover {
  color: #6cf581;
}

/* 2026-06-17: menu returns to button-open popover, not pinned sidebar */
@media (min-width: 901px) {
  body.fit-mode .app:not(.locked) {
    padding: 0 16px 10px !important;
  }

  body.fit-mode .app:not(.locked) > .side-menu.hidden {
    display: none !important;
  }

  body.fit-mode .app:not(.locked) > .side-menu:not(.hidden) {
    display: block !important;
    position: fixed !important;
    top: 92px !important;
    left: 14px !important;
    bottom: auto !important;
    width: 250px !important;
    max-height: calc(100dvh - 110px) !important;
    border: 1px solid #1b2a3b !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(10, 18, 29, 0.98), rgba(5, 8, 13, 0.98)) !important;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48) !important;
    overflow-y: auto !important;
    z-index: 1200 !important;
  }

  body.fit-mode .app:not(.locked) .side-menu-inner {
    min-height: 0 !important;
    padding: 18px 12px !important;
    gap: 8px !important;
  }

  body.fit-mode .app:not(.locked) .side-menu-inner::before {
    content: "≋  FlowSignal";
    display: block;
    margin: 0 10px 22px;
    color: #f4f7fb;
    font-size: 25px;
    font-weight: 900;
  }

  body.fit-mode .app:not(.locked) > .header-frame,
  body.fit-mode .app:not(.locked) > .topbar,
  body.fit-mode .app:not(.locked) > .performance-strip,
  body.fit-mode .app:not(.locked) > .dashboard-grid {
    margin-left: 0 !important;
    width: 100% !important;
  }

  body.fit-mode .app:not(.locked) .menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.fit-mode .app:not(.locked) .brand-left {
    visibility: visible !important;
  }
}

.settings-modal-box {
  width: min(96vw, 1480px) !important;
  max-width: 1480px !important;
  border-radius: 10px !important;
}

#riskSettingsPanel {
  color: #eef2f8;
}

#riskSettingsPanel .settings-modal-header,
.risk-pro-alert {
  margin-bottom: 18px;
}

.risk-pro-alert {
  padding: 18px 22px;
  border: 1px solid rgba(126, 75, 255, 0.35);
  border-radius: 8px;
  background: rgba(75, 39, 155, 0.16);
  color: #bd96ff;
  font-weight: 800;
}

.risk-pro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
}

.risk-pro-card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid #1d2a3a;
  border-radius: 8px;
  background: linear-gradient(145deg, #0d1623, #07101b);
}

.risk-pro-card h3 {
  margin: 0 0 8px;
  font-size: 23px;
}

.risk-pro-card p,
.risk-pro-card small {
  color: #aebbd0;
  font-weight: 700;
}

.risk-stepper {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  margin: 22px 0;
  border: 1px solid #1d2a3a;
  border-radius: 7px;
  overflow: hidden;
}

.risk-stepper button,
.risk-stepper input {
  height: 66px;
  border: 0;
  border-right: 1px solid #1d2a3a;
  background: #070d15;
  color: #f7f9fd;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
}

.risk-stepper button:last-child {
  border-right: 0;
}

.risk-stepper input {
  font-size: 30px;
}

.risk-bar {
  height: 7px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #172233;
}

.risk-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7b3ff2, #9b5cff);
}

.risk-pro-extra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.risk-pro-extra label {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-weight: 800;
}

.risk-pro-extra input,
.risk-pro-extra select {
  min-height: 44px;
  border: 1px solid #263446;
  border-radius: 8px;
  background: #08111d;
  color: #f8fbff;
  padding: 0 12px;
}

.risk-pro-actions,
.assistant-pro-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #1a2738;
}

.risk-pro-actions button,
.assistant-pro-actions button {
  min-height: 56px;
  padding: 0 26px;
  border: 1px solid #243246;
  border-radius: 8px;
  background: #0b1422;
  color: #f7f9fd;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

#riskSaveBtn,
.assistant-save-btn {
  background: linear-gradient(135deg, #6d28d9, #7c3aed) !important;
  border-color: #7c3aed !important;
}

.performance-modal-box {
  width: min(96vw, 1420px) !important;
  max-width: 1420px !important;
  max-height: calc(100dvh - 34px) !important;
  overflow-y: auto !important;
  border-radius: 10px !important;
}

.performance-pro-head,
.assistant-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.performance-pro-title,
.assistant-pro-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.performance-pro-title > span,
.assistant-pro-title > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.18);
  color: #9b5cff;
  font-size: 24px;
}

.performance-pro-title p,
.assistant-pro-title p {
  margin: 4px 0 0;
  color: #aebbd0;
  font-weight: 700;
}

.performance-pro-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.performance-pro-actions span {
  border: 1px solid #1e2a3b;
  border-radius: 8px;
  padding: 10px 14px;
  color: #d6deeb;
}

.performance-pro-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.performance-metric {
  min-height: 130px;
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #1d2a3a;
  border-radius: 8px;
  background: linear-gradient(145deg, #0d1623, #07101b);
}

.performance-metric span,
.performance-metric small {
  display: block;
  color: #b5c0d0;
  font-weight: 800;
}

.performance-metric strong {
  display: block;
  margin: 8px 0 12px;
  font-size: 27px;
}

.performance-metric i {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: 26px;
  border-radius: 50%;
  opacity: 0.65;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

.performance-metric.green strong,
.performance-metric.green { color: #3ee86f; }
.performance-metric.blue strong,
.performance-metric.blue { color: #3b82f6; }
.performance-metric.red strong,
.performance-metric.red { color: #ff4d57; }
.performance-metric.amber strong,
.performance-metric.amber { color: #f59e0b; }
.performance-metric.purple strong,
.performance-metric.purple { color: #a855f7; }

.performance-pro-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.performance-pro-panel {
  border: 1px solid #1d2a3a;
  border-radius: 8px;
  padding: 16px;
  background: #08111d;
}

.performance-pro-panel h3 {
  margin: 0 0 14px;
  text-transform: uppercase;
}

.performance-pro-panel div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #172437;
  border-radius: 8px;
  color: #dbe6f4;
}

.performance-pro-panel div + div {
  margin-top: 8px;
}

#assistantModal {
  padding: 70px 20px 20px !important;
}

#assistantModal .assistant-modal-box {
  width: min(1120px, calc(100vw - 42px)) !important;
  max-width: 1120px !important;
  max-height: calc(100dvh - 92px) !important;
  overflow-y: auto !important;
  border-radius: 10px !important;
}

.assistant-pro-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.25fr;
  gap: 12px;
}

.assistant-pro-card {
  border: 1px solid #1d2a3a !important;
  border-radius: 8px !important;
  background: linear-gradient(145deg, #0d1623, #07101b) !important;
  padding: 16px !important;
}

.assistant-behavior-card,
.assistant-advanced-card {
  grid-column: span 1;
}

.assistant-trigger-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #172437;
  color: #dce6f3;
  font-weight: 800;
}

.assistant-trigger-card input {
  width: 42px;
  height: 22px;
  accent-color: #7c3aed;
}

.assistant-preview {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #1d2a3a;
  border-radius: 8px;
  background: #0a1421;
  color: #cbd5e1;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .risk-pro-grid,
  .performance-pro-grid,
  .assistant-pro-grid,
  .performance-pro-panels,
  .risk-pro-extra {
    grid-template-columns: 1fr !important;
  }
}

/* Navigation + Settings organization */
.side-menu-inner {
  min-height: 100%;
  display: flex !important;
  flex-direction: column !important;
}

.menu-settings-group {
  display: grid;
  gap: 4px;
}

.menu-row-caret {
  margin-left: auto;
  color: #7dd3fc;
}

.menu-submenu {
  display: grid;
  gap: 3px;
  padding: 4px 0 8px 34px;
}

.menu-submenu.hidden {
  display: none !important;
}

.menu-subrow {
  min-height: 33px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.menu-subrow:hover {
  background: rgba(34, 197, 94, 0.12);
  color: #6ee785;
}

.menu-logout-row {
  margin-top: auto !important;
  color: #ff646b !important;
}

.settings-modal-box {
  max-width: 880px !important;
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(8, 14, 23, 0.86);
  color: #e5e7eb;
  font-size: 24px;
  cursor: pointer;
}

.settings-panel.hidden {
  display: none !important;
}

.settings-grid,
.risk-settings-grid,
.performance-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid label,
.risk-settings-grid label,
.performance-settings-grid div,
.settings-placeholder {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 14, 23, 0.72);
  color: #e5e7eb;
  padding: 13px 14px;
  font-weight: 800;
}

.settings-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.risk-settings-grid label {
  display: grid;
  gap: 8px;
}

.risk-settings-grid input,
.risk-settings-grid select,
.feedback-type-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #07111c;
  color: #f8fafc;
  padding: 10px 11px;
  font-weight: 800;
}

.notification-settings-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(8, 14, 23, 0.72);
  color: #e5e7eb;
  padding: 16px;
}

.notification-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.notification-toggle-row span {
  display: grid;
  gap: 5px;
}

.notification-toggle-row strong {
  color: #f8fafc;
  font-size: 15px;
}

.notification-toggle-row small,
#notificationPermissionStatus {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.notification-toggle-row input {
  width: 46px;
  height: 24px;
  accent-color: #22c55e;
  flex: 0 0 auto;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notification-actions button {
  min-height: 34px;
  border: 1px solid rgba(34, 197, 94, 0.55);
  border-radius: 8px;
  background: rgba(20, 83, 45, 0.26);
  color: #86efac;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.settings-inline {
  grid-template-columns: auto 1fr !important;
  display: flex !important;
  align-items: center;
}

.settings-note {
  margin-top: 12px;
  color: #9ca3af;
  font-size: 13px;
}

.performance-modal-box {
  max-width: 900px !important;
}

.performance-settings-grid {
  margin-bottom: 16px;
}

.performance-settings-grid span {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 6px;
}

.performance-settings-grid strong {
  color: #f8fafc;
  font-size: 18px;
}

.feedback-type-select {
  margin-bottom: 12px;
}

body.hide-weekly-pnl .performance-weekly,
body.hide-monthly-pnl .performance-monthly,
body.hide-floating-pnl .performance-floating,
body.hide-manual-trade-buttons .main-buttons-row,
body.hide-open-trades-counter .performance-trades,
body.hide-market-structure-ui .structure-panel,
body.hide-recent-history-ui .history-section {
  display: none !important;
}

/* Final desktop spacing fix: let the middle trade card grow instead of trapping SMC in a tiny scroll area. */
.main-trade-card,
body.fit-mode .main-trade-card {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.main-trade-panel,
body.fit-mode .main-trade-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

body.fit-mode .entry-strategy-debug,
.entry-strategy-debug {
  min-height: 178px !important;
  margin-bottom: 18px !important;
  overflow: hidden !important;
}

body.fit-mode .entry-strategy-debug-grid,
.entry-strategy-debug-grid {
  row-gap: 5px !important;
}

body.fit-mode #strategy-debug-block-reason,
#strategy-debug-block-reason {
  display: block !important;
  min-height: 30px !important;
  max-height: 38px !important;
  overflow: hidden !important;
}

body.fit-mode .main-bottom-row,
.main-bottom-row {
  margin-top: 16px !important;
  flex: 0 0 auto !important;
}

/* Restore SMC Plan horizontal detail layout. */
.smc-intel-grid,
body.fit-mode .smc-intel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.smc-intel-levels,
body.fit-mode .smc-intel-levels {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.smc-intel-section ul,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  min-width: 0 !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
.smc-intel-section li span,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong,
body.fit-mode .smc-intel-section li span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Stretch SMC Plan into the available middle-column space after all overrides. */
.main-trade-card,
body.fit-mode .main-trade-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  overflow-y: auto !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  flex: 1 1 auto !important;
  min-height: 560px !important;
  height: auto !important;
  overflow: visible !important;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  flex: 0 0 auto !important;
  margin-top: 18px !important;
}

/* Stretch SMC Plan into the available middle-column space. */
.main-trade-card,
body.fit-mode .main-trade-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  overflow-y: auto !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  flex: 1 1 auto !important;
  min-height: 560px !important;
  height: auto !important;
  overflow: visible !important;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  flex: 0 0 auto !important;
  margin-top: 18px !important;
}

/* Absolute final override for the narrow SMC Plan card. */
.main-trade-card,
body.fit-mode .main-trade-card {
  justify-content: flex-start !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 18px !important;
  padding-bottom: 14px !important;
}

.smc-plan-intel,
body.fit-mode .smc-plan-intel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.smc-intel-grid,
.smc-intel-levels,
.smc-intel-section ul,
body.fit-mode .smc-intel-grid,
body.fit-mode .smc-intel-levels,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: 1fr !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  min-width: 0 !important;
  overflow: hidden !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
.smc-intel-section li span,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong,
body.fit-mode .smc-intel-section li span {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.18 !important;
  max-height: none !important;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  clear: both !important;
  margin-top: 18px !important;
}

/* Absolute final override for the narrow SMC Plan card. */
.main-trade-card,
body.fit-mode .main-trade-card {
  justify-content: flex-start !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 18px !important;
  padding-bottom: 14px !important;
}

.smc-plan-intel,
body.fit-mode .smc-plan-intel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.smc-intel-grid,
.smc-intel-levels,
.smc-intel-section ul,
body.fit-mode .smc-intel-grid,
body.fit-mode .smc-intel-levels,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: 1fr !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  min-width: 0 !important;
  overflow: hidden !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
.smc-intel-section li span,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong,
body.fit-mode .smc-intel-section li span {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.18 !important;
  max-height: none !important;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  clear: both !important;
  margin-top: 18px !important;
}

/* Final SMC intelligence overlap fix: narrow dashboard column must stack safely. */
.main-trade-card,
body.fit-mode .main-trade-card {
  justify-content: flex-start !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  gap: 0 !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 18px !important;
  padding-bottom: 14px !important;
}

.smc-plan-intel,
body.fit-mode .smc-plan-intel {
  overflow: visible !important;
}

.smc-intel-grid,
.smc-intel-levels,
body.fit-mode .smc-intel-grid,
body.fit-mode .smc-intel-levels {
  grid-template-columns: 1fr !important;
  gap: 7px !important;
}

.smc-intel-section ul,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: 1fr !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  padding: 8px 9px !important;
  overflow: hidden !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
.smc-intel-section li span,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong,
body.fit-mode .smc-intel-section li span {
  display: block !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.18 !important;
  max-height: none !important;
}

.smc-intel-section li,
body.fit-mode .smc-intel-section li {
  min-width: 0 !important;
  align-items: flex-start !important;
}

.smc-intel-progress,
body.fit-mode .smc-intel-progress {
  margin-bottom: 0 !important;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  clear: both !important;
  margin-top: 18px !important;
}

/* SMC Plan intelligence layout: grow naturally and never overlap checks below. */
.main-smc-panel,
body.fit-mode .main-smc-panel {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  flex: 0 0 auto !important;
  margin-bottom: 16px !important;
  padding-bottom: 12px !important;
}

.main-smc-panel .smc-row {
  min-height: auto !important;
}

.smc-plan-intel,
body.fit-mode .smc-plan-intel {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 10px !important;
  padding-top: 10px !important;
}

.smc-intel-grid,
.smc-intel-levels,
body.fit-mode .smc-intel-grid,
body.fit-mode .smc-intel-levels {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  align-items: stretch !important;
}

.smc-intel-levels,
body.fit-mode .smc-intel-levels {
  grid-template-columns: 1fr !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong {
  min-width: 0 !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: anywhere !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.4em !important;
}

.smc-intel-section ul,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: 1fr !important;
  gap: 5px 8px !important;
}

.smc-intel-section li,
body.fit-mode .smc-intel-section li {
  align-items: flex-start !important;
  min-width: 0 !important;
}

.smc-intel-section li span,
body.fit-mode .smc-intel-section li span {
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: anywhere !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.entry-strategy-debug,
body.fit-mode .entry-strategy-debug {
  position: relative !important;
  clear: both !important;
  flex: 0 0 auto !important;
  margin-top: 16px !important;
  overflow: hidden !important;
}

@media (max-width: 520px) {
  .smc-intel-grid,
  .smc-intel-levels,
  .smc-intel-section ul,
  body.fit-mode .smc-intel-grid,
  body.fit-mode .smc-intel-levels,
  body.fit-mode .smc-intel-section ul {
    grid-template-columns: 1fr !important;
  }
}

/* NEWS IMPACT replaces the chart-area Market Structure card. */
body.hide-market-structure-ui .news-impact-panel {
  display: none !important;
}

.news-impact-panel,
body.fit-mode .news-impact-panel {
  min-height: 430px !important;
  height: auto !important;
  margin-top: 10px !important;
}

.news-impact-card {
  height: auto;
  min-height: 430px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(255, 48, 59, 0.72);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.09), transparent 38%),
    linear-gradient(180deg, #0a111a 0%, #060a10 100%);
  box-shadow:
    inset 0 1px rgba(255,255,255,0.035),
    0 0 0 1px rgba(255, 48, 59, 0.1),
    0 0 24px rgba(255, 48, 59, 0.12),
    0 0 18px rgba(0, 112, 255, 0.06);
  overflow: visible;
}

.news-impact-card.news-state-alert {
  border-color: rgba(255, 48, 59, 0.92);
  box-shadow:
    inset 0 1px rgba(255,255,255,0.035),
    0 0 0 1px rgba(255, 48, 59, 0.2),
    0 0 30px rgba(255, 48, 59, 0.18);
}

.news-impact-card.news-state-supports {
  border-color: rgba(255, 48, 59, 0.72);
  box-shadow:
    inset 0 1px rgba(255,255,255,0.035),
    0 0 0 1px rgba(255, 48, 59, 0.1),
    0 0 24px rgba(255, 48, 59, 0.12);
}

.news-impact-card.news-state-waiting {
  border-color: rgba(255, 48, 59, 0.72);
}

.news-impact-card.news-state-neutral,
.news-impact-card.news-state-unavailable {
  border-color: rgba(255, 48, 59, 0.68);
}

.news-impact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(78, 111, 148, 0.22);
}

.news-impact-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f3f7fb;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.2px;
  min-width: 0;
  white-space: nowrap;
}

.news-impact-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(203, 213, 225, 0.55);
  border-radius: 4px;
  color: #dbe6f5;
  font-size: 11px;
  line-height: 1;
}

.news-impact-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8fa1b8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.news-impact-refresh {
  color: #aeb9c8;
  font-size: 16px;
}

.news-impact-empty {
  height: calc(100% - 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.news-impact-content {
  height: auto;
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) minmax(90px, 0.62fr) minmax(140px, 0.9fr) minmax(170px, 1.1fr);
  grid-template-rows: minmax(112px, auto) minmax(74px, auto) minmax(70px, auto) minmax(78px, auto) minmax(64px, auto);
  gap: 0;
}

.news-impact-event,
.news-impact-item,
.news-impact-details,
.news-impact-score,
.news-impact-decision,
.news-impact-upcoming,
.news-impact-trading-window {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid rgba(78, 111, 148, 0.22);
}

.news-impact-item:last-of-type {
  border-right: 0;
}

.news-impact-event span,
.news-impact-item span,
.news-impact-details span,
.news-impact-score span,
.news-impact-decision span,
.news-impact-upcoming span,
.news-impact-trading-window span {
  display: block;
  color: #99a8ba;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  margin-bottom: 9px;
}

.news-impact-event strong {
  display: block;
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-impact-event em {
  display: block;
  margin-top: 8px;
  color: #ff6b75;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-impact-event b {
  display: block;
  margin-top: 7px;
  color: #f6c744;
  font-size: 16px;
  line-height: 1;
}

.news-impact-event small {
  display: block;
  margin-top: 7px;
  color: #b6c1d0;
  font-size: 11px;
  font-weight: 800;
}

.news-impact-item strong,
.news-impact-details strong,
.news-impact-decision strong,
.news-impact-trading-window strong {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 900;
}

.news-impact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 13px !important;
}

.news-impact-pill.high {
  color: #ff5b66 !important;
  border-color: rgba(255, 91, 102, 0.7);
  background: rgba(255, 43, 58, 0.12);
}

.news-impact-pill.medium {
  color: #f6c744 !important;
  border-color: rgba(246, 199, 68, 0.62);
  background: rgba(246, 199, 68, 0.1);
}

.news-impact-pill.low {
  color: #39df83 !important;
  border-color: rgba(57, 223, 131, 0.58);
  background: rgba(57, 223, 131, 0.1);
}

.news-impact-pill.neutral {
  color: #aeb7c4 !important;
  border-color: rgba(148, 163, 184, 0.46);
  background: rgba(148, 163, 184, 0.1);
}

.news-impact-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
}

.news-impact-dots i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.news-impact-dots.high {
  color: #ff303b;
}

.news-impact-dots.medium {
  color: #f6c744;
}

.news-impact-dots.low {
  color: #39df83;
}

.news-impact-dots.neutral {
  display: none;
}

.news-impact-item em,
.news-impact-decision em,
.news-impact-trading-window em {
  display: block;
  margin-top: 10px;
  color: #b6c1d0;
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.news-impact-item {
  text-align: center;
}

.news-impact-upcoming {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1.55fr);
  gap: 0;
  border-top: 1px solid rgba(78, 111, 148, 0.22);
  border-right: 0;
  padding: 0;
}

.news-impact-upcoming-heading {
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid rgba(78, 111, 148, 0.22);
}

.news-impact-upcoming-heading span {
  margin-bottom: 5px;
}

.news-impact-upcoming-heading em {
  color: #b6c1d0;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.news-impact-upcoming-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.news-impact-upcoming-event {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid rgba(78, 111, 148, 0.18);
}

.news-impact-upcoming-event:last-child {
  border-right: 0;
}

.news-impact-upcoming-event strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-impact-upcoming-event span,
.news-impact-upcoming-event b,
.news-impact-upcoming-event em,
.news-impact-upcoming-event small,
.news-impact-upcoming-empty {
  display: inline-block;
  margin: 4px 8px 0 0;
  color: #b6c1d0;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

.news-impact-upcoming-event b {
  color: #f6c744;
}

.news-impact-upcoming-event em {
  color: #39df83;
}

.news-impact-upcoming-event small {
  display: block;
  color: #99a8ba;
  text-transform: uppercase;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-impact-upcoming-empty {
  align-self: center;
  justify-self: center;
  margin: 0;
  padding: 20px 0;
}

.news-impact-details {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(78, 111, 148, 0.22);
  border-right: 0;
  padding: 0;
}

.news-impact-details div {
  min-width: 0;
  padding: 11px 12px;
  text-align: center;
  border-right: 1px solid rgba(78, 111, 148, 0.22);
}

.news-impact-details div:last-child {
  border-right: 0;
}

.news-impact-details span {
  margin-bottom: 5px;
}

.news-impact-details strong {
  display: block;
  font-size: 14px;
  line-height: 1.18;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

#news-impact-source {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal !important;
  max-height: 2.45em;
}

.news-impact-item:nth-of-type(4) strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
}

.news-impact-item:nth-of-type(4) strong.effect-sell::before,
.news-impact-item:nth-of-type(4) strong.effect-buy::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 36px;
  background: currentColor;
  clip-path: polygon(38% 0, 62% 0, 62% 58%, 100% 58%, 50% 100%, 0 58%, 38% 58%);
}

.news-impact-item:nth-of-type(4) strong.effect-buy::before {
  transform: rotate(180deg);
}

.effect-buy,
.score-positive,
.decision-supports {
  color: #39df83 !important;
}

.effect-sell,
.score-negative,
.decision-conflicts,
.decision-block {
  color: #ff4f5b !important;
}

.news-impact-score {
  grid-column: 1 / 3;
  grid-row: 4;
  border-top: 1px solid rgba(78, 111, 148, 0.22);
  text-align: center;
  padding-top: 10px;
}

.news-impact-score strong {
  display: block;
  color: #dce7f5;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.news-impact-score em {
  color: #9ba8b7;
  font-size: 10px;
  font-style: normal;
}

.news-impact-decision {
  grid-column: 3 / 5;
  grid-row: 4;
  border-right: 0;
  border-top: 1px solid rgba(78, 111, 148, 0.22);
  text-align: center;
  padding: 10px 14px 8px;
}

.news-impact-decision strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 21px;
  letter-spacing: 0.3px;
}

.news-impact-trading-window {
  grid-column: 1 / -1;
  grid-row: 5;
  display: grid;
  grid-template-columns: minmax(170px, 0.48fr) minmax(0, 2.52fr);
  gap: 0;
  border-top: 1px solid rgba(78, 111, 148, 0.22);
  border-right: 0;
  padding: 0;
}

.news-impact-trading-summary {
  min-width: 0;
  padding: 8px 12px;
  text-align: center;
  border-right: 1px solid rgba(78, 111, 148, 0.22);
}

.news-impact-trading-summary strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.news-impact-trading-summary strong.normal {
  color: #39df83;
}

.news-impact-trading-summary strong.high-risk {
  color: #f6c744;
}

.news-impact-trading-summary strong.release {
  color: #ff4f5b;
}

.news-impact-trading-summary em {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
}

.news-impact-window-phases {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
  position: relative;
}

.news-window-phase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 8px 8px;
  border-right: 1px solid rgba(78, 111, 148, 0.18);
  opacity: 0.7;
  text-align: center;
  position: relative;
}

.news-window-phase:last-child {
  border-right: 0;
}

.news-window-phase.active {
  opacity: 1;
  background: rgba(246, 199, 68, 0.1);
  box-shadow: inset 0 2px rgba(246, 199, 68, 0.95);
}

#news-window-release.active {
  background: rgba(255, 79, 91, 0.1);
  box-shadow: inset 0 2px rgba(255, 79, 91, 0.95);
}

#news-window-normal-start.active,
#news-window-normal.active {
  background: rgba(57, 223, 131, 0.08);
  box-shadow: inset 0 2px rgba(57, 223, 131, 0.9);
}

#news-window-normal.active {
  background: rgba(57, 223, 131, 0.08);
}

.news-window-phase.completed {
  opacity: 0.52;
}

.news-window-phase b {
  display: block;
  color: #f8fafc;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-window-phase span {
  margin: 4px 0 0;
  color: #b6c1d0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

@media (max-width: 850px) {
  .news-impact-panel,
  body.fit-mode .news-impact-panel {
    height: auto !important;
    min-height: 220px !important;
  }

  .news-impact-content {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .news-impact-event {
    grid-column: 1 / -1;
  }

  .news-impact-score,
  .news-impact-details,
  .news-impact-decision {
    grid-column: auto;
    grid-row: auto;
  }

  .news-impact-upcoming {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .news-impact-upcoming-heading {
    border-right: 0;
    border-bottom: 1px solid rgba(78, 111, 148, 0.22);
  }

  .news-impact-upcoming-list {
    grid-template-columns: 1fr;
  }

  .news-impact-upcoming-event {
    border-right: 0;
    border-bottom: 1px solid rgba(78, 111, 148, 0.18);
  }

  .news-impact-details {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .news-impact-trading-window {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .news-impact-trading-summary {
    border-right: 0;
    border-bottom: 1px solid rgba(78, 111, 148, 0.22);
  }

  .news-impact-window-phases {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    overflow-x: auto;
  }
}

/* Entry checks need enough reserved height for the full-width reason row. */
body.fit-mode .main-trade-card {
  justify-content: flex-start !important;
  overflow-y: auto !important;
}

.entry-strategy-debug {
  min-height: 166px !important;
  margin-bottom: 16px !important;
  overflow: hidden !important;
}

.entry-strategy-debug-grid {
  row-gap: 5px !important;
}

.entry-strategy-debug-grid .strategy-debug-reason-label {
  margin-top: 4px !important;
}

#strategy-debug-block-reason {
  display: block !important;
  min-height: 24px !important;
  max-height: 32px !important;
  overflow: hidden !important;
}

.main-bottom-row {
  margin-top: 14px !important;
  flex: 0 0 auto !important;
}

body.hide-confidence-ui #eurusd-conf-label,
body.hide-confidence-ui #gold-conf-label,
body.hide-confidence-ui .conf-wrap,
body.hide-confidence-ui .main-metrics > div:nth-child(3) {
  display: none !important;
}

body.hide-buy-sell-ui #eurusd-buy-label,
body.hide-buy-sell-ui #eurusd-sell-label,
body.hide-buy-sell-ui #gold-buy-label,
body.hide-buy-sell-ui #gold-sell-label,
body.hide-buy-sell-ui #eurusd-buy-label + .bar-wrap,
body.hide-buy-sell-ui #eurusd-sell-label + .bar-wrap,
body.hide-buy-sell-ui #gold-buy-label + .bar-wrap,
body.hide-buy-sell-ui #gold-sell-label + .bar-wrap,
body.hide-buy-sell-ui .main-metrics > div:nth-child(1),
body.hide-buy-sell-ui .main-metrics > div:nth-child(2) {
  display: none !important;
}

body.hide-account-balance-ui #dashboardWeeklyPnl,
body.hide-account-number-ui #brokerAuthorizedText,
body.hide-broker-info-ui #brokerConnectedBadge {
  display: none !important;
}

@media (max-width: 700px) {
  .settings-grid,
  .risk-settings-grid,
  .performance-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Final Broker Accounts placement override */
#brokerAccountsModal.trade-modal.broker-settings-modal {
  padding-top: 76px !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
  overflow-y: auto !important;
}

#brokerAccountsModal .broker-settings-shell {
  min-height: calc(100dvh - 76px) !important;
}

#brokerAccountsModal .broker-settings-content {
  padding-top: 22px !important;
}

#brokerAccountsModal .broker-settings-topbar {
  display: none !important;
}

#brokerAccountsModal .broker-settings-header {
  padding-top: 0 !important;
}

#brokerAccountsModal .broker-account-table {
  min-width: 720px !important;
}

#brokerAccountsModal .broker-account-table th,
#brokerAccountsModal .broker-account-table td {
  padding-left: 9px !important;
  padding-right: 9px !important;
}

#brokerAccountsModal .broker-account-table th:nth-child(8),
#brokerAccountsModal .broker-account-table td:nth-child(8) {
  width: 12% !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#brokerAccountsModal .broker-active-pill {
  display: inline-flex !important;
  max-width: none !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
}

/* Final user-page spacing override. Keep cards clear of the fetch badge. */
body.fit-mode .app.user-no-performance .dashboard-grid,
.app.user-no-performance .dashboard-grid {
  margin-top: 58px !important;
}

body.fit-mode .app.user-no-performance .signals-panel,
.app.user-no-performance .signals-panel {
  padding-top: 18px !important;
}

/* Full-screen live trading dashboard */
.brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px !important;
}

.performance-strip {
  width: min(1218px, calc(100% - 44px));
  min-height: 62px;
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: 0.82fr 0.92fr 0.92fr 1fr 0.62fr;
  border: 1px solid #173b66;
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 20%, rgba(24, 72, 122, 0.14), transparent 35%),
    linear-gradient(180deg, #09111a 0%, #071019 100%);
  box-shadow:
    0 0 12px rgba(30, 83, 142, 0.14),
    inset 0 0 18px rgba(30, 83, 142, 0.06);
  overflow: hidden;
}

.admin-only-hidden {
  display: none !important;
}

.performance-strip.user-no-pnl {
  display: none !important;
}

.performance-card {
  min-width: 0;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 28px minmax(96px, 1fr) 54px;
  align-items: center;
  gap: 9px;
  border-right: 1px solid #172532;
  justify-content: center;
}

.performance-card:last-child {
  border-right: 0;
}

.performance-icon {
  width: 27px;
  height: 27px;
  color: #e8edf4;
}

.performance-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.performance-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.performance-copy span {
  color: #b9c4d2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.performance-copy strong {
  color: #39d467;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.performance-copy strong.negative {
  color: #ff474f;
}

.performance-copy strong.neutral {
  color: #aab5c3;
}

.performance-sparkline {
  width: 54px;
  height: 27px;
  overflow: visible;
}

.performance-sparkline polyline {
  fill: none;
  stroke: #35df67;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.performance-trades {
  grid-template-columns: 28px 1fr;
}

.performance-daily {
  grid-template-columns: 28px minmax(96px, 1fr);
}

.performance-weekly {
  grid-template-columns: 28px 106px 56px;
}

.performance-weekly .performance-sparkline {
  width: 56px;
}

.performance-floating {
  grid-template-columns: 28px 122px 46px;
}

.performance-floating .performance-sparkline {
  width: 46px;
}

.performance-trades {
  padding-left: 12px;
  padding-right: 12px;
}

.performance-trades .performance-copy strong {
  color: #b8c2cf;
}

@media (min-width: 1251px) {
  .app {
    padding: 5px 17px 10px !important;
  }

  .header-frame {
    grid-template-columns: 44px 220px 1fr auto !important;
    min-height: 46px;
    padding: 1px 1px 2px !important;
  }

  .header {
    font-size: 21px !important;
  }

  .menu-toggle {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 17px;
  }

  #langSelect {
    min-width: 58px !important;
    width: 58px !important;
  }

  .divider {
    display: none;
  }

  .topbar {
    display: flex !important;
    position: absolute;
    top: 63px;
    left: 18px;
    z-index: 20;
    padding: 0;
    min-height: 68px;
    align-items: center;
  }

  .topbar .controls {
    display: none !important;
  }

  .status {
    min-width: 178px;
    max-width: 178px;
    padding: 8px 10px;
    border: 1px solid rgba(23, 59, 102, 0.72);
    border-radius: 10px;
    background: rgba(7, 16, 25, 0.92);
    box-shadow: 0 0 12px rgba(30, 83, 142, 0.12);
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .performance-strip {
    width: min(1020px, calc(100% - 312px));
    margin: 0 0 12px 286px;
  }

  .dashboard-grid {
    width: 100% !important;
    grid-template-columns: 300px 410px minmax(580px, 1fr) !important;
    gap: 14px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-items: stretch;
  }

  .signals-panel {
    padding: 10px !important;
  }

  .content-grid {
    gap: 12px !important;
  }

  .symbol-card {
    border-radius: 12px !important;
  }

  .main-trade-card,
  .chart-section,
  .structure-box,
  .history-section {
    border-radius: 12px !important;
  }
}

@media (max-width: 1450px) and (min-width: 1251px) {
  .performance-strip {
    width: min(980px, calc(100% - 300px));
    margin-left: 274px;
  }

  .topbar {
    left: 16px;
  }

  .status {
    min-width: 170px;
    max-width: 170px;
    font-size: 11px;
  }

  .performance-card {
    padding: 8px 10px;
    grid-template-columns: 28px minmax(86px, 1fr) 48px;
    gap: 8px;
  }

  .performance-copy strong {
    font-size: 19px;
  }

  .performance-sparkline {
    width: 48px;
  }

  .performance-weekly .performance-sparkline {
    width: 52px;
  }

  .performance-weekly {
    grid-template-columns: 28px 98px 52px;
  }

  .performance-floating {
    grid-template-columns: 28px 112px 44px;
  }

  .performance-floating .performance-sparkline {
    width: 44px;
  }

  .dashboard-grid {
    grid-template-columns: 286px 392px minmax(500px, 1fr) !important;
    gap: 12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 1250px) {
  .performance-strip {
    width: calc(100% - 24px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-card {
    padding: 9px 14px;
  }
}

@media (max-width: 700px) {
  .voice-toggle {
    height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  .smart-explain {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .performance-strip {
    width: calc(100% - 16px);
    grid-template-columns: 1fr;
    margin-bottom: 12px;
  }

  .performance-card {
    min-height: 68px;
    padding: 12px 18px;
    grid-template-columns: 31px minmax(120px, 1fr) 64px;
    border-right: 0;
    border-bottom: 1px solid #172532;
  }

  .performance-card:last-child {
    border-bottom: 0;
  }

  .performance-copy strong {
    font-size: 21px;
  }
}

/* Live Auto compact active cards + tall recent history override */
#paperModal .trade-modal-box {
  display: flex !important;
  flex-direction: column !important;
}

#liveActiveList {
  flex: 0 0 auto !important;
}

#liveHistoryList {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 220px !important;
  max-height: none !important;
  overflow: hidden !important;
}

#liveHistoryList .live-paper-section {
  height: 100% !important;
  min-height: 0 !important;
}

#liveHistoryList .live-recent-scroll {
  height: calc(100% - 18px) !important;
  min-height: 190px !important;
  max-height: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Absolute final Broker Accounts placement override */
#brokerAccountsModal.trade-modal.broker-settings-modal {
  padding-top: 76px !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
  overflow-y: auto !important;
}

#brokerAccountsModal .broker-settings-shell {
  min-height: calc(100dvh - 76px) !important;
}

#brokerAccountsModal .broker-settings-content {
  padding-top: 22px !important;
}

#brokerAccountsModal .broker-settings-topbar {
  display: none !important;
}

#brokerAccountsModal .broker-settings-header {
  padding-top: 0 !important;
}

#brokerAccountsModal .broker-account-table {
  min-width: 720px !important;
}

#brokerAccountsModal .broker-account-table th,
#brokerAccountsModal .broker-account-table td {
  padding-left: 9px !important;
  padding-right: 9px !important;
}

#brokerAccountsModal .broker-account-table th:nth-child(8),
#brokerAccountsModal .broker-account-table td:nth-child(8) {
  width: 12% !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#brokerAccountsModal .broker-active-pill {
  display: inline-flex !important;
  max-width: none !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
}

/* Absolute final dashboard menu drawer and P/L spacing override */
body.fit-mode .app:not(.locked).menu-drawer-open::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 1190 !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu.hidden {
  display: none !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu:not(.hidden) {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 250px !important;
  height: 100dvh !important;
  max-height: none !important;
  border: 0 !important;
  border-right: 1px solid #1b2a3b !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.42) !important;
  overflow-y: auto !important;
  z-index: 1300 !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner {
  min-height: 100dvh !important;
  align-items: stretch !important;
  gap: 9px !important;
  padding: 28px 12px 18px !important;
}

body.fit-mode .app:not(.locked) > #sideMenu.side-menu .side-menu-inner::before {
  content: "≋  FlowSignal" !important;
  display: block !important;
  margin: 0 12px 36px !important;
  color: #f4f7fb !important;
  font-size: 29px !important;
  font-weight: 900 !important;
}

body.fit-mode .app:not(.locked) > .performance-strip {
  margin: 12px 0 10px 190px !important;
  width: calc(100% - 190px) !important;
  max-width: none !important;
}

body.fit-mode .app:not(.locked) > .topbar {
  position: absolute !important;
  display: flex !important;
  top: 70px !important;
  left: 16px !important;
  width: 178px !important;
  padding: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  z-index: 30 !important;
}

body.fit-mode .app:not(.locked) > .dashboard-grid {
  height: calc(100vh - 148px) !important;
  padding-top: 0 !important;
}

body.fit-mode #mainApp.app:not(.locked).menu-drawer-open::after {
  inset: 164px 0 0 0 !important;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.side-menu:not(.hidden) {
  top: 164px !important;
  height: calc(100dvh - 164px) !important;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.side-menu .side-menu-inner {
  min-height: calc(100dvh - 164px) !important;
}

body.fit-mode #mainApp.app.menu-drawer-open #settingsModal,
body.fit-mode #mainApp.app.menu-drawer-open #statsModal,
body.fit-mode #mainApp.app.menu-drawer-open #assistantModal {
  padding: 164px 24px 24px 250px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode #mainApp.app.menu-drawer-open #settingsModal .trade-modal-box,
body.fit-mode #mainApp.app.menu-drawer-open #statsModal .trade-modal-box,
body.fit-mode #mainApp.app.menu-drawer-open #assistantModal .trade-modal-box {
  width: calc(100vw - 300px) !important;
  max-width: none !important;
  min-height: calc(100dvh - 164px) !important;
  max-height: calc(100dvh - 164px) !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  overflow-y: auto !important;
}

body.fit-mode #mainApp.app.menu-drawer-open > #sideMenu.side-menu:not(.hidden) {
  z-index: 10020 !important;
}

body.fit-mode #mainApp.app.menu-drawer-open #settingsModal .settings-modal-box,
body.fit-mode #mainApp.app.menu-drawer-open #statsModal .performance-modal-box,
body.fit-mode #mainApp.app.menu-drawer-open #assistantModal .assistant-modal-box {
  position: fixed !important;
  top: 164px !important;
  left: 250px !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(100vw - 250px) !important;
  max-width: none !important;
  min-height: calc(100dvh - 164px) !important;
  max-height: calc(100dvh - 164px) !important;
  border-radius: 0 !important;
  border-left: 0 !important;
}

body.fit-mode.menu-drawer-open #settingsModal,
body.fit-mode.menu-drawer-open #statsModal,
body.fit-mode.menu-drawer-open #assistantModal {
  padding: 164px 24px 24px 250px !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

body.fit-mode.menu-drawer-open #settingsModal .settings-modal-box,
body.fit-mode.menu-drawer-open #statsModal .performance-modal-box,
body.fit-mode.menu-drawer-open #assistantModal .assistant-modal-box {
  position: fixed !important;
  top: 164px !important;
  left: 250px !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(100vw - 250px) !important;
  max-width: none !important;
  min-height: calc(100dvh - 164px) !important;
  max-height: calc(100dvh - 164px) !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  overflow-y: auto !important;
}

/* Shared application sidebar: one component and one geometry on every page. */
:root {
  --app-sidebar-top: 70px;
  --app-panel-height: calc(100dvh - var(--app-sidebar-top));
  --app-sidebar-width: 250px;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar,
body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar.hidden {
  display: block !important;
  position: fixed !important;
  top: var(--app-sidebar-top) !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  width: var(--app-sidebar-width) !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-right: 1px solid #1b2a3b !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #0a121d 0%, #070c13 58%, #05080d 100%) !important;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.42) !important;
  overflow: hidden !important;
  z-index: 10020 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-100%) !important;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    visibility 0s linear 180ms !important;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(0) !important;
  transition:
    transform 180ms ease,
    opacity 180ms ease !important;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar .side-menu-inner {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  box-sizing: border-box !important;
  padding: 28px 12px 18px !important;
  gap: 9px !important;
  align-items: stretch !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar .side-menu-inner::before {
  content: "≋  FlowSignal" !important;
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 12px 36px !important;
  color: #f4f7fb !important;
  font-size: 29px !important;
  font-weight: 900 !important;
}

body.fit-mode #mainApp.app:not(.locked).menu-drawer-open::after {
  content: "" !important;
  position: fixed !important;
  inset: var(--app-sidebar-top) 0 0 0 !important;
  z-index: 1190 !important;
  background: rgba(0, 0, 0, 0.58) !important;
}

/* Broker Accounts uses the shared sidebar instead of its former duplicate aside. */
#brokerAccountsModal.trade-modal.broker-settings-modal {
  top: var(--app-sidebar-top) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  z-index: 1200 !important;
}

#brokerAccountsModal .broker-settings-shell {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: block !important;
}

#brokerAccountsModal .broker-settings-content {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  padding: 22px 26px 30px !important;
  overflow-y: auto !important;
  transition: padding-left 180ms ease !important;
}

body.menu-drawer-open #brokerAccountsModal .broker-settings-content {
  padding-left: calc(var(--app-sidebar-width) + 26px) !important;
}

@media (max-width: 700px) {
  :root {
    --app-sidebar-width: min(86vw, 300px);
  }

  body.menu-drawer-open #brokerAccountsModal .broker-settings-content {
    padding-left: 18px !important;
  }
}

/* Attached pages use the same computed top and height as the shared sidebar. */
body.fit-mode.menu-drawer-open #settingsModal,
body.fit-mode.menu-drawer-open #statsModal,
body.fit-mode.menu-drawer-open #assistantModal {
  padding:
    var(--app-sidebar-top)
    0
    0
    var(--app-sidebar-width) !important;
}

body.fit-mode.menu-drawer-open #settingsModal .settings-modal-box,
body.fit-mode.menu-drawer-open #statsModal .performance-modal-box,
body.fit-mode.menu-drawer-open #assistantModal .assistant-modal-box {
  top: var(--app-sidebar-top) !important;
  left: var(--app-sidebar-width) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(100vw - var(--app-sidebar-width)) !important;
  height: var(--app-panel-height) !important;
  min-height: var(--app-panel-height) !important;
  max-height: var(--app-panel-height) !important;
}

#brokerAccountsModal.trade-modal.broker-settings-modal {
  height: var(--app-panel-height) !important;
}

/* Win over legacy #mainApp drawer selectors that still contain 164px. */
body.fit-mode #mainApp.app:not(.locked).menu-drawer-open
  > #sideMenu.side-menu.app-sidebar.is-open:not(.hidden) {
  top: var(--app-sidebar-top) !important;
  bottom: 0 !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.fit-mode #mainApp.app:not(.locked).menu-drawer-open
  > #sideMenu.side-menu.app-sidebar.is-open:not(.hidden)
  .side-menu-inner {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.fit-mode #mainApp.app:not(.locked).menu-drawer-open::after {
  inset: var(--app-sidebar-top) 0 0 0 !important;
}

/* Final attached-page geometry: Auto Trade, Risk, and Performance */
body[data-active-settings-page="auto-trade"] #paperModal,
body[data-active-settings-page^="settings:"] #settingsModal,
body[data-active-settings-page="performance"] #statsModal {
  position: fixed !important;
  inset: 0 !important;
  padding: var(--app-sidebar-top) 0 0 var(--app-sidebar-width) !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1200 !important;
}

body[data-active-settings-page="auto-trade"] #paperModal .trade-modal-box,
body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box,
body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
  position: fixed !important;
  top: var(--app-sidebar-top) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--app-sidebar-width) !important;
  width: calc(100vw - var(--app-sidebar-width)) !important;
  max-width: none !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  max-height: var(--app-panel-height) !important;
  margin: 0 !important;
  border: 1px solid #1b293b !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 39, 132, 0.10), transparent 34%),
    linear-gradient(145deg, #07111e 0%, #050d17 62%, #07121f 100%) !important;
  box-shadow: none !important;
}

body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box,
body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body[data-active-settings-page="settings:risk"] #settingsModal .settings-modal-box {
  padding: 0 !important;
}

body[data-active-settings-page="settings:risk"] #riskSettingsPanel {
  min-width: 0;
}

body[data-active-settings-page="settings:risk"] #riskSaveBtn.is-saved {
  background: linear-gradient(135deg, #047857, #16a34a) !important;
  border-color: #22c55e !important;
}

body[data-active-settings-page="auto-trade"] #paperModal .trade-modal-box {
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 22px !important;
  overflow: hidden !important;
}

.auto-trade-attached-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 58px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #172436;
}

.auto-trade-attached-head .trade-modal-title {
  margin: 0;
  font-size: 25px;
  font-weight: 900;
}

.auto-trade-attached-head p {
  margin: 3px 0 0;
  color: #9eacc0;
  font-size: 13px;
}

body[data-active-settings-page="auto-trade"] #paperAutoSection,
body[data-active-settings-page="auto-trade"] #liveAutoSection,
body[data-active-settings-page="auto-trade"] #brokerConnectionStatus,
body[data-active-settings-page="auto-trade"] .execution-page-tabs,
body[data-active-settings-page="auto-trade"] #liveActiveOrders {
  flex: 0 0 auto !important;
}

body[data-active-settings-page="auto-trade"] #paperAutoSection,
body[data-active-settings-page="auto-trade"] #liveAutoSection {
  display: inline-flex;
  width: auto;
  margin: 0 8px 8px 0;
}

body[data-active-settings-page="auto-trade"] #paperAutoToggleBtn,
body[data-active-settings-page="auto-trade"] #liveAutoToggleBtn {
  width: auto !important;
  min-width: 150px !important;
  height: 38px !important;
  padding: 0 16px !important;
  font-size: 12px !important;
}

body[data-active-settings-page="auto-trade"] .execution-page-tabs {
  width: min(100%, 620px);
  margin: 8px 0 12px;
}

body[data-active-settings-page="auto-trade"] #liveActiveOrders {
  max-height: 190px;
  overflow-y: auto;
}

body[data-active-settings-page="auto-trade"] #paperHistoryList,
body[data-active-settings-page="auto-trade"] #liveHistoryList {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

@media (max-width: 700px) {
  body[data-active-settings-page="auto-trade"] #paperModal,
  body[data-active-settings-page^="settings:"] #settingsModal,
  body[data-active-settings-page="performance"] #statsModal {
    padding: 0 !important;
  }

  body[data-active-settings-page="auto-trade"] #paperModal .trade-modal-box,
  body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box,
  body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
}

/* Risk settings — visual treatment only */
body[data-active-settings-page="settings:risk"] #settingsModal {
  background: rgba(1, 6, 15, 0.82) !important;
  backdrop-filter: blur(10px);
}

body[data-active-settings-page="settings:risk"] #settingsModal .settings-modal-box {
  width: min(96vw, 1536px) !important;
  max-width: 1536px !important;
  padding: 0 !important;
  overflow: auto !important;
  border: 1px solid #1d2b3d !important;
  border-radius: 14px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(49, 37, 102, 0.12), transparent 35%),
    linear-gradient(145deg, #07111e 0%, #050d17 58%, #07121f 100%) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48) !important;
}

body[data-active-settings-page="settings:risk"] .settings-modal-header {
  position: relative;
  min-height: 146px;
  padding: 36px 96px 28px 128px;
  align-items: center;
  border-bottom: 1px solid #172436;
}

body[data-active-settings-page="settings:risk"] .settings-modal-header::before {
  content: "✓";
  position: absolute;
  left: 38px;
  top: 36px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 66px;
  color: #8b5cf6;
  font-size: 30px;
  font-weight: 950;
  border: 6px solid #7138e8;
  border-radius: 42% 42% 52% 52% / 25% 25% 62% 62%;
  box-shadow: inset 0 0 22px rgba(124, 58, 237, 0.22);
}

body[data-active-settings-page="settings:risk"] #settingsModalTitle {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.7px;
}

body[data-active-settings-page="settings:risk"] #settingsModalSubtitle {
  margin-top: 10px;
  color: #aebbd0;
  font-size: 20px;
  line-height: 1.4;
}

body[data-active-settings-page="settings:risk"] .settings-close-btn {
  width: 60px;
  height: 60px;
  border-radius: 9px;
  color: #f8fafc;
  font-size: 34px;
}

#riskSettingsPanel {
  padding: 16px 32px 0;
  color: #eef2f8;
}

#riskSettingsPanel .risk-pro-alert {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 74px;
  margin: 0 0 22px;
  padding: 0 26px;
  border: 1px solid rgba(124, 58, 237, 0.34);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(55, 27, 126, 0.18), rgba(41, 28, 98, 0.13));
  color: #b896ff;
  font-size: 18px;
  font-weight: 750;
}

.risk-info-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 900;
}

#riskSettingsPanel .risk-pro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px;
}

#riskSettingsPanel .risk-pro-card {
  position: relative;
  min-height: 264px;
  padding: 25px 22px 22px;
  border: 1px solid #1c2a3c;
  border-radius: 11px;
  background:
    radial-gradient(circle at 88% 10%, rgba(68, 40, 145, 0.10), transparent 26%),
    linear-gradient(145deg, rgba(12, 23, 38, 0.96), rgba(6, 15, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

#riskSettingsPanel .risk-card-icon {
  position: absolute;
  top: 23px;
  right: 25px;
  color: #7c3aed;
  font-size: 37px;
  line-height: 1;
}

#riskSettingsPanel .risk-pro-card h3 {
  max-width: calc(100% - 58px);
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 850;
}

#riskSettingsPanel .risk-pro-card p {
  margin: 0;
  color: #9eacc2;
  font-size: 17px;
  font-weight: 550;
}

#riskSettingsPanel .risk-stepper {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  margin: 22px 0 20px;
  overflow: hidden;
  border: 1px solid #1c2a3c;
  border-radius: 8px;
  background: #050c15;
}

#riskSettingsPanel .risk-stepper button,
#riskSettingsPanel .risk-stepper input {
  height: 66px;
  border: 0;
  border-right: 1px solid #1c2a3c;
  background: rgba(4, 11, 20, 0.94);
  color: #f8fafc;
  text-align: center;
}

#riskSettingsPanel .risk-stepper button:last-child {
  border-right: 0;
}

#riskSettingsPanel .risk-stepper button {
  font-size: 28px;
  font-weight: 400;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

#riskSettingsPanel .risk-stepper button:hover {
  background: rgba(124, 58, 237, 0.13);
  color: #a78bfa;
}

#riskSettingsPanel .risk-stepper input {
  appearance: textfield;
  font-size: 29px;
  font-weight: 900;
}

#riskSettingsPanel .risk-stepper input::-webkit-inner-spin-button,
#riskSettingsPanel .risk-stepper input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

#riskSettingsPanel .risk-bar {
  height: 7px;
  margin: 0 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #142033;
}

#riskSettingsPanel .risk-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d28d9, #8b5cf6);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.35);
}

#riskSettingsPanel .risk-pro-card small {
  display: block;
  color: #aebbd0;
  text-align: center;
  font-size: 16px;
  font-weight: 550;
}

#riskSettingsPanel .risk-pro-extra {
  display: none !important;
}

#riskSettingsPanel .risk-pro-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 26px -32px 0;
  padding: 26px 32px 0;
  border-top: 1px solid #172436;
}

.risk-pro-actions-right {
  display: flex;
  gap: 16px;
}

#riskSettingsPanel .risk-pro-actions button {
  min-width: 170px;
  min-height: 60px;
  padding: 0 26px;
  border: 1px solid #243246;
  border-radius: 9px;
  background: #0b1422;
  color: #f7f9fd;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

#riskSettingsPanel #riskSaveBtn {
  min-width: 238px;
  background: linear-gradient(135deg, #5720d5, #7133e6) !important;
  border-color: #7133e6 !important;
  box-shadow: 0 10px 30px rgba(91, 33, 182, 0.24);
}

#riskSettingsPanel .risk-pro-footnote {
  margin: 24px 0 28px;
  color: #93a4bc;
  text-align: center;
  font-size: 16px;
}

@media (max-width: 1100px) {
  #riskSettingsPanel .risk-pro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  body[data-active-settings-page="settings:risk"] .settings-modal-header {
    min-height: 120px;
    padding: 26px 70px 22px 82px;
  }

  body[data-active-settings-page="settings:risk"] .settings-modal-header::before {
    left: 22px;
    top: 27px;
    width: 38px;
    height: 44px;
    border-width: 4px;
    font-size: 20px;
  }

  body[data-active-settings-page="settings:risk"] #settingsModalTitle {
    font-size: 26px;
  }

  body[data-active-settings-page="settings:risk"] #settingsModalSubtitle {
    font-size: 15px;
  }

  #riskSettingsPanel {
    padding-inline: 16px;
  }

  #riskSettingsPanel .risk-pro-grid {
    grid-template-columns: 1fr !important;
  }

  #riskSettingsPanel .risk-pro-actions {
    margin-inline: -16px;
    padding-inline: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .risk-pro-actions-right {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }

  #riskSettingsPanel .risk-pro-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* Attached page overrides must remain last in the cascade. */
body[data-active-settings-page="auto-trade"] #paperModal,
body[data-active-settings-page^="settings:"] #settingsModal,
body[data-active-settings-page="performance"] #statsModal,
body[data-active-settings-page="assistant"] #assistantModal {
  position: fixed !important;
  inset: 0 !important;
  padding: var(--app-sidebar-top) 0 0 var(--app-sidebar-width) !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-active-settings-page="auto-trade"] #paperModal .trade-modal-box,
body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box,
body[data-active-settings-page="performance"] #statsModal .performance-modal-box,
body[data-active-settings-page="assistant"] #assistantModal .assistant-modal-box {
  position: fixed !important;
  top: var(--app-sidebar-top) !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--app-sidebar-width) !important;
  width: calc(100vw - var(--app-sidebar-width)) !important;
  max-width: none !important;
  height: var(--app-panel-height) !important;
  min-height: 0 !important;
  max-height: var(--app-panel-height) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: 1px solid #1b293b !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
}

body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box,
body[data-active-settings-page="performance"] #statsModal .performance-modal-box {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* FlowSignal premium phone dashboard */
.app-logo-wave {
  display: none;
}

.mobile-domain-pill {
  display: none;
}

.mobile-timeframe-row,
.mobile-open-trade-card,
.mobile-bottom-nav,
.mobile-notify-btn,
.mobile-live-status {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --phone-blue: #1687ff;
    --phone-blue-line: rgba(24, 135, 255, 0.52);
    --phone-card: rgba(5, 15, 26, 0.94);
    --phone-green: #25df72;
    --phone-red: #ff454f;
    --phone-gold: #e9a92f;
  }

  html,
  body {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    background:
      radial-gradient(circle at 54% 8%, rgba(0, 112, 255, 0.12), transparent 26rem),
      #02070d !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.fit-mode #mainApp.app:not(.locked) {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    padding: 12px 10px 82px !important;
    overflow: visible !important;
    color: #f4f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  }

  body.fit-mode #mainApp.app:not(.locked) > .top-header {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) auto auto !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 62px !important;
    margin: 0 0 10px !important;
    padding: 8px !important;
    border: 1px solid rgba(77, 130, 181, 0.34) !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, rgba(7, 19, 31, 0.96), rgba(3, 11, 19, 0.96)) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.03) !important;
    order: 1;
  }

  .top-header .menu-toggle {
    width: 42px !important;
    height: 42px !important;
    border-color: #23364a !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg, #101d2b, #09131f) !important;
    font-size: 0 !important;
  }

  .top-header .menu-toggle::before {
    content: "☰";
    font-size: 20px;
  }

  .top-header .brand-left {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    color: #f7f9fd !important;
    font-size: clamp(15px, 4.4vw, 19px) !important;
    font-weight: 850 !important;
    letter-spacing: -0.5px;
    white-space: nowrap;
  }

  .top-header .brand-left::before {
    content: none !important;
  }

  .app-logo-wave {
    display: inline-block;
    color: var(--phone-blue);
    font-size: 29px;
    line-height: 0.7;
    transform: rotate(-4deg);
    text-shadow: 0 0 16px rgba(24, 135, 255, 0.5);
  }

  .top-header > .header {
    display: none !important;
  }

  .top-header .header-actions {
    display: contents !important;
  }

  .top-header .voice-controls {
    display: block !important;
  }

  .top-header .voice-toggle {
    width: auto !important;
    height: 39px !important;
    padding: 0 7px !important;
    border: 1px solid rgba(37, 223, 114, 0.68) !important;
    border-radius: 11px !important;
    background: rgba(0, 79, 41, 0.24) !important;
    color: #39e77d !important;
    font-size: 0 !important;
    box-shadow: inset 0 0 14px rgba(37, 223, 114, 0.06);
  }

  .top-header .voice-toggle::after {
    content: "Voice Activated";
    font-size: clamp(8px, 2.35vw, 10px);
    font-weight: 850;
  }

  .top-header #langSelect {
    width: 48px !important;
    height: 39px !important;
    padding: 0 5px !important;
    border: 1px solid #25384b !important;
    border-radius: 11px !important;
    background: #0c1724 !important;
    color: #f7f9fd !important;
    font-size: 12px !important;
    font-weight: 800;
  }

  body.fit-mode #mainApp.app:not(.locked) > .divider {
    display: none !important;
  }

  body.fit-mode #mainApp.app:not(.locked) > .topbar {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    order: 2;
  }

  .topbar .status {
    display: inline-flex !important;
    align-items: center;
    min-height: 34px;
    padding: 0 13px !important;
    border: 1px solid rgba(37, 223, 114, 0.24) !important;
    border-radius: 999px !important;
    background: rgba(9, 48, 33, 0.48) !important;
    color: #2ee275 !important;
    font-size: 0 !important;
    font-weight: 800 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  }

  .topbar .status::after {
    content: attr(data-mobile-label);
    font-size: 12px;
  }

  .topbar .status.status-closed {
    border-color: rgba(244, 189, 72, 0.38) !important;
    background: rgba(88, 56, 10, 0.52) !important;
    color: #f4bd48 !important;
  }

  .topbar .controls {
    display: none !important;
  }

  body.fit-mode #mainApp.app:not(.locked) > .performance-strip {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 0 12px !important;
    padding: 4px 14px !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid var(--phone-blue-line) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 92% 5%, rgba(0, 119, 255, 0.1), transparent 44%),
      var(--phone-card) !important;
    box-shadow: 0 0 28px rgba(0, 105, 255, 0.08), inset 0 1px rgba(255, 255, 255, 0.025) !important;
    order: 3;
  }

  .performance-strip .performance-card {
    display: grid !important;
    grid-template-columns: 1fr 88px !important;
    align-items: center !important;
    min-height: 61px !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(73, 111, 148, 0.24) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .performance-strip .performance-card:last-child {
    min-height: 49px !important;
    border-bottom: 0 !important;
  }

  .performance-strip .performance-icon {
    display: none !important;
  }

  .performance-strip .performance-copy {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .performance-strip .performance-copy span {
    color: #aeb9c9 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.35px;
  }

  .performance-strip .performance-copy strong {
    color: #d8dfeb !important;
    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: 850 !important;
  }

  .performance-strip .performance-weekly .performance-copy strong:not(.neutral):not(.negative) {
    color: var(--phone-green) !important;
    font-size: 25px !important;
    text-shadow: 0 0 18px rgba(37, 223, 114, 0.12);
  }

  .performance-strip .performance-monthly .performance-copy strong:not(.neutral):not(.negative),
  .performance-strip .performance-floating .performance-copy strong:not(.neutral):not(.negative) {
    color: var(--phone-green) !important;
  }

  .performance-strip .performance-copy strong.negative {
    color: var(--phone-red) !important;
  }

  .performance-strip .performance-copy strong.neutral {
    color: #aeb9c9 !important;
    text-shadow: none !important;
  }

  .performance-strip .performance-sparkline {
    display: block !important;
    width: 82px !important;
    height: 29px !important;
    grid-column: 2;
    grid-row: 1;
    stroke: var(--phone-green) !important;
    filter: drop-shadow(0 0 5px rgba(37, 223, 114, 0.22));
  }

  body.fit-mode #mainApp.app:not(.locked) > .dashboard-grid {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 12px !important;
    overflow: visible !important;
    order: 4;
  }

  .dashboard-grid > .signals-panel,
  .dashboard-grid > .chart-panel {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .dashboard-grid > .main-trade-panel {
    display: none !important;
  }

  .signals-panel .content-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body.fit-mode .signals-panel .symbol-card {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 194px !important;
    padding: 12px 14px 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(68, 111, 151, 0.55) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 84% 15%, rgba(0, 113, 255, 0.07), transparent 35%),
      linear-gradient(145deg, rgba(5, 15, 25, 0.98), rgba(2, 9, 16, 0.99)) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.02) !important;
  }

  .symbol-card .card-outer-glow,
  .symbol-card .top-cap {
    display: none !important;
  }

  .symbol-card .card-header {
    position: static !important;
    min-height: 25px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .symbol-card .title-wrap {
    display: flex !important;
    align-items: center;
    gap: 9px;
  }

  .symbol-card .card-title {
    color: #f5f7fb !important;
    font-size: 18px !important;
    font-weight: 850 !important;
    letter-spacing: -0.3px;
  }

  .symbol-card .symbol-icon {
    position: static !important;
    width: auto !important;
    height: 21px !important;
    max-width: 48px !important;
    object-fit: contain;
  }

  .symbol-card .signal-shell {
    position: absolute !important;
    top: 44px !important;
    left: 14px !important;
    width: calc(55% - 20px) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .symbol-card .signal-box {
    display: grid !important;
    place-items: center;
    width: 100% !important;
    height: 66px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid rgba(233, 169, 47, 0.9) !important;
    border-radius: 16px !important;
    background: linear-gradient(145deg, rgba(91, 55, 8, 0.08), rgba(10, 13, 17, 0.42)) !important;
    box-shadow: inset 0 0 20px rgba(233, 169, 47, 0.035), 0 0 16px rgba(233, 169, 47, 0.04) !important;
  }

  .symbol-card .signal-text {
    max-width: 100% !important;
    font-size: clamp(27px, 8.5vw, 36px) !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: -1px !important;
    white-space: nowrap !important;
  }

  .symbol-card .signal-text.wait-text {
    color: #e5ad4e !important;
    text-shadow: 0 0 18px rgba(233, 169, 47, 0.2) !important;
  }

  .symbol-card .metric-label {
    position: absolute !important;
    left: 56% !important;
    width: calc(44% - 15px) !important;
    margin: 0 !important;
    padding: 2px 0 0 !important;
    color: #eff3f8 !important;
    font-size: 11px !important;
    font-weight: 720 !important;
    white-space: nowrap;
  }

  #eurusd-buy-label,
  #gold-buy-label {
    top: 32px !important;
  }

  #eurusd-sell-label,
  #gold-sell-label {
    top: 62px !important;
  }

  .symbol-card .metric-label.conf-label {
    top: 92px !important;
  }

  .symbol-card .bar-wrap {
    position: absolute !important;
    left: 56% !important;
    width: calc(44% - 15px) !important;
    height: 9px !important;
    margin: -2px 0 5px !important;
    padding: 0 !important;
  }

  #eurusd-buy-label + .bar-wrap,
  #gold-buy-label + .bar-wrap {
    top: 49px !important;
  }

  #eurusd-sell-label + .bar-wrap,
  #gold-sell-label + .bar-wrap {
    top: 79px !important;
  }

  .symbol-card .bar-wrap.conf-wrap {
    top: 109px !important;
  }

  .symbol-card .glow-bar {
    height: 8px !important;
    border-radius: 999px !important;
    background: #121d2a !important;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45) !important;
  }

  .symbol-card .signal-freshness-note {
    position: absolute !important;
    top: 113px !important;
    left: 15px !important;
    width: calc(55% - 20px);
    font-size: 9px !important;
  }

  .symbol-card .tags-row {
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    width: 100% !important;
    min-height: 43px;
    margin: 0 !important;
    padding: 6px 14px !important;
    border-top: 1px solid rgba(54, 91, 128, 0.34);
  }

  .symbol-card .glow-tag {
    min-width: 0 !important;
    height: 27px !important;
    padding: 0 8px !important;
    border: 1px solid #334154 !important;
    border-radius: 999px !important;
    background: linear-gradient(145deg, #151e2a, #0b121d) !important;
    color: #dbe2ec !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    white-space: nowrap;
  }

  .chart-panel .chart-wrap,
  .chart-panel .chart-section {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  .chart-section .chart-controls {
    position: relative !important;
    z-index: 4;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    width: 100% !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 8px 8px 0 !important;
    border: 1px solid rgba(68, 111, 151, 0.55) !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: #05101b !important;
  }

  .chart-controls .chart-symbols,
  .chart-controls .chart-timeframes {
    display: flex !important;
    gap: 5px !important;
  }

  .chart-controls button {
    min-width: 0 !important;
    height: 28px !important;
    padding: 0 8px !important;
    border: 1px solid #20344a !important;
    border-radius: 7px !important;
    background: #0b1828 !important;
    color: #aebbd0 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
  }

  body.fit-mode .chart-panel .chart-box {
    position: relative !important;
    width: 100% !important;
    height: 250px !important;
    min-height: 250px !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(68, 111, 151, 0.55) !important;
    border-top: 0 !important;
    border-radius: 0 0 18px 18px !important;
    background: #040d17 !important;
  }

  .chart-overlay-header {
    top: 8px !important;
    left: 10px !important;
    max-width: calc(100% - 20px);
  }

  #chartOverlayTitle {
    font-size: 17px !important;
  }

  #chartOverlayOhlc {
    margin-top: 7px !important;
    font-size: 9px !important;
    white-space: nowrap;
  }

  body.fit-mode .chart-box #chartContainer {
    width: 100% !important;
    height: 250px !important;
    min-height: 250px !important;
  }

  .chart-section > .structure-panel {
    display: none !important;
  }

  .history-section,
  body.fit-mode .history-section {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 12px 0 0 !important;
    padding: 9px 9px 7px !important;
    overflow: hidden !important;
    border: 1px solid rgba(68, 111, 151, 0.55) !important;
    border-radius: 18px !important;
    background: var(--phone-card) !important;
  }

  .history-header h2 {
    margin: 0 0 7px !important;
    color: #f5f7fb !important;
    font-size: 17px !important;
    letter-spacing: -0.35px;
  }

  .history-table-wrap {
    width: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  .history-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .history-table th,
  .history-table td {
    min-width: 0 !important;
    padding: 6px 2px !important;
    overflow: hidden;
    color: #e9edf4;
    font-size: clamp(8px, 2.5vw, 10px) !important;
    text-align: center !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-table th {
    color: #aeb8c7 !important;
    font-weight: 750 !important;
  }

  .history-table th:first-child,
  .history-table td:first-child {
    width: 22% !important;
    text-align: left !important;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    width: 18% !important;
  }

  .history-table th:nth-child(4),
  .history-table td:nth-child(4) {
    width: 18% !important;
  }

  .history-table .history-badge,
  .history-table .badge {
    min-width: 0 !important;
    padding: 4px 5px !important;
    font-size: 8px !important;
  }

  body.fit-mode #mainApp.app:not(.locked) > .footer {
    display: none !important;
  }

  .mobile-domain-pill {
    position: fixed;
    z-index: 700;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 178px;
    height: 39px;
    padding: 0 16px;
    transform: translateX(-50%);
    border: 1px solid rgba(76, 114, 154, 0.55);
    border-radius: 999px;
    background: rgba(11, 20, 32, 0.94);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.04);
    color: #e8edf5;
    font-size: 13px;
    text-decoration: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar,
  body.fit-mode #mainApp.app:not(.locked) > #sideMenu.app-sidebar.hidden {
    top: 0 !important;
    height: 100dvh !important;
  }

  body.fit-mode #mainApp.app:not(.locked).menu-drawer-open::after {
    inset: 0 !important;
  }

  /* Phone attached pages fill the viewport after the drawer closes. */
  body[data-active-settings-page="assistant"] #assistantModal,
  body[data-active-settings-page="auto-trade"] #paperModal,
  body[data-active-settings-page="performance"] #statsModal,
  body[data-active-settings-page^="settings:"] #settingsModal,
  body[data-active-settings-page="broker-accounts"] #brokerAccountsModal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    padding: 8px !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    background: rgba(1, 6, 14, 0.88) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 1200 !important;
  }

  body[data-active-settings-page="assistant"] #assistantModal .assistant-modal-box,
  body[data-active-settings-page="auto-trade"] #paperModal .trade-modal-box,
  body[data-active-settings-page="performance"] #statsModal .performance-modal-box,
  body[data-active-settings-page^="settings:"] #settingsModal .settings-modal-box {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border: 1px solid #1b3047 !important;
    border-radius: 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52) !important;
  }

  body[data-active-settings-page="broker-accounts"] #brokerAccountsModal .broker-settings-shell {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid #1b3047 !important;
    border-radius: 16px !important;
    background: #06101c !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52) !important;
  }

  body[data-active-settings-page="broker-accounts"] #brokerAccountsModal .broker-settings-content {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 18px 14px 28px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #brokerAccountsModal .broker-settings-header {
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 4px 46px 16px 0 !important;
  }

  #brokerAccountsModal .broker-settings-header h2 {
    margin-bottom: 7px !important;
    font-size: 24px !important;
  }

  #brokerAccountsModal .broker-settings-header p {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  .broker-mobile-close {
    position: absolute;
    top: 0;
    right: 0;
    display: grid !important;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #2b4058;
    border-radius: 10px;
    background: #0c1826;
    color: #e7edf5;
    font-size: 24px;
    line-height: 1;
  }

  #brokerAccountsModal .broker-connection-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    gap: 14px !important;
    margin-bottom: 12px !important;
    padding: 15px !important;
  }

  #brokerAccountsModal .broker-section-title {
    flex-wrap: wrap !important;
    font-size: 16px !important;
  }

  #brokerAccountsModal .broker-account-status,
  #brokerAccountsModal .broker-authorized-text {
    margin-top: 7px !important;
    font-size: 13px !important;
    overflow-wrap: anywhere;
  }

  #brokerAccountsModal .broker-account-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #brokerAccountsModal .broker-action-btn {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 13px !important;
  }

  #brokerAccountsModal .broker-settings-main {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: 100% !important;
    gap: 12px !important;
  }

  #brokerAccountsModal .broker-settings-main > main,
  #brokerAccountsModal .broker-right-panel {
    display: contents !important;
  }

  #brokerAccountsModal .broker-accounts-card,
  #brokerAccountsModal .broker-active-card,
  #brokerAccountsModal .broker-side-actions,
  #brokerAccountsModal .broker-about-card {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 15px !important;
  }

  #brokerAccountsModal .broker-accounts-card {
    order: 1;
  }

  #brokerAccountsModal .broker-active-card {
    order: 2;
  }

  #brokerAccountsModal .broker-side-actions {
    order: 3;
  }

  #brokerAccountsModal .broker-about-card {
    order: 4;
  }

  #brokerAccountsModal .broker-accounts-heading {
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  #brokerAccountsModal .broker-count-pill {
    flex: 0 0 auto;
    max-width: 94px;
    padding: 5px 7px !important;
    font-size: 9px !important;
    text-align: center;
  }

  #brokerAccountsModal .broker-account-table-wrap {
    width: 100% !important;
    overflow: visible !important;
    border: 0 !important;
  }

  #brokerAccountsModal .broker-account-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  #brokerAccountsModal .broker-account-table thead {
    display: none !important;
  }

  #brokerAccountsModal .broker-account-table tbody,
  #brokerAccountsModal .broker-account-table tr {
    display: block !important;
    width: 100% !important;
  }

  #brokerAccountsModal .broker-account-table tr {
    margin-bottom: 10px !important;
    padding: 8px 10px !important;
    overflow: hidden;
    border: 1px solid #1d3045 !important;
    border-radius: 10px !important;
    background: #08131f !important;
  }

  #brokerAccountsModal .broker-account-table td {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.09) !important;
    overflow: visible !important;
    font-size: 12px !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
  }

  #brokerAccountsModal .broker-account-table td:last-child {
    border-bottom: 0 !important;
  }

  #brokerAccountsModal .broker-account-table td::before {
    color: #8796aa;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  #brokerAccountsModal .broker-account-table td:nth-child(1)::before { content: "ID"; }
  #brokerAccountsModal .broker-account-table td:nth-child(2)::before { content: "Number"; }
  #brokerAccountsModal .broker-account-table td:nth-child(3)::before { content: "Broker"; }
  #brokerAccountsModal .broker-account-table td:nth-child(4)::before { content: "Type"; }
  #brokerAccountsModal .broker-account-table td:nth-child(5)::before { content: "Balance"; }
  #brokerAccountsModal .broker-account-table td:nth-child(6)::before { content: "Currency"; }
  #brokerAccountsModal .broker-account-table td:nth-child(7)::before { content: "Status"; }
  #brokerAccountsModal .broker-account-table td:nth-child(8)::before { content: "Active"; }

  #brokerAccountsModal .broker-account-table td:nth-child(8) {
    grid-template-columns: 72px minmax(0, 1fr) !important;
    width: 100% !important;
  }

  #brokerAccountsModal .broker-active-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: start !important;
    width: auto !important;
    min-width: 64px !important;
    max-width: none !important;
    padding: 5px 10px !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
    line-height: 1 !important;
  }

  #brokerAccountsModal .broker-account-table td[colspan] {
    display: block !important;
    padding: 14px 4px !important;
    text-align: center !important;
  }

  #brokerAccountsModal .broker-account-table td[colspan]::before {
    content: none !important;
  }

  #brokerAccountsModal .broker-active-title {
    margin-bottom: 14px !important;
    font-size: 16px !important;
  }

  #brokerAccountsModal .broker-active-card strong {
    font-size: 22px !important;
  }

  #brokerAccountsModal .broker-side-btn {
    min-height: 44px !important;
    font-size: 13px !important;
  }

  #brokerAccountsModal .broker-side-actions h3 {
    margin-bottom: 12px !important;
    font-size: 17px !important;
  }

  #brokerAccountsModal .broker-side-action {
    min-height: 62px !important;
    padding: 11px !important;
    font-size: 12px !important;
  }
}

.broker-mobile-close {
  display: none;
}

@media (max-width: 700px) {
  .broker-mobile-close {
    display: grid !important;
  }
}

@media (min-width: 701px) {
  body.fit-mode #mainApp.app:not(.locked) > .performance-strip {
    grid-template-columns:
      minmax(154px, 0.8fr)
      minmax(182px, 0.95fr)
      minmax(178px, 0.92fr)
      minmax(182px, 0.95fr)
      minmax(122px, 0.58fr) !important;
  }

  .performance-daily {
    grid-template-columns: 30px minmax(96px, 1fr) !important;
  }

  .performance-monthly {
    grid-template-columns: 30px minmax(108px, 1fr) !important;
  }
}

/* Compact SMC dashboard cleanup */
.main-smc-panel .smc-row {
  display: grid !important;
  grid-template-columns: 94px minmax(0, 1fr) !important;
  align-items: start !important;
  column-gap: 10px !important;
  min-height: 25px !important;
  padding: 4px 0 !important;
}

.main-smc-panel .smc-row span:last-child {
  min-width: 0 !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: anywhere !important;
  text-align: right !important;
  line-height: 1.2 !important;
  max-height: 2.4em !important;
}

.main-smc-panel .signal-blocker-row span:last-child {
  max-height: 3.6em !important;
}

.main-smc-panel,
body.fit-mode .main-smc-panel {
  min-height: min(620px, calc(100vh - 280px)) !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.main-trade-card,
body.fit-mode .main-trade-card {
  overflow-y: auto !important;
}

.smc-plan-intel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(188, 128, 32, 0.24);
}

.smc-intel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.smc-intel-levels {
  grid-template-columns: 1fr;
  margin-top: 7px;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(54, 74, 99, 0.68);
  border-radius: 8px;
  background: rgba(6, 14, 24, 0.58);
}

.smc-intel-grid span,
.smc-intel-section > span,
.smc-intel-progress span {
  display: block;
  margin-bottom: 4px;
  color: #91a2b7;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.smc-intel-grid strong,
.smc-intel-progress strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smc-intel-section {
  margin-top: 7px;
}

.smc-intel-section ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.smc-intel-section li {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.smc-intel-section li b {
  flex: 0 0 auto;
  font-size: 11px;
}

.smc-intel-section li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smc-intel-section li.complete b {
  color: #35ff8a;
}

.smc-intel-section li.missing b {
  color: #ff5b66;
}

.smc-intel-section li.info b {
  color: #8aa0b8;
}

.smc-intel-section li.info span {
  color: #9fb0c4;
}

.smc-intel-progress {
  margin-top: 7px;
  padding: 7px 8px 8px;
}

.smc-intel-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.smc-progress-track {
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}

.smc-progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6c744, #35ff8a);
  transition: width 220ms ease;
}

.smc-plan-intel.is-ready .smc-progress-track i {
  background: linear-gradient(90deg, #35ff8a, #7df7b1);
}

@media (max-width: 850px) {
  .main-smc-panel,
  body.fit-mode .main-smc-panel {
    min-height: auto !important;
  }

  .smc-intel-grid,
  .smc-intel-levels,
  .smc-intel-section ul {
    grid-template-columns: 1fr;
  }
}

.entry-strategy-debug {
  min-height: 0 !important;
  max-height: none !important;
  padding: 9px 10px 10px !important;
  overflow: visible !important;
}

.entry-strategy-debug summary {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

.entry-strategy-debug-grid {
  grid-template-columns: minmax(0, 1fr) minmax(82px, auto) !important;
  gap: 5px 8px !important;
  margin-top: 8px !important;
  font-size: 10.5px !important;
  line-height: 1.15 !important;
  overflow: visible !important;
}

.entry-strategy-debug-grid span,
.entry-strategy-debug-grid strong {
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.entry-strategy-debug-grid strong {
  text-align: right !important;
  font-size: 10px !important;
}

.entry-strategy-debug-grid .strategy-debug-reason-label {
  grid-column: 1 / -1 !important;
  margin-top: 2px !important;
}

#strategy-debug-block-reason {
  grid-column: 1 / -1 !important;
  white-space: normal !important;
  line-height: 1.18 !important;
  text-align: left !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.5em !important;
  font-size: 10.25px !important;
  color: #f5b84b !important;
}

.chart-section {
  min-height: 0 !important;
}

.history-section,
body.fit-mode .history-section {
  flex: 1 1 260px !important;
  height: auto !important;
  min-height: 230px !important;
  display: flex !important;
  flex-direction: column !important;
}

.history-table-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body.hide-recent-history-ui .history-section {
  display: none !important;
}

/* Final desktop spacing fix: let the middle trade card grow instead of trapping SMC in a tiny scroll area. */
.main-trade-card,
body.fit-mode .main-trade-card {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.main-trade-panel,
body.fit-mode .main-trade-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

body.fit-mode .entry-strategy-debug,
.entry-strategy-debug {
  min-height: 178px !important;
  margin-bottom: 18px !important;
  overflow: hidden !important;
}

body.fit-mode .entry-strategy-debug-grid,
.entry-strategy-debug-grid {
  row-gap: 5px !important;
}

body.fit-mode #strategy-debug-block-reason,
#strategy-debug-block-reason {
  display: block !important;
  min-height: 30px !important;
  max-height: 38px !important;
  overflow: hidden !important;
}

body.fit-mode .main-bottom-row,
.main-bottom-row {
  margin-top: 16px !important;
  flex: 0 0 auto !important;
}

/* Restore SMC Plan horizontal detail layout after all compact overrides. */
.smc-intel-grid,
body.fit-mode .smc-intel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.smc-intel-levels,
body.fit-mode .smc-intel-levels {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.smc-intel-section ul,
body.fit-mode .smc-intel-section ul {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.smc-intel-grid div,
.smc-intel-section,
.smc-intel-progress,
body.fit-mode .smc-intel-grid div,
body.fit-mode .smc-intel-section,
body.fit-mode .smc-intel-progress {
  min-width: 0 !important;
}

.smc-intel-grid strong,
.smc-intel-progress strong,
.smc-intel-section li span,
body.fit-mode .smc-intel-grid strong,
body.fit-mode .smc-intel-progress strong,
body.fit-mode .smc-intel-section li span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body:not([data-user-role="admin"]) #menuStatsBtn,
body:not([data-user-role="admin"]) #menuRiskSettingsBtn,
body:not([data-user-role="admin"]) #menuBrokerAccountsBtn,
body:not([data-user-role="admin"]) #livePageBtn,
body:not([data-user-role="admin"]) #liveAutoSection,
body:not([data-user-role="admin"]) #brokerConnectionStatus,
body:not([data-user-role="admin"]) #liveActiveOrders,
body:not([data-user-role="admin"]) #liveAutoSymbolStatus,
body:not([data-user-role="admin"]) .main-buttons-row,
body:not([data-user-role="admin"]) .entry-strategy-debug,
body:not([data-user-role="admin"]) .main-smc-panel,
body:not([data-user-role="admin"]) #tradeLevelDragLayer,
body:not([data-user-role="admin"]) #tradeLevelPreview,
body:not([data-user-role="admin"]) #tradeLevelConfirmModal {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.user-live-auto-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #86efac;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

body[data-user-role="admin"] .user-live-auto-status {
  display: none !important;
}
.news-trading-mode-badge {
  color: #f5b942;
  border: 1px solid rgba(245, 185, 66, 0.45);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.news-mode-settings-card {
  border: 1px solid #263c54;
  border-radius: 14px;
  padding: 20px;
  background: #0c1521;
  color: #e8eef7;
}

.news-mode-settings-heading,
.news-mode-settings-actions,
.news-mode-account-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.news-mode-settings-heading h3 { margin: 0 0 5px; }
.news-mode-settings-heading p { margin: 0; color: #91a2b8; }
.news-mode-settings-heading > strong { color: #f5b942; white-space: nowrap; }

.news-mode-account-context {
  justify-content: flex-start;
  margin: 18px 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #101e2d;
  color: #9fb0c4;
}

.news-mode-account-context strong { color: #fff; }

.news-mode-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.news-mode-options label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid #263c54;
  border-radius: 10px;
  cursor: pointer;
}

.news-mode-options label:has(input:checked) {
  border-color: #f5b942;
  background: rgba(245, 185, 66, 0.08);
}

.news-mode-options input { margin-top: 3px; accent-color: #f5b942; }
.news-mode-options span { display: grid; gap: 4px; }
.news-mode-options small { color: #91a2b8; line-height: 1.4; }

.news-mode-settings-actions { margin-top: 18px; }
.news-mode-settings-actions span { color: #91a2b8; }
.news-mode-settings-actions span.is-success { color: #4ade80; }
.news-mode-settings-actions span.is-error { color: #fb7185; }
.news-mode-settings-actions button,
.news-mode-confirm-actions button {
  border: 1px solid #f5b942;
  border-radius: 8px;
  padding: 9px 20px;
  background: #f5b942;
  color: #07101b;
  font-weight: 800;
  cursor: pointer;
}
.news-mode-settings-actions button:disabled { opacity: 0.5; cursor: wait; }

.news-mode-confirm-box { max-width: 470px; }
.news-mode-confirm-box p { color: #a9b7c9; line-height: 1.55; }
.news-mode-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.news-mode-confirm-actions #newsModeConfirmCancelBtn { background: transparent; color: #d7e0eb; border-color: #41536a; }

@media (max-width: 620px) {
  .news-mode-settings-heading,
  .news-mode-settings-actions,
  .news-mode-account-context { align-items: flex-start; flex-direction: column; }
}
