/* ═══════════════════════════════════════════════════════════════
   DERIVBOT v3 — Rise/Fall Engine  |  style.css
   Clean, light, professional. White surfaces, soft borders, plain
   cards. Monospace for numbers/data, Inter for everything else.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* — surface — */
  --bg:         #f4f5f7;
  --panel:      #ffffff;
  --panel-alt:  #f8f9fb;
  --border:     #e3e6ea;
  --border-lit: #cdd2d9;

  /* — brand (primary) — */
  --brand:      #2563eb;
  --brand-dim:  #eaf0fe;

  /* — functional — */
  --rise:        #16a34a;
  --rise-dim:    #eafaf0;
  --fall:        #dc2626;
  --fall-dim:    #fdecec;
  --caution:     #d97706;
  --caution-dim: #fdf3e3;
  --engine:      #7c3aed;
  --engine-dim:  #f2ecfe;
  --comms:       #2563eb;
  --comms-dim:   #eaf0fe;
  --fast:        #db2777;
  --fast-dim:    #fce9f2;

  /* — text — */
  --text:        #4b5563;
  --text-dim:    #98a1ac;
  --text-bright: #14171c;

  /* — type — */
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* — geometry — */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;

  color-scheme: light;
}

/* ─── DARK THEME — same tokens, different values. Every rule in this
   file reads these variables, so nothing below needs to be duplicated. ─── */
html[data-theme="dark"] {
  --bg:         #0c0e12;
  --panel:      #15181f;
  --panel-alt:  #1a1e26;
  --border:     #2a2f39;
  --border-lit: #3b4250;

  --brand:      #5b9dff;
  --brand-dim:  rgba(91,157,255,.15);

  --rise:        #34d399;
  --rise-dim:    rgba(52,211,153,.15);
  --fall:        #f8717a;
  --fall-dim:    rgba(248,113,122,.15);
  --caution:     #fbbf24;
  --caution-dim: rgba(251,191,36,.15);
  --engine:      #a78bfa;
  --engine-dim:  rgba(167,139,250,.15);
  --comms:       #5b9dff;
  --comms-dim:   rgba(91,157,255,.15);
  --fast:        #f472b6;
  --fast-dim:    rgba(244,114,182,.15);

  --text:        #b0b9c4;
  --text-dim:    #66707c;
  --text-bright: #f2f5f8;

  color-scheme: dark;
}

/* Smooth, immediate — no flash-of-wrong-theme transition on toggle */
html { transition: none; }
body, .topbar, .panel, .control-strip, .sym-card, .stats-strip, .stat-card,
.active-item, .hist-item, .acct-btn, .login-card, .account-card,
.ctrl-input, .balance-box, .net-status, .conn-status {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN SCREEN ─── */
.login-screen, .account-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

.login-card, .account-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 44px 44px 38px;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  box-shadow: 0 8px 28px rgba(20,23,28,.07);
}

.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
}
.login-ver {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: #fff; background: var(--brand);
  padding: 1px 6px; border-radius: 3px; font-weight: 600;
}
.login-sub {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--text-dim); text-align: center; line-height: 1.5; max-width: 30ch;
}

.login-alert {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm);
  font-family: var(--sans); font-size: 12px; font-weight: 500; text-align: center;
}
.login-alert.error { background: var(--fall-dim); border: 1px solid var(--fall); color: var(--fall); }
.login-alert.warn  { background: var(--caution-dim); border: 1px solid var(--caution); color: var(--caution); }

.btn-login {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  background: var(--brand); color: #fff;
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  border-radius: var(--r-md); text-decoration: none;
  transition: background .15s, transform .15s;
}
.btn-login:hover { background: #1d4fd1; transform: translateY(-1px); }

.login-note {
  font-size: 11.5px; color: var(--text-dim); text-align: center; line-height: 1.7;
}

.btn-logout {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 20px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all .15s; width: 100%;
}
.btn-logout:hover { border-color: var(--fall); color: var(--fall); }

/* ─── ACCOUNT PICKER ─── */
.account-list {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
}

.acct-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px;
  background: var(--panel-alt); border: 1px solid var(--border);
  border-left: 3px solid var(--border-lit);
  border-radius: var(--r-md); cursor: pointer;
  font-family: var(--mono); font-size: 12px;
  transition: all .15s; color: var(--text-bright);
}
.acct-btn:hover { border-color: var(--brand); background: var(--brand-dim); }
.acct-btn.demo  { border-left-color: var(--comms); }
.acct-btn.real  { border-left-color: var(--rise); }

.acct-id   { font-weight: 600; font-size: 13px; }
.acct-type { font-size: 9px; letter-spacing: 1.5px; padding: 2px 6px; border-radius: 3px; }
.acct-btn.demo  .acct-type { background: var(--comms-dim); color: var(--comms); }
.acct-btn.real  .acct-type { background: var(--rise-dim); color: var(--rise); }
.acct-cur  { color: var(--text-dim); font-size: 11px; }

/* ─── MAIN APP LAYOUT ─── */
.app {
  max-width: 1400px; margin: 0 auto;
  padding: 16px 18px 48px;
  display: flex; flex-direction: column; gap: 12px;
}

/* ─── TOPBAR ─── */
.topbar {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 22px;
  position: sticky; top: 8px; z-index: 100;
  box-shadow: 0 2px 10px rgba(20,23,28,.05);
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon { font-size: 20px; color: var(--brand); }
.brand-name { font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .3px; color: var(--text-bright); }
.brand-accent { color: var(--brand); }
.brand-sub { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text-dim); border-left: 1px solid var(--border); padding-left: 10px; margin-left: 3px; }

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

.net-status, .conn-status {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .5px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 12px; color: var(--text-dim); background: var(--panel-alt);
  transition: all .3s;
}
.net-dot, .conn-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.net-status.online { border-color: var(--rise); color: var(--rise); background: var(--rise-dim); }
.conn-status.connected { border-color: var(--brand); color: var(--brand); background: var(--brand-dim); }
.conn-status.connected .conn-dot { animation: blink 1.2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@media (prefers-reduced-motion: reduce) { .conn-status.connected .conn-dot { animation: none; } }

.acct-pill {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px; font-weight: 600;
  color: #fff; background: var(--brand);
  padding: 3px 10px; border-radius: var(--r-sm);
}

.balance-box {
  display: flex; align-items: baseline; gap: 7px;
  font-family: var(--mono);
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 8px 16px;
}
.balance-label { font-size: 9px; color: var(--text-dim); letter-spacing: 1.5px; align-self: center; }
.balance-val { font-size: 17px; font-weight: 700; color: var(--text-bright); }
.balance-cur { font-size: 10.5px; color: var(--text-dim); }

.btn-icon {
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px;
  color: var(--text-dim); cursor: pointer; font-size: 14px;
  transition: all .15s; flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-dim); }

.refresh-btn { display: flex; align-items: center; gap: 6px; padding: 7px 10px; }
.refresh-btn.spinning .refresh-icon { animation: spin .6s linear infinite; }
.refresh-icon { font-size: 15px; display: inline-block; line-height: 1; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── CONTROL STRIP ─── */
.control-strip {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}

.ctrl-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; min-width: 120px; }
.ctrl-label { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .2px; color: var(--text-dim); }

.ctrl-input {
  width: 100%; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 12px; color: var(--text-bright);
  font-family: var(--mono); font-size: 12.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.ctrl-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }
.ctrl-input::placeholder { color: var(--text-dim); opacity: .7; }
.ctrl-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2398a1ac' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
.ctrl-select option { background: var(--panel); }

.ctrl-btns { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

.btn {
  font-family: var(--sans); font-size: 12.5px; letter-spacing: .1px;
  border: none; border-radius: var(--r-sm); padding: 10px 20px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  font-weight: 700;
}
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.btn-connect    { background: var(--brand); color: #fff; }
.btn-connect:hover { background: #1d4fd1; transform: translateY(-1px); }
.btn-disconnect { background: var(--panel); border: 1px solid var(--fall); color: var(--fall); }
.btn-disconnect:not(:disabled):hover { background: var(--fall-dim); }
.btn-start      { background: var(--rise); color: #fff; }
.btn-start:not(:disabled):hover { background: #128a3e; transform: translateY(-1px); }
.btn-stop       { background: var(--panel); border: 1px solid var(--fall); color: var(--fall); }
.btn-stop:not(:disabled):hover  { background: var(--fall-dim); }

/* ─── PANELS ─── */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 19px 20px 20px;
}
.panel-hdr {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 15px; flex-wrap: wrap; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.panel-title { font-family: var(--sans); font-size: 14.5px; font-weight: 700; color: var(--text-bright); letter-spacing: -.1px; }
.panel-badge { font-family: var(--mono); font-size: 10px; letter-spacing: .5px; color: var(--brand); background: var(--brand-dim); padding: 3px 9px; border-radius: var(--r-sm); }
.panel-sub   { font-family: var(--sans); font-size: 11.5px; color: var(--text-dim); }

/* ─── MACD PANEL ─── */
.macd-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.macd-field { display: flex; flex-direction: column; gap: 5px; }


/* ─── SYMBOL GRID — plain, clean cards ─── */
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.sym-card {
  background: var(--panel-alt); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px;
  display: flex; flex-direction: column; gap: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.sym-card.sig-rise { border-color: var(--rise); box-shadow: 0 0 0 3px var(--rise-dim); }
.sym-card.sig-fall { border-color: var(--fall); box-shadow: 0 0 0 3px var(--fall-dim); }
.sym-card.is-1s { background: var(--panel); }

.sym-card-top { display: flex; align-items: center; justify-content: space-between; }
.sym-toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sym-toggle {
  width: 38px; height: 21px; background: var(--border-lit); border-radius: 11px;
  position: relative; transition: background .2s;
  appearance: none; -webkit-appearance: none; cursor: pointer; border: none; outline: none;
}
.sym-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.sym-toggle:checked { background: var(--brand); }
.sym-toggle:checked::after { transform: translateX(17px); }
.sym-card.is-1s .sym-toggle:checked { background: var(--fast); }

.sym-name   { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--text-bright); }
.sym-card.is-1s .sym-name::after {
  content: '1s'; font-size: 10px; font-weight: 700; color: var(--fast); background: var(--fast-dim);
  border-radius: 4px; padding: 2px 6px; margin-left: 7px; vertical-align: middle;
}
.sym-payout { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.sym-price  { font-family: var(--mono); font-size: 27px; font-weight: 700; color: var(--text-bright); letter-spacing: .1px; min-height: 34px; }
.sym-macd-bar { height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; }
.sym-macd-fill { height: 100%; border-radius: 4px; width: 0%; transition: width .5s, background .3s; }

.sym-status { font-family: var(--sans); font-size: 12.5px; letter-spacing: .3px; padding: 8px 12px; border-radius: 20px; text-align: center; font-weight: 700; }
.sym-status.waiting  { background: var(--caution-dim); color: var(--caution); }
.sym-status.trading  { background: var(--comms-dim); color: var(--comms); }
.sym-status.win      { background: var(--rise-dim); color: var(--rise); }
.sym-status.loss     { background: var(--fall-dim); color: var(--fall); }
.sym-status.cooldown { background: var(--engine-dim); color: var(--engine); }

.sym-cond-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cond-pip {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  border: 1px solid var(--border);
}
.cond-pip.pass { background: var(--rise); color: #fff; border-color: var(--rise); }
.cond-pip.fail { background: var(--panel); color: var(--text-dim); }

/* ─── ACTIVE TRADES ─── */
.active-count { font-family: var(--mono); font-size: 10px; color: var(--comms); background: var(--comms-dim); border-radius: var(--r-sm); padding: 3px 10px; }
.active-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.active-item {
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 14px;
  display: grid; grid-template-columns: 90px 80px 1fr auto auto 90px;
  gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 11px;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:translateX(0)} }
.active-item.rise-trade { border-left: 3px solid var(--rise); }
.active-item.fall-trade { border-left: 3px solid var(--fall); }
.ai-sym  { color: var(--text-bright); font-weight: 700; font-size: 12px; }
.ai-dir  { font-weight: 700; letter-spacing: .3px; }
.ai-dir.rise { color: var(--rise); }
.ai-dir.fall { color: var(--fall); }
.ai-stake { color: var(--text-dim); }
.ai-entry { color: var(--text); text-align: right; }
.ai-countdown { color: var(--caution); font-family: var(--mono); font-size: 12px; background: var(--caution-dim); border-radius: var(--r-sm); padding: 2px 8px; text-align: center; min-width: 50px; }
.ai-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ai-bar-fill { height: 100%; background: var(--caution); border-radius: 2px; transition: width 1s linear; }

/* ─── STATS STRIP ─── */
.stats-strip {
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.stat-card { padding: 16px; text-align: center; border-left: 1px solid var(--border); }
.stat-card:first-child { border-left: none; }
.stat-val { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--text-bright); line-height: 1; margin-bottom: 5px; }
.stat-card.green .stat-val { color: var(--rise); }
.stat-card.red   .stat-val { color: var(--fall); }
.stat-card.gold  .stat-val { color: var(--caution); }
.stat-card.blue  .stat-val { color: var(--brand); }
.stat-label { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .3px; color: var(--text-dim); }

/* ─── BOTTOM ROW ─── */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hist-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.hist-item {
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px;
  display: grid; grid-template-columns: 60px 50px 50px 65px 50px 58px 1fr;
  gap: 6px; align-items: center;
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  animation: slideIn .3s ease;
}
.hist-item.win  { border-left: 3px solid var(--rise); }
.hist-item.loss { border-left: 3px solid var(--fall); }
.hist-sym    { color: var(--text-bright); font-weight: 700; font-size: 11px; }
.hist-dir    { font-weight: 700; }
.hist-dir.rise { color: var(--rise); }
.hist-dir.fall { color: var(--fall); }
.hist-result { font-weight: 700; font-size: 11px; letter-spacing: .3px; }
.hist-result.win  { color: var(--rise); }
.hist-result.loss { color: var(--fall); }
.hist-pnl    { font-weight: 700; }
.hist-pnl.pos { color: var(--rise); }
.hist-pnl.neg { color: var(--fall); }
.hist-stake  { color: var(--text-dim); }
.hist-date   { color: var(--text-dim); opacity: .8; font-size: 9px; }
.hist-time   { color: var(--text-dim); opacity: .7; text-align: right; font-size: 9px; }

.log-list { display: flex; flex-direction: column; gap: 3px; max-height: 280px; overflow-y: auto; font-family: var(--mono); font-size: 11px; }
.log-entry { padding: 4px 8px; border-radius: 4px; border-left: 3px solid transparent; line-height: 1.6; }
.log-entry::before { content: attr(data-time) ' '; color: var(--text-dim); font-size: 10px; margin-right: 6px; }
.log-entry.info    { color: var(--text-dim); border-left-color: var(--border-lit); }
.log-entry.success { color: var(--rise); border-left-color: var(--rise); background: var(--rise-dim); }
.log-entry.error   { color: var(--fall); border-left-color: var(--fall); background: var(--fall-dim); }
.log-entry.warn    { color: var(--caution); border-left-color: var(--caution); background: var(--caution-dim); }
.log-entry.trade   { color: var(--comms); border-left-color: var(--comms); background: var(--comms-dim); }

.clear-btn { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px 10px; font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.clear-btn:hover { border-color: var(--fall); color: var(--fall); background: var(--fall-dim); }

/* ─── DAY BADGE ─── */
.sym-day-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.day-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .3px;
  padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--panel-alt); color: var(--text-dim);
  border: 1px solid var(--border);
}
.day-badge.ahead  { background: var(--rise-dim); color: var(--rise); border-color: var(--rise); }
.day-badge.behind { background: var(--fall-dim); color: var(--fall); border-color: var(--fall); }
.day-badge.done   { background: var(--caution-dim); color: var(--caution); border-color: var(--caution); }
.day-done {
  font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: .5px;
  color: var(--caution); background: var(--caution-dim);
  border: 1px solid var(--caution); border-radius: var(--r-sm); padding: 2px 6px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--panel-alt); }
::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.empty-state { font-family: var(--sans); font-size: 12px; color: var(--text-dim); text-align: center; padding: 24px 0; }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 18px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--text);
  box-shadow: 0 10px 30px rgba(20,23,28,.14);
  animation: toastIn .3s ease;
  max-width: 320px; min-width: 220px;
}
.toast.success { border-left: 3px solid var(--rise); color: var(--rise); }
.toast.error   { border-left: 3px solid var(--fall); color: var(--fall); }
.toast.warn    { border-left: 3px solid var(--caution); color: var(--caution); }
@keyframes toastIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) { .sym-grid { grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); } }
@media (max-width: 900px)  { .macd-grid { grid-template-columns: repeat(3,1fr); } .stats-strip { grid-template-columns: repeat(3,1fr); } .bottom-row { grid-template-columns: 1fr; } .stat-card:nth-child(3n+1) { border-left: none; } }
@media (max-width: 680px)  {
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .topbar-center { flex-direction: column; gap: 6px; }
  .brand-sub { display: none; }
  .control-strip { flex-direction: column; }
  .ctrl-field { flex: 1 1 100%; }
  .ctrl-btns  { flex-direction: row; }
  .macd-grid  { grid-template-columns: repeat(2,1fr); }
  .stats-strip { grid-template-columns: repeat(2,1fr); }
  .stat-card:nth-child(odd) { border-left: none; }
  .active-item { grid-template-columns: 70px 60px 1fr auto; grid-template-rows: auto auto; }
  .ai-bar { grid-column: 1/-1; }
  .hist-item { grid-template-columns: 55px 42px 1fr auto; grid-template-rows: auto auto; }
  .hist-date, .hist-time { grid-column: 1/-1; }
}
@media (max-width: 480px) {
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(odd) { border-left: none; }
  .stat-val { font-size: 19px; }
  .sym-price { font-size: 16px; }
  .login-card, .account-card { padding: 30px 22px; }
}

/* ── Signal-session label on each symbol card ── */
.sym-session { font-size: 10px; letter-spacing: .04em; color: var(--text-dim); margin: 4px 0 2px; }
.sym-session.active.rise { color: var(--rise); }
.sym-session.active.fall { color: var(--fall); }

/* ── Server-hosted dashboard ── */
.gate-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.gate-form .ctrl-input { width: 100%; }
.gate-form .btn-login { width: 100%; border: none; cursor: pointer; }
.gate-form .btn-login:disabled { opacity: .6; }
.bot-pill {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .4px;
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border);
  color: var(--text-dim); background: var(--panel-alt);
}
.bot-pill.running { border-color: var(--rise); color: var(--rise); background: var(--rise-dim); }
.bot-banner {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500; line-height: 1.5;
  padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--caution);
  color: var(--caution); background: var(--caution-dim);
}
.bot-banner.error { border-color: var(--fall); color: var(--fall); background: var(--fall-dim); }
