* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #0a0e17; color: #e1e5eb; min-height: 100vh; }

/* NAV */
.nav { background: #111827; border-bottom: 1px solid #1e2a3a; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1400px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-size: 18px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.5px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo-icon { height: 32px; width: auto; border-radius: 4px; }
.logo span { color: #22d3ee; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav-links a { color: #9ca3af; text-decoration: none; font-size: 13px; padding: 6px 12px; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover, .nav-links a.active { background: #1e2a3a; color: #fff; }
.nav-links a:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Nav dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: transparent; border: none; color: #9ca3af; font-size: 13px; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-family: inherit; transition: all 0.2s; display: flex; align-items: center;
}
.nav-dropdown-trigger:hover, .nav-dropdown.active .nav-dropdown-trigger { background: #1e2a3a; color: #fff; }
.nav-dropdown-trigger:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 2px); left: 0; min-width: 160px;
  background: rgba(17, 24, 39, 0.98); border: 1px solid #1e2a3a; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4); padding: 6px 0; z-index: 200;
  display: none; flex-direction: column;
  /* Invisible top bridge so mouse can travel from trigger to menu without gap */
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  display: block; padding: 8px 14px; color: #9ca3af; text-decoration: none; font-size: 13px;
  white-space: nowrap; transition: background 0.2s, color 0.2s; border-radius: 0;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background: #1e2a3a; color: #fff; }
.nav-dropdown-menu a:first-child { border-radius: 6px 6px 0 0; }
.nav-dropdown-menu a:last-child { border-radius: 0 0 6px 6px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-balance { color: #10b981; font-weight: 700; font-size: 14px; }
.nav-pnl { font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 4px; display: none; }
.nav-pnl.pnl-positive { display: inline; color: #10b981; background: rgba(16,185,129,0.12); }
.nav-pnl.pnl-negative { display: inline; color: #ef4444; background: rgba(239,68,68,0.12); }
.nav-pnl.pnl-zero { display: inline; color: #6b7280; background: rgba(107,114,128,0.12); }
.nav-user { color: #9ca3af; font-size: 13px; }
.nav-btn { color: #9ca3af; text-decoration: none; font-size: 13px; padding: 6px 14px; border: 1px solid #1e2a3a; border-radius: 6px; transition: all 0.2s; }
.nav-btn:hover { background: #1e2a3a; color: #fff; }
.nav-btn.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.nav-btn.primary:hover { background: #2563eb; }

.main-content { max-width: 1400px; margin: 0 auto; padding: 16px; }

/* TICKER */
.ticker-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 16px; scrollbar-width: thin; scrollbar-color: #1e2a3a transparent; }
.ticker-strip::-webkit-scrollbar { height: 4px; }
.ticker-strip::-webkit-scrollbar-thumb { background: #1e2a3a; border-radius: 2px; }
.ticker { background: #111827; border: 1px solid #1e2a3a; border-radius: 8px; padding: 10px 14px; min-width: 125px; flex-shrink: 0; cursor: pointer; transition: border-color 0.2s; }
.ticker:hover { border-color: #3b82f6; }
.ticker-sym { font-weight: 700; font-size: 12px; color: #9ca3af; }
.ticker-price { font-size: 16px; font-weight: 700; color: #fff; margin: 2px 0; }
.ticker-change { font-size: 11px; font-weight: 600; }
.up { color: #10b981; }
.down { color: #ef4444; }

/* SUMMARY BAR */
.summary-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.summary-stat { background: #111827; border: 1px solid #1e2a3a; border-radius: 8px; padding: 12px 16px; flex: 1; min-width: 120px; }
.summary-stat .label { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.summary-stat .value { font-size: 20px; font-weight: 700; color: #fff; margin-top: 2px; }

/* SIGNAL CARDS */
.signals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; margin-bottom: 24px; }
.signal-card { background: #111827; border: 1px solid #1e2a3a; border-radius: 12px; padding: 16px; transition: border-color 0.2s; }
.signal-card:hover { border-color: #3b82f6; }
.signal-card.strong-buy { border-left: 3px solid #10b981; }
.signal-card.buy { border-left: 3px solid #3b82f6; }
.signal-card.hold { border-left: 3px solid #eab308; }
.signal-card.sell { border-left: 3px solid #f97316; }
.signal-card.strong-sell { border-left: 3px solid #ef4444; }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.coin-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.coin-info h3 { font-size: 16px; color: #fff; font-weight: 700; margin: 0; flex: 1 1 auto; min-width: 0; }
.coin-info .symbol { font-size: 11px; color: #6b7280; }
.coin-price { text-align: right; }
.coin-price .price { font-size: 16px; font-weight: 700; color: #fff; }
.coin-price .change { font-size: 12px; font-weight: 600; }

.signal-badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.badge-STRONG_BUY { background: #064e3b; color: #10b981; }
.badge-BUY { background: #1e3a5f; color: #3b82f6; }
.badge-HOLD { background: #3b3510; color: #eab308; }
.badge-SELL { background: #4a2510; color: #f97316; }
.badge-STRONG_SELL { background: #451a1a; color: #ef4444; }

/* SCORE BAR */
.score-bar { margin: 8px 0; }
.score-bar-outer { width: 100%; height: 6px; background: #1e2a3a; border-radius: 3px; overflow: hidden; }
.score-bar-inner { height: 100%; border-radius: 3px; transition: width 0.3s; }
.score-label { font-size: 11px; color: #6b7280; display: flex; justify-content: space-between; margin-top: 2px; }

/* SCORE BREAKDOWN */
.score-breakdown { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.score-cat { font-size: 10px; padding: 3px 8px; border-radius: 4px; background: #0d1320; color: #9ca3af; }
.score-cat span { font-weight: 700; color: #e1e5eb; }

.signal-meta { display: flex; gap: 12px; margin: 8px 0; font-size: 12px; color: #9ca3af; flex-wrap: wrap; }
.signal-meta span { display: flex; align-items: center; gap: 3px; }

/* TF ROW */
.tf-row { display: flex; gap: 5px; margin: 8px 0; flex-wrap: wrap; }
.tf-chip { font-size: 10px; padding: 3px 8px; border-radius: 5px; display: inline-flex; gap: 4px; align-items: center; }
.tf-bull { background: #0d2818; color: #10b981; border: 1px solid #064e3b; }
.tf-bear { background: #2a1010; color: #ef4444; border: 1px solid #451a1a; }
.tf-neutral { background: #1a1a0d; color: #eab308; border: 1px solid #3b3510; }
.tf-label { font-weight: 700; }
.tf-rsi { color: #6b7280; font-size: 9px; }

/* LEVELS */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 10px 0; }
.level { background: #0d1320; border-radius: 5px; padding: 6px 8px; }
.level-label { font-size: 9px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.level-value { font-size: 13px; font-weight: 700; }
.level-value.entry { color: #3b82f6; }
.level-value.tp { color: #10b981; }
.level-value.sl { color: #ef4444; }
.level-value.rr { color: #a78bfa; }

/* REASONING */
.reasoning { margin-top: 10px; padding-top: 10px; border-top: 1px solid #1e2a3a; }
.reasoning h4 { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.reason { font-size: 12px; color: #9ca3af; padding: 2px 0 2px 10px; border-left: 2px solid #1e2a3a; margin-bottom: 3px; }
/* Counter-reasoning (signals against the trade) */
.counter-reasoning { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(239,68,68,0.2); }
.counter-reasoning h4 { color: #f87171; }
.counter-reason { color: #fca5a5; border-left-color: rgba(239,68,68,0.4); }

/* TRADE ACTIONS */
.trade-actions { margin-top: 10px; display: flex; gap: 8px; }
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; text-decoration: none; text-align: center; }
.btn-buy { background: #10b981; color: #fff; }
.btn-buy:hover { background: #059669; }
.btn-sell { background: #ef4444; color: #fff; }
.btn-sell:hover { background: #dc2626; }
.btn-close { background: #6b7280; color: #fff; }
.btn-close:hover { background: #4b5563; }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-outline { background: transparent; color: #9ca3af; border: 1px solid #1e2a3a; }
.btn-outline:hover { background: #1e2a3a; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* INDICATORS ROW */
.indicators-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ind { font-size: 10px; color: #6b7280; }
.ind span { color: #9ca3af; font-weight: 600; }

/* TABLES */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px; border-bottom: 1px solid #1e2a3a; }
.data-table td { padding: 10px; border-bottom: 1px solid #0d1320; font-size: 13px; }
.data-table tr:hover { background: #111827; }
.setup-notif-unread { background: rgba(16, 185, 129, 0.06); }
.setup-notif-unread:hover { background: rgba(16, 185, 129, 0.1); }

/* FORMS */
.auth-container { max-width: 420px; margin: 60px auto; }
.form-card { background: #111827; border: 1px solid #1e2a3a; border-radius: 12px; padding: 32px; }
.form-card h2 { font-size: 24px; color: #fff; margin-bottom: 6px; }
.form-card .subtitle { font-size: 13px; color: #6b7280; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; background: #0d1320; border: 1px solid #1e2a3a;
  border-radius: 8px; color: #e1e5eb; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #3b82f6; }
.form-group textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.form-btn { width: 100%; padding: 12px; background: #3b82f6; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.form-btn:hover { background: #2563eb; }
.form-link { text-align: center; margin-top: 16px; font-size: 13px; color: #6b7280; }
.form-link a { color: #3b82f6; text-decoration: none; }
.form-link a:hover { text-decoration: underline; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #451a1a; color: #ef4444; border: 1px solid #ef4444; }
.alert-success { background: #064e3b; color: #10b981; border: 1px solid #10b981; }

/* SECTION */
.section { background: #111827; border: 1px solid #1e2a3a; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.section h3 { font-size: 14px; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* PERFORMANCE */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.perf-card { background: #0d1320; border-radius: 8px; padding: 16px; text-align: center; }
.perf-card .perf-label { font-size: 11px; color: #6b7280; text-transform: uppercase; }
.perf-card .perf-value { font-size: 24px; font-weight: 700; color: #fff; margin-top: 4px; }

/* JOURNAL */
.journal-entry { background: #0d1320; border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.journal-entry .je-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.journal-entry .je-type { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #1e2a3a; color: #9ca3af; }
.journal-entry .je-date { font-size: 11px; color: #6b7280; }
.journal-entry .je-content { font-size: 13px; color: #d1d5db; line-height: 1.5; }
.journal-entry .je-emotion { font-size: 11px; color: #eab308; margin-top: 4px; }

/* LOADING */
.loading-note { font-size: 13px; color: #6b7280; text-align: center; padding: 40px; }
.empty-state { text-align: center; padding: 40px; color: #6b7280; }
.empty-state h3 { color: #9ca3af; margin-bottom: 8px; }

/* AUTH LOGO */
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 48px; width: auto; }

/* FOOTER */
.footer { margin-top: 32px; }
.footer-brand { text-align: center; padding: 16px 16px 0; }
.footer-logo { height: 32px; width: auto; opacity: 0.6; transition: opacity 0.2s; }
.footer-logo:hover { opacity: 1; }
.disclaimer { font-size: 11px; color: #4b5563; text-align: center; padding: 16px; border-top: 1px solid #1e2a3a; line-height: 1.5; }

/* LEVERAGE BADGE */
.lev-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #3b3510; color: #eab308; font-weight: 700; }

/* SCORE TIER, CONFLUENCE, R:R, STRATEGY BADGES */
.score-tier-badge, .confluence-badge, .rr-badge, .strategy-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
  background: rgba(15,23,42,0.6); border: 1px solid #1e2a3a;
}
.score-tier-badge.tier-high { background: rgba(16,185,129,0.2); color: #10b981; border-color: rgba(16,185,129,0.4); }
.score-tier-badge.tier-moderate { background: rgba(59,130,246,0.2); color: #3b82f6; border-color: rgba(59,130,246,0.4); }
.score-tier-badge.tier-caution { background: rgba(234,179,8,0.2); color: #eab308; border-color: rgba(234,179,8,0.4); }
.confluence-badge { background: rgba(139,92,246,0.2); color: #a78bfa; border-color: rgba(139,92,246,0.4); }
.rr-badge { background: rgba(59,130,246,0.2); color: #60a5fa; border-color: rgba(59,130,246,0.4); }
.strategy-badge { background: rgba(30,58,95,0.6); color: #93c5fd; border-color: rgba(59,130,246,0.3); }

/* REGIME BADGE */
.regime-badge { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.regime-trending { background: #064e3b; color: #10b981; }
.regime-ranging { background: #3b3510; color: #eab308; }
.regime-volatile { background: #451a1a; color: #ef4444; }
.regime-compression { background: #1e3a5f; color: #3b82f6; }
.regime-mixed { background: #1e2a3a; color: #9ca3af; }

/* SCORE CHECK */
.score-check { margin-top: 10px; padding: 10px; background: #0d1320; border-radius: 8px; border: 1px solid #1e2a3a; }
.score-check-pending { opacity: 0.6; }
.score-check-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.score-check-header h4 { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin: 0; }
.score-check-time { font-size: 10px; color: #4b5563; }
.score-check-summary { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
.score-check-summary strong { color: #e1e5eb; }
.score-diff { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.score-diff-pos { background: #064e3b; color: #10b981; }
.score-diff-neg { background: #451a1a; color: #ef4444; }
.score-diff-neutral { background: #1e2a3a; color: #6b7280; }
.score-check-messages { display: flex; gap: 5px; flex-wrap: wrap; }
.score-msg { font-size: 11px; padding: 3px 9px; border-radius: 5px; font-weight: 600; }
.score-msg-positive { background: #064e3b; color: #10b981; }
.score-msg-warning { background: #3b3510; color: #eab308; }
.score-msg-danger { background: #451a1a; color: #ef4444; }
.score-msg-info { background: #1e3a5f; color: #3b82f6; }
.score-msg-neutral { background: #1e2a3a; color: #6b7280; }

/* Trade actions taken (BE, TS) */
.trade-actions-taken { margin-top: 8px; margin-bottom: 8px; padding: 8px; background: rgba(15,23,42,0.6); border-radius: 6px; border: 1px solid #1e2a3a; }
.trade-actions-taken h4 { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px 0; }
.actions-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.action-badge { font-size: 10px; padding: 3px 8px; border-radius: 4px; font-weight: 600; }
.action-badge.action-be { background: #064e3b; color: #10b981; }
.action-badge.action-ts { background: #1e3a5f; color: #3b82f6; }
.action-badge.action-pp { background: #4a2463; color: #a78bfa; }
.action-badge.action-rp { background: #78350f; color: #fbbf24; }
.action-badge.action-exit { background: #7f1d1d; color: #f87171; }
.action-badge.action-lock { background: #0c4a6e; color: #38bdf8; }
.action-badge.action-dca { background: #083344; color: #06b6d4; }

/* PROBABILITY METER */
.prob-meter { margin: 8px 0 6px; }
.prob-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.prob-label { font-size: 10px; color: #6b7280; min-width: 100px; }
.prob-bar-outer { flex: 1; height: 6px; background: #1e2a3a; border-radius: 3px; overflow: hidden; }
.prob-bar-inner { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.prob-bar-entry { background: #3b82f6; }
.prob-bar-current { background: #10b981; }
.prob-bar-green { background: #10b981; }
.prob-bar-yellow { background: #eab308; }
.prob-bar-red { background: #ef4444; }
.prob-value { font-size: 11px; font-weight: 700; color: #e1e5eb; min-width: 32px; text-align: right; }

/* HEAT INDICATOR DOT */
.heat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 4px; vertical-align: middle; }
.heat-green { background: #10b981; box-shadow: 0 0 4px #10b981; }
.heat-yellow { background: #eab308; box-shadow: 0 0 4px #eab308; }
.heat-red { background: #ef4444; box-shadow: 0 0 4px #ef4444; animation: heat-pulse 1.5s infinite; }
@keyframes heat-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* WHAT CHANGED */
.change-reasons { margin: 6px 0; padding-top: 6px; border-top: 1px solid #1e2a3a; }
.change-reasons-title { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.change-reason { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin: 2px 3px 2px 0; font-weight: 500; }
.change-reason-negative { background: #451a1a; color: #ef4444; }
.change-reason-positive { background: #064e3b; color: #10b981; }
.change-reason-neutral { background: #1e2a3a; color: #6b7280; }

/* SUGGESTED ACTION LADDER */
.action-ladder { margin: 6px 0; padding: 6px 10px; border-radius: 6px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.action-label { font-size: 10px; color: #6b7280; text-transform: uppercase; font-weight: 600; }
.action-text { font-weight: 600; }
.action-low { background: #0d1320; border: 1px solid #1e2a3a; }
.action-low .action-text { color: #10b981; }
.action-positive { background: #064e3b33; border: 1px solid #064e3b; }
.action-positive .action-text { color: #10b981; }
.action-medium { background: #3b351033; border: 1px solid #3b3510; }
.action-medium .action-text { color: #eab308; }
.action-high { background: #4a251033; border: 1px solid #4a2510; }
.action-high .action-text { color: #f97316; }
.action-extreme { background: #451a1a33; border: 1px solid #451a1a; }
.action-extreme .action-text { color: #ef4444; }
.action-details { margin: 4px 0 0 0; padding: 4px 10px; font-size: 11px; color: #9ca3af; background: #0d132066; border-radius: 4px; border-left: 2px solid #3b82f6; }

/* TRADE HEALTH TIMELINE */
.health-timeline { margin-top: 8px; padding-top: 6px; border-top: 1px solid #1e2a3a; }
.timeline-title { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.timeline-canvas { width: 100%; height: 80px; display: block; }

/* NAV TOGGLE (mobile) */
.nav-toggle { display: none; background: transparent; border: 1px solid #334155; color: #e5e7eb; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; min-height: 44px; min-width: 44px; }
.nav-toggle:hover { background: #1e2a3a; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .signals-grid { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-bar { flex-wrap: wrap; gap: 8px; }
  .ticker-strip { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .section { padding: 12px; }
  .tf-row { flex-wrap: wrap; }
  table { font-size: 12px; }
  th, td { padding: 6px 4px; }
  .top-strategies { font-size: 10px; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .trade-actions { flex-wrap: wrap; gap: 8px; }
  .trade-actions .btn { min-height: 44px; padding: 10px 14px; }
  .form-btn, .btn { min-height: 44px; padding: 10px 16px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
}
@media (max-width: 600px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; max-height: 0; overflow: hidden; transition: max-height 0.3s; }
  .nav-links.nav-open { display: flex; max-height: 600px; flex-direction: column; width: 100%; order: 10; }
  .nav-links a { padding: 12px 16px; min-height: 44px; display: flex; align-items: center; }
  .nav-dropdown { position: static; }
  .nav-dropdown-trigger { width: 100%; justify-content: space-between; padding: 12px 16px; min-height: 44px; text-align: left; }
  .nav-dropdown-menu {
    position: static; margin: 0; box-shadow: none; border: none; border-radius: 0;
    padding: 0 0 0 16px; background: rgba(0,0,0,0.2); display: none; max-height: 0; overflow: hidden;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; max-height: 400px; }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.open:hover .nav-dropdown-menu { display: flex; }
  .nav-dropdown-menu a { padding: 10px 14px; min-height: 44px; display: flex; align-items: center; }
  .nav-inner { flex-wrap: wrap; }
  .nav-right { margin-left: 0; margin-right: auto; }

  /* All data-tables: horizontal scroll on mobile (same layout as landscape, swipe to see more) */

  /* Chart containers: fixed height on mobile */
  .chart-mobile-300, #lw-chart-container, .equity-chart-wrap, #bt-equity-bars, #score-history-chart {
    min-height: 300px !important;
    height: 300px !important;
  }
  .equity-chart-wrap canvas, #equity-curve, #trench-equity-curve { height: 300px !important; }
  #bt-equity-chart { height: 320px !important; }
  #bt-equity-bars { height: 300px !important; }

  /* Candle colors + indicators dropdowns: stay in viewport on mobile */
  .candle-colors-panel, .indicators-dropdown-panel {
    max-height: min(60vh, 320px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 500px) {
  .nav-inner { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .nav-links { order: 3; width: 100%; flex-wrap: wrap; gap: 4px; }
  .nav-links a { font-size: 12px; padding: 12px 16px; min-height: 44px; }
  .nav-right { width: 100%; justify-content: center; gap: 6px; }
  .main-content { padding: 8px; }
  .score-breakdown { flex-wrap: wrap; }
  .score-cat { font-size: 11px; }
  .card-header { flex-direction: column; gap: 8px; }
  .perf-grid { grid-template-columns: 1fr; gap: 8px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-header h2 { font-size: 18px; }
  .ticker { min-width: 110px; padding: 12px; }
  .signal-card { padding: 12px; }
  .ft-toggle { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 380px) {
  .nav-balance, .nav-user { font-size: 12px; }
  .nav-btn { padding: 8px 12px; font-size: 12px; }
  .main-content { padding: 6px; }
}

/* ========================================
   THEMES & MARKET PULSE (frontend-design + ui-design-system)
   - 4px grid: 8, 12, 16, 24px
   - Staggered reveal, hover states, glass depth
   ======================================== */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pulse-card {
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e2a3a;
  border-radius: 8px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: pulse-card-reveal 0.4s ease-out backwards;
}
.pulse-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.pulse-card:nth-child(1) { animation-delay: 0.05s; }
.pulse-card:nth-child(2) { animation-delay: 0.1s; }
.pulse-card:nth-child(3) { animation-delay: 0.15s; }
.pulse-card:nth-child(4) { animation-delay: 0.2s; }
.pulse-card:nth-child(5) { animation-delay: 0.25s; }
@keyframes pulse-card-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-card { animation: none; }
}
.pulse-card-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.pulse-card-value { font-size: 28px; font-weight: 700; }
.pulse-card-sub { font-size: 13px; color: #9ca3af; margin-top: 4px; }

.themes-info-box {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid;
}
.themes-info-box.theme-detector {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}
.themes-info-box.market-context {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}
.themes-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #1e2a3a;
  background: rgba(15, 23, 42, 0.6);
}
.themes-table-wrap .data-table th,
.themes-table-wrap .data-table td {
  padding: 12px 16px;
}
.themes-table-wrap .data-table tr {
  transition: background 0.15s;
}
.themes-table-wrap .data-table tr:hover {
  background: rgba(30, 58, 95, 0.2);
}
