:root {
  --bg:         #0a0a0f;
  --bg2:        #12121a;
  --bg3:        #1a1a26;
  --bg4:        #22223a;
  --border:     #2a2a40;
  --border2:    #3a3a55;
  --text:       #ffffff;
  --text2:      #8888aa;
  --text3:      #4a4a6a;
  --accent:     #f0b429;
  --accent2:    #ffd166;
  --accent-bg:  rgba(240,180,41,0.08);
  --accent-glow:rgba(240,180,41,0.13);
  --gold:       #f0b429;
  --gold2:      #ffd166;
  --teal:       #00d4aa;
  --teal2:      #00ffcc;
  --green:      #22c55e;
  --green-bg:   #0d2e1a;
  --red:        #ef4444;
  --red-bg:     #2d1215;
  --yellow:     #eab308;
  --yellow-bg:  #2d2008;
  --topbar-h:   56px;
  --bottom-h:   68px;
}

[data-theme="light"] {
  --bg:        #f0f0f8;
  --bg2:       #ffffff;
  --bg3:       #eaeaf5;
  --bg4:       #e0e0f0;
  --border:    #d0d0e8;
  --border2:   #b0b0d0;
  --text:      #0a0a1a;
  --text2:     #5555775;
  --text3:     #9090b0;
  --accent:    #c97a00;
  --accent2:   #f0b429;
  --accent-bg: rgba(240,180,41,0.1);
  --gold:      #c97a00;
  --gold2:     #f0b429;
  --teal:      #009977;
  --teal2:     #00d4aa;
  --green:     #16a34a;
  --green-bg:  #dcfce7;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --yellow:    #ca8a04;
  --yellow-bg: #fef9c3;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 200;
  backdrop-filter: blur(10px);
}

.topbar-logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.three-dots {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1;
  transition: all .2s;
}
.three-dots:hover { background: var(--bg4); border-color: var(--accent); }

.user-avatar { cursor: pointer; }

/* ===== SETTINGS DROPDOWN ===== */
.settings-dropdown {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 12px;
  width: 320px;
  max-height: calc(100vh - var(--topbar-h) - 20px);
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 300;
  padding: 4px 0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

.settings-dropdown-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  padding: 12px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-dropdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.settings-dropdown-footer {
  font-size: 11px;
  color: var(--text3);
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle { display: flex; gap: 4px; }
.theme-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}
.theme-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 600; }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--bg4); border-radius: 24px; transition: .3s; }
.toggle-slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: var(--text2); border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); background: #fff; }

/* ===== MAIN ===== */
.main {
  margin-top: var(--topbar-h);
  padding-bottom: 100px;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  flex: 1;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
body.is-pc .main {
  padding-bottom: 80px;
}

/* Standard tab padding — mobile first */
#tab-dashboard,
#tab-history,
#tab-strategy,
#tab-performance {
  padding: 14px 16px;
  padding-bottom: 100px;
}
/* Chart tabs: no padding — internal layout handles it */
#tab-chart, #tab-backtest, #tab-livechart { padding: 0; }

#tab-news,
#tab-bots,
#tab-botmanager {
  padding: 16px;
  padding-bottom: calc(var(--bottom-h) + 32px);
}

.tab { display: none; }
.tab.active { display: block; }
/* Livechart tab uses grid layout on desktop — must override display:block */
body.is-pc #tab-livechart.active { display: grid !important; }

h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.subtitle { color: var(--text2); margin-bottom: 20px; font-size: 13px; }
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 16px;
  right: 16px;
  height: auto;
  min-height: 60px;
  /* Floating glass pill — PipNex style */
  background: rgba(13, 13, 20, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 26px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.04) inset;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.bottom-btn {
  background: none;
  border: none;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all .2s;
  font-size: 10px;
  font-weight: 500;
  min-width: 56px;
  position: relative;
}

.bottom-btn svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.bottom-btn.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ===== CARDS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }
.card:active { transform: scale(0.97); }

.card-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-bg);
}

.card-info h3 { font-size: 12px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.card-info p  { font-size: 10px; color: var(--text2); }

/* ===== STATUS BAR ===== */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.status-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.red   { background: var(--red); }

/* ===== SIGNAL BOX ===== */
.signal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.signal-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.signal-header {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.signal-pair { font-size: 22px; font-weight: 800; color: var(--text); }

.signal-direction {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.signal-direction.BUY  { background: var(--green-bg);  color: var(--green); border: 1px solid var(--green); }
.signal-direction.SELL { background: var(--red-bg);    color: var(--red);   border: 1px solid var(--red);   }
.signal-direction.WAIT { background: var(--yellow-bg); color: var(--yellow);border: 1px solid var(--yellow);}

.signal-confidence { grid-column: 1/-1; }

.confidence-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 8px;
}

.confidence-track {
  position: relative;
  height: 14px;
  background: var(--bg4);
  border-radius: 7px;
  margin-bottom: 6px;
  overflow: visible;
}

.confidence-fill {
  height: 100%;
  border-radius: 7px;
  position: absolute;
  top: 0; left: 0;
  transition: none;
}

.confidence-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3px solid var(--bg2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
}

.confidence-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
}

.signal-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.signal-item-label { font-size: 10px; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.signal-item-value { font-size: 14px; font-weight: 700; color: var(--text); }
.signal-item-value.buy  { color: var(--green); }
.signal-item-value.sell { color: var(--red);   }

.signal-reason {
  grid-column: 1/-1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
}

.signal-source {
  grid-column: 1/-1;
  font-size: 10px;
  color: var(--text3);
  text-align: right;
}

/* ===== DASHBOARD CALENDAR ===== */
.dash-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  transition: border-color .2s;
}
.dash-event:hover { border-color: var(--accent); }
.dash-event-time { color: var(--text2); min-width: 90px; font-size: 11px; }
.dash-event-name { flex: 1; color: var(--text); font-weight: 500; }
.dash-countdown   { font-size: 11px; color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label { display: block; font-size: 11px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border .2s, box-shadow .2s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; font-family: inherit; }
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
/* ===== STRATEGY PILLS ===== */
.strategy-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
}
.pill:hover  { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c97a00);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-bottom: 14px;
  width: 100%;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover   { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active  { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-copy  { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .2s; }
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

.btn-close { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; }

.btn-send {
  background: linear-gradient(135deg, var(--accent), #c97a00);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-voice {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  margin-right: 8px;
  transition: all .2s;
}
.btn-voice:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

.btn-voice-stop { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); padding: 10px 18px; border-radius: 10px; font-size: 13px; cursor: pointer; margin-top: 10px; }

/* ===== LOADING & RESULTS ===== */
.loading {
  color: var(--accent);
  font-size: 13px;
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.loading::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid var(--accent-bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 10px;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 13px;
  color: var(--text);
}

.hidden { display: none !important; }

/* ===== UPLOAD ===== */
.upload-area {
  border: 2px dashed var(--border2);
  border-radius: 16px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 14px;
  color: var(--text2);
  font-size: 13px;
  background: var(--bg2);
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-glow); }
.upload-icon { font-size: 32px; color: var(--accent); margin-bottom: 8px; }
.upload-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
#image-preview-container { margin-bottom: 14px; }
#image-preview { max-width: 100%; border-radius: 14px; border: 1px solid var(--border); display: block; }

/* ===== NEWS ===== */
.news-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.news-tab-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  flex: 1;
  text-align: center;
}
.news-tab-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 700; }

.calendar-event {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.calendar-event:hover { border-color: var(--accent); }

.event-left { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.event-time { font-size: 11px; color: var(--text2); min-width: 105px; padding-top: 2px; }

.event-currency {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.event-currency.USD { background: #0c1d6b; color: #6699ff; }
.event-currency.EUR { background: #1a1440; color: #aa88ff; }
.event-currency.GBP { background: #0a2010; color: #44dd88; }
.event-currency.CAD { background: #2d1a00; color: #ffaa44; }
.event-currency.JPY { background: #2d0a0a; color: #ff6666; }
.event-currency.AUD { background: #0a2020; color: #44ddcc; }
.event-currency.CHF { background: #1a1a2d; color: #aaaaff; }
.event-currency.NZD { background: #0a1a20; color: #44bbcc; }

.event-name    { font-size: 13px; font-weight: 600; color: var(--text); }
.event-details { font-size: 11px; color: var(--text2); margin-top: 3px; }

.event-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.event-countdown { font-size: 12px; color: var(--accent); font-weight: 700; }

.impact-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.impact-badge.High   { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red);    }
.impact-badge.Medium { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.impact-badge.Low    { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green);  }

.btn-brain {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  transition: all .2s;
  line-height: 1;
}
.btn-brain:hover { background: var(--accent); }

.event-analysis-inline { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.event-result-text { font-size: 12px; color: var(--text2); line-height: 1.7; max-height: 200px; overflow-y: auto; }
.event-signal-box { margin-top: 8px; }
.event-analysis-header { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; }

.headlines-list { margin-top: 16px; }
.headlines-list h3 { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.headline-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 12px; color: var(--text); }
.headline-source { color: var(--accent); font-size: 11px; margin-top: 3px; }

/* ===== CHAT ===== */
.chat-container {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  height: 340px;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message { display: flex; }
.chat-message.ai   { justify-content: flex-start; }
.chat-message.user { justify-content: flex-end; }

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}
.chat-message.ai   .chat-bubble { background: var(--bg3); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-message.user .chat-bubble { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #000; border-bottom-right-radius: 4px; }

.chat-input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.chat-input-row input { flex: 1; }

/* ===== BOT LIST ===== */
.bot-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; transition: border-color .2s; }
.bot-item:hover { border-color: var(--accent); }
.bot-item-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.bot-item-info p  { font-size: 11px; color: var(--text2); }
.bot-status { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.bot-status.stopped  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.bot-status.started  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.bot-status.paused   { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }

/* ===== CODE ===== */
.code-header { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; }
pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent2);
  font-family: 'Fira Code', 'Consolas', monospace;
}

/* ===== STRATEGY WIZARD ===== */
.wizard-step { margin-bottom: 22px; }
.wizard-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }

.option-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.option-card:hover    { border-color: var(--accent); box-shadow: 0 4px 16px var(--accent-glow); }
.option-card.selected { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 4px 16px var(--accent-glow); }

.option-icon  { font-size: 24px; margin-bottom: 6px; }
.option-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.option-desc  { font-size: 11px; color: var(--text2); }

.multi-select-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.multi-option {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
}
.multi-option:hover    { border-color: var(--accent); color: var(--accent); }
.multi-option.selected { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ===== MTF TOGGLE ===== */
.mtf-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.mtf-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.mtf-desc  { font-size: 11px; color: var(--text2); display: block; }
.mtf-uploads { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mtf-upload-item { display: flex; flex-direction: column; gap: 6px; }
.mtf-tf-label { font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.mtf-tf-select { font-size: 12px; padding: 6px 10px; }
.upload-area-sm { padding: 16px 8px; }
.upload-area-sm p { font-size: 11px; }

/* ===== PREVIEW ===== */
.preview-wrapper { position: relative; margin-bottom: 14px; }
.preview-wrapper img { width: 100%; border-radius: 14px; border: 1px solid var(--border); display: block; }
.preview-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn-preview-action { flex: 1; background: var(--bg3); color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer; transition: all .2s; text-align: center; }
.btn-preview-action:hover { border-color: var(--accent); color: var(--accent); }
.btn-preview-action.danger { color: var(--red); }
.btn-preview-action.danger:hover { background: var(--red-bg); border-color: var(--red); }

/* ===== BACKTEST ===== */
.bt-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.bt-stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; text-align: center; }
.bt-stat-label { font-size: 10px; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.bt-stat-value { font-size: 17px; font-weight: 800; color: var(--text); }
.bt-equity-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.bt-ai-section { margin-bottom: 16px; }
.bt-trades-section { margin-bottom: 16px; }
.bt-trade-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.bt-trade-dir { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 8px; min-width: 44px; text-align: center; }
.bt-trade-dir.buy  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.bt-trade-dir.sell { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red);   }
.bt-trade-info { flex: 1; }
.bt-trade-result { font-size: 12px; font-weight: 800; text-align: right; min-width: 50px; }
.bt-trade-result.win  { color: var(--green); }
.bt-trade-result.loss { color: var(--red);   }

/* ===== BOT MANAGER ===== */
.bot-manager-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.bm-empty { text-align: center; padding: 48px 20px; color: var(--text2); font-size: 14px; }
.bm-empty-icon { font-size: 48px; margin-bottom: 12px; }
.bm-bot-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 14px; transition: border-color .2s; }
.bm-bot-card:hover { border-color: var(--accent); }
.bm-bot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bm-bot-name { font-size: 15px; font-weight: 700; color: var(--text); }
.bm-bot-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.bm-bot-meta { display: flex; gap: 6px; font-size: 12px; color: var(--text2); margin-bottom: 14px; flex-wrap: wrap; }
.bm-bot-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.bm-stat { background: var(--bg3); border-radius: 10px; padding: 8px; text-align: center; }
.bm-stat-label { font-size: 10px; color: var(--text2); margin-bottom: 3px; text-transform: uppercase; font-weight: 600; }
.bm-stat-value { font-size: 14px; font-weight: 800; color: var(--text); }
.bm-bot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bm-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 7px 14px; border-radius: 10px; font-size: 12px; cursor: pointer; transition: all .2s; font-weight: 600; }
.bm-btn:hover  { background: var(--bg4); border-color: var(--accent); color: var(--accent); }
.bm-btn.start  { color: var(--green);  border-color: var(--green);  background: var(--green-bg); }
.bm-btn.pause  { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }
.bm-btn.stop   { color: var(--red);    border-color: var(--red);    background: var(--red-bg); }
.bm-btn.danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.bm-btn.code   { font-family: monospace; }
.bm-code-panel { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== TRADE SETUP BOX ===== */
.trade-setup-box { border: 2px solid var(--accent); border-radius: 16px; overflow: hidden; margin: 14px 0; box-shadow: 0 4px 20px var(--accent-glow); }
.trade-setup-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 13px; font-weight: 800; }
.trade-setup-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.trade-setup-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--bg3); border-radius: 10px; border: 1px solid var(--border); }
.entry-row { border-color: var(--accent); background: var(--accent-bg); }
.ts-label { font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.ts-value { font-size: 15px; font-weight: 800; color: var(--text); }
.ts-value.buy  { color: var(--green); }
.ts-value.sell { color: var(--red);   }
.trade-setup-confidence { margin-top: 4px; }
.trade-setup-note { background: var(--bg3); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text2); line-height: 1.5; border: 1px solid var(--border); }

/* ===== FUNDAMENTAL SIGNAL ===== */
.fundamental-signal-card { border: 2px solid var(--green); border-radius: 14px; overflow: hidden; margin-top: 12px; }
.fs-direction { padding: 10px 16px; font-size: 15px; font-weight: 800; text-align: center; letter-spacing: 0.5px; }
.fs-confidence-wrap { padding: 12px 16px; background: var(--bg3); }
.fs-conf-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
.fs-conf-track { position: relative; height: 12px; background: var(--bg4); border-radius: 6px; margin-bottom: 6px; overflow: visible; }
.fs-conf-fill  { height: 100%; border-radius: 6px; position: absolute; top: 0; left: 0; }
.fs-conf-thumb { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bg2); z-index: 2; }
.fs-event-name { font-size: 11px; color: var(--text3); text-align: center; padding: 6px 16px 10px; }

/* ===== SIGNAL AI CHAT ===== */
.signal-ai-chat { margin-top: 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.signal-chat-title { font-size: 11px; font-weight: 700; color: var(--text2); padding: 10px 14px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.8px; background: var(--bg3); }
.signal-chat-messages { padding: 12px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.signal-chat-msg { max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.signal-chat-msg.ai   { background: var(--bg3); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.signal-chat-msg.user { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
.signal-chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg3); }
.signal-chat-input-row input { flex: 1; font-size: 13px; padding: 8px 12px; background: var(--bg2); }

/* ===== LIVE CHART ===== */
.tradingview-container { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 14px; background: var(--bg2); min-height: 420px; }
#tradingview-widget { width: 100%; height: 420px; }
.live-chart-actions { text-align: center; margin-bottom: 8px; }
.live-chart-hint { font-size: 12px; color: var(--text2); margin-bottom: 10px; }

/* ===== EXECUTE TRADE ===== */
.execute-trade-box { background: var(--bg2); border: 2px solid var(--accent); border-radius: 16px; padding: 18px; margin: 14px 0; box-shadow: 0 4px 20px var(--accent-glow); }
.execute-title { font-size: 15px; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.mt5-status-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); margin-bottom: 12px; padding: 8px 12px; background: var(--bg3); border-radius: 10px; border: 1px solid var(--border); }
.btn-execute { width: 100%; background: linear-gradient(135deg, var(--accent), #c97a00); color: white; border: none; padding: 14px 20px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; transition: opacity .2s; letter-spacing: 0.3px; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-execute:hover { opacity: 0.9; }
.btn-execute:disabled { opacity: 0.4; cursor: not-allowed; }
.exec-result-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg3); border-radius: 8px; font-size: 13px; margin-bottom: 6px; }
.exec-status.queued { color: var(--green); font-weight: 700; }
.exec-status.error  { color: var(--red);   font-weight: 700; }

/* ===== DESKTOP ===== */
@media (min-width: 768px) {
  .main { padding: 28px 32px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .option-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .signal-card { grid-template-columns: 1fr 1fr 1fr; }
  h1 { font-size: 26px; }
  .bt-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .mtf-uploads { grid-template-columns: 1fr; }
  .bt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bm-bot-stats  { grid-template-columns: repeat(2, 1fr); }
  .signal-card   { grid-template-columns: 1fr 1fr; }
}
/* ===== NEWS HEADER ===== */
.news-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.news-impact-filter { display: flex; gap: 6px; }
.impact-filter-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all .2s; }
.impact-filter-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* ===== LIVE CHART CONTROLS ===== */
.live-chart-controls { display: flex; gap: 10px; margin-bottom: 10px; }
.live-select { flex: 1; padding: 9px 12px; font-size: 13px; }

/* ===== STRATEGY PRESETS ===== */
.strategy-preset-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.preset-title { font-size: 14px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.preset-subtitle { font-size: 12px; color: var(--text2); margin-bottom: 12px; }

/* ===== INDICATOR TABS ===== */
.indicator-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ind-tab { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all .2s; }
.ind-tab.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.ind-panel { display: none; }
.ind-panel.active { display: block; }

/* ===== TF PILLS ===== */
.tf-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tf-pill { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .2s; }
.tf-pill.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* ===== RISK SLIDER ===== */
.risk-slider-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.risk-slider-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.risk-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--bg4); outline: none; }
.risk-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--bg2); box-shadow: 0 2px 8px var(--accent-glow); }
.risk-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--bg2); }

/* ===== USER INITIALS ===== */
.user-initials-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--accent); }
.settings-user-section { display: flex; align-items: center; gap: 12px; padding: 16px; }
.settings-dropdown-divider { height: 1px; background: var(--border); }
/* ===== NEWS PIPNEX STYLE ===== */
.news-event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.news-event-card:active { background: var(--bg3); }
.news-event-card.high-impact {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.news-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.news-card-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge-next-up {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.news-card-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.countdown-timer {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.imminent-label {
  font-size: 10px;
  color: var(--yellow);
  font-weight: 600;
}

.news-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.news-card-left { flex: 1; }

.news-card-category {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.news-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}

.news-card-time {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
}

.news-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text2);
  flex-wrap: wrap;
}

.news-card-meta strong { color: var(--text); }

.btn-analyze-news {
  background: rgba(240,180,41,0.08);
  border: 1px solid rgba(240,180,41,0.3);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
  align-self: center;
}

.btn-analyze-news:hover {
  background: var(--accent);
  color: #fff;
}

.news-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text2);
  flex-wrap: wrap;
  gap: 8px;
}

.news-group-time { color: var(--text3); font-size: 11px; }

.group-analyze-btn {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.news-inline-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.news-analysis-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}

.news-fundamental-signal {
  border: 2px solid var(--green);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.nfs-direction {
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
}

.nfs-confidence-wrap {
  padding: 10px 16px;
  background: var(--bg3);
}

.nfs-conf-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 600;
}

.nfs-event {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  padding: 6px 16px 10px;
}

/* ===== NEWS TAB FIXES ===== */
#tab-news h1 { margin-bottom: 4px; }
.bm-btn.analyze { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.bm-btn.analyze:hover { background: var(--accent); color: #fff; }
.bm-ai-result { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== LIGHTWEIGHT CHARTS ===== */
.lwc-chart-wrapper {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

#lwc-container {
  width: 100%;
  height: 380px;
}

.lwc-price-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  background: var(--bg2);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 10;
}

.lwc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  color: var(--text2);
  font-size: 13px;
  z-index: 5;
}

.lwc-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.lwc-actions .btn-primary {
  flex: 1;
  margin-bottom: 0;
}
/* ===== HISTORY ===== */
.history-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.history-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.hs-val   { font-size: 20px; font-weight: 800; color: var(--text); }
.hs-label { font-size: 10px; color: var(--text2); margin-top: 3px; text-transform: uppercase; font-weight: 600; }

.history-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.history-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text2);
}

.history-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.history-card:hover { border-color: var(--accent); }

.history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-pair-row { display: flex; align-items: center; gap: 8px; }
.history-pair     { font-size: 16px; font-weight: 800; color: var(--text); }
.history-tf       { font-size: 11px; color: var(--text2); background: var(--bg3); padding: 2px 8px; border-radius: 6px; }
.history-strategy { font-size: 11px; color: var(--accent); background: var(--accent-bg); padding: 2px 8px; border-radius: 6px; }

.history-dir {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.history-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.history-level {
  background: var(--bg3);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.hl-label { font-size: 9px; color: var(--text3); text-transform: uppercase; display: block; margin-bottom: 2px; font-weight: 600; }
.hl-value { font-size: 12px; font-weight: 700; color: var(--text); }

.history-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.history-date { font-size: 11px; color: var(--text3); flex: 1; }

.history-result-btns { display: flex; gap: 6px; }

.btn-result {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-result.win  { background: var(--green-bg); color: var(--green); }
.btn-result.loss { background: var(--red-bg);   color: var(--red);   }
.btn-result:hover { opacity: 0.8; }

.history-analysis-preview {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
    }
 /* ===== PERFORMANCE ANALYTICS ===== */
.perf-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text2);
}

.perf-overview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.perf-stat-big { margin-bottom: 16px; }
.perf-stat-val { font-size: 52px; font-weight: 900; line-height: 1; }
.perf-stat-label { font-size: 13px; color: var(--text2); margin-top: 6px; font-weight: 600; }

.perf-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.perf-stat-sm {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px 6px;
}
.perf-sm-val   { font-size: 18px; font-weight: 800; color: var(--text); }
.perf-sm-label { font-size: 10px; color: var(--text2); margin-top: 2px; text-transform: uppercase; font-weight: 600; }

.perf-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.perf-rows { display: flex; flex-direction: column; gap: 10px; }

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

.perf-row-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 80px;
}

.perf-row-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
}

.perf-row-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

.perf-row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 70px;
  gap: 2px;
}

.perf-recent-section { margin-bottom: 16px; }

.perf-signal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.psc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.psc-pair { font-size: 14px; font-weight: 800; color: var(--text); }
.psc-tf   { font-size: 11px; color: var(--text2); background: var(--bg3); padding: 2px 8px; border-radius: 6px; }

.psc-levels {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.psc-levels strong { color: var(--text); }

.psc-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  }
/* ===== BACKTEST VISUAL STUDIO ===== */
.bt-visual-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.bvh-item { display: flex; flex-direction: column; gap: 2px; }
.bvh-label { font-size: 9px; color: #555577; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.bvh-val   { font-size: 12px; font-weight: 700; color: #c0c0d0; }

.bt-playback-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.bt-ctrl-btn {
  background: #1a1a2e;
  border: 1px solid #2a2a40;
  color: #c0c0d0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.bt-ctrl-btn:hover { background: #2a2a40; }
.bt-ctrl-btn.primary {
  background: linear-gradient(135deg, #f0b429, #c97a00);
  border-color: #f0b429;
  color: white;
  flex: 1;
}

.bt-visual-chart-container {
  width: 100%;
  height: 420px;
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.bt-tool-tab {
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  max-height: 450px;
  overflow-y: auto;
}

.tt-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1a1a2e;
}

.tt-stat { text-align: center; }
.tt-val   { font-size: 15px; font-weight: 800; color: #c0c0d0; }
.tt-label { font-size: 9px; color: #555577; text-transform: uppercase; font-weight: 700; margin-top: 3px; letter-spacing: 0.5px; }

.tt-progress-row { margin-bottom: 12px; }
.tt-progress-bar {
  height: 4px;
  background: #1a1a2e;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.tt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f0b429, #26a69a);
  border-radius: 2px;
  transition: width .3s;
}

.tt-current-trade {
  background: #0a0a12;
  border: 1px solid #2a2a40;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.tt-trade-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tt-dir {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.tt-dir.buy  { background: rgba(38,166,154,0.15); color: #26a69a; }
.tt-dir.sell { background: rgba(239,83,80,0.15);  color: #ef5350; }

.tt-trade-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.tt-level { text-align: center; background: #1a1a2e; border-radius: 6px; padding: 5px 4px; }
.tt-level span   { display: block; font-size: 9px; color: #555577; margin-bottom: 2px; }
.tt-level strong { font-size: 10px; font-weight: 700; color: #c0c0d0; }

.tt-trade-pnl {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  background: #1a1a2e;
  border-radius: 8px;
  padding: 6px;
}

.tt-history-section { margin-top: 10px; }
.tt-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #1a1a2e;
  gap: 6px;
}

/* Final results */
.btf-header {
  background: linear-gradient(135deg, rgba(240,180,41,0.15), rgba(38,166,154,0.1));
  border: 1px solid rgba(240,180,41,0.3);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #c0c0d0;
  margin-bottom: 16px;
}

.btf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.btf-stat {
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.btf-val   { font-size: 14px; font-weight: 800; color: #c0c0d0; margin-bottom: 4px; }
.btf-label { font-size: 9px; color: #555577; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }

.btf-equity-section {
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.btf-ai-section {
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  padding: 14px;
}
.btf-ai-text { font-size: 13px; color: #8888aa; line-height: 1.7; white-space: pre-wrap; }
/* ===== LIBRARY ===== */
.bt-library-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.bt-library-section select {
  width: 100%;
}

.lib-info-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text);
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 16px 0;
}

.lib-tab-toggle {
  display: flex;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.lib-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s;
}
.lib-tab-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.lib-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
}

.lib-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.lib-card:hover { border-color: var(--accent); }

.lib-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.lib-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.lib-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.lib-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg3);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lib-card-wr {
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  min-width: 70px;
}

.lib-card-last-bt {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 10px;
}

.lib-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lib-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
}
.lib-btn:hover   { border-color: var(--accent); color: var(--accent); }
.lib-btn.primary { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.lib-btn.danger  { color: var(--red); border-color: var(--red); }

.lib-code-section { margin-top: 10px; }
.lib-code {
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 10px;
  color: #a0cfff;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre;
  font-family: monospace;
  margin-bottom: 8px;
}

.lib-doc-text {
  background: var(--bg3);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

.lib-bt-history { margin-top: 10px; }
.lib-bt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 6px;
  }
/* ===== RISK CALCULATOR ===== */
.risk-calc-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.risk-calc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-calc-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.risk-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

.risk-result-row strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  }
/* ===== PIPNEX STYLE ANALYSIS CARD ===== */
.pipnex-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}

.pipnex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.pipnex-header-left { display: flex; align-items: center; gap: 10px; }
.pipnex-pair  { font-size: 16px; font-weight: 800; color: var(--text); }
.pipnex-tf    { font-size: 12px; color: var(--text2); background: var(--bg3); padding: 2px 8px; border-radius: 6px; }

.pipnex-dir-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.pipnex-structure-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.pipnex-struct-item { display: flex; flex-direction: column; gap: 4px; }
.pipnex-struct-label { font-size: 10px; color: var(--text3); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.pipnex-struct-val   { font-size: 13px; font-weight: 700; color: var(--text); }

.pipnex-trend-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
}

.pipnex-strength-bar {
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0;
}
.pipnex-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}

.pipnex-levels-section { padding: 14px 16px; }
.pipnex-levels-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.pipnex-level-card {
  background: var(--bg3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.pipnex-level-card.entry { border-left: 3px solid var(--accent); }
.pipnex-level-card.sl    { border-left: 3px solid #ef4444; }
.pipnex-level-card.tp    { border-left: 3px solid #22c55e; }

.pipnex-level-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pipnex-level-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.pipnex-level-label { font-size: 10px; color: var(--text3); margin-bottom: 3px; }
.pipnex-level-value { font-size: 16px; font-weight: 800; color: var(--text); }

.pipnex-order-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
}

.pipnex-conf-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  display: inline-block;
  margin-top: 3px;
}

.pipnex-rr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pipnex-rr-label    { font-size: 12px; color: var(--text2); }
.pipnex-rr-value    { font-size: 15px; font-weight: 800; color: #22c55e; }
.pipnex-rr-adjusted { font-size: 11px; color: #22c55e; }

.pipnex-strategy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
}
.pipnex-strategy-label { font-size: 12px; color: var(--text2); }
.pipnex-strategy-val   { font-size: 13px; font-weight: 700; color: var(--text); }

.pipnex-waitfor {
  margin: 0 16px 10px;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #eab308;
}

.pipnex-analysis-section {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
}
.pipnex-analysis-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.pipnex-analysis-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== AI ANALYSIS SUMMARY BLOCK ===== */
.pipnex-summary-block {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.pipnex-summary-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pipnex-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pipnex-summary-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pipnex-summary-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.pipnex-summary-val {
  font-size: 13px;
  font-weight: 700;
}
.pipnex-bias-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

/* ===== DEEP CHART BREAKDOWN ===== */
.pipnex-deep-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.pipnex-deep-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.pipnex-deep-item {
  background: var(--bg3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.pipnex-deep-item:last-child { margin-bottom: 0; }
.pipnex-deep-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pipnex-deep-item-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ===== RISK MANAGEMENT ===== */
.pipnex-risk-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.pipnex-risk-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.pipnex-risk-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border)33;
}
.pipnex-risk-row:last-child { border-bottom: none; }
.pipnex-risk-label { font-size: 13px; color: var(--text2); }
.pipnex-risk-val   { font-size: 14px; font-weight: 700; color: var(--text); }
.pipnex-risk-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid;
}

/* ===== STRATEGY RECOMMENDATION (analysis text) ===== */
.pipnex-strategy-rec-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
/* ===== FUNDAMENTAL ANALYSIS ===== */
.fund-pair-select {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.fund-pair-select select { flex: 1; }

.fund-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.fund-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.fund-pair {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.fund-bias {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid;
}

.fund-events {
  font-size: 11px;
  color: var(--green);
  background: var(--green-bg);
  padding: 3px 10px;
  border-radius: 10px;
}

.fund-analysis-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.fund-analysis-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
  white-space: pre-wrap;
  }
.pipnex-meta-row {
  display: flex;
  gap: 8px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.pipnex-meta-item  { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pipnex-meta-label { font-size: 10px; color: var(--text3); text-transform: uppercase; font-weight: 600; }
.pipnex-meta-val   { font-size: 12px; font-weight: 700; color: var(--text); }

.pipnex-counter-trend {
  margin: 8px 0 4px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #ef4444;
  font-weight: 600;
  }

/* ═══════════════════════════════════════════════════════════
   NEW UPDATES — PIPNEX-STYLE IMPROVEMENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Start AI Trading Button ── */
.btn-start-ai-trading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin: 8px 0 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #c97a00 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(240,180,41,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start-ai-trading:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(240,180,41,0.3); }

/* ── Signal Date Badge ── */
.signal-date-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: center;
}

/* ── Signal Market Execution Badge ── */
.signal-mkt-exec-badge {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  grid-column: 1 / -1;
}

/* ── Bottom Nav Upload Center Button ── */
.nav-upload-btn { position: relative; }
.nav-upload-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent) 0%, #b86e00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Float above the nav bar */
  margin: -30px auto 2px;
  box-shadow:
    0 0 0 3px rgba(13, 13, 20, 0.9),
    0 6px 24px rgba(240,180,41,0.6);
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-upload-circle:active {
  transform: scale(0.91);
  box-shadow:
    0 0 0 3px rgba(13, 13, 20, 0.9),
    0 3px 12px rgba(240,180,41,0.4);
}
.nav-upload-btn svg { display: none; }
.nav-upload-btn .nav-upload-circle svg { display: block; }
.nav-upload-btn span { font-size: 10px; color: var(--accent); font-weight: 700; }

/* Desktop mode: hide mobile nav immediately */
body.is-pc .bottom-nav { display: none !important; }
.btn-connect-mt5 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  margin: 14px 0 0;
  background: var(--bg2);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-connect-mt5:active { background: var(--accent-bg); }

/* ── MT5 Execution Window (floating) ── */
.mt5-window {
  position: fixed;
  bottom: 70px;
  left: 12px;
  right: 12px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 16px;
  z-index: 900;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.5);
}
.mt5-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 14px;
}
.mt5-window-close {
  background: var(--bg3);
  border: none;
  color: var(--text2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mt5-account-bar {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Trade Mode Toggle ── */
.trade-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.trade-mode-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.trade-mode-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.mt5-ai-info {
  font-size: 12px;
  color: var(--text3);
  background: var(--bg3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Strategy Doc Header ── */
.strategy-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.strategy-doc-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

/* ── MQL5 Code Section ── */
.mql5-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mql5-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mql5-copy-btn {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mql5-instructions {
  font-size: 11px;
  color: var(--text3);
  background: var(--bg3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.mql5-code-block {
  background: #0d1117;
  color: #7ee787;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 11px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  font-family: 'Courier New', monospace;
  max-height: 400px;
  overflow-y: auto;
}

/* ── News Analysis Inline Cards ── */
.news-analysis-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.news-analysis-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.news-analysis-card:active,
.news-analysis-card.active {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.nac-flag { font-size: 22px; }
.nac-info { flex: 1; }
.nac-title { font-size: 13px; font-weight: 800; color: var(--text); }
.nac-sub   { font-size: 11px; color: var(--text3); }
.nac-arrow { font-size: 18px; color: var(--text3); }

/* ── Fund Result Inline ── */
.fund-result-inline {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 10px;
}
.fund-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.fund-currency-badge {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.fund-result-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.fund-result-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}

/* ═══════════════════════════════════════════════════════
   PIPNEX-MATCH DASHBOARD STYLES
   ═══════════════════════════════════════════════════════ */

/* ── Welcome Banner ── */
.dash-welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(240,180,41,0.18) 0%, rgba(0,212,170,0.08) 100%);
  border: 1px solid rgba(240,180,41,0.2);
  border-radius: 18px;
  padding: 20px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.dash-welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(240,180,41,0.2), transparent 70%);
  pointer-events: none;
}
.dwb-wave { font-size: 28px; }
.dwb-text { flex: 1; }
.dwb-title { font-size: 18px; font-weight: 900; color: var(--text); line-height: 1.2; }
.dwb-brand { background: linear-gradient(135deg, #f0b429, #ffd166); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.dwb-sub { font-size: 12px; color: var(--text2); margin-top: 3px; line-height: 1.4; }
.dwb-live { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* ── QPS Card Improvements ── */
.qps-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
}
.qps-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.qps-header-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; }
.qps-icon-wrap { font-size: 22px; width: 42px; height: 42px; background: rgba(240,180,41,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qps-title { font-size: 15px; font-weight: 800; color: var(--text); }
.qps-sub { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.qps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.qps-item { }
.qps-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.qps-value { font-size: 22px; font-weight: 900; color: var(--text); }
.qps-muted { font-size: 14px; font-weight: 700; color: var(--text2); }
.qps-pill-off { display: inline-block; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 800; color: var(--text2); margin-top: 4px; }
.qps-divider { height: 1px; background: var(--border); margin: 14px 0; }
.btn-start-ai-trading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; margin-top: 16px;
  background: linear-gradient(135deg, #f0b429 0%, #c97a00 100%);
  color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.3px;
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(240,180,41,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start-ai-trading:active { transform: scale(0.97); }

/* ── Market Pulse Strip ── */
.market-pulse-strip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  overflow: hidden;
}
.mps-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mps-icon { font-size: 16px; }
.mps-title { font-size: 14px; font-weight: 800; color: var(--text); flex: 1; }
.mps-live-badge { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.3); border-radius: 6px; padding: 2px 8px; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.mps-ticker { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.mps-ticker::-webkit-scrollbar { display: none; }
.mps-tick { flex-shrink: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 80px; text-align: center; }
.mps-pair { display: block; font-size: 10px; font-weight: 700; color: var(--text3); margin-bottom: 3px; }
.mps-price { display: block; font-size: 13px; font-weight: 900; color: var(--text); }
.mps-price.up { color: var(--green); }
.mps-price.down { color: var(--red); }

/* ── Dash section row ── */
.dash-section-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dash-section-title { font-size: 13px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 0.8px; }

/* ── Quick Access Grid (PIPNEX style) ── */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.qa-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.qa-card:active { transform: scale(0.96); border-color: var(--accent); }
.qa-icon { font-size: 22px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.qa-label { font-size: 12px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.qa-sub { font-size: 10px; color: var(--text3); }

/* ── NewsIQ dashboard header (PIPNEX match) ── */
.newsiq-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 12px;
}
.newsiq-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.newsiq-sub { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.4; }

/* ── NewsIQ Event Cards (PIPNEX style) ── */
.newsiq-event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.newsiq-high { border-color: rgba(239,68,68,0.3); background: linear-gradient(135deg, rgba(239,68,68,0.04), var(--bg2)); }
.newsiq-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.newsiq-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.newsiq-badge-next { background: linear-gradient(135deg, #f0b429, #c97a00); color: #fff; border-radius: 20px; padding: 3px 10px; font-size: 10px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.newsiq-impact-badge { border-radius: 20px; padding: 4px 10px; font-size: 10px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.newsiq-cat-badge { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.newsiq-country { font-size: 13px; font-weight: 800; color: var(--text); }
.newsiq-timer-col { text-align: right; }
.newsiq-countdown { font-size: 18px; font-weight: 900; color: var(--text); display: block; }
.newsiq-imminent { font-size: 10px; color: var(--text3); display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 2px; }
.newsiq-card-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.newsiq-card-left { flex: 1; }
.newsiq-event-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.newsiq-event-time { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.newsiq-event-meta { font-size: 11px; color: var(--text3); line-height: 1.6; }
.newsiq-event-meta span { display: block; }
.newsiq-analyze-btn {
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.newsiq-analyze-btn:active { background: var(--accent-bg); border-color: var(--accent); }
.newsiq-group-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(240,180,41,0.08); border: 1px solid rgba(240,180,41,0.2);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--text2);
}
.newsiq-analyze-all-btn {
  background: linear-gradient(135deg, #f0b429, #c97a00);
  color: #fff; border: none; border-radius: 10px;
  padding: 8px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.newsiq-inline-result { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.newsiq-analysis-text { font-size: 12px; color: var(--text2); line-height: 1.7; }
.newsiq-signal-pill {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px;
}

/* ── Bottom Nav Upload Center (PIPNEX pill style) ── */
.nav-upload-center { position: relative; overflow: visible; }
.nav-upload-pill {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #f0b429, #c97a00);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: -20px auto 0;
  box-shadow: 0 4px 18px rgba(240,180,41,0.5);
  border: 3px solid var(--bg);
  transition: transform 0.15s;
}
.nav-upload-pill:active { transform: scale(0.92); }
.nav-upload-pill svg { color: #fff; }

/* ── PIPNEX Analysis Cards (chart results) ── */
.pipnex-card { display: flex; flex-direction: column; gap: 12px; }

/* Summary block */
.pipnex-summary-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.pipnex-summary-title { font-size: 16px; font-weight: 900; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.pipnex-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pipnex-summary-item { }
.pipnex-summary-label { font-size: 11px; color: var(--text3); margin-bottom: 5px; display: block; }
.pipnex-summary-val { font-size: 13px; font-weight: 700; color: var(--text); }
.pipnex-trend-badge { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 800; width: 100%; text-align: center; }
.pipnex-strength-bar { height: 6px; background: var(--bg3); border-radius: 3px; margin: 6px 0; overflow: hidden; }
.pipnex-strength-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.pipnex-bias-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 800; width: 100%; justify-content: center; }

/* Key levels section */
.pipnex-levels-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.pipnex-levels-title { font-size: 16px; font-weight: 900; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

.pipnex-level-card {
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.pipnex-level-card.entry { background: rgba(240,180,41,0.05); border-color: rgba(240,180,41,0.2); }
.pipnex-level-card.sl { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }
.pipnex-level-card.tp { background: rgba(34,197,94,0.05); border-color: rgba(34,197,94,0.2); }
.pipnex-level-header { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.pipnex-level-row { display: flex; gap: 14px; flex-wrap: wrap; }
.pipnex-level-label { font-size: 10px; color: var(--text3); margin-bottom: 4px; }
.pipnex-level-value { font-size: 22px; font-weight: 900; color: var(--text); }
.pipnex-order-badge { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.pipnex-conf-badge { font-size: 11px; font-weight: 800; border: 1px solid; border-radius: 20px; padding: 4px 10px; }
.pipnex-rr-row { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pipnex-rr-label { font-size: 11px; color: var(--text3); }
.pipnex-rr-value { font-size: 16px; font-weight: 900; color: var(--green); }
.pipnex-rr-adjusted { font-size: 11px; color: var(--green); }
.pipnex-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pipnex-meta-item { flex: 1; min-width: 70px; background: var(--bg3); border-radius: 10px; padding: 8px 10px; }
.pipnex-meta-label { font-size: 10px; color: var(--text3); margin-bottom: 3px; }
.pipnex-meta-val { font-size: 12px; font-weight: 800; color: var(--text); }
.pipnex-counter-trend { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--red); margin-top: 10px; }
.pipnex-waitfor { background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--text2); line-height: 1.5; }

/* Deep Breakdown */
.pipnex-deep-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.pipnex-deep-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; }
.pipnex-deep-item { background: var(--bg3); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.pipnex-deep-item:last-child { margin-bottom: 0; }
.pipnex-deep-item-title { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 5px; }
.pipnex-deep-item-text { font-size: 12px; color: var(--text2); line-height: 1.6; }

/* Risk Section */
.pipnex-risk-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.pipnex-risk-title { font-size: 16px; font-weight: 900; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; }
.pipnex-risk-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.pipnex-risk-row:last-child { border-bottom: none; }
.pipnex-risk-label { font-size: 12px; color: var(--text3); }
.pipnex-risk-val { font-size: 14px; font-weight: 800; color: var(--text); }
.pipnex-risk-badge { font-size: 12px; font-weight: 800; border: 1px solid; border-radius: 8px; padding: 3px 10px; }

/* Analysis section */
.pipnex-analysis-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.pipnex-strategy-rec-title { font-size: 16px; font-weight: 900; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; }
.pipnex-analysis-text { font-size: 13px; color: var(--text2); line-height: 1.8; }

/* Action buttons after analysis (PIPNEX style) */
.pipnex-action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.pipnex-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  border-radius: 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; transition: transform 0.15s;
}
.pipnex-action-btn:active { transform: scale(0.97); }
.pipnex-action-btn.primary { background: linear-gradient(135deg,#f0b429,#c97a00); color:#fff; }
.pipnex-action-btn.secondary { background: var(--bg2); border: 1px solid var(--border); color: var(--text); }
.pipnex-action-btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text2); }

/* ── Dashboard event inline analysis ── */
.dash-event-result { margin-top: 10px; }
.dash-event-analysis {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.dea-bias {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.dea-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.65;
}

/* ── Event Analysis PIPNEX Card (analyze button result) ── */
.ea-pipnex-card {
  margin-top: 12px;
  padding: 4px 0;
}
.ea-cached-box {
  margin-top: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 12px 14px;
}
.ea-prerelease-box {
  margin-top: 10px;
  background: rgba(240,180,41,0.08);
  border: 1px solid rgba(240,180,41,0.25);
  border-radius: 12px;
  padding: 12px 14px;
}
.ea-prerelease-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ea-direction-card {
  margin-top: 10px;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}
.ea-fundamental-box {
  margin-top: 10px;
  background: var(--bg3);
  border-radius: 12px;
  padding: 14px;
}
.ea-fundamental-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ea-plain-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  padding: 10px 0;
}

/* ===== DASHBOARD REDESIGN — PIPNEX STYLE ===== */
.dash-welcome-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(240,180,41,0.12), rgba(240,180,41,0.06));
  border: 1px solid rgba(240,180,41,0.2);
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
}
.dash-welcome-icon { font-size: 28px; flex-shrink: 0; }
.dash-welcome-title { font-size: 17px; font-weight: 800; color: var(--text); }
.dash-welcome-sub { font-size: 12px; color: var(--text2); margin-top: 3px; }

/* Performance Snapshot Card */
.dash-snapshot-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.dash-snapshot-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-snapshot-icon { font-size: 22px; }
.dash-snapshot-title { font-size: 14px; font-weight: 800; color: var(--text); }
.dash-snapshot-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; }

.dash-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.dash-snap-item { display: flex; flex-direction: column; gap: 4px; }
.dash-snap-label { font-size: 11px; color: var(--text2); }
.dash-snap-val   { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }

.dash-snapshot-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* Start AI Trading button */
.btn-ai-trading {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #c97a00 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(240,180,41,0.35);
  transition: opacity 0.2s, transform 0.15s;
}
.btn-ai-trading:active { opacity: 0.85; transform: scale(0.98); }

/* Signal idle state */
.signal-idle-state {
  text-align: center;
  padding: 20px 16px;
}
.signal-idle-icon { font-size: 32px; margin-bottom: 10px; }
.signal-idle-text { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.signal-idle-sub  { font-size: 12px; color: var(--text3); line-height: 1.5; }

/* Signal levels grid */
.signal-levels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.signal-level-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.signal-level-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.signal-level-val   { font-size: 15px; font-weight: 800; color: var(--text); }
.signal-level-sub   { font-size: 10px; color: var(--text3); margin-top: 2px; }

.signal-key-level {
  background: var(--bg3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text2);
  margin-top: 8px;
}
.signal-date-badge {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 10px;
  text-align: center;
}

/* Dashboard news header row */
.dash-news-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  margin-top: 4px;
  gap: 10px;
}

/* Dashboard calendar event cards */
.dash-cal-event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.dash-cal-event-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* Inline analyze button on event cards */
.cal-analyze-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  white-space: nowrap;
}
.cal-analyze-btn:hover, .cal-analyze-btn:active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* Event analysis result inline */
.dash-event-result {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
}
.dash-event-result-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.dash-event-result-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
}

/* ===== NEWS ANALYSIS — PIPNEX STYLE ===== */
.na-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 12px;
}
.na-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.na-bias-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid;
  flex-shrink: 0;
}
.na-direction-card {
  margin: 14px 16px 0;
  border: 1px solid;
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}
.na-direction-arrow { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.na-direction-main  { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 6px; }
.na-direction-sub   { font-size: 12px; color: var(--text2); }

.na-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.na-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.na-conf-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}
.na-conf-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 1s ease;
}
.na-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border)44;
}
.na-info-label { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.na-info-val   { font-size: 12px; color: var(--text); font-weight: 600; text-align: right; max-width: 60%; }
.na-risk-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid;
}
.na-prerelease-box {
  margin: 12px 16px 0;
  background: rgba(240,180,41,0.08);
  border: 1px solid rgba(240,180,41,0.25);
  border-radius: 12px;
  padding: 12px 14px;
}
.na-prerelease-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.na-prerelease-text { font-size: 13px; color: var(--text2); line-height: 1.6; }

.na-fundamental-box {
  margin: 12px 16px 16px;
  background: var(--bg3);
  border-radius: 12px;
  padding: 14px;
}
.na-fundamental-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.na-fundamental-text { font-size: 14px; color: var(--text); line-height: 1.75; }

.na-pairs-list { display: flex; flex-direction: column; gap: 8px; }
.na-pair-row   { display: flex; align-items: center; gap: 8px; }
.na-pair-label { font-size: 12px; font-weight: 700; color: var(--text); min-width: 60px; }
.na-pair-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.na-pair-bar      { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.na-pair-dir      { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.na-pair-strength { font-size: 10px; min-width: 52px; text-align: right; color: var(--text3); }

.na-key-events { display: flex; flex-direction: column; gap: 6px; }
.na-key-event  { background: var(--bg3); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--text2); }

/* ========================================================
   LIVE CHART TAB
   ======================================================== */

/* The tab itself fills the whole viewport below topbar/above nav */
.lc-tab {
  display: none;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  overflow: hidden;
  background: var(--bg);
  box-sizing: border-box;
  /* NO will-change or transform here — causes click-blocking when display:none */
  pointer-events: none;
}
.lc-tab.active {
  display: flex;
  pointer-events: auto;
  /* GPU layer only when ACTIVE — fixes position:fixed + display:grid Chrome paint bug */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
/* Desktop overrides flex to grid */
body.is-pc .lc-tab.active { display: grid !important; }
/* Desktop: always show analysis panel regardless of .hidden */
body.is-pc #tab-livechart > .lc-chat-panel { display: flex !important; }

/* ── Header bar ── */
.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lc-pair-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.lc-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
}
.lc-pair-select { max-width: 130px; }
.lc-strategy-select { flex: 1; font-size: 12px; }

.lc-price-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 5px 10px;
  flex-shrink: 0;
}

.lc-live-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.lc-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: lcPulse 1.8s infinite;
}
@keyframes lcPulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ── Timeframe pills ── */
.lc-tf-pills {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.lc-tf-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
  transition: all .18s;
}
.lc-tf-pill.active, .lc-tf-pill:active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Chart area ── */
.lc-chart-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;           /* critical: allows flex child to shrink below content size */
  background: var(--bg);
  overflow: hidden;
}
.lc-chart-container {
  /* Absolutely fill the wrap — guaranteed to match wrap dimensions */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   AI SCAN OVERLAY  —  TradingView-style chart analysis animation
   ═══════════════════════════════════════════════════════════════════ */
.lc-scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  border-radius: inherit;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  /* background set dynamically by _startScanRain() based on theme */
}
.lc-scan-overlay.hidden { display: none; }

/* ── Canvas: character rain — sits at z-index 1, chart bleeds through ── */
.lc-scan-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ── No separate blur div needed — background on overlay handles it ── */
.lc-scan-blur { display: none; }

/* ── Top floating pill: "GENERATING XAUUSD" ── */
.lc-scan-topbar {
  position: absolute;
  top: 10px;
  right: 12px;
  left: auto;                          /* not full width — floats top-right */
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  background: rgba(12, 8, 30, 0.88);
  border: 1px solid rgba(240, 180, 41, 0.45);
  border-radius: 999px;                /* pill shape */
  /* background set by JS per theme */
  z-index: 5;
  pointer-events: none;
}
.lc-scan-reticle {
  font-size: 15px;
  color: #f0b429;
  animation: lcReticleSpin 2.4s linear infinite;
  display: inline-block;
}
@keyframes lcReticleSpin {
  0%   { transform: rotate(0deg);   opacity: 1;   }
  50%  { transform: rotate(180deg); opacity: 0.5; }
  100% { transform: rotate(360deg); opacity: 1;   }
}
.lc-scan-generating-label {
  font-size: 11px;
  font-weight: 800;
  color: rgba(180, 160, 255, 0.95);  /* always readable on dark/light — JS overrides for light */
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.lc-scan-pair-name {
  font-size: 12px;
  font-weight: 900;
  color: #f0b429;
  letter-spacing: 1px;
}
/* Animated signal bars */
.lc-scan-bars {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.lc-scan-bars span {
  display: block;
  width: 3px;
  background: #f0b429;
  border-radius: 2px;
  animation: lcBarPulse 0.9s ease-in-out infinite;
}
.lc-scan-bars span:nth-child(1) { height: 5px;  animation-delay: 0s;    }
.lc-scan-bars span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.lc-scan-bars span:nth-child(3) { height: 7px;  animation-delay: 0.3s;  }
.lc-scan-bars span:nth-child(4) { height: 13px; animation-delay: 0.45s; }
@keyframes lcBarPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50%       { opacity: 1;   transform: scaleY(1);   }
}

/* ── Green sweep line — top to bottom scan ── */
.lc-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(34,197,94,0.25) 15%,
    rgba(34,197,94,0.85) 50%,
    rgba(34,197,94,0.25) 85%,
    transparent 100%
  );
  box-shadow:
    0 0 6px 2px rgba(34,197,94,0.55),
    0 0 18px 4px rgba(34,197,94,0.18);
  animation: lcScanMove 2.6s cubic-bezier(0.4,0,0.6,1) infinite;
  z-index: 4;
  pointer-events: none;
}
/* Soft glow curtain that trails just below the sweep line */
.lc-scan-glow {
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(
    to bottom,
    rgba(34,197,94,0.10) 0%,
    rgba(34,197,94,0.04) 50%,
    transparent 100%
  );
  animation: lcScanMove 2.6s cubic-bezier(0.4,0,0.6,1) infinite;
  margin-top: 2px;   /* sits just below the line */
  z-index: 3;
  pointer-events: none;
}
@keyframes lcScanMove {
  0%   { top: -4px; }
  100% { top: calc(100% + 4px); }
}
/* Light theme: slightly less intense green */
[data-theme="light"] .lc-scan-line {
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(22,163,74,0.2) 15%,
    rgba(22,163,74,0.75) 50%,
    rgba(22,163,74,0.2) 85%,
    transparent 100%
  );
  box-shadow:
    0 0 5px 2px rgba(22,163,74,0.45),
    0 0 14px 3px rgba(22,163,74,0.12);
}
[data-theme="light"] .lc-scan-glow {
  background: linear-gradient(
    to bottom,
    rgba(22,163,74,0.08) 0%,
    rgba(22,163,74,0.03) 50%,
    transparent 100%
  );
}

/* ── Bottom floating pill: "AI PROCESSING |||" ── */
.lc-scan-footer {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;                          /* not full width — floats centered */
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 14px 5px 10px;
  background: rgba(12, 8, 30, 0.88);
  border: 1px solid rgba(240, 180, 41, 0.35);
  border-radius: 999px;                 /* pill shape */
  /* background set by JS per theme */
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}
.lc-scan-footer-text {
  font-size: 10px;
  font-weight: 800;
  color: rgba(180, 160, 255, 0.95);    /* always readable — JS overrides for light */
  letter-spacing: 2px;
  text-transform: uppercase;
}
.lc-scan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0b429;
  box-shadow: 0 0 6px rgba(240,180,41,0.9);
  animation: lcDotPulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lcDotPulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.3; transform: scale(0.6); }
}
.lc-scan-footer-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.lc-scan-footer-bars span {
  display: block;
  width: 3px;
  background: rgba(240,180,41,0.8);
  border-radius: 2px;
  animation: lcBarPulse 0.7s ease-in-out infinite;
}
.lc-scan-footer-bars span:nth-child(1) { height: 5px;  animation-delay: 0s;   }
.lc-scan-footer-bars span:nth-child(2) { height: 11px; animation-delay: 0.2s; }
.lc-scan-footer-bars span:nth-child(3) { height: 7px;  animation-delay: 0.4s; }
.lc-signal-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 30;
  background: rgba(13,13,20,0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 14px 10px;
  min-width: 220px;
  max-width: 280px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: fadeInDown .2s ease;
}
.lc-signal-overlay.hidden { display: none; }
@keyframes fadeInDown {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}
.lc-signal-overlay-header {
  display:flex; align-items:center; gap:8px;
  margin-bottom:10px; padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,0.07);
}
.lc-overlay-direction {
  font-size:13px; font-weight:900; letter-spacing:.5px;
  padding:3px 10px; border-radius:20px;
}
.lc-overlay-direction.buy  { background:rgba(34,197,94,0.15); color:#22c55e; }
.lc-overlay-direction.sell { background:rgba(239,68,68,0.15);  color:#ef4444; }
.lc-overlay-pair  { font-size:13px; font-weight:700; color:var(--text); flex:1; }
.lc-overlay-conf  {
  font-size:12px; font-weight:700; color:var(--accent);
  background:rgba(240,180,41,0.1); border-radius:8px; padding:2px 8px;
}
.lc-overlay-close {
  background:none; border:none; color:var(--text3);
  font-size:14px; cursor:pointer; padding:0 2px; line-height:1;
}
.lc-overlay-levels { display:flex; flex-direction:column; gap:5px; margin-bottom:10px; }
.lc-overlay-row   { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.lc-overlay-label { font-size:10px; color:var(--text3); font-weight:600; text-transform:uppercase; letter-spacing:.5px; }
.lc-overlay-value { font-size:13px; font-weight:800; font-variant-numeric:tabular-nums; }
.lc-overlay-value.entry { color:var(--accent); }
.lc-overlay-value.sl    { color:#ef4444; }
.lc-overlay-value.tp    { color:#22c55e; }
.lc-overlay-footer {
  display:flex; align-items:center; justify-content:space-between;
  padding-top:8px; border-top:1px solid rgba(255,255,255,0.07);
}
.lc-overlay-rr { font-size:11px; color:var(--text2); font-weight:700; }
.lc-overlay-detail-btn {
  font-size:11px; font-weight:700; color:var(--accent);
  background:none; border:none; cursor:pointer; padding:0;
}
/* Hide on desktop — desktop uses full right panel */
@media (min-width:1024px) { .lc-signal-overlay { display:none !important; } }

.lc-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  z-index: 10;
  font-size: 13px;
  color: var(--text2);
}
.lc-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Strategy bar ── */
.lc-strategy-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.lc-strategy-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* ── Floating Action Buttons ── */
.lc-fab-group {
  position: fixed;
  /* Above floating mobile nav: 14px bottom + 60px nav + 12px gap = 86px */
  bottom: 90px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 150;
}

.lc-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform .2s, box-shadow .2s;
}
.lc-fab:active { transform: scale(0.92); }

/* Chat bubble FAB — matches TradingView purple circle */
.lc-fab-chat {
  background: var(--accent);
  color: #fff;
}
.lc-fab-chat:hover { box-shadow: 0 6px 24px rgba(240,180,41,0.5); }

/* Sparkle / auto-analyze FAB */
.lc-fab-analyze {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}
.lc-fab-analyze:hover { box-shadow: 0 6px 24px rgba(34,197,94,0.45); }

/* spinning state while analyzing */
.lc-fab-spinning svg {
  animation: spin .7s linear infinite;
}

/* ── AI Chat + Results Panel ── */
.lc-chat-panel {
  position: fixed;
  /* Float above the mobile nav pill */
  bottom: 84px;
  left: 8px;
  right: 8px;
  height: 55vh;
  max-height: 480px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.55);
  animation: slideUp .22s ease;
  overflow: hidden;
}
.lc-chat-panel.hidden {
  display: none;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.lc-chat-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}
.lc-handle-bar {
  display: none;
}
.lc-chat-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.lc-chat-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 9px;
  cursor: pointer;
}

.lc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lc-chat-msg {
  display: flex;
}
.lc-chat-msg.user { justify-content: flex-end; }
.lc-chat-msg.ai   { justify-content: flex-start; }

.lc-chat-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
}
.lc-chat-msg.user .lc-chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.lc-chat-msg.ai .lc-chat-bubble {
  background: var(--bg3);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* typing indicator */
.lc-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px;
}
.lc-typing span {
  width: 6px;
  height: 6px;
  background: var(--text3);
  border-radius: 50%;
  display: inline-block;
  animation: lcBounce 1.2s infinite;
}
.lc-typing span:nth-child(2) { animation-delay: .2s; }
.lc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes lcBounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-6px); }
}

.lc-chat-input-row {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg2);
}
.lc-chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
}
.lc-chat-input:focus { border-color: var(--accent); }
.lc-chat-input::placeholder { color: var(--text3); }

.lc-chat-send {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.lc-chat-send:active { background: var(--accent2); }

/* Hide lc-fab-group when not on livechart tab */
body:not(:has(#tab-livechart.active)) .lc-fab-group { display: none; }
/* Hide floating bottom nav when live chart is open on mobile */
body:has(#tab-livechart.active):not(.is-pc) .bottom-nav { display: none !important; }

/* ── Upload Feature Cards — PipNex vertical style ───────────────── */
.upload-feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.upload-feat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.upload-feat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.upload-feat-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.upload-feat-desc {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
  max-width: 280px;
}

/* ── Live Chart Header — PipNex style ───────────────────────────── */
/* Pair pill button */
.lc-pair-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s;
}
.lc-pair-pill:active { border-color: var(--accent); }

/* Pair dropdown modal */
.lc-pair-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) + 56px);
  left: 8px;
  z-index: 400;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: fadeInDown .15s ease;
}
.lc-pair-dropdown.hidden { display: none; }
.lc-pair-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
}
.lc-pair-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 16px 4px;
}
.lc-pair-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .1s;
}
.lc-pair-opt:hover, .lc-pair-opt:active { background: var(--bg3); }
.lc-pair-opt.active { color: var(--accent); }
.lc-pair-check { color: var(--accent); flex-shrink: 0; }

/* Inline price (no colored badge — PipNex shows plain number) */
.lc-price-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.lc-live-price-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TF as a clean dropdown */
.lc-tf-dropdown-wrap { flex-shrink: 0; }
.lc-tf-select-dropdown {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
}

/* Live chart back button */
.lc-back-btn {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .18s;
}
.lc-back-btn:active { background: var(--bg4); color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER + DRAWER
═══════════════════════════════════════════════════════════════ */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .25s ease;
}
.hamburger-btn:active span { background: var(--accent); }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 490;
  backdrop-filter: blur(2px);
}
.drawer-backdrop.hidden { display: none; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 82vw;
  max-width: 320px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}
.drawer.hidden { display: none; }
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.3px;
}
.drawer-close {
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  padding: 16px 18px 6px;
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  cursor: pointer;
  border-radius: 10px;
  margin: 1px 8px;
  transition: background .15s;
}
.drawer-item:active { background: var(--bg3); }
.drawer-item-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.drawer-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.drawer-item-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════
   QUICK ACCESS MODAL
═══════════════════════════════════════════════════════════════ */
.qa-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 490;
  backdrop-filter: blur(3px);
}
.qa-modal-backdrop.hidden { display: none; }

.qa-modal {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--border);
  z-index: 495;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
.qa-modal.hidden { display: none; }

.qa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg2);
  z-index: 1;
}
.qa-modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.qa-modal-close {
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
}
.qa-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}
.qa-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 14px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qa-card:active { transform: scale(0.97); border-color: var(--accent); }
.qa-card-icon { font-size: 28px; }
.qa-card-name { font-size: 14px; font-weight: 700; color: var(--text); }
.qa-card-sub { font-size: 11px; color: var(--text3); }

/* Dashboard quick access button */
.dash-quick-access-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s;
}
.dash-quick-access-btn:active { border-color: var(--accent); }
.dash-quick-access-btn svg:first-child { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   FEATURE TAB SHARED HEADER
═══════════════════════════════════════════════════════════════ */
.feature-tab-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.feature-tab-title { font-size: 16px; font-weight: 800; color: var(--text); }
.feature-tab-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════
   MARKET HEATMAP
═══════════════════════════════════════════════════════════════ */
.heatmap-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.hm-tab-btn {
  flex: 1;
  padding: 8px 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}
.hm-tab-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px;
  overflow-y: auto;
}
.hm-cell {
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}
.hm-cell-pair { font-size: 13px; font-weight: 700; color: var(--text); }
.hm-cell-val { font-size: 24px; font-weight: 900; }
.hm-cell-label {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.hm-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }
.hm-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   POSITION SIZE CALCULATOR
═══════════════════════════════════════════════════════════════ */
.calc-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 16px;
  padding-bottom: 16px;
  overflow: hidden;
}
.calc-row { padding: 12px 16px 0; }
.calc-label { display: block; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.calc-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  box-sizing: border-box;
}
.calc-input:focus { outline: none; border-color: var(--accent); }
.calc-risk-wrap { display: flex; align-items: center; gap: 8px; }
.calc-risk-wrap input[type="range"] { flex: 1; accent-color: var(--accent); }
.calc-risk-num { width: 64px !important; flex-shrink: 0; }
.calc-pct-label { font-size: 14px; color: var(--text2); }

.calc-result {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 16px 16px;
  padding: 16px;
}
.calc-result-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 14px; }
.calc-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.calc-result-item { background: var(--bg3); border-radius: 10px; padding: 12px; }
.calc-result-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.calc-result-val { font-size: 20px; font-weight: 800; color: var(--text); }

.calc-risk-bar-wrap { margin-bottom: 12px; }
.calc-risk-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.calc-risk-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.calc-risk-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s ease; }
.calc-note { font-size: 12px; color: var(--text3); padding: 10px 12px; background: var(--bg3); border-radius: 10px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   TRADING JOURNAL
═══════════════════════════════════════════════════════════════ */
.journal-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 16px 16px;
  padding-bottom: 4px;
}
.journal-form-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  padding: 14px 16px 0;
  margin-bottom: 4px;
}
.journal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 16px 16px;
}
.jnl-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.jnl-stat-val { font-size: 20px; font-weight: 800; color: var(--text); }
.jnl-stat-label { font-size: 10px; color: var(--text3); margin-top: 3px; }

.journal-list { padding: 0 16px 80px; display: flex; flex-direction: column; gap: 10px; }
.jnl-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.jnl-entry-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jnl-entry-pair { font-size: 14px; font-weight: 700; color: var(--text); }
.jnl-entry-dir { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.jnl-entry-pnl { font-size: 16px; font-weight: 800; }
.jnl-entry-meta { font-size: 11px; color: var(--text3); display: flex; gap: 10px; flex-wrap: wrap; }
.jnl-entry-notes { font-size: 12px; color: var(--text2); margin-top: 8px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 8px; }

/* ═══════════════════════════════════════════════════════════════
   AI MENTOR CHAT
═══════════════════════════════════════════════════════════════ */
.mentor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mentor-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.mentor-chip:active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

.mentor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mentor-msg { display: flex; }
.mentor-msg.user { justify-content: flex-end; }
.mentor-msg.ai   { justify-content: flex-start; }
.mentor-bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.65;
}
.mentor-msg.ai .mentor-bubble {
  background: var(--bg3);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.mentor-msg.user .mentor-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.mentor-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   PROMPT TRADING
═══════════════════════════════════════════════════════════════ */
.prompt-trade-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 16px;
  padding-bottom: 4px;
  overflow: hidden;
}
.prompt-trade-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  padding: 14px 16px 8px;
}
.prompt-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
}
.prompt-tpl-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}
.prompt-tpl-btn:active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.prompt-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px;
}
.prompt-pair-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.prompt-pair-check input { accent-color: var(--accent); width: 16px; height: 16px; }
#tab-prompttrading .result-box { margin: 0 16px 16px; }

/* ═══════════════════════════════════════════════════════════════
   VOICE OVERLAY
═══════════════════════════════════════════════════════════════ */
.voice-overlay {
  position: fixed; inset: 0;
  background: #060810;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.voice-overlay.hidden { display: none; }
.voice-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  width: 88vw;
  max-width: 340px;
  text-align: center;
  position: relative;
}
.voice-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2); font-size: 14px; cursor: pointer;
}
.voice-modal-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.voice-modal-sub { font-size: 12px; color: var(--text3); margin-bottom: 28px; }

.voice-orb {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid var(--accent);
  margin: 0 auto 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--accent);
  transition: transform .15s;
}
.voice-orb:active { transform: scale(0.94); }
.voice-orb.listening { background: rgba(34,197,94,0.15); border-color: #22c55e; color: #22c55e; }

.voice-orb-ring {
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
}
.voice-orb.listening .voice-orb-ring { animation: voiceRing 1.5s ease-out infinite; }
.voice-orb.listening .voice-orb-ring2 { animation: voiceRing 1.5s ease-out .5s infinite; }
@keyframes voiceRing {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.voice-status { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.voice-transcript {
  min-height: 36px; font-size: 13px; color: var(--text2);
  background: var(--bg3); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 12px; line-height: 1.5; text-align: left;
}
.voice-response {
  font-size: 13px; color: var(--text); background: var(--accent-bg);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 12px; min-height: 36px; line-height: 1.6; text-align: left;
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   PIPNEX-STYLE REDESIGNED FEATURES
═══════════════════════════════════════════════════════════════ */

/* ── Feature Page Header (icon + title + subtitle) ── */
.feature-page-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 16px 16px;
}
.feature-page-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.feature-page-icon svg { color: var(--accent); }
.feature-page-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.feature-page-sub   { font-size: 13px; color: var(--text2); margin-top: 3px; line-height: 1.4; }
.feature-page-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  margin-top: 6px;
}
.badge-platinum { background: rgba(240,180,41,0.2); color: var(--accent2); border: 1px solid var(--accent); }
.badge-ultimate { background: rgba(234,179,8,0.15); color: #eab308; border: 1px solid rgba(234,179,8,0.4); }
.badge-beta     { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.4); }

/* ── Action Row Buttons (Reset / Copy / Connect MT5 etc) ── */
.feature-action-row {
  display: flex; gap: 8px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}
.feat-action-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px; font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.feat-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.feat-action-btn.primary-action {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Section Card ── */
.section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 0 16px 14px;
  overflow: hidden;
}
.section-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 14px;
}
.section-card-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-card-title svg { color: var(--accent); }
.section-card-label {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 0 16px 8px;
}
.section-card-body { padding: 0 16px 16px; }

/* ── Stat Cards Row ── */
.stat-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 14px;
}
.stat-card-single {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.stat-card-label { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card-sub   { font-size: 12px; color: var(--text3); margin-top: 4px; }
.stat-card-value.green { color: var(--green); }
.stat-card-value.red   { color: var(--red); }

/* ── Big Stat (full width) ── */
.stat-card-full {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 0 16px 10px;
}

/* ── MT5 Status Banner ── */
.mt5-banner {
  margin: 0 16px 14px;
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.mt5-banner-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.mt5-banner-title { font-size: 14px; font-weight: 700; color: var(--text); }
.mt5-banner-sub   { font-size: 12px; color: var(--text2); margin-top: 3px; line-height: 1.5; }
.mt5-banner-refresh {
  margin-left: auto; flex-shrink: 0;
  background: none; border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; padding: 4px;
  border-radius: 8px; transition: color .2s;
}
.mt5-banner-refresh:hover { color: var(--accent); }

/* ── Toggle Section Card (Auto-Trading) ── */
.toggle-card {
  margin: 0 16px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.toggle-card-icon { font-size: 20px; color: var(--accent); }
.toggle-card-label { font-size: 15px; font-weight: 700; color: var(--text); }
.toggle-card-status { font-size: 13px; color: var(--text2); margin-left: 4px; }
.toggle-card .toggle-switch { margin-left: auto; flex-shrink: 0; }

/* ── Execution Mode Selector ── */
.exec-mode-option {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 8px;
}
.exec-mode-option.selected {
  background: rgba(34,197,94,0.08);
  border-color: var(--green);
}
.exec-mode-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.exec-mode-option.selected .exec-mode-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.exec-mode-option.selected .exec-mode-radio::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}
.exec-mode-icon { font-size: 16px; }
.exec-mode-title { font-size: 14px; font-weight: 700; color: var(--text); }
.exec-mode-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* Safety First Banner */
.safety-banner {
  margin: 12px 0 8px;
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 8px;
}
.safety-banner-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.safety-banner-title { font-size: 13px; font-weight: 700; color: #eab308; }
.safety-banner-sub   { font-size: 12px; color: var(--text2); margin-top: 3px; line-height: 1.5; }
.exec-check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); padding: 6px 0;
}
.exec-check-row svg { color: var(--green); flex-shrink: 0; }

/* ── Safety Controls Card ── */
.safety-controls-card {
  margin: 0 16px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.safety-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.safety-card-header-title { font-size: 17px; font-weight: 800; color: var(--text); }
.safety-metric-row { padding: 14px 16px 0; }
.safety-metric-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.safety-metric-val { font-size: 13px; font-weight: 700; color: var(--text); }
.safety-progress-track { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.safety-progress-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .5s ease; }
.stop-ai-btn {
  margin: 4px 16px 10px;
  width: calc(100% - 32px);
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 12px;
  padding: 13px;
  font-size: 15px; font-weight: 800;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: 0.5px;
}
.stop-ai-btn:hover { background: var(--red); color: #fff; }
.safety-secondary-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 16px 14px;
}
.pause-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 11px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s;
}
.pause-btn:hover { border-color: var(--accent); color: var(--accent); }
.cancel-pending-btn {
  background: var(--red-bg); border: 1px solid var(--red);
  color: var(--red); border-radius: 12px; padding: 11px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s;
}
.cancel-pending-btn:hover { background: var(--red); color: #fff; }
.safety-active-banner {
  margin: 4px 16px 14px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 12px;
  padding: 12px 14px;
}
.safety-active-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--green);
  margin-bottom: 8px;
}
.safety-active-item {
  font-size: 12px; color: var(--text2);
  padding: 2px 0; line-height: 1.6;
}
.safety-active-item::before { content: '• '; }
.safety-latency-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 14px;
  font-size: 12px; color: var(--text2);
}
.safety-latency-left { display: flex; align-items: center; gap: 6px; }

/* ══════════════════════════════════
   REDESIGNED POSITION SIZE CALC
══════════════════════════════════ */
.psc-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px 12px;
}
.psc-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.psc-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.psc-sub   { font-size: 13px; color: var(--text2); margin-top: 2px; }
.psc-action-row { display: flex; gap: 8px; padding: 0 16px 14px; }

/* Direction Toggle */
.dir-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.dir-btn {
  padding: 12px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s; background: var(--bg3); color: var(--text2);
}
.dir-btn.buy.active  { background: rgba(34,197,94,0.15); color: var(--green); }
.dir-btn.sell.active { background: rgba(239,68,68,0.15); color: var(--red); }

/* Instrument Selector */
.instrument-select-wrap {
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; margin-bottom: 6px;
  transition: border-color .2s;
}
.instrument-select-wrap:hover { border-color: var(--accent); }
.instrument-name { font-size: 15px; font-weight: 700; color: var(--text); }
.instrument-pip-badge {
  background: var(--bg4); color: var(--text2);
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.instrument-meta { font-size: 11px; color: var(--text3); margin-bottom: 14px; }

/* Price Field */
.price-field-group { margin-bottom: 14px; }
.price-field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.price-field-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.badge-required { background: rgba(239,68,68,0.2); color: var(--red); border: 1px solid rgba(239,68,68,0.4); }
.badge-optional { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.price-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 13px 14px;
  font-size: 16px; font-weight: 700;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.price-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.price-input.sl-active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.price-input.tp-active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,0.12); }

/* Quick Select Pills */
.quick-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.quick-pill {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-radius: 20px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.quick-pill.active {
  background: var(--accent-bg); color: var(--accent);
  border-color: var(--accent);
}

/* Calc Results Card */
.calc-results-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; margin: 0 16px 14px; overflow: hidden;
}
.calc-results-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.calc-results-title { font-size: 15px; font-weight: 800; color: var(--text); }
.calc-results-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; }
.calc-results-body  { padding: 14px 16px; }
.calc-results-empty {
  text-align: center; padding: 30px 16px; color: var(--text3);
}
.calc-results-empty-icon { font-size: 36px; margin-bottom: 10px; }
.calc-results-empty-text { font-size: 13px; }

/* How It Works Steps */
.how-it-works { margin: 0 16px 14px; }
.how-it-works-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.how-it-works-sub   { font-size: 13px; color: var(--text2); margin-bottom: 14px; }
.how-step {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.how-step-num { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.how-step-title { font-size: 15px; font-weight: 700; color: var(--text); }
.how-step-formula { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* Risk Management Banner */
.risk-mgmt-banner {
  margin: 0 16px 14px;
  background: rgba(234,179,8,0.07);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 14px; padding: 14px 16px;
}
.risk-mgmt-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.risk-mgmt-item { font-size: 12px; color: var(--text2); padding: 2px 0; line-height: 1.7; }
.risk-mgmt-item::before { content: '• '; }

/* ══════════════════════════════════
   REDESIGNED TRADING JOURNAL
══════════════════════════════════ */
.journal-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px 14px;
}
.journal-icon-wrap {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(240,180,41,0.12); border: 1px solid rgba(240,180,41,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.journal-title { font-size: 22px; font-weight: 800; color: var(--text); }
.journal-sub   { font-size: 13px; color: var(--text2); margin-top: 2px; }
.journal-action-row { display: flex; gap: 8px; padding: 0 16px 14px; flex-wrap: wrap; }

.journal-tab-bar {
  display: flex;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  margin: 0 16px 14px; padding: 4px;
  gap: 2px;
}
.journal-tab-btn {
  flex: 1; padding: 9px; border: none; background: none;
  color: var(--text2); font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 10px; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  white-space: nowrap;
}
.journal-tab-btn.active {
  background: var(--accent-bg); color: var(--accent);
}

/* ══════════════════════════════════
   REDESIGNED PROMPT TRADING
══════════════════════════════════ */
.prompt-hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px; margin: 16px 16px 12px;
  padding: 20px;
  position: relative; overflow: hidden;
}
.prompt-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.prompt-hero-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 0;
}
.prompt-hero-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--accent-bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.prompt-hero-title { font-size: 19px; font-weight: 800; color: var(--text); }
.prompt-hero-sub   { font-size: 12px; color: var(--text2); margin-top: 3px; }

/* Dropdown Section */
.dropdown-section {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  margin-bottom: 10px; cursor: pointer;
}
.dropdown-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px; font-weight: 700; color: var(--text);
  user-select: none;
}
.dropdown-section-header-left {
  display: flex; align-items: center; gap: 8px;
}
.dropdown-section-body { padding: 0 14px 14px; display: none; }
.dropdown-section.open .dropdown-section-body { display: block; }
.dropdown-chevron { transition: transform .2s; color: var(--text2); font-size: 16px; }
.dropdown-section.open .dropdown-chevron { transform: rotate(180deg); }

/* Strategy Textarea */
.strategy-textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); padding: 14px 44px 14px 16px;
  font-size: 14px; line-height: 1.6; outline: none; resize: vertical;
  transition: border .2s;
  font-family: inherit;
}
.strategy-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.strategy-textarea::placeholder { color: var(--text3); }
.textarea-voice-wrap { position: relative; }
.textarea-voice-btn {
  position: absolute; right: 12px; bottom: 12px;
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; font-size: 18px;
  transition: color .2s;
}
.textarea-voice-btn:hover { color: var(--accent); }

/* Generate Button */
.generate-strategy-btn {
  width: 100%; background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #000; border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .2s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px var(--accent-glow);
  margin-top: 12px;
}
.generate-strategy-btn:hover { opacity: 0.9; }
.generate-strategy-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* MT5 Not Connected Banner (Strategy page) */
.mt5-not-connected {
  margin: 0 16px 14px;
  background: rgba(234,179,8,0.07);
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.mt5-nc-icon { font-size: 18px; }
.mt5-nc-text { flex: 1; font-size: 14px; font-weight: 700; color: var(--text); }
.mt5-nc-refresh {
  background: none; border: none; color: var(--text2);
  font-size: 20px; cursor: pointer; padding: 4px; border-radius: 8px;
  transition: color .2s;
}
.mt5-nc-refresh:hover { color: var(--accent); }

/* Auto Trading Toggle */
.auto-trade-card {
  margin: 0 16px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 15px 16px;
  display: flex; align-items: center; gap: 10px;
}
.auto-trade-icon { font-size: 20px; color: var(--accent); }
.auto-trade-label { font-size: 15px; font-weight: 700; color: var(--text); }
.auto-trade-status { font-size: 13px; color: var(--text2); }
.auto-trade-card .toggle-switch { margin-left: auto; }

/* Strategy History */
.strategy-history-card {
  margin: 0 16px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
}
.sh-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px; font-size: 16px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sh-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--text3);
}
.sh-empty-icon { font-size: 36px; margin-bottom: 12px; }
.sh-empty-text { font-size: 13px; }

/* ══════════════════════════════════
   TOOLS OVERVIEW PAGE (pipnex style)
══════════════════════════════════ */
.tool-search-wrap {
  padding: 12px 16px 0;
}
.tool-search {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); padding: 12px 16px;
  font-size: 14px; outline: none; transition: border .2s;
}
.tool-search:focus { border-color: var(--accent); }
.tool-search::placeholder { color: var(--text3); }

.tool-feature-card {
  margin: 0 16px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px;
  position: relative; transition: border-color .2s;
  cursor: pointer;
}
.tool-feature-card:hover { border-color: var(--accent); }
.tool-feature-card .badge-corner {
  position: absolute; top: 14px; right: 14px;
}
.tool-feature-icon-lg {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.tool-feature-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.tool-feature-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }
.tool-feature-bullet { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.tool-open-btn {
  width: 100%; background: var(--accent-bg);
  border: none; color: var(--accent);
  border-radius: 12px; padding: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tool-open-btn:hover { background: var(--accent); color: #fff; }

/* ══════════════════════════════════
   HEATMAP ENHANCEMENTS
══════════════════════════════════ */
.heatmap-live-badge {
  background: rgba(34,197,94,0.12); color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.hm-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.hm-currency-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; padding: 0 16px 12px;
}
.hm-currency-chip {
  border-radius: 10px; padding: 8px 6px;
  text-align: center; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: transform .15s;
  color: #fff;
}
.hm-currency-chip:active { transform: scale(0.95); }

.hm-score-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; padding: 0 16px 14px;
}
.hm-score-card {
  background: var(--bg2); border-radius: 12px;
  padding: 10px 8px; text-align: center;
  border-left: 3px solid transparent;
}
.hm-score-pair { font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.hm-score-val  { font-size: 20px; font-weight: 800; }
.hm-score-change { font-size: 10px; margin-top: 2px; }

/* Volatility Heatmap - colored tiles */
.volatility-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0 16px 14px;
}
.vol-tile {
  border-radius: 16px; padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 110px;
  border: 1px solid transparent;
  transition: transform .15s;
}
.vol-tile:active { transform: scale(0.97); }
.vol-tile-pair { font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: 0.5px; }
.vol-tile-price { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.vol-tile-val { font-size: 28px; font-weight: 900; margin-bottom: 6px; }
.vol-tile-badge {
  background: rgba(0,0,0,0.3);
  border-radius: 20px; padding: 3px 12px;
  font-size: 11px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ═══════════════════════════════════════════════════════════════
   VOICE ORB — IMMERSIVE REDESIGN
═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   CINEMATIC VOICE OVERLAY — Waveform + Orb
═══════════════════════════════════════════════════════════════ */

/* Background layer */
.vc-bg {
  position: fixed; inset: 0;
  background: #060810;
  z-index: 0;
}
.vc-bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 55%, rgba(100,120,200,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 100% 30% at 50% 55%, rgba(200,60,100,0.08) 0%, transparent 60%);
  transition: all .6s ease;
}

/* ── Close button ── */
.vc-close {
  position: fixed; top: 16px; right: 16px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; z-index: 20;
}
.vc-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ── Header ── */
.vc-header {
  position: relative; z-index: 2;
  text-align: center;
  padding-top: 64px;
  padding-bottom: 0;
}
.vc-title {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: 0.3px;
}
.vc-subtitle {
  font-size: 13px; color: rgba(255,255,255,0.38);
  margin-top: 6px; transition: color .3s;
}

/* ── Stage: waveform + orb ── */
.vc-stage {
  position: relative; z-index: 2;
  width: 100%; flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 240px;
  margin: 10px 0 0;
}

/* Horizontal waveform bar field */
.vc-waveform-bg {
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  gap: 3px;
  overflow: hidden;
  pointer-events: none;
}
.vc-waveform-bg .wv-bar {
  width: 3px;
  border-radius: 2px;
  opacity: 0.18;
  transform-origin: center;
  animation: wvIdle 2.5s ease-in-out infinite;
  transition: opacity .4s, background .4s;
}

/* Idle — subtle static bars */
@keyframes wvIdle {
  0%,100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(0.5); }
}

/* Listening — bars animate energetically */
.vc-stage.listening .vc-waveform-bg .wv-bar {
  opacity: 1;
  animation: wvActive 0.6s ease-in-out infinite;
}
@keyframes wvActive {
  0%,100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

/* Speaking — bars pulse in a wave */
.vc-stage.speaking .vc-waveform-bg .wv-bar {
  opacity: 0.85;
  animation: wvSpeak 0.7s ease-in-out infinite;
}
@keyframes wvSpeak {
  0%,100% { transform: scaleY(0.5); }
  50%      { transform: scaleY(0.85); }
}

/* Thinking — slow gentle ripple */
.vc-stage.thinking .vc-waveform-bg .wv-bar {
  opacity: 0.45;
  animation: wvThink 1.8s ease-in-out infinite;
}
@keyframes wvThink {
  0%,100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(0.6); }
}

/* ── Orb wrap ── */
.vc-orb-wrap {
  position: relative;
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
}

/* Ambient glow rings */
.vc-ambient {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(100,120,240,0.22) 0%, transparent 70%);
  pointer-events: none;
  transition: background .5s;
}
.vc-ambient-1 { width: 200px; height: 200px; animation: vcAmbient 3.5s ease-in-out infinite; }
.vc-ambient-2 { width: 150px; height: 150px; animation: vcAmbient 3.5s ease-in-out 0.6s infinite; }
.vc-ambient-3 { width: 100px; height: 100px; animation: vcAmbient 3.5s ease-in-out 1.2s infinite; }
@keyframes vcAmbient {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* Listening glow — teal/green */
.vc-stage.listening .vc-ambient-1 { background: radial-gradient(circle, rgba(0,220,160,0.3) 0%, transparent 70%); animation-duration: 0.9s; }
.vc-stage.listening .vc-ambient-2 { background: radial-gradient(circle, rgba(0,220,160,0.2) 0%, transparent 70%); }
.vc-stage.listening .vc-ambient-3 { background: radial-gradient(circle, rgba(0,220,160,0.25) 0%, transparent 70%); }

/* Speaking glow — pink/coral */
.vc-stage.speaking .vc-ambient-1 { background: radial-gradient(circle, rgba(240,80,120,0.35) 0%, transparent 70%); animation-duration: 0.5s; }
.vc-stage.speaking .vc-ambient-2 { background: radial-gradient(circle, rgba(240,80,120,0.2) 0%, transparent 70%); }

/* Thinking glow — amber */
.vc-stage.thinking .vc-ambient-1 { background: radial-gradient(circle, rgba(240,180,41,0.3) 0%, transparent 70%); animation-duration: 1.4s; }

/* ── Main Orb ── */
.vc-orb {
  width: 140px; height: 140px;
  border-radius: 50%;
  cursor: pointer;
  position: relative; z-index: 4;
  animation: vcOrbBreathe 4s ease-in-out infinite;
  transition: transform .15s;
}
.vc-orb:active { transform: scale(0.88) !important; animation: none; }
@keyframes vcOrbBreathe {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.vc-orb-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(160,170,255,0.9) 0%, rgba(80,90,220,0.95) 40%, rgba(30,30,120,1) 80%);
  box-shadow:
    0 0 0 1.5px rgba(120,140,255,0.55),
    0 0 35px rgba(100,120,255,0.8),
    0 0 70px rgba(100,120,255,0.45),
    0 0 130px rgba(100,120,255,0.2),
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -3px 0 rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: all .45s cubic-bezier(.4,0,.2,1);
}

/* Listening — vivid teal/cyan orb */
.vc-stage.listening .vc-orb { animation: vcOrbListen 0.75s ease-in-out infinite; }
@keyframes vcOrbListen { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
.vc-stage.listening .vc-orb-inner {
  background: radial-gradient(circle at 35% 30%, rgba(120,255,200,0.95) 0%, rgba(0,200,150,1) 40%, rgba(0,80,70,1) 80%);
  box-shadow: 0 0 0 1.5px rgba(0,220,160,0.7), 0 0 40px rgba(0,220,160,1), 0 0 90px rgba(0,220,160,0.5), 0 0 150px rgba(0,220,160,0.2), inset 0 2px 0 rgba(255,255,255,0.35);
}

/* Speaking — hot coral/pink orb */
.vc-stage.speaking .vc-orb-inner {
  background: radial-gradient(circle at 35% 30%, rgba(255,160,180,0.95) 0%, rgba(240,60,110,1) 40%, rgba(120,0,50,1) 80%);
  box-shadow: 0 0 0 1.5px rgba(240,80,120,0.7), 0 0 45px rgba(240,80,120,1), 0 0 90px rgba(240,80,120,0.5), 0 0 150px rgba(240,80,120,0.2), inset 0 2px 0 rgba(255,255,255,0.35);
  animation: vcSpeakPulse 0.55s ease-in-out infinite !important;
}
@keyframes vcSpeakPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }

/* Thinking — amber/gold orb */
.vc-stage.thinking .vc-orb-inner {
  background: radial-gradient(circle at 35% 30%, rgba(255,230,100,0.95) 0%, rgba(240,180,41,1) 40%, rgba(120,70,0,1) 80%);
  box-shadow: 0 0 0 1.5px rgba(240,180,41,0.7), 0 0 45px rgba(240,180,41,0.9), 0 0 90px rgba(240,180,41,0.45), 0 0 150px rgba(240,180,41,0.18), inset 0 2px 0 rgba(255,255,255,0.35);
}

/* Mic icon */
.vc-mic-icon {
  color: rgba(255,255,255,0.92);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.4));
}

/* Idle dot */
.vc-idle-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* Inner bars (inside orb while listening) */
.vc-inner-bars {
  display: flex; align-items: center; gap: 4px; height: 38px;
}
.vc-inner-bars span {
  width: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.95);
  animation: vcInnerBar 0.7s ease-in-out infinite;
}
.vc-inner-bars span:nth-child(1) { height: 12px; animation-delay: 0s; }
.vc-inner-bars span:nth-child(2) { height: 26px; animation-delay: 0.1s; }
.vc-inner-bars span:nth-child(3) { height: 36px; animation-delay: 0.2s; }
.vc-inner-bars span:nth-child(4) { height: 26px; animation-delay: 0.3s; }
.vc-inner-bars span:nth-child(5) { height: 12px; animation-delay: 0.4s; }
@keyframes vcInnerBar {
  0%,100% { transform: scaleY(0.4); opacity: 0.7; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* Thinking ring */
.vc-thinking { width: 38px; height: 38px; }
.vc-think-ring {
  width: 38px; height: 38px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* State label below orb */
.vc-state-label {
  position: absolute;
  bottom: -30px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; letter-spacing: 2.5px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap; transition: color .3s;
}
.vc-stage.listening .vc-state-label { color: rgba(0,220,160,0.9); }
.vc-stage.speaking  .vc-state-label { color: rgba(240,80,120,0.9); }
.vc-stage.thinking  .vc-state-label { color: rgba(240,180,41,0.9); }

/* ── Conversation area ── */
.vc-convo {
  position: relative; z-index: 2;
  width: 100%; padding: 0 20px;
  display: flex; flex-direction: column;
}
.vc-you-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 1px;
  margin: 18px 0 6px;
}
.vc-transcript {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 13px 16px;
  font-size: 15px; color: rgba(255,255,255,0.82);
  line-height: 1.55; min-height: 46px;
}
.vc-response {
  background: rgba(100,120,255,0.1);
  border: 1px solid rgba(100,120,255,0.3);
  border-radius: 16px; padding: 14px 16px;
  font-size: 15px; color: rgba(255,255,255,0.9);
  line-height: 1.65; margin-top: 10px;
}
.vc-stage.listening ~ .vc-convo .vc-response { border-color: rgba(0,220,160,0.3); background: rgba(0,220,160,0.08); }
.vc-stage.speaking  ~ .vc-convo .vc-response { border-color: rgba(240,80,120,0.3); background: rgba(240,80,120,0.08); }

/* ── Quick chips ── */
.vc-chips {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 20px 20px 24px;
}
.vc-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px; padding: 9px 15px;
  font-size: 12px; color: rgba(255,255,255,0.5);
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.vc-chip:hover,
.vc-chip:active {
  background: rgba(100,120,255,0.18);
  border-color: rgba(100,120,255,0.5);
  color: #fff;
}

/* ── State helpers ── */
.vc-stage.listening ~ .vc-convo,
.vc-stage.speaking ~ .vc-convo,
.vc-stage.thinking ~ .vc-convo { }

/* voice-orb-stage alias kept for JS compat */
.voice-orb-stage { display: none !important; }

/* Old classes kept for JS compat (zero-footprint) */
.voice-orb-idle-dot { display: none; }
.voice-modal-new { display: none !important; }
.voice-close-btn { display: none !important; }
.voice-you-label, .voice-transcript-bubble, .voice-response-bubble, .voice-quick-row { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   QUICK ACCESS — SCROLLABLE TOOL CARDS
═══════════════════════════════════════════════════════════════ */
/* ── QUICK ACCESS: Full-Screen Page ── */
.qa-modal-new {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(0.32, 0.72, 0, 1);
}
.qa-modal-new.open { transform: translateX(0); }

.qa-modal-handle { display: none; }

.qa-modal-top {
  padding: 0;
  flex-shrink: 0;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.qa-modal-title-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 14px;
}
.qa-modal-title { font-size: 18px; font-weight: 800; color: #fff; flex: 1; }
.qa-close-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: rgba(255,255,255,0.6);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.qa-close-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.qa-search-wrap {
  position: relative; padding: 0 16px 14px;
}
.qa-search-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: #fff;
  padding: 12px 14px 12px 42px;
  font-size: 14px; outline: none;
  transition: border .2s;
}
.qa-search-input:focus { border-color: rgba(240,180,41,0.6); }
.qa-search-input::placeholder { color: rgba(255,255,255,0.3); }

/* Scrollable tool list */
.qa-tools-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 100px;
  -webkit-overflow-scrolling: touch;
  background: #000;
}

/* Individual tool card — PipNex dark style */
.qa-tool-card {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .2s, transform .1s, background .2s;
  position: relative;
  overflow: hidden;
}
.qa-tool-card:hover  { border-color: rgba(240,180,41,0.5); background: var(--bg2); }
.qa-tool-card:active { transform: scale(0.98); }

.qa-tool-icon-wrap {
  width: 50px; height: 50px;
  border-radius: 16px;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.qa-tool-info { margin-bottom: 14px; }
.qa-tool-name { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.qa-tool-desc { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.65; margin-bottom: 6px; }
.qa-tool-tag  { font-size: 12px; color: rgba(255,255,255,0.35); }

.qa-open-btn {
  width: 100%;
  background: rgba(240,180,41,0.15);
  border: 1px solid rgba(240,180,41,0.3);
  color: #ffd166;
  border-radius: 14px;
  padding: 13px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.qa-open-btn:hover { background: #f0b429; border-color: #f0b429; color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   AI MENTOR CHAT — PROFESSIONAL REDESIGN
═══════════════════════════════════════════════════════════════ */
.mentor-tab-fullscreen {
  display: none;
  flex-direction: column;
  padding: 0;
  background: var(--bg);
  /* No fixed height - let it be normal page flow */
  min-height: calc(100vh - var(--topbar-h) - var(--bottom-h));
  padding-bottom: 80px; /* space for fixed input bar */
}
.mentor-tab-fullscreen.active {
  display: flex;
}

/* Header */
.mentor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
}
.mentor-header-left { display: flex; align-items: center; gap: 12px; }
.mentor-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  position: relative; flex-shrink: 0;
}
.mentor-online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  background: var(--green);
  border: 2px solid var(--bg2);
  border-radius: 50%;
}
.mentor-name { font-size: 15px; font-weight: 700; color: var(--text); }
.mentor-status-txt {
  font-size: 11px; color: var(--green);
  display: flex; align-items: center; gap: 4px; margin-top: 2px;
}
.mentor-status-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.mentor-header-actions { display: flex; gap: 6px; }
.mentor-action-btn {
  width: 34px; height: 34px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.mentor-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.mentor-action-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* Chips row — horizontally scrollable */
.mentor-chips-row {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}
.mentor-chips-scroll {
  display: flex; gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mentor-chips-scroll::-webkit-scrollbar { display: none; }
.mentor-chip-new {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.mentor-chip-new:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* Messages area */
.mentor-messages-new {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
  /* Natural height - grows with messages */
  min-height: 200px;
}

.mentor-msg-wrap {
  display: flex; gap: 8px;
  align-items: flex-end;
}
.mentor-msg-wrap.user { flex-direction: row-reverse; }

.mentor-ai-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}

.mentor-bubble-new {
  max-width: 84%;
}
.mentor-bubble-text {
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.7;
}
.mentor-bubble-new.ai .mentor-bubble-text {
  background: var(--bg3);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.mentor-bubble-new.user .mentor-bubble-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border-bottom-right-radius: 4px;
}
.mentor-bubble-time {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
  padding: 0 2px;
}
.mentor-msg-wrap.user .mentor-bubble-time { text-align: right; }

/* Typing indicator */
.mentor-typing-dots {
  display: flex; gap: 4px; align-items: center;
  padding: 14px 16px;
}
.mentor-typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text3);
  animation: typingDot 1.2s ease-in-out infinite;
}
.mentor-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.mentor-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-6px); opacity: 1; }
}

/* Input area — FIXED at bottom, always visible above keyboard */
.mentor-input-area {
  position: fixed;
  bottom: var(--bottom-h);
  left: 0; right: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  z-index: 50;
  max-width: 680px;
  margin: 0 auto;
}
.mentor-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 8px 8px 12px;
  transition: border-color .2s;
}
.mentor-input-wrap:focus-within { border-color: var(--accent); }

.mentor-voice-input-btn {
  width: 34px; height: 34px;
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; transition: all .2s; flex-shrink: 0;
}
.mentor-voice-input-btn:hover { color: var(--accent); background: var(--accent-bg); }

.mentor-text-input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 14px;
  outline: none; padding: 6px 4px;
  min-width: 0;
}
.mentor-text-input::placeholder { color: var(--text3); }

.mentor-send-btn {
  width: 38px; height: 38px;
  background: var(--accent);
  border: none; border-radius: 10px;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
  box-shadow: 0 3px 12px var(--accent-glow);
}
.mentor-send-btn:hover   { opacity: 0.9; transform: scale(1.05); }
.mentor-send-btn:active  { transform: scale(0.95); }
.mentor-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.mentor-input-hint {
  text-align: center; font-size: 10px;
  color: var(--text3); margin-top: 7px;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE PAGES — Theme-aware (works in both dark & light)
═══════════════════════════════════════════════════════════════ */

/* All feature tabs: use theme background, proper scroll height */
#tab-heatmap,
#tab-positioncalc,
#tab-journal,
#tab-prompttrading {
  background: var(--bg);
  min-height: calc(100dvh - var(--topbar-h) - var(--bottom-h));
  /* Use fixed padding-bottom since --bottom-h is 0 on desktop and 
     floating nav is handled by padding on .main */
  padding-bottom: 100px;
}

/* Heatmap tab buttons */
#tab-heatmap .hm-tab-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
#tab-heatmap .hm-tab-btn.active,
#tab-heatmap .hm-tab-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* Heatmap section blocks */
.hm-section-block {
  display: block !important;
  margin: 0 16px 16px;
  animation: sectionFadeIn 0.5s ease forwards;
}
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hm-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text2);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.hm-section-live-dot {
  width: 6px; height: 6px; background: #22c55e;
  border-radius: 50%; animation: pulse 2s infinite;
}

/* Vol tile — theme-aware */
.vol-tile {
  background: var(--bg2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
}
.vol-tile-pair { font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 6px; letter-spacing: 0.5px; }
.vol-tile-val  { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.vol-tile-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid;
}

/* Section cards — theme-aware */
#tab-heatmap .section-card,
#tab-positioncalc .section-card,
#tab-journal .section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 0 16px 16px;
}
#tab-heatmap .section-card-header,
#tab-positioncalc .section-card-header,
#tab-journal .section-card-header {
  border-bottom: 1px solid var(--border);
}
#tab-heatmap .section-card-title,
#tab-positioncalc .section-card-title,
#tab-journal .section-card-title {
  color: var(--text);
}

/* Position Size Calculator — theme-aware */
#tab-positioncalc .psc-hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 16px 16px 12px;
  padding: 20px;
}
#tab-positioncalc .psc-title { color: var(--text); }
#tab-positioncalc .psc-sub   { color: var(--text2); }
#tab-positioncalc .calc-label { color: var(--text); }

/* Journal — theme-aware */
#tab-journal .journal-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
#tab-journal h1,
#tab-journal .section-title { color: var(--text); }
#tab-journal .subtitle { color: var(--text2); }
#tab-journal .journal-stats-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
}
#tab-journal .journal-entry {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 0 16px 10px;
}

/* Stat cards — theme-aware */
#tab-journal .stat-card-single,
#tab-journal .stat-card-full {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
}
#tab-journal .stat-card-label { color: var(--text2); }
#tab-journal .stat-card-value { color: var(--text); }
#tab-journal .stat-card-sub   { color: var(--text3); }

/* feat-action-btn — theme-aware */
#tab-journal .feat-action-btn,
#tab-positioncalc .feat-action-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
}
#tab-journal .feat-action-btn:hover,
#tab-positioncalc .feat-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
#tab-journal .feat-action-btn.primary-action {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
#tab-journal .feat-action-btn.primary-action:hover {
  background: var(--accent);
  color: #fff;
}

/* Position calc direction/instrument — theme-aware */
#tab-positioncalc .dir-btn {
  background: var(--bg3);
  color: var(--text2);
}
#tab-positioncalc .dir-btn.buy.active  { background: rgba(34,197,94,0.12); color: #22c55e; }
#tab-positioncalc .dir-btn.sell.active { background: rgba(239,68,68,0.12); color: #ef4444; }
#tab-positioncalc .instrument-select-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
}
#tab-positioncalc .instrument-name { color: var(--text); }

/* ── DARK-ONLY overrides ── */
[data-theme="dark"] #tab-heatmap,
[data-theme="dark"] #tab-positioncalc,
[data-theme="dark"] #tab-journal,
[data-theme="dark"] #tab-prompttrading {
  background: #000;
}

[data-theme="dark"] .vol-tile {
  background: #111 !important;
  border-color: rgba(255,255,255,0.07) !important;
}
[data-theme="dark"] .vol-tile-pair { color: rgba(255,255,255,0.5); }

[data-theme="dark"] #tab-heatmap .section-card,
[data-theme="dark"] #tab-positioncalc .section-card,
[data-theme="dark"] #tab-journal .section-card {
  background: #0d0d0d;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] #tab-positioncalc .psc-hero {
  background: #0d0d0d;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] #tab-journal .stat-card-single,
[data-theme="dark"] #tab-journal .stat-card-full {
  background: #0d0d0d;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] #tab-journal .journal-entry,
[data-theme="dark"] #tab-journal .journal-stats-card {
  background: var(--bg2);
  border-color: var(--border);
}
[data-theme="dark"] #tab-prompttrading .auto-trade-card,
[data-theme="dark"] #tab-prompttrading .strategy-history-card {
  background: var(--bg2);
  border-color: var(--border);
}
[data-theme="dark"] #tab-positioncalc .calc-input,
[data-theme="dark"] #tab-positioncalc input[type="number"],
[data-theme="dark"] #tab-positioncalc select {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

/* Prompt trading — theme-aware */
#tab-prompttrading .quick-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
#tab-prompttrading .quick-pill:hover,
#tab-prompttrading .quick-pill.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
#tab-prompttrading .prompt-pair-check {
  color: var(--text);
  font-size: 13px;
}
#tab-prompttrading .prompt-pair-check input { accent-color: var(--accent); }
#tab-prompttrading .auto-trade-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 16px 12px;
}
#tab-prompttrading .auto-trade-label { color: var(--text); }
#tab-prompttrading .auto-trade-status { color: var(--text2); }
#tab-prompttrading .strategy-history-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 16px 12px;
}
#tab-prompttrading .sh-header { color: var(--text2); }

/* ── QA modal backdrop hidden ── */
#qa-modal-backdrop { display: none !important; }

/* Voice state label */
.voice-state-label {
  position: absolute;
  bottom: -40px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap; transition: color .3s;
  z-index: 1;
}

/* Voice orb idle dot */
.voice-orb-idle-dot {
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255,255,255,0.7), 0 0 48px rgba(255,255,255,0.3);
  transition: all .4s ease;
}
.voice-orb-stage.listening .voice-orb-idle-dot,
.voice-orb-stage.thinking .voice-orb-idle-dot,
.voice-orb-stage.speaking .voice-orb-idle-dot { display: none; }

/* Ensure .main is scrollable */
.main {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   MENTOR TAB — Normal scrollable page, fixed input bar
═══════════════════════════════════════════════════════════════ */
body:has(#tab-aichat.active) .main {
  /* Don't clip - let body scroll so messages are readable */
  padding-bottom: calc(var(--bottom-h) + 80px);
}

/* ═══════════════════════════════════════════════════════════════
   BOT MANAGER — PipNex Style Redesign
═══════════════════════════════════════════════════════════════ */

/* Hero card */
.bm-hero-card {
  margin: 0 16px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 16px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.bm-hero-left { display: flex; align-items: flex-start; gap: 14px; flex: 1; }
.bm-hero-icon-wrap {
  width: 56px; height: 56px;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bm-hero-title { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.2; }
.bm-hero-sub { font-size: 12px; color: var(--text3); margin-top: 3px; }
.bm-hero-brokers {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.bm-hero-brokers span {
  font-size: 11px; color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}

/* Stats row */
.bm-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 16px 14px;
}
.bm-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bm-stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bm-stat-card-label {
  font-size: 10px; font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.bm-stat-card-val {
  font-size: 22px; font-weight: 800; color: var(--text);
  line-height: 1;
}

/* Tab bar */
.bm-tabs-bar {
  display: flex;
  gap: 0;
  margin: 0 16px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bm-tabs-bar::-webkit-scrollbar { display: none; }
.bm-tab-btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap;
}
.bm-tab-btn.active {
  background: var(--bg3);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Empty state */
.bm-empty-new {
  text-align: center;
  padding: 48px 24px 32px;
  color: var(--text3);
}
.bm-empty-bot-icon {
  width: 80px; height: 80px;
  background: var(--bg2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
}
.bm-empty-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.bm-empty-desc {
  font-size: 13px; color: var(--text3);
  line-height: 1.5; max-width: 260px; margin: 0 auto;
}

/* Action row */
.bm-action-row {
  display: flex;
  gap: 10px;
  margin: 0 16px 24px;
  align-items: center;
}

/* Bot Manager tab padding */
#tab-botmanager { padding-bottom: 80px; }

/* ═══════════════════════════════════════════════════════════════
   HEATMAP — Ultimate System (theme-aware)
═══════════════════════════════════════════════════════════════ */

/* Category tab buttons */
.hm-cat-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px 8px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text2);
}
.hm-cat-btn:active { transform: scale(0.95); }
.hm-cat-btn.hm-cat-active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.hm-cat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Category panels */
.hm-cat-panel { padding: 0 16px; }
.hm-cat-panel.hidden { display: none; }

/* Heatmap card container */
.hm-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
}
[data-theme="dark"] .hm-card {
  background: #0d0d0d;
  border-color: rgba(255,255,255,0.07);
}
.hm-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hm-badge-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
}

/* 2-column grid */
.hm-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
/* 3-column grid */
.hm-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* 2-col tile */
.hm-tile-2 {
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .15s;
}
.hm-tile-2:active { transform: scale(0.96); }
[data-theme="dark"] .hm-tile-2 { border-color: rgba(255,255,255,0.06); }
.hm-t2-pair {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}
.hm-t2-sub {
  font-size: 10px;
  color: var(--text2);
  margin-bottom: 3px;
}
.hm-t2-val {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
  line-height: 1;
}
.hm-t2-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

/* 3-col score tile */
.hm-tile-3 {
  border-radius: 12px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  text-align: center;
}
[data-theme="dark"] .hm-tile-3 { border-color: rgba(255,255,255,0.06); }
.hm-t3-pair {
  font-size: 10px;
  font-weight: 800;
  color: var(--text2);
  margin-bottom: 3px;
}
.hm-t3-val {
  font-size: 14px;
  font-weight: 900;
}

/* BOS/CHoCH tile */
.hm-bos-tile {
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
}
[data-theme="dark"] .hm-bos-tile { background: #111; border-color: rgba(255,255,255,0.06); }
.hm-bos-pair {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.hm-bos-badge {
  display: block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin: 3px 0;
  text-align: center;
}

/* FVG tile */
.hm-fvg-tile {
  border-radius: 14px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  text-align: center;
}
[data-theme="dark"] .hm-fvg-tile { background: #111; border-color: rgba(255,255,255,0.06); }
.hm-fvg-pair {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.hm-fvg-pills {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.hm-fvg-pill {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  gap: 2px;
}

/* Legend row */
.hm-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font-size: 10px;
  color: var(--text2);
  align-items: center;
}
.hm-leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Status bar bottom padding */
#hm-status-bar {
  padding-bottom: 80px !important;
}

/* Dark overrides */
[data-theme="dark"] #tab-heatmap {
  background: #000;
}


/* ═══════════════════════════════════════════════════════════════
   BOT BUILDER — options & pick UI
═══════════════════════════════════════════════════════════════ */

.bb-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.bb-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.bb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bb-field { display: flex; flex-direction: column; gap: 6px; }

.bb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.bb-select, .bb-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.bb-select:focus, .bb-input:focus,
.bb-textarea:focus {
  border-color: var(--accent);
}

.bb-textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 10px 12px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .2s;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
}
.bb-textarea::placeholder { color: var(--text3); }

/* Chip grids — strategy / filter chips */
.bb-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bb-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.bb-chip.active,
.bb-chip:active {
  background: rgba(240,180,41,0.12);
  border-color: rgba(240,180,41,0.5);
  color: var(--accent);
}

/* Toggle chips — multi-select */
.bb-chip-toggle {
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text3);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.bb-chip-toggle.active {
  background: rgba(0,212,170,0.1);
  border-color: rgba(0,212,170,0.4);
  color: var(--teal, #00d4aa);
}

/* Small chips — risk/RR/maxTrades */
.bb-chip-grid-small {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bb-chip-sm {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.bb-chip-sm.active {
  background: rgba(240,180,41,0.12);
  border-color: rgba(240,180,41,0.5);
  color: var(--accent);
}

/* Mode tab buttons */
#bb-tab-configure.active-tab,
#bb-tab-describe.active-tab {
  background: var(--accent);
  color: #000;
}

/* ═══════════════════════════════════════════════════════════════
   DAVIN-AI — QUALITY TIER COLORS + NUMERIC POUR ANIMATION
   Add this block to the END of style.css (before last closing brace)
   ═══════════════════════════════════════════════════════════════ */

/* ── Quality tier color tokens ───────────────────────────────── */
:root {
  --q-aplus:      #f0b429;   /* Gold   — A+ High Conviction        */
  --q-aplus-bg:   rgba(240,180,41,0.10);
  --q-aplus-glow: rgba(240,180,41,0.22);
  --q-a:          #22c55e;   /* Green  — A Good Conviction          */
  --q-a-bg:       rgba(34,197,94,0.10);
  --q-a-glow:     rgba(34,197,94,0.18);
  --q-b:          #3b82f6;   /* Blue   — B Moderate                 */
  --q-b-bg:       rgba(59,130,246,0.10);
  --q-b-glow:     rgba(59,130,246,0.18);
  --q-c:          #f97316;   /* Orange — C Low Conviction           */
  --q-c-bg:       rgba(249,115,22,0.10);
  --q-c-glow:     rgba(249,115,22,0.18);
  --q-none:       #6b7280;   /* Gray   — No Trade                   */
  --q-none-bg:    rgba(107,114,128,0.10);
  --q-none-glow:  rgba(107,114,128,0.10);
}

/* ── Quality tier badge ──────────────────────────────────────── */
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.quality-badge.q-aplus {
  color: var(--q-aplus);
  background: var(--q-aplus-bg);
  box-shadow: 0 0 10px var(--q-aplus-glow);
}
.quality-badge.q-a {
  color: var(--q-a);
  background: var(--q-a-bg);
  box-shadow: 0 0 10px var(--q-a-glow);
}
.quality-badge.q-b {
  color: var(--q-b);
  background: var(--q-b-bg);
  box-shadow: 0 0 8px var(--q-b-glow);
}
.quality-badge.q-c {
  color: var(--q-c);
  background: var(--q-c-bg);
}
.quality-badge.q-none {
  color: var(--q-none);
  background: var(--q-none-bg);
}

/* ── Trade setup card — quality border theming ───────────────── */
.trade-setup-box.q-aplus { border-color: var(--q-aplus) !important; box-shadow: 0 0 18px var(--q-aplus-glow); }
.trade-setup-box.q-a     { border-color: var(--q-a)     !important; box-shadow: 0 0 14px var(--q-a-glow); }
.trade-setup-box.q-b     { border-color: var(--q-b)     !important; box-shadow: 0 0 10px var(--q-b-glow); }
.trade-setup-box.q-c     { border-color: var(--q-c)     !important; }
.trade-setup-box.q-none  { border-color: var(--q-none)  !important; opacity: 0.7; }

.trade-setup-header.q-aplus { background: var(--q-aplus-bg) !important; color: var(--q-aplus) !important; }
.trade-setup-header.q-a     { background: var(--q-a-bg)     !important; color: var(--q-a)     !important; }
.trade-setup-header.q-b     { background: var(--q-b-bg)     !important; color: var(--q-b)     !important; }
.trade-setup-header.q-c     { background: var(--q-c-bg)     !important; color: var(--q-c)     !important; }
.trade-setup-header.q-none  { background: var(--q-none-bg)  !important; color: var(--q-none)  !important; }

/* Strategy found-by badge */
.strategy-found-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  margin-left: 6px;
}

/* ── Numeric pour — shared container ────────────────────────────
   Wraps any number that should "pour in" from above.
   JS adds .pour-active to trigger the animation.
   ──────────────────────────────────────────────────────────────*/
.num-pour-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.num-pour-digit {
  display: inline-block;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0s, opacity 0s;
}
.num-pour-wrap.pour-active .num-pour-digit {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1),
              opacity   0.3s ease;
}

/* ── Live chart analyzing state — numeric rain overlay ──────── */
#lwc-analysis-loading {
  position: relative;
}

/* The rain canvas sits inside lwc-analysis-loading */
#lwc-num-rain-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.55;
  z-index: 2;
}

/* Scanning pulse ring on the analyze FAB while analyzing */
@keyframes lc-fab-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(240,180,41,0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(240,180,41,0); }
  100% { box-shadow: 0 0 0 0   rgba(240,180,41,0); }
}
.lc-fab-spinning {
  animation: lc-fab-spinning 1s linear infinite,
             lc-fab-pulse    1.4s ease-out infinite !important;
}

/* ── Analysis step ticker shown inside loading panel ─────────── */
#lwc-step-ticker {
  font-size: 12px;
  color: var(--accent);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.03em;
  min-height: 18px;
  text-align: center;
  padding: 2px 0 6px;
}

/* ── Level cards — pour animation on entry/sl/tp values ─────── */
.ts-value.pour-done {
  animation: tsValuePop 0.4s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes tsValuePop {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Confidence bar — smooth fill ───────────────────────────── */
.confidence-fill {
  transition: width 1.2s cubic-bezier(0.22,1,0.36,1) !important;
}
.confidence-thumb {
  transition: left 1.2s cubic-bezier(0.22,1,0.36,1) !important;
}

/* ── Upload chart result card quality theming ───────────────── */
.upload-result-card.q-aplus { border-left: 4px solid var(--q-aplus); box-shadow: 0 0 16px var(--q-aplus-glow); }
.upload-result-card.q-a     { border-left: 4px solid var(--q-a);     box-shadow: 0 0 12px var(--q-a-glow); }
.upload-result-card.q-b     { border-left: 4px solid var(--q-b);     box-shadow: 0 0 8px  var(--q-b-glow); }
.upload-result-card.q-c     { border-left: 4px solid var(--q-c); }
.upload-result-card.q-none  { border-left: 4px solid var(--q-none);  opacity: 0.75; }

/* Fusion summary strip */
.fusion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
}
.fusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg4);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.fusion-chip.winner {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}


/* ═══════════════════════════════════════════════════════════════
   MT5 / MetaApi Connection — Settings Dropdown
   ═══════════════════════════════════════════════════════════════ */
.mt5-panel { padding: 0; }

.mt5-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mt5-icon { font-size: 24px; line-height: 1; }
.mt5-title { font-size: 13px; font-weight: 700; color: var(--text); }
.mt5-subtitle { font-size: 11px; color: var(--text2); margin-top: 2px; }

.mt5-info-banner {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.22);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.mt5-form { display: flex; flex-direction: column; gap: 9px; }

.mt5-field { display: flex; flex-direction: column; gap: 4px; }

.mt5-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mt5-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.mt5-input:focus {
  outline: none;
  border-color: var(--accent);
}

.mt5-password-wrap { position: relative; }
.mt5-password-wrap .mt5-input { padding-right: 42px; }
.mt5-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  color: var(--text2);
}

.mt5-connect-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 2px;
  transition: opacity 0.2s;
}
.mt5-connect-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.mt5-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 9px;
  font-size: 12px;
  color: var(--red);
  line-height: 1.5;
}

.mt5-account-card {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px 12px;
}
.mt5-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}
.mt5-account-row:last-child { border-bottom: none; }
.mt5-field-label { font-size: 11px; color: var(--text2); }
.mt5-field-val   { font-size: 12px; font-weight: 600; color: var(--text); }

.mt5-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.mt5-status-dot.connected    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.mt5-status-dot.connecting   { background: var(--yellow); animation: pulse 1.5s infinite; }
.mt5-status-dot.disconnected { background: var(--text3); }
