/* ═══════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════ */

/* Typography */
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 10px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 12px;
}
.stat-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
}
.stat-cell-label {
  font-size: 10px; font-family: 'DM Mono', monospace;
  color: var(--text3); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 4px;
}
.stat-cell-value {
  font-family: 'Syne', sans-serif;
  font-size: 21px; font-weight: 800; line-height: 1;
}
.stat-cell-sub { font-size: 10px; color: var(--text2); margin-top: 3px; }

/* Colour helpers */
.c-green  { color: var(--accent);  }
.c-amber  { color: var(--warn);    }
.c-red    { color: var(--danger);  }
.c-blue   { color: var(--info);    }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-family: 'DM Mono', monospace;
}
.badge-green  { background: var(--accent-dim); color: var(--accent); }
.badge-amber  { background: var(--warn-dim);   color: var(--warn);   }
.badge-red    { background: var(--danger-dim); color: var(--danger); }
.badge-blue   { background: var(--info-dim);   color: var(--info);   }

/* Alert Strips */
.alert-strip {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 13px; border-radius: var(--radius-md);
  margin-bottom: 8px; font-size: 12px;
  line-height: 1.5; color: var(--text2);
}
.alert-strip.warn   { background: var(--warn-dim);   border-left: 3px solid var(--warn);   }
.alert-strip.ok     { background: var(--accent-dim); border-left: 3px solid var(--accent); }
.alert-strip.danger { background: var(--danger-dim); border-left: 3px solid var(--danger); }
.alert-icon { font-size: 14px; flex-shrink: 0; }

/* Impact dots */
.impact-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.impact-high { background: var(--danger); }
.impact-med  { background: var(--warn);   }
.impact-low  { background: var(--accent); }

/* Progress bars */
.progress-bar {
  height: 3px; background: var(--surface3);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.6s ease;
}

/* Streak row */
.streak-row { display: flex; gap: 5px; margin: 8px 0; }
.streak-day {
  flex: 1; height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-family: 'DM Mono', monospace;
}
.streak-day.done   { background: var(--accent-dim); border: 1px solid rgba(0,200,150,0.25); color: var(--accent); }
.streak-day.missed { background: var(--danger-dim); border: 1px solid rgba(232,69,90,0.2);  color: var(--danger); }
.streak-day.future { background: var(--surface3);   border: 1px solid var(--border);         color: var(--text3);  }

/* Perf rows */
.perf-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.perf-row:last-child { border-bottom: none; }
.perf-label  { font-size: 12px; color: var(--text2); }
.perf-value  { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; }
.perf-bar-wrap { width: 55px; height: 3px; background: var(--surface3); border-radius: 2px; margin: 0 9px; overflow: hidden; }
.perf-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); }

/* Checklist */
.check-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.check-item:last-child { border-bottom: none; }
.check-circle {
  width: 18px; height: 18px; border-radius: 50%;
  flex-shrink: 0; border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all 0.2s;
}
.check-item.checked .check-circle { background: var(--accent); border-color: var(--accent); color: #000; }
.check-item.checked .check-label  { color: var(--text3); text-decoration: line-through; }
.check-label { font-size: 13px; color: var(--text); }

/* Trade log */
.trade-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.trade-pair  { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; min-width: 64px; }
.trade-dir   { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-family: 'DM Mono', monospace; }
.trade-dir.buy  { background: var(--accent-dim); color: var(--accent); }
.trade-dir.sell { background: var(--danger-dim); color: var(--danger); }
.trade-meta  { flex: 1; }
.trade-setup { font-size: 11px; color: var(--text2); }
.trade-time  { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; }
.trade-rr    { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 700; }

/* Watchlist pair rows */
.pair-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.2s;
}
.pair-row:hover { border-color: var(--accent); }
.pair-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-family: 'DM Mono', monospace;
  font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.pair-name  { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; }
.pair-cat   { font-size: 10px; color: var(--text2); }
.pair-price-col { margin-left: auto; text-align: right; }
.pair-price { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; }
.pair-change {
  font-family: 'DM Mono', monospace; font-size: 10px;
  padding: 2px 5px; border-radius: 4px;
  margin-top: 2px; display: inline-block;
}
.pair-change.up { background: var(--accent-dim); color: var(--accent); }
.pair-change.dn { background: var(--danger-dim); color: var(--danger); }

/* Risk rows */
.risk-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.risk-row:last-child { border-bottom: none; }
.risk-label { font-size: 12px; color: var(--text2); }
.risk-value {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 5px 10px;
  font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text);
}

/* News cards */
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px; margin-bottom: 8px;
  display: flex; gap: 11px; align-items: flex-start;
}
.news-time-col { text-align: center; flex-shrink: 0; width: 42px; }
.news-time { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--text); }
.news-utc  { font-size: 10px; color: var(--text2); }
.news-body { flex: 1; }
.news-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.4; }
.news-desc  { font-size: 11px; color: var(--text2); line-height: 1.5; }
.news-pairs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.news-pair-tag {
  padding: 2px 6px; border-radius: 4px;
  font-family: 'DM Mono', monospace; font-size: 10px;
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text2);
}

/* Bias rows */
.bias-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.bias-row:last-child { border-bottom: none; }
.bias-pair  { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; min-width: 68px; }
.bias-bar-wrap { flex: 1; height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.bias-bar   { height: 100%; border-radius: 2px; }
.bias-label { font-size: 10px; font-family: 'DM Mono', monospace; min-width: 38px; text-align: right; }

/* Score ring */
.score-ring-wrap { position: relative; width: 100px; height: 100px; margin: 0 auto 10px; }
.score-ring-wrap svg { width: 100px; height: 100px; transform: rotate(-90deg); }
.score-ring-bg   { fill: none; stroke: var(--surface3); stroke-width: 8; }
.score-ring-fill {
  fill: none; stroke: var(--disc-color, var(--accent)); stroke-width: 8;
  stroke-linecap: round; stroke-dasharray: 283;
  stroke-dashoffset: 62; transition: stroke-dashoffset 1s ease;
}
.score-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; color: var(--disc-color, var(--accent)); line-height: 1; }
.score-label  { font-size: 10px; color: var(--text2); font-family: 'DM Mono', monospace; letter-spacing: 1px; }

/* ── DASHBOARD COMMAND CENTRE ── */
.dash-pos-row {
  display: flex; align-items: center; justify-content: space-between;
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
  background: rgba(0,200,150,0.03); border: 1px solid rgba(0,200,150,0.1);
  border-left: 3px solid var(--accent); padding: 9px 10px; margin-bottom: 6px;
}
.dash-score-event {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dash-score-event:last-child { border-bottom: none; }

/* ── PREMIUM MENTOR BRIEFING CARD ── */
.mentor-tip-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Top accent bar */
.mentor-tip-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(0,200,150,0.05), transparent);
}

.tip-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  color: #000;
  font-family: 'Syne', sans-serif;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0,200,150,0.3);
}

.tip-label {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}

.tip-from {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  line-height: 1;
}

.tip-from-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}

.tip-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.75;
  padding: 14px 16px 16px;
}

.tip-text strong {
  color: var(--text);
  font-weight: 700;
}

/* Chat bubbles */
.chat-msg { display: flex; gap: 9px; animation: msgIn 0.28s ease forwards; opacity: 0; }
@keyframes msgIn { to { opacity: 1; } }
.chat-msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.msg-avatar.mentor { background: var(--accent); color: #000; }
.msg-avatar.user   { background: var(--surface3); border: 1px solid var(--border2); color: var(--text2); }
.msg-body { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.chat-msg.user .msg-body { align-items: flex-end; }
.msg-from { font-size: 10px; font-family: 'DM Mono', monospace; color: var(--text2); letter-spacing: 0.5px; }
.bubble {
  padding: 10px 13px; border-radius: 15px;
  font-size: 13px; line-height: 1.65; color: var(--text);
}
.bubble.mentor { background: var(--mb); border: 1px solid rgba(0,200,150,0.1); border-top-left-radius: 4px; }
.bubble.user   { background: var(--ub); border: 1px solid rgba(77,159,255,0.1); border-top-right-radius: 4px; }
.bubble strong { color: var(--accent); font-weight: 600; }

.insight-chip {
  margin-top: 8px; padding: 8px 11px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); font-size: 11px; color: var(--text2); line-height: 1.5;
}
.insight-chip-title {
  font-size: 10px; font-family: 'DM Mono', monospace;
  color: var(--accent); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px;
}

/* Typing indicator */
.typing-bubble {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 13px; background: var(--mb);
  border: 1px solid rgba(0,200,150,0.1);
  border-radius: 15px; border-top-left-radius: 4px; width: 52px;
}
.typing-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: tpulse 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes tpulse { 30% { opacity: 1; transform: scale(1.2); } }

/* Chat input area */
.chat-input-area {
  padding: 9px 13px 11px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.quick-prompts {
  display: flex; gap: 5px; overflow-x: auto;
  padding-bottom: 7px; scrollbar-width: none;
}
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-prompt {
  flex-shrink: 0; padding: 4px 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; font-size: 10px; color: var(--text2);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.quick-prompt:hover { border-color: var(--accent); color: var(--accent); }
.chart-preview {
  display: none; align-items: center; gap: 7px;
  padding: 6px 9px; margin-bottom: 7px;
  background: var(--surface2); border: 1px solid rgba(0,200,150,0.2);
  border-radius: var(--radius-sm); font-size: 11px; color: var(--text2);
}
.chart-preview.visible { display: flex; }
.chart-thumb { width: 38px; height: 28px; border-radius: 4px; object-fit: cover; }
.remove-chart-btn { margin-left: auto; background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; padding: 2px; }
.input-row { display: flex; gap: 7px; align-items: flex-end; }
.upload-label {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; position: relative;
}
.upload-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.input-wrap {
  flex: 1; display: flex; align-items: flex-end; gap: 7px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-md); padding: 3px 3px 3px 11px;
  transition: border-color 0.2s;
}
.input-wrap:focus-within { border-color: rgba(0,200,150,0.4); }
.chat-textarea {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 13px; resize: none; max-height: 90px;
  line-height: 1.5; padding: 7px 0; min-height: 38px;
}
.chat-textarea::placeholder { color: var(--text3); }
.send-btn {
  width: 32px; height: 32px; flex-shrink: 0; margin-bottom: 2px;
  background: var(--accent); border: none; border-radius: 7px;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 13px; color: #000;
  transition: all 0.2s;
}
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }


/* ═══════════════════════════════
   AUTH / LOGIN SCREEN
═══════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  background: #161b22; /* fixed, not theme-following — same wordmark-visibility fix as .sidebar-header and .topbar-logo-btn. This is a third instance the original diagnosis missed: .login-card follows var(--surface) too, so the logo went invisible here in light mode as well. */
  border-radius: var(--radius-md, 10px);
  padding: 10px 14px;
}
.login-brand-mark {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 14px; color: #000;
}
.login-brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 20px; color: var(--text);
}
.login-brand-name em { color: var(--accent); font-style: normal; }
.login-tagline {
  font-size: 13px; color: var(--text2);
  margin-bottom: 28px; line-height: 1.5;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px; gap: 3px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 8px;
  border: none; background: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.auth-label {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.auth-input {
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-input:focus { border-color: rgba(0,200,150,0.5); }
.auth-input::placeholder { color: var(--text3); }

/* Buttons */
.auth-btn {
  width: 100%; padding: 13px;
  border: none; border-radius: var(--radius-md);
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.auth-btn.primary {
  background: var(--accent); color: #000;
}
.auth-btn.primary:hover { filter: brightness(1.1); }
.auth-btn.google {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
}
.auth-btn.google:hover { border-color: var(--accent); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text3); font-size: 11px;
  font-family: 'DM Mono', monospace;
  margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border2);
}

.auth-forgot {
  text-align: right; margin-top: -4px;
}
.auth-link {
  font-size: 11px; color: var(--accent);
  cursor: pointer; background: none;
  border: none; font-family: 'Nunito', sans-serif;
  text-decoration: underline;
}

.auth-error {
  display: none;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.5;
  border: 1px solid var(--danger);
  background: var(--danger-dim);
  color: var(--danger);
}

/* User profile pill in sidebar */
.user-profile-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px; cursor: pointer;
  transition: border-color 0.2s;
}
.user-profile-pill:hover { border-color: var(--accent); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #000;
  flex-shrink: 0; overflow: hidden;
}
.user-name {
  font-size: 12px; font-weight: 600;
  color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.signout-btn {
  font-size: 10px; color: var(--text3);
  background: none; border: none;
  cursor: pointer; font-family: 'DM Mono', monospace;
  padding: 2px 4px; border-radius: 4px;
  transition: color 0.2s;
}
.signout-btn:hover { color: var(--danger); }


/* ═══════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: all 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #000;
}
.toggle-switch input:disabled + .toggle-slider { opacity: .4; cursor: not-allowed; }

/* Chime option active state */
.chime-option.active {
  border-color: rgba(0,200,150,0.3) !important;
  background: rgba(0,200,150,0.06) !important;
}


/* ═══════════════════════════════
   NOTIFICATIONS
═══════════════════════════════ */
.notif-icon {
  position: relative;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 50%;
  transition: background 0.2s;
}
.notif-icon:hover { background: var(--surface2); }

/* Notif icon always visible in topbar on all screen sizes */
.notif-icon { display: flex !important; }
.sidebar-notif-desktop { display: none !important; }

.notif-bolt {
  font-size: 18px;
  display: inline-block;
  filter: hue-rotate(85deg) saturate(1.5) brightness(1.1);
  transition: filter 0.4s ease;
}
.notif-bolt.unread {
  filter: none !important;
  animation: boltPulse 2s infinite;
}
@keyframes boltPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.notif-badge {
  position: absolute;
  top: 1px; right: 1px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

/* Toast notification */
.tiq-toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 380px);
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 14px;
  display: flex; align-items: flex-start; gap: 11px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  transition: top 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  opacity: 0;
}
.tiq-toast.show  { top: 12px; opacity: 1; }
.tiq-toast.hide  { top: -80px; opacity: 0; transition: top 0.3s ease, opacity 0.3s ease; }
.tiq-toast.type-ok      { background: rgba(0,200,150,0.15);  border: 1px solid rgba(0,200,150,0.3);  }
.tiq-toast.type-warn    { background: var(--warn-dim);  border: 1px solid rgba(168,184,204,0.3);  }
.tiq-toast.type-danger  { background: rgba(232,69,90,0.15);  border: 1px solid rgba(232,69,90,0.3);  }
.tiq-toast.type-info    { background: rgba(77,159,255,0.15); border: 1px solid rgba(77,159,255,0.3); }
.tiq-toast.type-session { background: rgba(0,200,150,0.12);  border: 1px solid rgba(0,200,150,0.25); }
.tiq-toast.type-trade        { background: rgba(77,159,255,0.15); border: 1px solid rgba(77,159,255,0.3); }
.tiq-toast.type-achievement  { background: rgba(0,200,150,0.15);  border: 1px solid rgba(0,200,150,0.3);  }
.tiq-toast.type-discipline   { background: var(--warn-dim);  border: 1px solid rgba(168,184,204,0.3);  }
.tiq-toast.type-risk         { background: rgba(232,69,90,0.15);  border: 1px solid rgba(232,69,90,0.3);  }
.tiq-toast.type-briefing     { background: rgba(0,200,150,0.12);  border: 1px solid rgba(0,200,150,0.25); }

.toast-icon  { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.toast-body  { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.toast-msg   { font-size: 11px; color: var(--text2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-time  { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; flex-shrink: 0; margin-top: 2px; }

/* Notification list items */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
  position: relative;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(0,200,150,0.03); }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.notif-item-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-item-body  { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.4; }
.notif-item-msg   { font-size: 12px; color: var(--text2); line-height: 1.5; }
.notif-item-time  { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; margin-top: 4px; }


/* ═══════════════════════════════
   PROFILE SETTINGS
═══════════════════════════════ */
.style-btn, .count-btn {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.style-btn.active, .count-btn.active {
  background: var(--accent-dim);
  border-color: rgba(0,200,150,0.3);
  color: var(--accent);
}
/* ── PAIRS GRID ─────────────────────────── */
.pairs-category-label {
  width: 100%;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 10px 0 5px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.pairs-category-label:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.pair-toggle {
  padding: 5px 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.pair-toggle:hover {
  border-color: rgba(0,200,150,0.3);
  color: var(--text);
}
.pair-toggle.active {
  background: var(--accent-dim);
  border-color: rgba(0,200,150,0.35);
  color: var(--accent);
  font-weight: 700;
}
/* ── VOLATILITY ANALYZER STYLES ── */
.vol-event-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.vol-event-card:hover {
  border-color: var(--accent);
}
.vol-event-header {
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vol-event-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0, 1, 0, 1);
  padding: 0 12px;
  background: var(--surface);
}
.vol-event-card.expanded .vol-event-details {
  max-height: 1000px;
  padding: 12px;
  border-top: 1px solid var(--border);
  transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
}
.vol-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}
.vol-table th {
  color: var(--text3);
  text-align: left;
  padding: 4px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.vol-table td {
  padding: 6px 4px;
  color: var(--text2);
}
.vol-badge-country {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  background: var(--surface3);
  color: var(--text);
  font-weight: 600;
}
/* ── NATIVE FULLSCREEN CHART OVERLAY & STACKING HIERARCHY ── */
body.body-chart-fullscreen #chart-card-parent {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  z-index: 1000 !important; /* Base fullscreen layer */
  background: var(--bg) !important;
  overflow: visible !important;
}

/* Temporarily disable parent transition transforms during fullscreen active state */
body.body-chart-fullscreen .screen.active {
  transform: none !important;
}

/* Display the floating close button above the fullscreen chart card layer */
body.body-chart-fullscreen #chart-close-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: fixed !important;
  z-index: 1001 !important; /* Positioned directly above the chart canvas layer */
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: 28px !important;
  padding: 0 14px !important;
  border-radius: 20px !important;
  background: rgba(13, 17, 23, 0.85) !important;
  border: 1px solid var(--border2) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  font-family: 'DM Mono', monospace !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0.6px !important;
  color: var(--text) !important;
  cursor: pointer !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Responsive alignment to match the TradingView logo level per device size */
@media (min-width: 768px) {
  body.body-chart-fullscreen #chart-close-btn {
    bottom: 80px !important;
    left: 56px !important;
    top: auto !important;
    right: auto !important;
  }
}

@media (max-width: 767px) {
  body.body-chart-fullscreen #chart-close-btn {
    bottom: 40px !important;
    left: 48px !important;
    top: auto !important;
    right: auto !important;
  }
}

/* Hover effects for the floating close button */
body.body-chart-fullscreen #chart-close-btn:hover {
  background: rgba(0, 200, 150, 0.12) !important;
  color: var(--accent) !important;
  border-color: rgba(0, 200, 150, 0.4) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 24px rgba(0, 200, 150, 0.15) !important;
}

/* Prevent nested SVGs and spans inside authentication targets from absorbing touch states */
.auth-btn * {
  pointer-events: none;
}

/* Enable momentum scrolling for disclosures inside regulatory modals */
.gate-text {
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════
   LEGAL CONSENT SYSTEM
═══════════════════════════════ */
.legal-tab-btn {
  transition: all 0.2s !important;
}
.legal-tab-btn.active {
  background: var(--accent-dim) !important;
  border-color: rgba(0,200,150,0.3) !important;
  color: var(--accent) !important;
}
.legal-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.legal-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.legal-p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 10px;
}
.legal-p:last-child { margin-bottom: 0; }
.legal-list {
  margin: 8px 0 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-list li {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.legal-list li strong { color: var(--text); }

/* Acceptance animation */
#legal-consent-overlay.legal-accepted {
  animation: legalFadeOut 0.6s ease forwards;
}
@keyframes legalFadeOut {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(0.96); }
}

/* ═══════════════════════════════
   SETTINGS ACCORDION
═══════════════════════════════ */
.settings-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.settings-accordion:hover {
  border-color: var(--border2);
}
.settings-acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.settings-acc-header:hover {
  background: var(--surface2);
}
.settings-acc-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.settings-acc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  flex: 1;
}
.settings-acc-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  margin-right: 4px;
}
.settings-acc-arrow {
  font-size: 18px;
  color: var(--text3);
  transition: transform 0.25s ease;
  line-height: 1;
  flex-shrink: 0;
}
.settings-acc-header.open .settings-acc-arrow {
  transform: rotate(90deg);
}
.settings-acc-body {
  display: none;
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
}
.settings-acc-body.open {
  display: block;
}

/* Settings rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border) !important;
  gap: 12px;
}
.settings-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0;
}
.settings-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.settings-select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  max-width: 180px;
}
.settings-input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 7px 10px;
  outline: none;
  width: 100%;
  max-width: 200px;
  transition: border-color 0.2s;
}
.settings-input:focus {
  border-color: rgba(0,200,150,0.4);
}

/* ── BRAND DROPDOWN BUTTONS ── */
.brand-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 4px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.brand-menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 200, 150, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── BRAND DROPDOWN BUTTONS ── */
.brand-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 4px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.brand-menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 200, 150, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── MAIN BRAND BUTTON HOVER GLOW ── */
.sidebar-brand-btn, .topbar-logo-btn {
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.topbar-logo-btn {
  /* Same fixed-dark-background reasoning as .sidebar-header — this is the
     mobile equivalent of the sidebar logo area, and the wordmark SVG's
     hardcoded white text goes invisible against a light-theme topbar
     otherwise. Scoped to just this button, not the whole .topbar, so
     the notification bell / market-status badge keep following the
     theme normally. */
  background: #161b22;
}

.sidebar-brand-btn:hover, .topbar-logo-btn:hover {
  background: var(--accent-glow) !important;
  box-shadow: 0 0 16px rgba(0, 200, 150, 0.15);
  transform: scale(1.02);
}

.sidebar-brand-btn:active, .topbar-logo-btn:active {
  transform: scale(0.98);
  background: var(--accent-dim) !important;
}

/* ── LOCALIZED SIGN OUT BUTTON HOVER GLOW ── */
.settings-acc-body button[onclick="executeSignOut()"] {
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.settings-acc-body button[onclick="executeSignOut()"]:hover {
  background: rgba(232, 69, 90, 0.15) !important;
  border-color: rgba(232, 69, 90, 0.5) !important;
  box-shadow: 0 0 16px rgba(232, 69, 90, 0.25) !important;
  transform: translateY(-1px) !important;
}
/* ── NAV POSITION PICKER — desktop/tablet only ── */
/* On mobile the nav is always fixed bottom — this setting has no effect */
.nav-pos-picker {
  display: none;
}
@media (min-width: 768px) {
  .nav-pos-picker {
    display: flex;
    gap: 6px;
  }
  .nav-pos-btn {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text2);
  }
  .nav-pos-btn.active,
  .nav-pos-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
  }
}

/* Hide the entire Nav Position settings row on mobile */
@media (max-width: 767px) {
  .settings-row.nav-pos-picker {
    display: none;
  }
}

/* ── CANDLESTICK NOTIFICATION ICON ── */
/* Green = all clear, Red = unread notifications */
.notif-candle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
  color: #00c896 !important; /* green — all clear */
}
.notif-candle .candle-body {
  fill: #00c896 !important;
  transition: fill 0.3s;
}
.notif-candle line {
  stroke: #00c896 !important;
  transition: stroke 0.3s;
}
/* Unread state — red candle */
.notif-candle[data-unread="true"] {
  color: var(--danger) !important;
}
.notif-candle[data-unread="true"] .candle-body {
  fill: var(--danger) !important;
}
.notif-candle[data-unread="true"] line {
  stroke: var(--danger) !important;
}
/* ── Reflection popup button active states ── */
.ref-emotion-btn.active {
  background: rgba(0,200,150,0.12) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.ref-plan-btn.active {
  background: rgba(0,200,150,0.12) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ── Shimmer animation (history card + any skeleton loaders) ── */
@keyframes shimmer {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.9; }
  100% { opacity: 0.4; }
}

/* ── Skeleton-sweep shimmer — was referenced 12x across briefing.js,
   onboarding.js, and profile.js (Daily Mentor Read skeleton, typing-dot
   indicators) but never actually defined, so none of those ever animated.
   Combines a background-position sweep (for the gradient skeleton bars,
   which have background-size:200% set) with an opacity pulse (for the
   plain solid-colour typing dots, which have no gradient to sweep) so one
   keyframe correctly animates both use cases. ── */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; opacity: 0.6; }
  50%  { opacity: 1; }
  100% { background-position: 200% 0; opacity: 0.6; }
}