/* XRPL Trading Bot Dashboard - Version 3.0.0
   CSS housekeeping pass (2025-10-29)

   Comment conventions:
   - Used in: where this block is referenced in markup (index.html) or JS (script.js)
   - Notes: non-functional notes for future maintainers
   - Legacy?: suspected unused; verify before removal

   Mobile-First Responsive Design with Fixed Navigation (refatorado)
====================================================================== */

/* Reset e base */
* { margin:0; padding:0; box-sizing:border-box; }

:root{
  /* Paleta */
  --primary-color: #616eec; --primary-dark:#1d4ed8; --secondary-color:#64748b;
  --success-color:#10b981; --warning-color:#f59e0b; --danger-color:#ef4444; --info-color:#06b6d4;

  /* Fundos */
  --bg-primary:#0f172a; --bg-secondary:#1e293b; --bg-tertiary:#334155; --bg-card:rgba(30,41,59,.8); --bg-glass:rgba(255,255,255,.1);

  /* Texto */
  --text-primary:#f8fafc; --text-secondary:#cbd5e1; --text-muted:#94a3b8;

  /* Bordas */
  --border-color:rgba(255,255,255,.1); --border-focus:var(--primary-color);

  /* Sombras */
  --shadow-sm:0 1px 2px rgba(0,0,0,.05);
  --shadow-md:0 4px 6px -1px rgba(0,0,0,.1);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.1);
  --shadow-xl:0 20px 25px -5px rgba(0,0,0,.1);

  /* Transições */
  --transition-fast:.15s ease-in-out; --transition-normal:.3s ease-in-out; --transition-slow:.5s ease-in-out;

  /* Raio */
  --radius-sm:.375rem; --radius-md:.5rem; --radius-lg:.75rem; --radius-xl:1rem;

  /* Altura da bottom bar */
  --bottom-bar-h:64px;
}

body{
  font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:linear-gradient(135deg,#0f1419 0%, #1a2332 100%);
  color:var(--text-primary);
  overflow-x:hidden; min-height:100vh; line-height:1.6;
}

/* When access banner is visible, push content down */
body.with-access-banner{ padding-top: var(--notice-offset); }

/* ===== AUTH ===== */
/* Runs Grid/Card styles */
.runs-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.run-card{
  background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-md);
  padding:12px; cursor:pointer; transition:transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  box-shadow: var(--shadow-md);
}
.run-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(255,255,255,.18); }
.run-title{ display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.35rem; font-size:1rem; }
.run-meta{ display:flex; align-items:center; gap:.5rem; color:var(--text-secondary); font-size:.85rem; margin:2px 0; }
.run-meta i{ color:var(--text-muted); }
.run-pnl{ display:flex; align-items:center; gap:.5rem; margin-top:.35rem; font-weight:600; }
.pnl-pos{ color: var(--success-color); }
.pnl-neg{ color: var(--danger-color); }
.pnl-flat{ color: var(--text-secondary); }
.chip{ display:inline-block; padding:.1rem .4rem; border-radius:999px; background:rgba(255,255,255,.08); font-size:.75rem; color:var(--text-secondary); border:1px solid var(--border-color); }

/* Runs Modal summary */
.run-summary-box{ display:grid; grid-template-columns: 1fr; gap:.35rem; }
.summary-row{ display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.35rem .5rem; background: rgba(255,255,255,.04); border:1px dashed var(--border-color); border-radius: var(--radius-sm); }
.summary-row.pnl-pos strong{ color: var(--success-color); }
.summary-row.pnl-neg strong{ color: var(--danger-color); }
.summary-row.pnl-flat strong{ color: var(--text-secondary); }
/* Used in: index.html (#auth-container)
   Purpose: Full-screen auth overlay until user logs in */
.auth-container{
  position:fixed; inset:0; background:linear-gradient(135deg,#0f1419 0%, #1a2332 100%);
  display:flex; align-items:center; justify-content:center; z-index:1000; padding:20px;
  top: 0;
  height: 100vh;
}
.auth-card{
  width:100%; max-width:420px; background:rgba(255,255,255,.05); backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.1); border-radius:var(--radius-xl);
  padding:2rem; text-align:center; box-shadow:var(--shadow-xl); animation:slideUp .5s ease-out;
}
@keyframes slideUp{from{opacity:0; transform:translateY(30px)} to{opacity:1; transform:translateY(0)}}
.auth-header{margin-bottom:2rem;}
.auth-header i{font-size:3rem; color:var(--primary-color); margin-bottom:1rem; display:block}
.auth-header h1{
  font-size:1.75rem; font-weight:700; margin-bottom:.5rem;
  background:linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.auth-header p{ color:var(--text-secondary); font-size:.875rem }

/* Tabs */
/* Used in: index.html (Login/Register tabs) */
.auth-tabs{ display:flex; margin-bottom:2rem; background:rgba(255,255,255,.05); border-radius:var(--radius-md); padding:.25rem; }
.tab-btn{
  flex:1; padding:.75rem 1rem; background:none; border:none; color:var(--text-secondary);
  font-size:.875rem; font-weight:500; border-radius:var(--radius-sm); cursor:pointer; transition:all var(--transition-normal);
}
.tab-btn.active{ background:var(--primary-color); color:#fff; transform:translateY(-1px); }
.tab-btn:hover:not(.active){ color:var(--text-primary); background:rgba(255,255,255,.05); }

/* Forms */
.seed-display { -webkit-text-security: none !important; text-security: none !important; font-variant-ligatures: none; color: var(--text-primary) !important; }
.auth-form{ display:none; text-align:left; }
.auth-form.active{ display:block; animation:fadeIn .3s ease-in; }
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }

.form-group{ position:relative; margin-bottom:1.5rem; }
.form-group label{ display:block; margin-bottom:.5rem; font-size:.875rem; font-weight:500; color:var(--text-secondary); }
.form-group input, .form-group textarea{
  width:100%; padding:1rem 3rem 1rem 1rem; background:rgba(255,255,255,.05);
  border:1px solid var(--border-color); border-radius:var(--radius-md);
  color:var(--text-primary); font-size:.875rem; transition:all var(--transition-normal); font-family:inherit;
}
.form-group input:focus, .form-group textarea:focus{
  outline:none; border-color:var(--primary-color); background:rgba(255,255,255,.08);
  box-shadow:0 0 0 3px rgba(37,99,235,.1);
}
.form-group i{ position:absolute; right:1rem; top:50%; transform:translateY(-50%); color:var(--text-muted); margin-top:.75rem; pointer-events:none; }
.form-group textarea{ min-height:80px; resize:vertical; padding-right:1rem; }
.form-group textarea + i{ display:none; }

/* AI Badge
   Used in: index.html (#ai-badge, .ai-badge-chip)
   Notes: toggled via script to show AI availability */
.ai-badge{pointer-events:none}
.ai-badge-chip{pointer-events:auto; display:inline-flex; align-items:center; gap:.4rem; background: linear-gradient(135deg, #22c55e, #16a34a); padding:.4rem .6rem; border-radius:999px; color:#fff; font-weight:600; box-shadow:0 6px 20px rgba(22,163,74,.35); border:1px solid rgba(255,255,255,.2);}
.ai-badge-chip i{opacity:.9}

/* Buttons
   Used in: index.html (auth submit, modal actions), plus various dashboard buttons
*/
.btn-primary{
  width:100%; padding:1rem; background:linear-gradient(135deg, var(--primary-color), #8b5cf6);
  border:none; border-radius:var(--radius-md); color:#fff; font-size:1rem; font-weight:600; cursor:pointer;
  transition:all var(--transition-normal); display:flex; align-items:center; justify-content:center; gap:.5rem; margin-top:1rem;
}
.btn-primary:hover{ transform:translateY(-2px); box-shadow:0 10px 25px rgba(37,99,235,.3); }
.btn-primary:active{ transform:translateY(0); }
.btn-secondary{
  padding:.75rem 1.5rem; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2);
  border-radius:var(--radius-sm); color:#fff; font-size:.875rem; cursor:pointer; transition:all var(--transition-normal);
  display:flex; align-items:center; justify-content:center; gap:.5rem;
}
.btn-secondary:hover{ background:rgba(255,255,255,.15); transform:translateY(-1px); }
.btn-success{ background:linear-gradient(135deg, var(--success-color), #059669); border:none; color:#fff; }
.btn-warning{ background:linear-gradient(135deg, var(--warning-color), #d97706); border:none; color:#fff; }
.btn-danger{
  background:linear-gradient(135deg, var(--danger-color), #dc2626);
  color:#fff;
  box-shadow: var(--shadow-md);
}
.btn-danger:hover{
  box-shadow: 0 10px 20px rgba(239,68,68,.3);
}

/* ===== WALLET SETUP ===== */
.wallet-setup-container{
  position:fixed; inset:0; background:linear-gradient(135deg,#0f1419 0%, #1a2332 100%);
  display:flex; align-items:center; justify-content:center; z-index:1000; padding:20px;
}
.setup-card{
  width:100%; max-width:600px; background:rgba(255,255,255,.05); backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.1); border-radius:var(--radius-xl); padding:2rem; text-align:center;
  box-shadow:var(--shadow-xl); animation:slideUp .5s ease-out;
}
.setup-header{ margin-bottom:2rem; }
.setup-header h2{ font-size:1.75rem; font-weight:700; margin-bottom:.5rem; color:var(--text-primary) }
.setup-header p{ color:var(--text-secondary); font-size:1rem; }
.wallet-options{ display:grid; grid-template-columns:1fr; gap:1rem; margin-bottom:2rem; }
@media (min-width:640px){ .wallet-options{ grid-template-columns:1fr 1fr } }
.wallet-option-btn{
  padding:2rem 1.5rem; background:rgba(255,255,255,.05); border:2px solid var(--border-color);
  border-radius:var(--radius-lg); color:#fff; cursor:pointer; transition:all var(--transition-normal); text-align:center;
}
.wallet-option-btn:hover{ border-color:var(--primary-color); background:rgba(37,99,235,.1); transform:translateY(-2px) }
.wallet-option-btn i{ font-size:2rem; color:var(--primary-color); margin-bottom:1rem; display:block }
.wallet-option-btn h3{ font-size:1.125rem; font-weight:600; margin-bottom:.5rem; }
.wallet-option-btn p{ font-size:.875rem; color:var(--text-secondary); line-height:1.4; }
.wallet-form{ text-align:left; margin-top:2rem; }
.wallet-form h3{ text-align:center; margin-bottom:1.5rem; font-size:1.25rem; color:var(--text-primary); }
.wallet-info{ background:rgba(255,255,255,.05); border-radius:var(--radius-md); padding:1.5rem; margin-top:1rem; }
.wallet-info h4{ color:var(--text-primary); margin-bottom:1rem; text-align:center; }

/* ===== DASHBOARD ===== */
.dashboard-container{ display:flex; height:100vh; background:linear-gradient(135deg,#0f1419 0%, #1a2332 100%) }

/* --- Sidebar única que vira bottom bar no mobile --- */
.sidebar{
  display:flex; flex-direction:column;
  width:260px; height:100vh; position:fixed; top:0; left:0;
  background:rgba(255,255,255,.05); backdrop-filter:blur(20px);
  border-right:1px solid var(--border-color);
  transition:var(--transition-normal); z-index:100;
}
/* Offset sidebar when access banner is visible */
body.with-access-banner .sidebar{ top: var(--notice-offset); height: calc(100vh - var(--notice-offset)); }
.sidebar-header{ padding:2rem 1.5rem; text-align:center; border-bottom:1px solid var(--border-color); }
.sidebar-header i{ font-size:2rem; color:var(--primary-color); margin-bottom:.75rem; display:block }
.sidebar-header h2{
  font-size:1.25rem; font-weight:700;
  background:linear-gradient(135deg, var(--primary-color), #8b5cf6);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.nav-menu{ flex:1; padding:1.5rem 0; list-style:none; }
.nav-item{
  display:flex; align-items:center; padding:1rem 1.5rem; color:var(--text-secondary);
  cursor:pointer; transition:all var(--transition-normal); border-left:3px solid transparent; margin-bottom:.25rem;
}
.nav-item:hover{ background:rgba(255,255,255,.05); color:var(--text-primary); }
.nav-item.active{ background:rgba(37,99,235,.1); color:var(--primary-color); border-left-color:var(--primary-color); }
.nav-item i{ width:20px; margin-right:1rem; font-size:1rem; }
.nav-item span{ font-size:.875rem; font-weight:500; }
.sidebar-footer{ padding:1.5rem; border-top:1px solid var(--border-color); }

/* --- Main content --- */
.main-content{
  flex:1; margin-left:260px; display:flex; flex-direction:column; overflow:hidden;
}
.content-section{ padding:2rem; overflow-y:auto; height:100vh; }
.section-header{ margin-bottom:2rem; }
.section-header h2{ font-size:1.875rem; font-weight:700; margin-bottom:.5rem; color:var(--text-primary); }
.section-header p{ color:var(--text-secondary); font-size:1rem; }

/* ===== Cards e Grids ===== */
.wallet-cards{ display:grid; grid-template-columns:1fr; gap:1.5rem; margin-bottom:2rem; }
@media (min-width:640px){ .wallet-cards{ grid-template-columns:repeat(2,1fr) } }
@media (min-width:1024px){ .wallet-cards{ grid-template-columns:repeat(3,1fr) } }
.wallet-card{
  background:rgba(255,255,255,.05); backdrop-filter:blur(10px); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:1.5rem; text-align:center; transition:all var(--transition-normal);
}
.wallet-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.wallet-card h3{ font-size:.875rem; font-weight:500; color:var(--text-secondary); margin-bottom:.75rem; text-transform:uppercase; letter-spacing:.05em; }
.balance-amount{ font-size:1.875rem; font-weight:700; color:var(--text-primary); margin-bottom:.25rem; }
.wallet-card p{ font-size:.875rem; color:var(--text-muted); }

.wallet-actions{ display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.wallet-actions .btn-primary, .wallet-actions .btn-secondary{ min-width:120px; padding:.75rem 1.5rem; width:auto; }

.portfolio-stats{ display:grid; grid-template-columns:1fr; gap:1.5rem; margin-bottom:2rem; }
@media (min-width:640px){ .portfolio-stats{ grid-template-columns:repeat(2,1fr) } }
@media (min-width:1024px){ .portfolio-stats{ grid-template-columns:repeat(3,1fr) } }
.stat-card{
  background:rgba(255,255,255,.05); backdrop-filter:blur(10px); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:1.5rem; text-align:center; transition:all var(--transition-normal);
}
.stat-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.stat-card h3{ font-size:.875rem; font-weight:500; color:var(--text-secondary); margin-bottom:.75rem; text-transform:uppercase; letter-spacing:.05em; }
.stat-value{ font-size:1.875rem; font-weight:700; color:var(--text-primary); }

/* Timeframe */
.timeframe-selector{ display:flex; gap:.5rem; margin-bottom:2rem; justify-content:center; flex-wrap:wrap; }
.timeframe-btn{
  padding:.5rem 1rem; background:rgba(255,255,255,.05); border:1px solid var(--border-color);
  border-radius:var(--radius-sm); color:var(--text-secondary); cursor:pointer; transition:all var(--transition-normal);
  font-size:.875rem; font-weight:500;
}
.timeframe-btn:hover{ background:rgba(255,255,255,.1); color:var(--text-primary); }
.timeframe-btn.active{ background:var(--primary-color); color:#fff; border-color:var(--primary-color); }

/* Chart placeholder */
.chart-container{
  position:relative;
  width:100%;
  background:rgba(255,255,255,.05); border:1px solid var(--border-color); border-radius:var(--radius-lg);
  padding:1rem; height:400px; display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.chart-container canvas{ width:100% !important; height:100% !important; display:block; cursor:grab; }

/* Config form */
.config-form{ max-width:500px; }
.config-form .form-group{ margin-bottom:1.5rem; }
.config-form select{
  width:100%; padding:1rem; background:rgba(255,255,255,.05); border:1px solid var(--border-color);
  border-radius:var(--radius-md); color:var(--text-primary); font-size:.875rem; cursor:pointer;
}
.config-form select:focus{
  outline:none; border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(37,99,235,.1);
}
.config-form label{
  display:flex; align-items:center; gap:.75rem; cursor:pointer; color:var(--text-secondary); font-size:.875rem;
}
.config-form input[type="checkbox"]{ width:1.25rem; height:1.25rem; accent-color:var(--primary-color); }

/* P&L */
.pnl-summary{ display:grid; grid-template-columns:1fr; gap:1.5rem; margin-bottom:2rem; }
@media (min-width:640px){ .pnl-summary{ grid-template-columns:repeat(2,1fr) } }
@media (min-width:1024px){ .pnl-summary{ grid-template-columns:repeat(3,1fr) } }
.pnl-card{
  background:rgba(255,255,255,.05); backdrop-filter:blur(10px); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:1.5rem; text-align:center; transition:all var(--transition-normal);
}
.pnl-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.pnl-card h3{ font-size:.875rem; font-weight:500; color:var(--text-secondary); margin-bottom:.75rem; text-transform:uppercase; letter-spacing:.05em; }
.pnl-value{ font-size:1.875rem; font-weight:700; color:var(--text-primary); }
.pnl-card.positive .pnl-value{ color:var(--success-color); }
.pnl-card.negative .pnl-value{ color:var(--danger-color); }

/* Trade history */
.trade-history{ background:rgba(255,255,255,.05); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:1.5rem; }
.trade-history h3{ font-size:1.125rem; font-weight:600; color:var(--text-primary); margin-bottom:1rem; }
.trade-list{ color:var(--text-secondary); text-align:center; padding:2rem; }

/* Bot status (cards) */
.bot-status{ display:grid; grid-template-columns:1fr; gap:1.5rem; margin-bottom:1.5rem; }
@media (min-width:640px){ .bot-status{ grid-template-columns:repeat(2,1fr) } }
.status-card{
  background:rgba(255,255,255,.05); backdrop-filter:blur(10px); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:1.5rem; text-align:center; transition:all var(--transition-normal);
  display:flex; flex-direction:column; align-items:center; text-align:center;
}
.status-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.status-card h3{ font-size:.875rem; font-weight:500; color:var(--text-secondary); margin-bottom:.75rem; text-transform:uppercase; letter-spacing:.05em; }
.status-indicator{ font-size:1.125rem; font-weight:600; padding:.5rem 1rem; border-radius:var(--radius-sm); display:inline-block; }
.status-indicator.offline{ background:rgba(239,68,68,.1); color:var(--danger-color); border:1px solid rgba(239,68,68,.2); }
.status-indicator.online{ background:rgba(16,185,129,.1); color:var(--success-color); border:1px solid rgba(16,185,129,.2); }
/* Loading state while preparing bot (fetching candles) */
.status-indicator.loading-candles{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  background: rgba(139,92,246,.15); /* purple-500 background tint */
  color: #A78BFA; /* purple-400 text */
  border: 1px solid rgba(139,92,246,.35);
}
.status-indicator.loading-candles .spinner{ width:16px; height:16px; border:2px solid rgba(167,139,250,.35); border-top-color:#A78BFA; border-radius:50%; animation: spin 1s linear infinite; }
.mode-indicator{ font-size:1.125rem; font-weight:600; color:var(--text-primary); }

/* Trading controls */
.trading-controls{ background:rgba(255,255,255,.05); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:1.5rem; }
.control-group h3{ font-size:1.125rem; font-weight:600; color:var(--text-primary); margin-bottom:1.5rem; }
.trade-inputs{ display:flex; gap:1rem; margin-bottom:1rem; align-items:center; flex-wrap:wrap; }
.trade-inputs input{
  flex:1; min-width:150px; padding:.75rem; background:rgba(255,255,255,.05); border:1px solid var(--border-color);
  border-radius:var(--radius-sm); color:var(--text-primary); font-size:.875rem;
}
.trade-inputs input:focus{ outline:none; border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(37,99,235,.1) }
.trade-inputs button{ min-width:100px; padding:.75rem 1rem; font-size:.875rem; font-weight:500; border-radius:var(--radius-sm); cursor:pointer; transition:all var(--transition-normal); border:none; display:flex; align-items:center; justify-content:center; gap:.5rem; }

/* ===== Componentes Wallet Overview (wo-) ===== */
.wo-actions{ display:flex; gap:12px; flex-wrap:wrap; margin:0 0 16px 0; }
.wo-btn{
  display:inline-flex; align-items:center; gap:10px; padding:12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight:600; cursor:pointer; transition: var(--transition-fast); box-shadow:none;
}
.wo-btn:hover{ transform: translateY(-1px); border-color: var(--primary-color); background: rgba(255,255,255,0.06); }
.wo-btn.wo-danger{ background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.25); color: var(--danger-color); }

.wo-summary{ display:grid; grid-template-columns:repeat(auto-fit,minmax(350px,1fr)); gap:1.5rem; margin-bottom:1.5rem; }
@media (max-width:900px){ .wo-summary{ grid-template-columns:1fr; } }

.wo-card{
  position:relative; border-radius: var(--radius-lg); padding:18px; overflow:hidden;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-primary); box-shadow:none;
}
.wo-card::before{ content:none; }
.wo-card-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.wo-title{ display:flex; align-items:center; gap:10px; font-weight:800; }
.wo-controls{ display:flex; align-items:center; gap:10px; }

.wo-toggle{ display:inline-flex; align-items:center; gap:4px; padding:4px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); border-radius: 999px; }
.wo-toggle button{ border:0; background:transparent; color: var(--text-secondary); padding:6px 10px; border-radius:999px; cursor:pointer; font-weight:700; transition: var(--transition-fast); }
.wo-toggle button:hover{ color: var(--text-primary); }
.wo-toggle button.active{ background: var(--primary-color); color:#fff; }

.wo-eye{ width:36px; height:36px; border-radius:10px; border:1px solid var(--border-color); background: rgba(255,255,255,0.05); display:grid; place-items:center; cursor:pointer; }

.wo-balance-line{ display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.wo-total{ font-size:2rem; font-weight:800; letter-spacing:.2px; }
.blurred{ filter: blur(6px); }
.wo-sub{ color: var(--text-secondary); font-weight:600; }

.wo-pill{
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px; font-size:12px; border-radius:999px;
  background: rgba(37,99,235,0.12); border: 1px solid rgba(37,99,235,0.30); color: var(--primary-color);
}

.wo-address{ margin-top:12px; }
.wo-address label{ display:block; color: var(--text-muted); font-size:12px; margin-bottom:6px; }
.wo-address-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-radius:12px; background: rgba(255,255,255,0.05); border:1px solid var(--border-color); }
.wo-copy{ border:0; background:transparent; color: var(--text-secondary); cursor:pointer; }

.wo-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(350px,1fr)); gap:1.5rem; margin-bottom:1.5rem; }
@media (max-width:900px){ .wo-grid{ grid-template-columns:1fr; } }

.wo-tokens{ display:grid; gap:10px; }
.wo-row{
  display:grid; grid-template-columns:1.2fr .8fr .8fr .6fr; align-items:center;
  padding:12px; border-radius: var(--radius-md);
  border:1px solid var(--border-color); background: rgba(255,255,255,0.05);
  transition: var(--transition-fast);
}
.wo-row:hover{ border-color: var(--primary-color); background: rgba(255,255,255,0.06); }
.wo-token{ display:flex; align-items:center; gap:10px; }
.wo-avatar{
  width:32px; height:32px; border-radius:9px; display:grid; place-items:center; font-size:14px;
  background: rgba(37,99,235,0.12); border:1px solid rgba(37,99,235,0.28); color: var(--primary-color); font-weight:700;
  position: relative; overflow: hidden;
}
.wo-avatar img{ width:100%; height:100%; border-radius:inherit; object-fit:cover; display:block; }
/* Brand tint overlay for avatars (matches America logo tint) */
.wo-avatar.tint-brand::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: var(--brand, var(--primary-color)); mix-blend-mode:multiply; opacity:.55;
}
.wo-sym{ font-weight:800; }
.wo-m{ color: var(--text-secondary); }
.wo-right{ text-align:right; }
.wo-chg.wo-up{ color: var(--success-color); }
.wo-chg.wo-down{ color: var(--danger-color); }
.wo-pnl-figure{ font-size:1.25rem; font-weight:800; margin-bottom:6px; }

/* ===== Strategy layout / toggles ===== */
.strategy-col{ border-radius: var(--radius-xl); padding: 1rem; background: rgba(255,255,255,0.05); border:2px solid transparent; box-shadow:var(--shadow-md); }
.strategy-col.buy-col{ border-color:rgba(16,185,129,.35); }
.strategy-col.sell-col{ border-color:rgba(239,68,68,.35); }
.strategy-heading{ margin:.25rem 0 .75rem; }
.strategy-grid{ display:grid; grid-template-columns:1fr; gap:1.25rem; align-items:start; }
@media (min-width:768px){ .strategy-grid{ grid-template-columns:1fr 1fr; } }
.strategy-list{ display:flex; flex-direction:column; gap:.75rem; }
.strategy-item{
  display:flex; align-items:flex-start; justify-content:space-between; gap:1rem;
  padding:.9rem 1rem; background:rgba(0,0,0,.06); border:1px solid var(--border-color); border-radius:12px;
}
.strategy-meta{ flex:1 1 auto; min-width:0; }
.strategy-name{ font-weight:600; color:var(--text-primary); }
.strategy-desc{ color:var(--text-muted); font-size:.86rem; line-height:1.35; }

/* iOS-like switches */
.switch{ position:relative; width:46px; height:26px; flex-shrink:0; }
.switch input{ position:absolute; opacity:0; pointer-events:none; }
.switch span{
  position:absolute; inset:0; background:rgba(255,255,255,.12);
  border:1px solid var(--border-color); border-radius:999px; transition:var(--transition-fast);
}
.switch span::after{
  content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:var(--shadow-sm); transition:var(--transition-fast);
}
.switch input:checked + span::after{ transform:translateX(20px); }
.switch--buy input:checked + span{ background:rgba(16,185,129,.9); border-color:rgba(16,185,129,.9); }
.switch--sell input:checked + span{ background:rgba(239,68,68,.9); border-color:rgba(239,68,68,.9); }

.switch input[data-action="buy"]:checked + span{ background: var(--success-color); border-color: var(--success-color); }
.switch input[data-action="sell"]:checked + span{ background: var(--danger-color); border-color: var(--danger-color); }

.strategy-item.on-buy{
  border-color: rgba(16,185,129,.55);
  box-shadow: inset 0 0 0 2px rgba(16,185,129,.15);
  background: linear-gradient(180deg, rgba(16,185,129,.08), rgba(16,185,129,.03));
}
.strategy-item.on-sell{
  border-color: rgba(239,68,68,.55);
  box-shadow: inset 0 0 0 2px rgba(239,68,68,.12);
  background: linear-gradient(180deg, rgba(239,68,68,.08), rgba(239,68,68,.03));
}

/* ===== Mode Toggle (Simulation / Live) ===== */
.mode-toggle{ display:inline-block; cursor:pointer; user-select:none; }
.mode-toggle input{ display:none; }
.mode-toggle .mode-track{
  position:relative; display:flex; align-items:center; gap:0;
  width: clamp(220px, 40vw, 320px); height:42px; padding:6px;
  border-radius:999px; background:rgba(255,255,255,0.06); border:1px solid var(--border-color); box-shadow:var(--shadow-sm);
}
.mode-track .mode-left,.mode-track .mode-right{
  flex:1; text-align:center; font-weight:600; font-size:.9rem; color:var(--text-secondary); position:relative; z-index:1; transition:color var(--transition-normal);
}
.mode-track .mode-thumb{
  position:absolute; top:4px; left:4px; width:calc(50% - 8px); height:calc(100% - 8px);
  border-radius:999px; background:var(--primary-color); box-shadow:var(--shadow-md);
  transform:translateX(100%); transition:transform var(--transition-normal), background var(--transition-normal); z-index:0;
}
.mode-toggle input:checked + .mode-track .mode-thumb{ transform:translateX(0); }
.mode-toggle input:checked + .mode-track .mode-left{ color:#fff; }
.mode-toggle input:checked + .mode-track .mode-right{ color:var(--text-secondary); }
.mode-toggle input:not(:checked) + .mode-track .mode-right{ color:#fff; }
.mode-toggle input:not(:checked) + .mode-track .mode-left{ color:var(--text-secondary); }

.form-row-center{ align-items:center; justify-content:center; }
.form-group-inline{ display:inline-flex; flex-direction:column; gap:.5rem; }
.form-label{ color:var(--text-secondary); font-size:.85rem; font-weight:500; }

/* ===== Current Run / Terminal-like ===== */
#bot-status{ cursor:pointer; }

.run-summary{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color:var(--text-secondary); line-height:1.5; margin-bottom:.75rem;
}

/* Trade Overview styled like Run Cards (indicator-card) */
#current-run-status-box{
  margin-top:.75rem;
  background:var(--bg-card);
  border:1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding:.85rem;
  box-shadow: var(--shadow-md);
}
/* Make each row look like indicator rows */
#current-run-status-box .run-status-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:.4rem .55rem; border:1px dashed var(--border-color); border-radius: var(--radius-lg);
  background: rgba(255,255,255,.03);
  margin:0;
}
#current-run-status-box .run-status-row + .run-status-row{ margin-top:.35rem; }
#current-run-status-box .run-label{ color: var(--text-secondary); font-weight:600; letter-spacing:.02em; }
#current-run-status-box .run-chip{
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-weight:700;
  padding:0; border:none; background:transparent; border-radius:0;
}
/* Make the OHLCV chip look like indicator pills and fit mobile */
#current-run-status-box #ohlcv-last{
  display:inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#current-run-status-box #ohlcv-last .status-label{
  margin-left:0;
}
/* Ensure Trade Overview keeps right-aligned values on small screens */
@media (max-width: 480px){
  #current-run-status-box .run-status-row{ flex-wrap: nowrap; gap:0; }
  #current-run-status-box .run-chip{ margin-left:auto; text-align:right; flex:0 0 auto; min-width: fit-content; }
}
/* Preserve online/offline border tint on the card, but don't tint value chips */
.run-box.is-online{ border-color:rgba(16,185,129,.35); box-shadow:0 0 0 2px rgba(16,185,129,.08) inset; }
.run-box.is-offline{ border-color:rgba(239,68,68,.35); box-shadow:0 0 0 2px rgba(239,68,68,.08) inset; }

/* Subtle blink effect when a value updates */
@keyframes value-blink{
  0%{ background-color: rgba(59,130,246,.28); }
  70%{ background-color: rgba(59,130,246,.28); }
  100%{ background-color: transparent; }
}
.value-blink{ animation: value-blink 1500ms ease-out; border-radius:6px; }

.run-log{
  margin-top:.75rem;
  max-height:200px;
  overflow-y:auto;
  overflow-x:hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.85rem;
  line-height:1.5;
  color:var(--text-secondary);
  background:rgba(255,255,255,.04);
  border:1px solid var(--border-color);
  border-radius:12px;
  padding:.6rem .8rem;
}
.run-log .t{ color:var(--text-muted); }
.run-log .buy{ color:var(--success-color); font-weight:600; }
.run-log .sell{ color:var(--danger-color); font-weight:600; }
.run-log .info{ color:var(--info-color); }
.run-log-line{ padding:2px 0; }
.run-log-line strong{ color:var(--text-primary); }
.run-log-line .ok{ color:var(--success-color); font-weight:600; }
.run-log-line .warn{ color:var(--warning-color); font-weight:600; }
.run-log-line .err{ color:var(--danger-color); font-weight:600; }

/* ===== Cards de indicadores ===== */
.run-metrics{ display:flex; gap:.75rem; flex-wrap:wrap; margin:.75rem 0 1rem; }
.metric-pill{
  display:inline-flex; align-items:center; gap:.5rem;
  background:var(--bg-secondary); border:1px solid var(--border-color);
  padding:.4rem .65rem; border-radius: var(--radius-lg); color:var(--text-primary);
  font-weight:600; box-shadow: var(--shadow-sm);
}

.run-cards{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-bottom:1rem; }
@media (max-width:900px){ .run-cards{ grid-template-columns:1fr; } }

.indicator-card{
  background:var(--bg-card); border:1px solid var(--border-color);
  border-radius: var(--radius-xl); padding:.85rem; box-shadow:var(--shadow-md);
}
.indicator-card-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:.5rem; }
.indicator-title{ font-weight:800; color:var(--text-primary); }
.indicator-sub{ font-size:.85rem; color:var(--text-muted); }
.indicator-price{ font-weight:800; color:var(--text-primary); }

.indicator-list{ display:flex; flex-direction:column; gap:.35rem; }
.indicator-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:.4rem .55rem; border:1px dashed var(--border-color); border-radius: var(--radius-lg);
  background: rgba(255,255,255,.03);
}
.ind-name{ color: var(--text-secondary); font-weight:600; }
.ind-value{ color: var(--text-primary); font-variant-numeric: tabular-nums; cursor:pointer; user-select:none; }
.ind-value .bull{ color: var(--success-color); font-weight:700; }
.ind-value .bear{ color: var(--danger-color); font-weight:700; }
.ind-value .neutral{ color: var(--warning-color); font-weight:700; }
/* Toggleable indicator details */
.ind-value .ind-details{ display:none; margin-left:6px; color: var(--text-secondary); font-weight:500; }
.ind-value.expanded .ind-details{ display:inline; }
.ind-value.expanded .ind-compact{ display:none; }

/* ===== LEGACY MODAL (static .modal) =====
   Used in: index.html (#deposit-modal, #liq-modal)
   Notes: Older modal style using .modal; newer modals use .modal-backdrop with .open state below
*/
.modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;z-index:1000;align-items:center;justify-content:center;padding:16px}
.modal .modal-content{background:var(--card-bg,#0f172a);color:var(--text,#e2e8f0);border:1px solid var(--border-color,rgba(255,255,255,.1));border-radius:14px;max-width:640px;width:100%;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.modal.open {
    display: flex;
}
.modal-header,.modal-footer{padding:14px 18px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border-color,rgba(255,255,255,.08))}
.modal-footer{border-top:1px solid var(--border-color,rgba(255,255,255,.08));border-bottom:none}
.modal-body{padding:18px}
.modal-close{background:transparent;border:none;color:inherit;font-size:22px;cursor:pointer}
.deposit-row{display:flex;gap:16px;flex-wrap:wrap}
.qr-box{display:flex;flex-direction:column;align-items:center;gap:8px}
.qr-canvas>img,.qr-canvas>canvas{width:180px;height:180px}
.addr-box .addr-line{display:flex;gap:8px;align-items:center;background:rgba(255,255,255,.04);padding:8px 10px;border-radius:8px;font-family:ui-monospace, SFMono-Regular, Menlo, monospace}
.input-with-btn{display:flex;gap:8px;align-items:center}
.confirm-row{margin-top:8px}

/* ===== Helpers ===== */
.muted{ opacity:.8; }
.warn{
  border:1px solid var(--border-color,#394150);
  background:var(--warn-bg,#10151f);
  border-radius:12px; padding:10px 12px;
}
.progress{ height:10px; border:1px solid var(--border-color,#1f2a44); background:var(--track-bg,#0f172a); border-radius:12px; overflow:hidden; }
.progress__bar{ height:100%; width:40%; background:linear-gradient(90deg, var(--p1,#60a5fa), var(--p2,#93c5fd)); border-radius:10px; }
.progress--indeterminate{ animation: liq-indeterminate 1.1s linear infinite; }
@keyframes liq-indeterminate{ 0%{ transform:translateX(-100%) } 100%{ transform:translateX(250%) } }

.code-box{ background:var(--code-bg,#0f172a); border:1px solid var(--border-color,#1f2a44); border-radius:12px; padding:12px; max-height:45vh; overflow:auto; }

.status-label{
  display:inline-block;
  padding: 2px 8px;
  border-radius:999px;
  font-size:.8rem;
  font-weight:700;
  margin-left:8px;
  border:1px solid var(--border-color, rgba(255,255,255,.18));
  background: rgba(255,255,255,.06);
}
/* Color variants to match Bollinger pill style */
.status-label.bullish{ color: var(--success-color, #10b981); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.status-label.bearish{ color: var(--danger-color, #ef4444); background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.status-label.neutral{ color: var(--warning-color, #f59e0b); background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.status-label.trend{ color: var(--primary-color, #60a5fa); background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }

.token-display{ display:flex; flex-direction:column; align-items:center; gap:8px; margin-top:8px; font-size:1.2rem; font-weight:600; }
.token-logo{
  width:36px; height:36px; border-radius:50%; background-color:var(--bg-primary);
  border:1px solid var(--border-color); object-fit:cover;
}
/* Bot token logo wrapper with brand tint overlay (matches America logo tint) */
.token-logo-wrap{ position:relative; display:inline-grid; place-items:center; width:36px; height:36px; border-radius:50%; overflow:hidden; }
.token-logo-wrap .token-logo{ width:100%; height:100%; border-radius:inherit; object-fit:cover; display:block; }
.token-logo-wrap.tint-brand::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: var(--brand, var(--primary-color)); mix-blend-mode:multiply; opacity:.55;
}
/* Subtle grayscale/contrast/bias to match tint effect */
.token-logo-wrap.tint-brand .token-logo{ filter: grayscale(1) contrast(1.05) brightness(0.95); }
/* Same filter for wallet avatars when tinted */
.wo-avatar.tint-brand img{ filter: grayscale(1) contrast(1.05) brightness(0.95); }

/* Utilities */
.hidden{ display:none !important }
.text-center{ text-align:center } .text-left{ text-align:left } .text-right{ text-align:right }
.mb-1{ margin-bottom:.25rem } .mb-2{ margin-bottom:.5rem } .mb-3{ margin-bottom:.75rem } .mb-4{ margin-bottom:1rem } .mb-5{ margin-bottom:1.25rem } .mb-6{ margin-bottom:1.5rem }
.mt-1{ margin-top:.25rem } .mt-2{ margin-top:.5rem } .mt-3{ margin-top:.75rem } .mt-4{ margin-top:1rem } .mt-5{ margin-top:1.25rem } .mt-6{ margin-top:1.5rem }

/* Scrollbar */
::-webkit-scrollbar{ width:8px }
::-webkit-scrollbar-track{ background:rgba(255,255,255,.05) }
::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.2); border-radius:4px }
::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.3) }

/* Focus */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline:2px solid var(--primary-color); outline-offset:2px;
}

/* Print */
@media print{
  .sidebar{ display:none !important }
  .main-content{ margin-left:0 !important }
  .content-section{ padding:1rem !important }
}

/* ====== Responsivo: Mobile (≤768px) ====== */
@media (max-width:768px){
  /* Sidebar vira bottom bar */
  .sidebar{
    flex-direction:row; align-items:center; justify-content:space-around;
    position:fixed; top:auto; bottom:0; left:0; right:0;
    width:100%;
    height:calc(var(--bottom-bar-h) + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    border-right:0; border-top:1px solid var(--border-color);
    background:rgba(15,23,42,.7); backdrop-filter:blur(20px);
    z-index:200;
  }
  .sidebar-header, .sidebar-footer{ display:none !important; }

  .nav-menu{
    flex:1; display:flex; flex-direction:row; align-items:center;
    gap:.25rem; padding:0 .5rem; overflow-x:auto; -webkit-overflow-scrolling:touch;
  }
  .nav-item{
    flex:1 0 auto; margin:0; padding:.5rem .75rem;
    border-left:0; border-bottom:3px solid transparent;
    justify-content:center; gap:.5rem; background:transparent;
  }
  .nav-item i{ margin:0; font-size:1.2rem; }
  .nav-item span{ font-size:.75rem; display:none; }
  .nav-item:hover{ background:rgba(255,255,255,.05); color:var(--text-primary); }
  .nav-item.active{ color:var(--primary-color); border-bottom-color:var(--primary-color); background:transparent; }

  /* Main sem margem lateral + espaço para a barra inferior */
  .main-content{ margin-left:0 !important; padding-bottom:calc(var(--bottom-bar-h) + env(safe-area-inset-bottom) + 12px); }

  /* Grids em 1 coluna */
  .wallet-options,.wallet-cards,.portfolio-stats,.pnl-summary,.bot-status{ grid-template-columns:1fr }
  .trade-inputs{ flex-direction:column }
  .trade-inputs input, .trade-inputs button{ width:100% }

  /* Timeframe com scroll */
  .timeframe-selector{ justify-content:flex-start; overflow-x:auto; padding-bottom:.5rem }
  .timeframe-btn{ flex-shrink:0 }

  /* Canvas menor */
  .chart-container{ height:320px; }
}

/* === HARD PATCH: Sidebar -> Bottom bar quando viewport <= 900px === */
@media (max-width: 900px){
  .sidebar{
    /* força o layout de bottom bar */
    position: fixed !important;
    inset: auto 0 0 0 !important;            /* top:auto; right:0; bottom:0; left:0 */
    width: 100% !important;
    height: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom)) !important;
    padding-bottom: env(safe-area-inset-bottom);
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    border-right: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    background: rgba(15,23,42,0.70) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 200 !important;
    transform: none !important;
  }

  /* esconde áreas de header/footer que só fazem sentido na lateral */
  .sidebar-header,
  .sidebar-footer{
    display: none !important;
  }

  /* menu em linha */
  .nav-menu{
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .25rem !important;
    padding: 0 .5rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item{
    flex: 1 0 auto !important;
    margin: 0 !important;
    padding: .5rem .75rem !important;
    border-left: 0 !important;
    border-bottom: 3px solid transparent !important;
    justify-content: center !important;
    gap: .5rem !important;
    background: transparent !important;
  }
  .nav-item i{ margin: 0 !important; font-size: 1.2rem !important; }
  /* mostre ou esconda os rótulos como preferir */
  .nav-item span{ font-size: .75rem; display: none; } /* troque para inline se quiser texto */

  .nav-item.active{
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background: transparent !important;
  }

  /* conteúdo sem margem lateral e com respiro para a bottom bar */
  .main-content{
    margin-left: 0 !important;
    padding-bottom: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom) + 12px) !important;
  }
}

/* === FINAL PATCH: Sidebar -> Bottom bar quando viewport <= 1024px === */

/* 0) Se algum contêiner tiver min-width, zera no break mobile/tablet */
@media (max-width: 1024px){
  html, body, .dashboard-container, #app, main {
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
}

/* 1) Transformar a sidebar em bottom bar */
@media (max-width: 1024px){
  .sidebar{
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;

    width: 100% !important;
    height: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom)) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;

    background: rgba(15,23,42,0.70) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 200 !important;

    border-right: 0 !important;
    border-top: 1px solid var(--border-color) !important;

    transform: none !important;
  }

  /* sumir com header/footer da lateral */
  .sidebar-header,
  .sidebar-footer{ display: none !important; }

  /* menu horizontal */
  .nav-menu{
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .25rem !important;
    padding: 0 .5rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item{
    flex: 1 0 auto !important;
    margin: 0 !important;
    padding: .5rem .75rem !important;
    border-left: 0 !important;
    border-bottom: 3px solid transparent !important;
    justify-content: center !important;
    gap: .5rem !important;
    background: transparent !important;
  }
  .nav-item i{ margin: 0 !important; font-size: 1.2rem !important; }
  .nav-item span{ font-size: .75rem !important; display: none !important; } /* mude para inline se quiser texto */
  .nav-item.active{
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background: transparent !important;
  }

  /* conteúdo sem margem lateral + respiro para a barra inferior */
  .main-content{
    margin-left: 0 !important;
    padding-bottom: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom) + 12px) !important;
  }
}

@media (max-width: 1024px){
  body{ outline: 4px dashed magenta !important; } /* DEBUG: remova depois */
}

/* === DECOMMISSION: overlay + off-canvas antigo ==================== */

/* 1) Desligar o overlay sempre */
.mobile-overlay{
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* 2) Neutralizar qualquer transform herdado da sidebar "off-canvas" */
.sidebar{
  transform: none !important;
}

/* 3) Se algum script adicionar .mobile-open, não muda nada */
.sidebar.mobile-open{
  transform: none !important;
}

/* 4) Forçar a barra inferior quando <= 1024px (ajuste se quiser) */
@media (max-width: 1024px){
  .sidebar{
    position: fixed !important;
    inset: auto 0 0 0 !important;         /* bottom bar */
    width: 100% !important;
    height: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom)) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    border-right: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    background: rgba(15,23,42,0.70) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 200 !important;
  }

  /* nada de header/footer no mobile */
  .sidebar-header, .sidebar-footer{ display: none !important; }

  .nav-menu{
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: .25rem !important;
    padding: 0 .5rem !important;
  }
  .nav-item{
    flex: 1 0 auto !important;
    margin: 0 !important;
    padding: .5rem .75rem !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    justify-content: center !important;
    gap: .5rem !important;
    background: transparent !important;
  }
  .nav-item i{ margin: 0 !important; font-size: 1.2rem !important; }
  .nav-item span{ display: none !important; font-size: .75rem !important; } /* troque p/ inline se quiser texto */

  .main-content{
    margin-left: 0 !important;
    padding-bottom: calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom) + 12px) !important;
  }
}

/* === Trading Configuration Cards === */
.config-section {
  display: grid;
  gap: 1.5rem; /* espaço entre as caixas */
  margin-top: 1.5rem;
}

.config-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.config-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: .5rem;
}

.config-card .form-group {
  margin-bottom: 1rem;
}

/* Buy / Sell strategy grid */
.strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .strategy-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Cards específicos de Buy/Sell */
.strategy-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.strategy-col.buy-col {
  border-top: 3px solid var(--success-color);
}
.strategy-col.sell-col {
  border-top: 3px solid var(--danger-color);
}

/* === Trading Bot Control - Current Run cards === */
.current-run-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .current-run-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.run-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.run-card h3 {
  margin-top: 0;
  margin-bottom: .75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: .4rem;
}

/* Alignment fixes: center Duration, Trading Mode and Currently Trading content */
#run-duration-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#run-duration-card .run-value, #run-duration-card .run-sub { text-align: center; }

/* Positions card styles */
#run-positions-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}
#run-positions-card .positions-inner{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
#run-positions-card .mini-card{
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#run-positions-card .positions-pie-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 48px;
}
#run-positions-card .positions-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}
#run-positions-card .positions-label {
  font-size: .8rem;
  color: var(--text-muted);
}
#run-positions-card .positions-percent {
  font-weight: 600;
}
#run-positions-card .positions-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: .75rem;
  margin-top: .25rem;
}

/* Legend under Positions donut */
#run-positions-card .positions-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .35rem;
}
#run-positions-card .positions-legend .legend-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-muted);
  font-size: .75rem;
}
#run-positions-card .positions-legend .legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}
/* Matches the donut arc color (native XRP) */
#run-positions-card .positions-legend .legend-xrp {
  background: var(--primary-color);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
/* Matches the donut base color (tokens/positions) */
#run-positions-card .positions-legend .legend-pos {
  background: rgba(255,255,255,.1);
  border: 1px solid var(--border-color);
}

@media (min-width: 768px){
  #run-positions-card .positions-inner{ grid-template-columns: 1fr 1fr; }
}


/* Center the Currently Trading status card vertically and horizontally */
#currently-trading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Center the Trading Mode status card vertically and horizontally */
#trading-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Ensure status card key contents are centered */
.bot-status .status-card .mode-indicator,
.bot-status .status-card .token-display,
.bot-status .status-card small {
  align-self: center;
  text-align: center;
}

/* New P&L layout */
.pl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.pl-box {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: .6rem .75rem;
}

.pl-box .pl-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.pl-box .pl-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pl-box.pl-pct .pl-value {
  font-size: 1.6rem;
}

@media (max-width: 520px) {
  .pl-grid { grid-template-columns: 1fr; }
}

.run-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.run-sub {
  font-size: .9rem;
  color: var(--text-secondary);
}

/* Estado online/offline mais visível */
.run-status {
  display: inline-block;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
}
.run-status.online {
  background: rgba(16,185,129,.15);
  color: var(--success-color);
  border: 1px solid rgba(16,185,129,.35);
}
.run-status.offline {
  background: rgba(239,68,68,.15);
  color: var(--danger-color);
  border: 1px solid rgba(239,68,68,.35);
}

/* === Config form controls: unified dark styling for <select>, inputs === */
.config-card .form-group label{ color:var(--text-secondary); font-weight:600; }

/* === Config form controls: compact === */
.config-card select,
.config-card input[type="text"],
.config-card input[type="number"],
.config-card input[type="password"],
.config-card textarea{
  width:100%;
  height:32px;                              /* was 44px */
  padding:.38rem 1.6rem .38rem .7rem;       /* tighter */
  font-size:.85rem;                         /* smaller text */
  border-radius: var(--radius-md);          /* a bit squarer */
  border:1px solid var(--border-color);
  background: rgba(255,255,255,.05);
  color: var(--text-primary);
  line-height:1.2;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  outline: none;
}

/* smaller chevron for <select> */
.config-card select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-size:12px;                     /* was 16px */
  background-position:right .55rem center;
}

/* extra compact for .sm groups if you use them */
.form-group.sm select,
.form-group.sm input{
  height:28px;
  padding:.25rem 1.2rem .25rem .55rem;
  font-size:.8rem;
}

/* === COMPACT OVERRIDE (must be last) === */
.config-card .form-group select,
.config-card .form-group input[type="text"],
.config-card .form-group input[type="number"],
.config-card .form-group input[type="password"]{
  height:32px !important;
  padding:.38rem 1.6rem .38rem .7rem !important;
  font-size:.85rem !important;
  border-radius: var(--radius-md) !important;
}

.config-card select{ background-size:12px !important; background-position:right .55rem center !important; }
.form-group.sm select,.form-group.sm input{ height:28px !important; padding:.25rem 1.2rem .25rem .55rem !important; font-size:.8rem !important; }


/* hover/focus */
.config-card select:hover,
.config-card input:hover,
.config-card textarea:hover{
  background: rgba(255,255,255,.06);
}
.config-card select:focus,
.config-card input:focus,
.config-card textarea:focus{
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: rgba(255,255,255,.08);
}

/* Disabled state */
.config-card select:disabled,
.config-card input:disabled,
.config-card textarea:disabled{
  opacity:.7; cursor:not-allowed;
}

/* --- Pretty dropdown arrow for <select> --- */
.config-card select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position: right .8rem center;
  background-size: 16px;
}

/* Compact size helper if you use .sm on groups */
.form-group.sm select,
.form-group.sm input{ height:40px; padding:.6rem 2.2rem .6rem .8rem; }

/* --- Multiple select (if you use <select multiple>) --- */
.config-card select[multiple]{
  height:auto; min-height:132px; padding:.5rem; background-position: right .6rem .6rem; /* arrow irrelevant */
}
.config-card select[multiple] option{
  padding:.35rem .5rem; border-radius:.5rem;
}
.config-card select[multiple] option:checked{
  background: rgba(37,99,235,.25) linear-gradient(0, rgba(37,99,235,.25), rgba(37,99,235,.25));
  color:#fff;
}

/* === Bot Options grid (place Mode + Signal Mode on the next row) === */
.bot-options-grid{
  display:grid;
  grid-template-columns: repeat(12, minmax(0,1fr));
  gap: 14px 16px; /* row-gap / col-gap */
}

.bot-options-grid .fg{ grid-column: span 12; }
.bot-options-grid .fg.half{ grid-column: span 6; }

/* toggles column content stacks label + control */
.bot-options-grid .fg-toggle{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

/* Fix overflow: let the toggle fill its column, not use clamp() width */
.bot-options-grid .mode-toggle .mode-track{
  width:100% !important;            /* fill the grid column */
  max-width:none !important;         /* remove clamp upper bound */
  min-width:0 !important;            /* allow shrink */
}

/* Slightly tighter track on this grid so it never pokes out */
.bot-options-grid .mode-track .mode-left,
.bot-options-grid .mode-track .mode-right{
  font-size:.9rem;
}

@media (max-width: 900px){
  .bot-options-grid .fg.half{ grid-column: span 12; } /* stack on mobile/tablet */
}
/* Toast Notification
   Used by JS: showToast(message) in script.js (creates .toast element)
   Purpose: Transient alerts bottom-right */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(239,68,68,.95);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
/* Variants */
.toast.success { background: rgba(16,185,129,.95); }
.toast.info    { background: rgba(59,130,246,.95); }
.toast.error   { background: rgba(239,68,68,.95); }
/* Deposit modal copy button */
.copy-btn {
  background: var(--primary-color);   /* same blue as rest of the app */
  color: #aaaa;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.copy-btn:hover {
  background: var(--primary-hover, #1e40af); /* darker blue on hover */
  transform: scale(1.05);
}

.copy-btn i {
  color: #aaaa;
  font-size: 1rem;
}

/* Footer: equal width & alignment */
#withdraw-modal .modal-footer{
  display:flex;
  gap:.75rem;
  justify-content:flex-end;     /* buttons sit to the right as a row */
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

#withdraw-modal .modal-footer .btn-primary,
#withdraw-modal .modal-footer .btn-secondary{
  flex: 1;                       /* <- equal widths */
  height:48px;
  padding:0 1.25rem;
  border-radius: var(--radius-lg);
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .15s ease;
}

#withdraw-modal .modal-footer .btn-primary{
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color:#fff;
}

#withdraw-modal .modal-footer .btn-secondary{
  background: rgba(239,68,68,.12);
  color: var(--danger-color);
  border: 1px solid rgba(239,68,68,.35);
}

/* iOS-like slider */
#withdraw-modal .confirm-row{
  margin-top: .9rem;
}

#wd-confirm{
  --wd-progress: 0%;                /* updated via JS below */
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 56px;                     /* thick track */
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--primary-color), #8b5cf6) 0 / var(--wd-progress) 100% no-repeat,
    rgba(255,255,255,.10);          /* base track */
  border: 1px solid var(--border-color);
  outline: none;
  transition: box-shadow .2s ease;
}

#wd-confirm:focus{
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* WebKit thumb */
#wd-confirm::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 56px; height: 56px;        /* match track height for seamless look */
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  border: none;
  cursor: grab;
  margin-top: 0;                    /* centered without offset since sizes match */
}

/* Firefox thumb */
#wd-confirm::-moz-range-thumb{
  width: 56px; height: 56px;        /* match track height for seamless look */
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  border: none; cursor: grab;
}

/* Firefox track */
#wd-confirm::-moz-range-track{
  height: 56px;
  border-radius: 999px;
  background: rgba(255,255,255,.10); /* base track in Firefox */
  border: 1px solid var(--border-color);
}
/* Filled progress portion in Firefox */
#wd-confirm::-moz-range-progress{
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
  border: 1px solid var(--border-color);
}

/* “Sliding” shimmer overlay when dragging */
#wd-confirm.sliding{
  background:
    linear-gradient(90deg, var(--primary-color), #8b5cf6) 0 / var(--wd-progress) 100% no-repeat,
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,.08) 0 10px,
      rgba(255,255,255,.02) 10px 20px
    ),
    rgba(255,255,255,.10);
  animation: wdShimmer 1.1s linear infinite;
}
@keyframes wdShimmer{
  from{ background-position: 0 0, 0 0, 0 0; }
  to  { background-position: 0 0, 60px 0, 0 0; }
}
/* Withdraw footer: two equal columns, same height, perfectly aligned */
#withdraw-modal .modal-footer{
  display: grid !important;
  grid-template-columns: 1fr 1fr;   /* equal widths */
  gap: .9rem;
  align-items: stretch;             /* same height */
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* Make both buttons fill their grid cell identically */
#withdraw-modal .modal-footer .btn-primary,
#withdraw-modal .modal-footer .btn-secondary{
  width: 100% !important;
  height: 56px !important;
  padding: 0 !important;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-sizing: border-box;          /* include borders in size */
}

/* Visual styles (unchanged, but keep here to ensure they still apply) */
#withdraw-modal .modal-footer .btn-primary{
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color:#fff;
  border: 0;
}
#withdraw-modal .modal-footer .btn-secondary{
  background: rgba(239,68,68,.12);
  color: var(--danger-color);
  border: 1px solid rgba(239,68,68,.35);
}

/* Nuke any stray margins that might offset alignment */
#withdraw-modal .modal-footer > *{ margin: 0 !important; }
/* Full-screen blocker */
.screen-lock{
  position:fixed; inset:0;
  background: rgba(2,6,23,.65);               /* dark blur veil */
  backdrop-filter: blur(6px);
  display:flex; align-items:center; justify-content:center;
  z-index: 12000; /* above wo-modal (10050) */
}
.screen-lock.hidden{ display:none !important; }
body.locked{ overflow:hidden; }

/* Card inside the overlay */
.lock-card{
  min-width: 280px; padding: 18px 20px;
  border-radius: 16px;
  background: var(--bg-card, rgba(30,41,59,.85));
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  color: var(--text-primary, #e2e8f0);
  display:flex; align-items:center; gap:12px;
  box-shadow: var(--shadow-xl, 0 20px 40px rgba(0,0,0,.35));
  font-weight:700;
}

/* Spinner
   Used in: index.html (multiple .spinner loading indicators), Wallet History placeholders
*/
.spinner{
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: var(--primary-color, #2563eb);
  animation: spin 0.8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Wallet History chart placeholder: center overlay and larger spinner */
#wh-chart{ position: relative; }
#wh-chart-placeholder{
  position: absolute; inset: 0;
  display: flex;
  align-items: center; justify-content: center;
  padding: 0; margin: 0;
}
#wh-chart-placeholder .spinner{
  width: 32px; height: 32px; border-width: 3px;
}
#wh-chart-placeholder .muted, #wh-chart-placeholder span{ font-size: .95rem; }

/* Wallet History table loading: center row */
#wh-table-loading > div{ display:flex; align-items:center; justify-content:center; }
#wh-table-loading .spinner{ width: 24px; height: 24px; border-width: 3px; }

/* Wallet History full-card overlay */
.wh-overlay{
  position:absolute; inset:0;
  display:none; align-items:center; justify-content:center;
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(2px);
  z-index: 10;
}
.wh-overlay.show{ display:flex; }
.wh-overlay-inner{ display:flex; align-items:center; gap:.75rem; padding:.85rem 1rem; border-radius: 12px; background: rgba(15,23,42,.85); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 25px rgba(0,0,0,.35); }
.wh-overlay-inner .spinner{ width:28px; height:28px; border-width:3px; }
.wh-overlay-text{ color: var(--text-primary, #e2e8f0); font-weight:600; }

.lock-text{ font-size: .95rem; }

/* ===== Form Elements & Buttons (Generic) ===== */

/* Base styles for all select and text/number inputs */
select,
input[type="text"],
input[type="number"],
textarea { /* Include textarea for future proofing if needed */
  width: 100%;
  height: 48px; /* Standard height for inputs */
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.2;
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none; /* Reset for selects */
  -moz-appearance: none;
  appearance: none;
}

select:hover,
input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .2);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
  background: rgba(255, 255, 255, .1);
}

/* Specific styling for selects to add a chevron */
select {
  padding-right: 2.8rem; /* Make space for the chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}

/* Input group with a button (e.g., Amount + Max button) */
.input-group-with-button {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.input-group-with-button > select,
.input-group-with-button > input {
  flex-grow: 1; /* Allows input/select to take available space */
}

/* Generic Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0; /* Prevent buttons from shrinking in flex/grid */
  text-decoration: none; /* In case it's an <a> tag */
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  box-shadow: 0 10px 20px rgba(37, 99, 235, .3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  box-shadow: 0 10px 20px rgba(37, 99, 235, .3);
}


/* Secondary Button (for Cancel/Max, etc.) */
.btn-secondary {
  background: rgba(255, 255, 255, .1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .2);
  color: var(--text-primary); /* Darken text on hover */
}

/* Pill-shaped buttons (like MAX) */
.btn-pill-secondary {
  height: 38px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 700;
}
.btn-pill-secondary:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, .15);
  transform: translateY(-1px);
}

/* Modal Footer Layout (generic for any modal footer) */
.modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two equal-width columns */
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* Responsive adjustment for footer buttons */
@media (min-width: 640px) {
  .modal-footer {
    justify-content: center; /* Center the buttons at wider sizes */
    grid-template-columns: repeat(2, minmax(0, 180px)); /* Fixed max width for buttons */
  }
}

/* ===== End Generic Styles ===== */

/* ===== Swap Modal (Specific) ===== */

/* Base backdrop for the modal */
#swap-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease-out, visibility .3s ease-out;
}

/* Open state: make it visible */
#swap-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Content Card (reusing .modal-content general style) */
#swap-modal .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform .3s ease-out, opacity .3s ease-out;
}

#swap-modal.open .modal-content {
  transform: translateY(0);
  opacity: 1;
}

/* Header */
#swap-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
#swap-modal .modal-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}
#swap-modal .modal-title i {
  color: var(--primary-color);
  font-size: 1.3rem;
}
#swap-modal .modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 .2rem;
  transition: color var(--transition-fast);
}
#swap-modal .modal-close:hover {
  color: var(--text-primary);
}

/* Body */
#swap-modal .modal-body {
  padding: 1.5rem 1.25rem;
}

/* Form Row Layout */
#swap-modal .form-row {
  margin-bottom: 1.25rem;
}
#swap-modal .form-row:last-of-type {
  margin-bottom: 0;
}

#swap-modal .form-label {
  display: block;
  margin-bottom: .6rem;
  color: var(--text-secondary);
  font-size: .95rem;
  font-weight: 500;
}

/* Balance line */
#swap-modal .balance-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: .4rem;
  color: var(--text-secondary);
  font-size: .88rem;
}

/* Arrow separator between From/To */
#swap-modal .swap-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}
#swap-modal .swap-dot {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border-color);
}
#swap-modal .swap-dot i {
  color: var(--text-primary);
  font-size: 1.1rem;
}

/* Quote box */
#swap-modal .quote-box {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .03);
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.6;
}
#swap-modal .quote-box strong {
  color: var(--text-primary);
}
#swap-modal .quote-box .route-details {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ===== End Swap Modal (Specific) ===== */


/* Pill-shaped buttons (like MAX) */
.btn-pill {
  height: 38px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1); /* Secondary style */
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 700;
}
.btn-pill:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, .15);
  transform: translateY(-1px);
}
/* ===== MODAL SYSTEM (Unified) =====
   Used in: index.html (#swap-modal, #withdraw-modal) with class="modal-backdrop" and .open state
   Notes: Prefer this over legacy .modal below
*/

/* 1. Backdrop (The full-screen dark layer) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2. Content Card (The main modal window) */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity .3s ease, transform .3s ease;
}

.modal-backdrop.open .modal-content {
  opacity: 1;
  transform: scale(1);
}

/* 3. Header, Body, and Footer Structure */
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 1.5rem 1.25rem;
}
.modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* 4. Form Elements inside ANY modal */
.modal-content .form-row {
  margin-bottom: 1.25rem;
}
.modal-content .form-label {
  display: block;
  margin-bottom: .6rem;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
}
.modal-content select,
.modal-content input[type="text"],
.modal-content input[type="number"] {
  width: 100%;
  height: 48px;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.modal-content select {
  padding-right: 2.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}
.modal-content select:focus,
.modal-content input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
  background: rgba(255, 255, 255, .1);
}

/* 5. Specifics for Swap Modal */
#swap-modal .balance-line {
  margin-top: .5rem;
  color: var(--text-secondary);
  font-size: .88rem;
}
#swap-modal .swap-sep {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}
#swap-modal .swap-dot {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border-color);
}

/* 7. Reusable Pill Style */
.pill {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  margin-right: .375rem;
}
/* Colored variants for direction chips */
.pill.green {
  background: rgba(16,185,129,0.18);
  color: #10b981;
  border-color: rgba(16,185,129,0.35);
}
.pill.red {
  background: rgba(239,68,68,0.18);
  color: #ef4444;
  border-color: rgba(239,68,68,0.35);
}
.pill.purple {
  background: rgba(139,92,246,0.18);
  color: #a78bfa;
  border-color: rgba(139,92,246,0.35);
}

/* Swap summary text under amount: keep font consistent, slightly smaller */
.swap-summary {
  font-size: 0.85em;
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.25;
  margin-top: 2px;
}

.modal-head .modal-close{
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.modal-footer .modal-close.btn-danger{
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color:#dc2626;
  border:0;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.modal-footer .modal-close.btn-danger:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(239,68,68,.3);
}
.modal-footer .modal-close.btn-danger:active{
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--card-bg, #0b1020);
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  width: min(520px, 92vw);
  max-width: 520px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  margin: 0;
}
.modal-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary, #cbd5e1);
  font-size: 1.25rem;
}

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  margin: 10px 0;
}

.addr-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.addr-row code {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  border-radius: 10px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copy-btn,
.share-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255,255,255,.15));
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.muted-note {
  color: var(--text-muted, #94a3b8);
  font-size: .8rem;
  margin-top: 8px;
}

/* ========= Liquidation Modal (arruma footer e botões) ========= */
.liq-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:3000}
.liq-modal.is-open{display:flex}
.liq-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6)}
.liq-card{
  position:relative;
  background:var(--bg-card, #0b1020);
  color:var(--text-primary,#e5e7eb);
  width:min(520px,94vw);
  border:1px solid var(--border-color,rgba(255,255,255,.12));
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
  padding:16px;
}
.liq-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.liq-title{font-weight:700;margin:0}
.liq-close{background:transparent;border:0;color:var(--text-muted);font-size:1.1rem;cursor:pointer;line-height:1}
.liq-body{margin-top:4px}

/* Footer: dois botões iguais, e neutraliza o width/margin globais do .btn-primary */
.liq-footer{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.9rem;
  margin-top:12px;
}
.liq-footer .btn{
  width:100% !important;          /* ambos ocupam sua coluna */
  height:48px;
  border-radius:12px;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:0 !important;         /* anula o margin-top global */
}
.liq-footer .btn-primary{
  background: linear-gradient(135deg, var(--primary-color,#2563eb), #8b5cf6);
  color:#fff;
  border:0;
}
.liq-footer .btn-secondary{
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.liq-footer .btn:hover{ transform: translateY(-2px); transition: transform .15s ease; }

/* (opcional) versão danger para Cancel, se quiser vermelho */
.liq-footer .btn-danger{
  background: linear-gradient(135deg, var(--danger-color,#ef4444), #dc2626);
  color:#dc2626;
  border:0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;      /* tweak to your taste (32–48px works well) */
  height: 32px;
  border-radius: 8px; /* optional, remove if you don’t want rounded corners */
  object-fit: cover;
}

/* Use the SAME purple as your title.
   If your title already uses --primary (or another var),
   point --brand to it so both match perfectly. */
:root{
  --brand: var(--primary, #8b5cf6); /* fallback if --primary isn't defined */
}

.sidebar-header{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:.5rem;
  padding:0.75rem 0.5rem;
}

/* Perfect circle + crop + subtle glow */
.logo-wrap{
  width:78px;             /* adjust size */
  height:78px;
  border-radius:50%;      /* 100% round */
  overflow:hidden;        /* crop corners */
  position:relative;
  display:grid;
  place-items:center;
}

/* Zoom to hide black outer corners; keep centered */
.logo-wrap .app-logo{
  width:102%;
  height:102%;
  object-fit:cover;
  object-position:center 100%; /* nudge if the subject is high/low */
  transform:scale(1.0);       /* extra zoom if needed */
  filter:grayscale(1) contrast(1.05) brightness(0.95);
}

/* Exact brand tint: overlay the brand color so hue matches the heading */
.logo-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  background: var(--brand);
  mix-blend-mode:multiply; /* consistent colorization */
  opacity:.55;             /* strength of tint */
  pointer-events:none;
}

/* Optional soft brand glow */
.logo-wrap::before{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius:50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%);
  filter:blur(10px);
  pointer-events:none;
}

/* Title uses the same color */
.sidebar-header h2{
  margin:0;
  color: var(--brand);
  font-weight:800;
}

.app-version{
  color: var(--text-muted);
  font-size:.75rem;
}

/* Signals card layout */
.signals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.signals-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 6px 0;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.signals-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 28px; /* keeps box height when empty */
}

.signal-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  background: rgba(255,255,255,.04);
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

/* Optional accents */
.signal-chip.buy  { border-color: rgba(0, 200, 120, .35); background: rgba(0, 200, 120, .10); }
.signal-chip.sell { border-color: rgba(255, 80,  80,  .35); background: rgba(255, 80,  80,  .10); }

/* muted placeholder text */
.muted { color: var(--text-muted); }

/* Generic panel/card (matches run-log vibe) */
.panel{
  background: var(--card-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--card-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.panel-header{
  display:flex;
  align-items:baseline;
  gap:.5rem;
  margin-bottom:12px;
}

.panel-header h3{
  margin:0;
  font-size:1.05rem;
  color: var(--text-strong, #e8ecf1);
}

/* --- Signals as simple lists (override old pill styles) --- */
#signals-panel .signal-column{
  background: transparent;
  border: 0;
  padding: 0;
}

/* container becomes a block with its own UL */
#signals-panel .signals-list{
  display: block !important;   /* override previous flex */
  padding: 0;
  margin: 0;
}

#signals-panel .signals-list.empty{
  color: var(--text-muted, #8fa0b3);
  font-size: .9rem;
  padding: 6px 2px;
}

/* actual list */
#signals-panel .signals-ul{
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--card-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3, rgba(255,255,255,0.02));
}

/* each row */
#signals-panel .signal-item{
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.06));
}
#signals-panel .signal-item:last-child{ border-bottom: none; }

/* dot + text */
#signals-panel .signal-item .sig-dot{
  width: 8px; height: 8px; border-radius: 50%;
}
#signals-panel .signal-item.buy  .sig-dot{ background: var(--success-color, #3ddc97); }
#signals-panel .signal-item.sell .sig-dot{ background: var(--danger-color,  #ff5d6c); }

#signals-panel .sig-name{
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  font-size: .95rem;
}

#signals-panel .sig-time{
  color: var(--text-muted, #8fa0b3);
  font-size: .82rem;
  white-space: nowrap;
}

/* keep panel + log heights nice */
#signals-panel, #current-run-log{ height: 220px; }
#signals-panel{ display:flex; flex-direction:column; overflow-y:auto; overflow-x:hidden; }
#signals-panel .signals-grid{ flex:1 1 auto; min-height:0; overflow:auto; }


/* Stack Signals over Trade Log and let it span full width even inside grids */
.run-stack{
  grid-column: 1 / -1;     /* if parent is a 2-col grid, this makes it full width */
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;               /* spacing between the two blocks */
}

.auth-socials{
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-socials .social-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--text-primary, #e5e7eb);
  text-decoration: none;
  font-weight: 600;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.auth-socials .social-link:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.20);
  transform: translateY(-1px);
}

.auth-socials .social-link i{
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 480px){
  .auth-socials{ gap: 8px; }
  .auth-socials .social-link{ padding: 8px 10px; font-size: .95rem; }
}

/* Prefer Telegram’s numbers; fall back to dynamic viewport if opened in a browser */
:root {
  --app-height: var(--tg-svh, 100dvh);
}

/* Ensure the document can grow */
html, body {
  height: var(--app-height);
  min-height: var(--app-height);
  margin: 0;
}

/* Make your main containers use the full height */
#dashboard-container,
#auth-container,
#wallet-setup-container,
.content-root,
body > .app,  /* whatever your top wrapper is named */
.main-wrap {
  min-height: var(--app-height);
}

/* iOS safe areas (optional, nicer look) */
body {
  padding-bottom: var(--tg-safe-area-bottom, env(safe-area-inset-bottom));
  padding-top:    var(--tg-safe-area-top,    env(safe-area-inset-top));
  padding-left:   var(--tg-safe-area-left,  0px);
  padding-right:  var(--tg-safe-area-right, 0px);
}

/* =====================
   Mobile fixes for FEES/PRICE/LAST CANDLE and address overflow
   ===================== */
@media (max-width: 600px){
  /* Make FEES, PRICE, LAST CANDLE chips more compact */
  .run-label{ font-size:.8rem; }
  .run-chip{ font-size:.85rem; padding:.25rem .5rem; }
}
@media (max-width: 480px){
  /* Allow rows to wrap so chips don’t push off-screen */
  .run-status-row{ flex-wrap: wrap; gap:6px; }
  .run-status-row .run-label{ flex:0 0 auto; }
  .run-status-row .run-chip{ flex:1 1 auto; min-width:0; }
  /* Slightly smaller still on very small screens */
  .run-label{ font-size:.75rem; }
  .run-chip{ font-size:.8rem; padding:.2rem .45rem; }
}
/* Truncate long wallet addresses while keeping copy button visible */
.wo-address-row span{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* Deposit modal address row truncation (both legacy and new) */
.addr-box .addr-line .mono,
.addr-box .addr-line span,
#deposit-address{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Generated address input (creation) – show ellipsis instead of overflow */
#generated-address{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* --- Token Contract custom suggestions dropdown (restored) --- */
.token-suggest-panel{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 8px);
  display: none;
  background: var(--bg-card, rgba(30,41,59,.95));
  border: 1px solid var(--border-color, rgba(255,255,255,.12));
  border-radius: 12px;
  box-shadow: var(--shadow-xl, 0 20px 40px rgba(0,0,0,.35));
  z-index: 5000;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.token-suggest-list{ max-height: 260px; overflow-y: auto; }
.token-suggest-item{
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  color: var(--text-primary, #e2e8f0);
  background: transparent;
}
.token-suggest-item:hover{ background: rgba(255,255,255,.06); }
.token-suggest-item.required{ background: linear-gradient(90deg, rgba(37,99,235,.15), transparent); border-left: 3px solid var(--primary-color, #2563eb); }
.token-suggest-empty{ padding: 12px; color: var(--text-muted, #94a3b8); text-align: center; }
.tsi-name{ font-weight: 700; font-size: .95rem; display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.tsi-badge{ display:inline-block; padding:1px 6px; border-radius:999px; background:rgba(37,99,235,.25); color:#bfdbfe; font-weight:700; font-size:.7rem; border:1px solid rgba(37,99,235,.35); }
.tsi-sub{ font-size: .8rem; color: var(--text-muted, #94a3b8); word-break: break-all; }

/* --- Token Contract toggle arrow to match select arrows (restored) --- */
#config-token-toggle.token-toggle-btn{
  background: transparent; border: none; outline: none; padding: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px; opacity: .9;
}
#config-token-toggle.token-toggle-btn:hover{ opacity: 1; }
#config-token-toggle.token-toggle-btn:focus{ box-shadow: 0 0 0 3px rgba(37,99,235,.15); border-radius: 10px; }

/* Ensure Stop Loss and Take Profit type selects align like other selects (restored) */
#sl-type, #tp-type{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat:no-repeat !important; background-position: right .55rem center !important; background-size: 12px !important;
}

/* Align Position Sizing and Timeframe selects with Token Contract dropdown style (restored) */
#config-size-type, #config-timeframe{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e1' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5.5a.5.5 0 0 1 .592-.805l.07.057L8 8.293l4.134-3.54a.5.5 0 0 1 .765.638l-.052.063-4.5 3.85a.5.5 0 0 1-.622 0l-4.5-3.85a.5.5 0 0 1-.121-.164z'/%3E%3C/svg%3E");
  background-repeat:no-repeat !important; background-position: right .55rem center !important; background-size: 12px !important;
}


/* Compact variant for Trading Mode status card */
.status-card.compact{ padding:0.75rem 1rem; }
.status-card.compact h3{ margin-bottom:.5rem; }
.status-card.compact .mode-indicator{ font-size:1rem; }

.aiassist-summary{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}
.aiassist-summary .chip{display:inline-flex;align-items:center;gap:.4rem;background:rgba(255,255,255,.06);border:1px solid var(--border-color);padding:.35rem .6rem;border-radius:999px;color:var(--text-primary);font-weight:600}
.aiassist-summary .chip.info{background:linear-gradient(135deg,#0ea5e9,#2563eb);border-color:rgba(255,255,255,.15)}
.aiassist-grid{display:grid;grid-template-columns:1fr;gap:1rem;margin:.25rem 0 1rem}
@media(min-width:900px){.aiassist-grid{grid-template-columns:1fr 1fr}}
.aiassist-subtitle{font-size:.95rem;color:var(--text-secondary);margin-bottom:.5rem}
.aiassist-list{list-style:none;padding-left:0;margin:0}
.aiassist-list li{padding:.4rem .6rem;border:1px solid var(--border-color);border-radius:var(--radius-md);background:rgba(255,255,255,.04);margin-bottom:.4rem;display:flex;align-items:center;gap:.5rem}
.aiassist-list li .dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--success-color)}
.aiassist-protections{border:1px solid var(--border-color);border-radius:var(--radius-md);padding:.6rem;background:rgba(255,255,255,.04);font-size:.9rem}
.aiassist-notes{margin-top:.5rem}
.aiassist-pre{margin-top:.25rem;background:rgba(0,0,0,.35);border:1px solid var(--border-color);padding:.75rem;border-radius:var(--radius-md);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto}
.aiassist-loading .spinner{width:18px;height:18px;border:3px solid rgba(255,255,255,.15);border-top-color:#fff;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}


/* ===== AI Assist Modal: footer buttons alignment fix ===== */
#ai-assist-modal .modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center; /* vertically align buttons */
  /* Do not allow the footer to shrink when content scrolls */
  flex: 0 0 auto;
}
#ai-assist-modal .modal-footer > * {
  margin: 0; /* remove any stray margins that could misalign */
}
#ai-assist-modal .modal-footer .btn {
  width: 100%; /* make both buttons equal width in their grid cells */
  height: 52px; /* ensure consistent height */
}

/* ===== New: AI One‑Shot Settings Modal (namespaced: .aios-*) ===== */
.aios-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.72);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;z-index:2600;padding:1rem}
.aios-backdrop.open{display:flex}
.aios-card{background:var(--bg-card);border:1px solid var(--border-color);border-radius:var(--radius-xl);width:min(560px,94vw);max-height:calc(100vh - 2rem);box-shadow:var(--shadow-xl);display:flex;flex-direction:column;overflow:hidden}
.aios-head{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;border-bottom:1px solid var(--border-color)}
.aios-title{margin:0;font-weight:700;font-size:1.1rem}
.aios-close{background:transparent;border:0;color:var(--text-muted);font-size:1.4rem;cursor:pointer;line-height:1}
.aios-body{padding:1rem 1.25rem;overflow:auto}
.aios-foot{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:1rem 1.25rem;border-top:1px solid var(--border-color)}
.aios-foot .btn{width:100%;height:52px;margin:0;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;font-weight:700}

/* Switch/toggle styling */
.aios-switch{display:flex;align-items:center;gap:.75rem}
.aios-switch input{position:absolute;opacity:0;width:0;height:0}
.aios-toggle{width:48px;height:28px;background:rgba(255,255,255,.12);border:1px solid var(--border-color);border-radius:999px;position:relative;transition:all .2s ease;box-shadow:inset 0 1px 2px rgba(0,0,0,.25)}
.aios-toggle::after{content:"";position:absolute;top:2px;left:2px;width:24px;height:24px;background:#fff;border-radius:50%;transition:transform .2s ease}
.aios-switch input:checked + .aios-toggle{background:linear-gradient(135deg, var(--primary-color), #8b5cf6);border-color:transparent}
.aios-switch input:checked + .aios-toggle::after{transform:translateX(20px)}
.aios-label{font-weight:600;color:var(--text-primary)}
.aios-switch.disabled .aios-label{color:var(--text-muted);opacity:.6}

/* Fields layout */
.aios-field{margin-bottom:1rem}
.aios-muted{color:var(--text-secondary);font-size:.9rem}
.aios-row{display:grid;grid-template-columns:auto 1fr;gap:.75rem;align-items:center}

/* small inline controls */
.aios-inline{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}

/* Date/time input styling */
.aios-input{height:42px;padding:.5rem .75rem;border-radius:12px;border:1px solid var(--border-color);background:rgba(255,255,255,.06);color:var(--text-primary)}
.aios-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 3px rgba(37,99,235,.2)}

/* appended by AI: AI Assist modal BUY/SELL lists styling */
#ai-assist-modal .aiassist-subheading{font-size:.8rem;font-weight:700;color:var(--text-secondary);margin-bottom:.35rem;letter-spacing:.03em}
#ai-assist-modal .aiassist-strat-columns{display:grid;grid-template-columns:1fr;gap:.75rem}
@media(min-width:700px){#ai-assist-modal .aiassist-strat-columns{grid-template-columns:1fr 1fr}}

/* --- Mobile scroll fixes for AI Assist modal --- */
#ai-assist-modal{
  /* Use Telegram stable viewport height if available */
  height: var(--tg-svh, 100vh);
  /* Allow the backdrop itself to scroll when content is taller than the viewport */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* On small screens, anchor to top so the header is visible and body can scroll */
  align-items: flex-start;
  /* Reduce vertical padding on tiny screens to reclaim space */
  padding-top: .75rem;
  padding-bottom: .75rem;
}
#ai-assist-modal .modal-content{
  /* Constrain modal height to viewport and allow internal scroll */
  max-height: calc(var(--tg-svh, 100vh) - 1.5rem);
  display: flex;
  flex-direction: column;
}
#ai-assist-modal .modal-body{
  /* Make the main body area scrollable */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
}
#ai-assist-modal{ overscroll-behavior: contain; }

/* ===== Wallet History Pro Table (shaded, bordered) ===== */
.table.pro{ border-collapse:separate; border-spacing:0; width:100%; border:1px solid var(--border-color, rgba(255,255,255,.12)); border-radius:12px; overflow:hidden; background: rgba(255,255,255,.03); }
.table.pro thead th{ text-align:left; padding:.6rem .75rem; font-size:.9rem; font-weight:700; color: var(--text-secondary, #cbd5e1); background: rgba(255,255,255,.06); border-bottom:1px solid var(--border-color, rgba(255,255,255,.12)); }
.table.pro tbody td{ padding:.6rem .75rem; border-top:1px solid rgba(255,255,255,.08); color: var(--text-primary, #e2e8f0); font-size:.95rem; }
.table.pro tbody tr:hover{ background: rgba(255,255,255,.05); }

/* Wallet History row states */
.wh-row{ cursor: pointer; transition: background .15s ease, transform .04s ease; }
.wh-row.is-pos{ background: rgba(16,185,129,.08); }
.wh-row.is-pos:hover{ background: rgba(16,185,129,.14); }
.wh-row.is-neg{ background: rgba(239,68,68,.08); }
.wh-row.is-neg:hover{ background: rgba(239,68,68,.14); }
.wh-row.is-trust{ background: rgba(168,85,247,.10); }
.wh-row.is-trust:hover{ background: rgba(168,85,247,.16); }

/* Accent left border for quick visual cue */
.wh-row.is-pos td:first-child{ border-left:3px solid var(--success-color, #10b981); }
.wh-row.is-neg td:first-child{ border-left:3px solid var(--danger-color, #ef4444); }
.wh-row.is-trust td:first-child{ border-left:3px solid #a855f7; }

/* Emphasize delta cell color */
/* Delta is 5th column in the simplified table */
.wh-row.is-pos td:nth-child(5){ color: var(--success-color, #10b981); font-weight:600; }
.wh-row.is-neg td:nth-child(5){ color: var(--danger-color, #ef4444); font-weight:600; }
.wh-row.is-trust td:nth-child(2){ color: #c084fc; font-weight:600; }

/* ===== Chips (timeframe) ===== */
.chip-group{ display:flex; gap:.4rem; flex-wrap:wrap; }
.chip{
  padding:.35rem .65rem; border-radius: 999px; border:1px solid var(--border-color, rgba(255,255,255,.18));
  background: rgba(255,255,255,.05); color: var(--text-primary, #e2e8f0);
  font-size:.85rem; cursor:pointer; transition: all .15s ease;
}
.chip:hover{ background: rgba(255,255,255,.08); }
.chip.active{ background: rgba(37,99,235,.15); border-color: rgba(37,99,235,.45); color: #bfdbfe; }

/* Pager buttons */
.wh-pager .btn[disabled], .btn[disabled]{ opacity:.55; cursor:not-allowed; }

/* Access requirements banner */
:root { --notice-offset: 56px; }
body.with-access-banner { padding-top: var(--notice-offset); }
.access-banner{position:fixed;top:0;left:0;right:0;z-index:9999;background:linear-gradient(90deg,#5b21b6,#7c3aed);color:#fff;display:flex;flex-direction:column;gap:0;border-bottom:1px solid rgba(255,255,255,0.2);font-family:inherit;font-size:.9rem}
.access-banner-inner{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.5rem .75rem;position:relative}
.access-banner-main{text-align:center}
.access-banner-title{font-weight:700;letter-spacing:.04em}
.access-banner-summary{opacity:.95}
.access-banner-actions{position:absolute;top:8px;right:8px;display:flex;gap:.5rem;align-items:center}
.btn-link{background:transparent;border:none;color:#fff;text-decoration:underline;cursor:pointer}
.btn-dismiss{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.35);color:#fff;border-radius:6px;padding:2px 8px;cursor:pointer}
.access-banner-details{background:rgba(0,0,0,.18);border-top:1px solid rgba(255,255,255,.25);padding:.5rem .75rem .75rem}
.details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}
.details-grid .detail-name{font-weight:600}
.details-grid .detail-item.subtle{grid-column:1 / -1;opacity:.85;font-size:.85em}
@media (max-width:640px){:root{--notice-offset:68px}.access-banner-inner{flex-direction:column;align-items:center;gap:.25rem}}

/* Spacing adjustment: add a bit of space above the GeckoTerminal card */
#gecko-embed-card{ margin-top: 1rem; }

/* Adjust fixed badges to account for banner */
#ai-badge{ top: calc(var(--notice-offset) + 10px) !important; }


/* Mobile layout: special handling for FEES row with two chips */
@media (max-width: 480px){
  .run-status-row.has-two-chips{ flex-wrap: wrap; align-items: flex-start; }
  .run-status-row.has-two-chips .run-label{ flex: 0 0 100%; }
  .run-status-row.has-two-chips .run-chip{
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 8px);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* ===== Bot logo purple tint (applies wherever bot.png is used) ===== */
:root{ --bot-purple-filter: sepia(25%) saturate(260%) hue-rotate(255deg) brightness(.96) contrast(1.05); }
img[src$="bot.png"]{ filter: var(--bot-purple-filter); }


/* === Vertical layout for FEES chips: stack Network and Pool on separate lines === */
.run-status-row .fees-lines{ display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.run-status-row .fees-lines .run-chip{ flex:0 0 auto; max-width:100%; }

/* === Bollinger zone pill === */
.bb-pill{
  display:inline-block;
  padding: 2px 8px;
  border-radius:999px;
  font-size:.8rem;
  font-weight:700;
  margin: 0 6px 0 8px; /* align with other pills that have left margin */
  border:1px solid var(--border-color, rgba(255,255,255,.18));
  background: rgba(255,255,255,.06);
}
/* Color variants */
.bb-pill.zone-upper{ color: var(--success-color, #10b981); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.bb-pill.zone-mid{ color: var(--warning-color, #f59e0b); background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); }
.bb-pill.zone-lower{ color: var(--success-color, #10b981); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }

/* Smaller meta text for Bollinger details */
.bb-meta{
  font-size: .78rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}


/* Swap Modal: ensure Cancel is red */
#swap-modal .modal-footer .modal-close{
  background: linear-gradient(135deg, var(--danger-color, #ef4444), #dc2626);
  color: #fff;
  border: 0;
}
#swap-modal .modal-footer .modal-close:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(239,68,68,.3);
}
#swap-modal .modal-footer .modal-close:active{
  transform: translateY(0);
}

/* Withdraw Modal: ensure Cancel is red */
#withdraw-modal .modal-footer .modal-close{
  background: linear-gradient(135deg, var(--danger-color, #ef4444), #dc2626);
  color: #fff;
  border: 0;
}
#withdraw-modal .modal-footer .modal-close:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(239,68,68,.3);
}
#withdraw-modal .modal-footer .modal-close:active{
  transform: translateY(0);
}

/* Swap & Withdraw Modal: align footer buttons and unify shape */
#swap-modal .modal-footer .btn,
#withdraw-modal .modal-footer .btn{
  width: 100%;
  height: 52px; /* consistent height */
  margin: 0; /* remove stray margins */
  border-radius: 12px; /* same rounded shape */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem; /* ensure same font size */
  font-family: inherit; /* ensure same font family */
  line-height: 1.1; /* consistent text box height */
}


/* Xaman login button full-bleed logo styling */

/* Swap tabs */
.swap-tabs{display:flex;gap:8px;margin:0 0 12px 0}
.swap-tab{flex:0 0 auto;padding:.5rem .85rem;border:1px solid var(--border-color);border-radius:999px;background:rgba(255,255,255,.06);color:var(--text-secondary);font-weight:700;cursor:pointer}
.swap-tab.active{background:var(--primary-color);color:#fff;border-color:transparent}
.swap-row{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:10px}
.swap-asset{display:flex;align-items:center;gap:8px}
.swap-asset .asset-img{width:24px;height:24px;border-radius:8px;border:1px solid var(--border-color);object-fit:cover;background:#222}
.xaman-btn{
  position: relative;
  width: 100%;
  height: 52px;
  padding: 0; /* logo fills, no inner padding */
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  /* subtle outer shade around the button */
  box-shadow: 0 6px 18px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.35) inset;
}
.xaman-btn:hover{
  border-color: var(--primary-color);
  background: rgba(255,255,255,0.05);
}
.xaman-btn .xaman-logo{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit: contain; /* keep SVG aspect ratio */
  /* Apply same purple gradient as Sign In button behind the transparent SVG */
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  /* ensure the SVG itself is not color-shifted; we only tint the background */
  filter: none;
  pointer-events: none; /* ensure clicks reach the button */
  border-radius: inherit; /* rounded corners on image */
}
/* Keep text for a11y but hide visually (screen readers will announce) */
.xaman-btn .xaman-btn-text{
  position:absolute; left:0; top:0; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}


/* === AI Assist Setup alignment fixes ===
   Ensures the two primary options (One Shot vs Continuous) are aligned and balanced */
.aiassist-setup-grid{ display:grid; grid-template-columns:1fr; gap:12px; align-items:stretch; }
@media(min-width:700px){ .aiassist-setup-grid{ grid-template-columns:1fr 1fr; } }
.aiassist-choice{ display:flex; flex-direction:column; justify-content:flex-start; gap:.25rem; height:100%; }
.aiassist-choice .btn{ width:100%; }
.aiassist-choice small{ min-height:2.6em; display:block; }

/* Continuous panel: compact and aligned */
.aiassist-continuous{ margin-top:.5rem; }
.aiassist-continuous-grid{ display:grid; grid-template-columns:1fr; gap:8px; align-items:center; }
.aiassist-field label{ display:block; margin-bottom:.25rem; }
.aiassist-inline{ display:inline-flex; align-items:center; gap:.5rem; }
.aiassist-number{ width:3ch; min-width:3ch; text-align:center; padding:.5rem; height:48px; }

/* Equal-width action buttons for Continuous panel */
.aiassist-actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-top:.75rem; }
.aiassist-actions .btn{ width:100%; margin-top:0; height:52px; margin:0; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:1rem; line-height:1.1; }

/* Equal-width footer buttons on result step */
#ai-assist-footer{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
#ai-assist-footer .btn{ width:100%; }


/* Compound primary-danger button: keeps primary layout but with red hues */
.btn-primary.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: #fff;
}
.btn-primary.btn-danger:hover {
  /* Ensure red glow overrides later .btn-primary hover shadow */
  box-shadow: 0 10px 25px rgba(239, 68, 68, .35);
}

/* Responsive DexScreener wrapper */
.dexscreener-embed {
  position: relative;
  width: 100%;
  padding-bottom: 125%; /* Taller on mobile for full tools */
  border-radius: 12px;
  overflow: hidden; /* keep rounded corners */
}
@media (min-width: 1400px) {
  .dexscreener-embed { padding-bottom: 65%; }
}
.dexscreener-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* Mobile cap for DexScreener panel (Option 3) */
@media (max-width: 768px) {
  /* Prevent the chart from overtaking the screen and pushing cards below */
  #dexscreener-panel {
    max-height: 60vh;
    overflow: hidden;
  }
  /* On mobile, stop using aspect-ratio and use a concrete height */
  #dexscreener-panel .dexscreener-embed {
    height: 60vh;
    aspect-ratio: auto;
    padding-bottom: 0; /* ensure no legacy padding hack applies */
  }
  #dexscreener-panel .dexscreener-embed iframe {
    height: 100%;
  }
}


/* Runs Modal specific footer/button adjustments */
#runs-modal .modal-footer {
  grid-template-columns: 1fr; /* single full-width column */
}
#runs-modal .modal-footer .btn {
  width: 100%;
  height: 52px;
  margin: 0;
  border-radius: 12px;
}
/* Ensure Close button uses primary (purple) style, not the header close icon style */
#runs-modal .modal-footer .modal-close {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: #fff;
  border: 0;
  font-size: 1rem; /* reset from header close icon size */
}
#runs-modal .modal-footer .modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37,99,235,.3);
}
#runs-modal .modal-footer .modal-close:active {
  transform: translateY(0);
}
