/* ================================================================
   MARKET PULSE v3 — Production CSS
   Dark Bloomberg-inspired terminal UI
   ================================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg:          #0a0e1a;
  --bg-alt:      #080c18;
  --surface:     #0f1628;
  --surface-2:   #141d35;
  --surface-3:   #1a2440;
  --border:      rgba(0, 255, 136, 0.10);
  --border-2:    rgba(255, 255, 255, 0.07);
  --green:       #00ff88;
  --green-dim:   rgba(0, 255, 136, 0.12);
  --green-glow:  rgba(0, 255, 136, 0.25);
  --amber:       #f5a623;
  --amber-dim:   rgba(245, 166, 35, 0.12);
  --red:         #ff4757;
  --red-dim:     rgba(255, 71, 87, 0.12);
  --blue:        #3b82f6;
  --blue-dim:    rgba(59, 130, 246, 0.12);
  --purple:      #a855f7;
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --header-h:    56px;
  --nav-h:       44px;
  --font-mono:   'Space Mono', 'Courier New', monospace;
  --font-body:   'DM Sans', system-ui, sans-serif;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 20px 48px rgba(0,0,0,0.5);
  --transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 1000px;
  margin:auto;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Background Grid ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,255,136,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
}
body::after {
  content: '';
  position: fixed;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,136,0.04) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none; z-index: 0;
}

/* ── Logo Components ────────────────────────────────────────── */
.logo-mark {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark-sm {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-pulse-ring {
  position: absolute;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0.3;
  animation: logo-ring-pulse 2s ease infinite;
}
@keyframes logo-ring-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.3; }
  50%       { transform: scale(1.1);  opacity: 0.0; }
}
.logo-text {
  font-family: var(--font-mono);
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--text);
}
.logo-accent { color: var(--green); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn var(--transition);
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-logo {
  display: flex; align-items: center; justify-content: center; gap: 0.875rem;
  margin-bottom: 2rem;
}
.modal-logo .logo-text { font-size: 1.1rem; }
.modal-tabs {
  display: flex; background: var(--surface-2);
  border-radius: var(--radius); padding: 4px;
  margin-bottom: 1.75rem; gap: 4px;
}
.modal-tab {
  flex: 1; background: transparent; border: none; color: var(--text-muted);
  padding: 0.5rem; border-radius: 6px;
  font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition);
}
.modal-tab.active {
  background: var(--surface-3); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.modal-tab:hover:not(.active) { color: var(--text-dim); }
.modal-form { display: flex; flex-direction: column; gap: 1rem; }
.form-divider {
  text-align: center; color: var(--text-muted); font-size: 0.8rem;
  position: relative; margin: 0.25rem 0;
}
.form-divider::before, .form-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 40%; height: 1px; background: var(--border-2);
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 500;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.header-left { display: flex; align-items: center; flex-shrink: 0; }
.header-logo {
  display: flex; align-items: center; gap: 0.5rem;
  user-select: none;
}
.logo-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  position: absolute; top: -2px; right: -2px;
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: live-pulse 2s ease infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 var(--green-glow); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.header-center { flex: 1; min-width: 0; overflow: hidden; }
.ticker-strip { overflow: hidden; position: relative; }
.ticker-inner {
  display: flex; gap: 2rem;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.72rem;
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--text-muted); flex-shrink: 0;
}
.ticker-item .ticker-sym { color: var(--text-dim); font-weight: 700; }
.ticker-item .ticker-price { color: var(--text); }
.ticker-item .ticker-up { color: var(--green); }
.ticker-item .ticker-dn { color: var(--red); }

.header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.header-badge {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.25rem 0.65rem;
  cursor: pointer; transition: all var(--transition);
}
.header-badge:hover { border-color: var(--green-glow); }
.badge-count {
  font-family: var(--font-mono); font-size: 0.72rem;
  font-weight: 700; color: var(--green);
}
.user-chip {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.25rem 0.4rem 0.25rem 0.3rem;
}
.user-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-dim); border: 1px solid var(--green-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; color: var(--green);
  text-transform: uppercase; flex-shrink: 0;
}
.user-name { font-size: 0.78rem; font-weight: 500; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.68rem; padding: 0.1rem 0.2rem;
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--red); }
.btn-login {
  background: var(--green); color: #0a0e1a;
  border: none; padding: 0.4rem 0.9rem;
  border-radius: 6px; font-size: 0.8rem; font-weight: 600;
  transition: all var(--transition);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--green-glow); }

/* ── Navigation ─────────────────────────────────────────────── */
.main-nav {
  position: sticky; top: var(--header-h); z-index: 400;
  background: rgba(10,14,26,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-scroll {
  display: flex; gap: 0;
  overflow-x: auto; padding: 0 0.75rem;
  scrollbar-width: none;
}
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative; flex-shrink: 0;
  background: none; border: none; color: var(--text-muted);
  padding: 0 0.75rem; height: var(--nav-h);
  font-size: 0.75rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: all var(--transition); white-space: nowrap;
  cursor: pointer;
}
.nav-tab:hover { color: var(--text-dim); }
.nav-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.tab-icon { font-size: 0.78rem; }
.tab-label { font-size: 0.73rem; }
.tab-badge {
  background: var(--amber-dim); color: var(--amber);
  border: 1px solid rgba(245,166,35,0.2);
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  padding: 0.08rem 0.4rem; border-radius: 100px;
  min-width: 18px; text-align: center; display: none;
}

/* ── Main Content ───────────────────────────────────────────── */
.app-main {
  position: relative; z-index: 1;
  min-height: calc(100vh - var(--header-h) - var(--nav-h) - 48px);
  max-width: 1000px; margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ── Tab Panes ──────────────────────────────────────────────── */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Section Headers ────────────────────────────────────────── */
.section-header {
  margin-bottom: 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.section-title {
  font-family: var(--font-mono); font-size: 1.2rem;
  font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; margin-bottom: 0.2rem;
}
.section-subtitle {
  color: var(--text-muted); font-size: 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.refresh-info { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; padding-top: 0.25rem; }

/* ── Notification Banner ────────────────────────────────────── */
.notification-banner {
  display: flex; align-items: center; gap: 0.875rem;
  background: var(--amber-dim); border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-lg); padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}
.notif-icon { font-size: 1.25rem; flex-shrink: 0; }
.notif-text { flex: 1; }
.notif-text strong { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.1rem; }
.notif-text span { color: var(--text-muted); font-size: 0.78rem; }
.btn-enable-notif {
  background: var(--amber); color: #0a0e1a;
  border: none; padding: 0.4rem 1rem;
  border-radius: 6px; font-weight: 600; font-size: 0.78rem;
  white-space: nowrap; transition: all var(--transition); flex-shrink: 0;
}
.btn-enable-notif:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,166,35,0.3); }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem; margin-bottom: 1rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 0.875rem;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, var(--card-accent, var(--green-dim)));
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(0,255,136,0.15); }
.card-rsi  { --card-accent: rgba(0,255,136,0.06); }
.card-price { --card-accent: rgba(245,166,35,0.06); }
.card-change { --card-accent: rgba(59,130,246,0.06); }
.card-market { --card-accent: rgba(168,85,247,0.06); }
.stat-icon { font-size: 1.4rem; flex-shrink: 0; }
.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-family: var(--font-mono); font-size: 1.5rem;
  font-weight: 700; color: var(--text); line-height: 1;
  margin-bottom: 0.2rem;
}
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.stat-trend {
  font-size: 0.68rem; color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex; align-items: center; gap: 0.25rem;
  flex-shrink: 0; white-space: nowrap;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  display: inline-block;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); animation: live-pulse 2s infinite; }
.status-dot.offline { background: var(--red); }
.status-dot.pending { background: var(--amber); }

/* ── Alert Quick Nav ────────────────────────────────────────── */
.alert-quick-nav {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.quick-nav-label { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.chip-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); padding: 0.3rem 0.75rem;
  border-radius: 100px; font-size: 0.75rem; font-weight: 500;
  transition: all var(--transition);
}
.chip-btn:hover { border-color: rgba(0,255,136,0.2); color: var(--green); background: var(--green-dim); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-2);
}
.card-title {
  font-family: var(--font-mono); font-size: 0.8rem;
  font-weight: 700; color: var(--text); letter-spacing: 0.05em;
  text-transform: uppercase;
}
.count-badge {
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 100px;
}

/* ── Preset Cards ───────────────────────────────────────────── */
.preset-card { background: var(--surface); }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem; margin-bottom: 0.875rem;
}
.preset-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
  transition: all var(--transition); text-align: left;
  cursor: pointer;
}
.preset-btn:hover { border-color: rgba(0,255,136,0.2); background: var(--surface-3); transform: translateY(-1px); }
.preset-btn.preset-ob:hover { border-color: rgba(255,71,87,0.3); }
.preset-btn.preset-os:hover { border-color: rgba(0,255,136,0.3); }
.preset-icon { font-size: 1.2rem; flex-shrink: 0; }
.preset-info { min-width: 0; }
.preset-name { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.preset-sub  { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem; }

.set-all-row {
  padding: 0.6rem 0.75rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center;
}
.set-all-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-dim); cursor: pointer; user-select: none;
}
.set-all-label input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--green);
  cursor: pointer;
}

/* ── Accordion (Top Movers) ─────────────────────────────────── */
.movers-accordions { display: flex; flex-direction: column; gap: 0.5rem; }
.accordion {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.accordion-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: var(--surface-2);
  border: none; width: 100%; text-align: left;
  cursor: pointer; transition: background var(--transition);
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  gap: 0.75rem;
}
.accordion-head:hover { background: var(--surface-3); }
.accordion-count {
  background: var(--surface-3); border: 1px solid var(--border-2);
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 100px;
  margin-left: auto;
}
.accordion-arrow { color: var(--text-muted); font-size: 0.65rem; }
.accordion-body { background: var(--surface); }

.mover-list { display: flex; flex-direction: column; }
.mover-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; border-bottom: 1px solid var(--border-2);
}
.mover-item:last-child { border-bottom: none; }
.mover-sym { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--text); width: 70px; }
.mover-price { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); flex: 1; }
.mover-change { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; width: 70px; text-align: right; }

/* ── Market Controls (compact for dashboard) ────────────────── */
.market-controls-compact {
  display: flex; gap: 0.5rem; margin-bottom: 0.875rem; align-items: center;
}
.market-controls-compact .search-wrapper { flex: 1; }
.market-controls-compact .sort-field { width: 120px; flex-shrink: 0; }
.search-wrapper { position: relative; }

/* ── Quick Monitor ──────────────────────────────────────────── */
.quick-monitor {
  display: flex; gap: 0.625rem; margin-bottom: 0.875rem;
}
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.625rem;
}
.watchlist-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  position: relative; transition: all var(--transition);
}
.watchlist-item:hover { border-color: rgba(0,255,136,0.15); }
.watchlist-sym { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--text); }
.watchlist-price { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700; }
.watchlist-change { font-size: 0.72rem; }
.watchlist-remove {
  position: absolute; top: 0.35rem; right: 0.4rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.65rem; padding: 0.1rem;
  opacity: 0; transition: all var(--transition);
}
.watchlist-item:hover .watchlist-remove { opacity: 1; }
.watchlist-remove:hover { color: var(--red); }

/* ── Two-Column Layout ──────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem; align-items: start;
}
.form-card { position: sticky; top: calc(var(--header-h) + var(--nav-h) + 1rem); }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.form-group label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.input-hint { font-weight: 400; color: var(--text-muted); text-transform: none; }
.input-field {
  background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--text); padding: 0.55rem 0.8rem;
  border-radius: var(--radius); font-size: 0.875rem;
  transition: all var(--transition); outline: none;
  width: 100%; appearance: none; -webkit-appearance: none;
}
.input-field:focus { border-color: rgba(0,255,136,0.4); box-shadow: 0 0 0 3px rgba(0,255,136,0.08); }
.input-field::placeholder { color: var(--text-muted); }
select.input-field {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center;
  padding-right: 1.75rem;
}
.price-fetch-row { display: flex; gap: 0.5rem; }
.price-fetch-row .input-field { flex: 1; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--green); color: #0a0e1a;
  border: none; padding: 0.6rem 1.4rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 600;
  transition: all var(--transition); display: inline-flex;
  align-items: center; justify-content: center; gap: 0.35rem;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--green-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  background: var(--surface-3); border: 1px solid var(--border-2);
  color: var(--text); padding: 0.55rem 0.875rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.btn-secondary:hover { border-color: rgba(0,255,136,0.2); color: var(--green); }

.btn-ghost {
  background: transparent; border: 1px solid var(--border-2);
  color: var(--text-muted); padding: 0.55rem 1rem;
  border-radius: var(--radius); font-size: 0.875rem;
  transition: all var(--transition);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.btn-ghost.full-width { width: 100%; text-align: center; }

.btn-ghost-sm {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.75rem;
  padding: 0.2rem 0.45rem; border-radius: 4px;
  transition: all var(--transition);
}
.btn-ghost-sm:hover { color: var(--text); background: var(--surface-2); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-danger {
  background: var(--red-dim); color: var(--red);
  border: 1px solid rgba(255,71,87,0.2);
  padding: 0.28rem 0.55rem; border-radius: 4px;
  font-size: 0.72rem; transition: all var(--transition);
  cursor: pointer !important;
  font-family: var(--font-mono);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,71,87,0.15);
  white-space: nowrap;
}
.btn-danger:hover { background: rgba(255,71,87,0.2); }
.btn-danger:active { background: rgba(255,71,87,0.3); transform: scale(0.97); }

/* ── Form Errors ────────────────────────────────────────────── */
.form-error {
  color: var(--red); font-size: 0.8rem;
  background: var(--red-dim); border: 1px solid rgba(255,71,87,0.2);
  border-radius: 4px; padding: 0.45rem 0.75rem;
  display: none;
}
.form-error:not(:empty) { display: block; }

/* ── Alert Lists ────────────────────────────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 0.625rem; }
.alert-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 0.875rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; transition: border-color var(--transition);
  position: relative;
}
.alert-item:hover { border-color: rgba(0,255,136,0.15); }
.alert-info { flex: 1; min-width: 0; overflow: hidden; }
.alert-actions {
  display: flex; gap: 0.3rem; flex-shrink: 0;
  align-items: flex-start;
  position: relative; z-index: 5;
}
.alert-actions button {
  position: relative; z-index: 5;
  pointer-events: auto !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
  user-select: none;
}
.alert-pair {
  font-family: var(--font-mono); font-size: 0.88rem;
  font-weight: 700; color: var(--text); margin-bottom: 0.18rem;
}
.alert-condition {
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.alert-condition .cond-tag {
  background: var(--surface-3); border: 1px solid var(--border-2);
  border-radius: 3px; padding: 0.08rem 0.35rem;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim);
}
.alert-meta {
  font-size: 0.7rem; color: var(--text-muted);
  margin-top: 0.3rem; display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.alert-status-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.12rem 0.45rem; border-radius: 100px;
  font-size: 0.65rem; font-family: var(--font-mono); font-weight: 700;
}
.badge-active { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0,255,136,0.2); }
.badge-triggered { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.2); }

/* ── Alert Edit + Delete Buttons ────────────────────────────── */
.btn-edit {
  background: rgba(0,184,212,0.08);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.25);
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer !important;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-mono);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(56,189,248,0.15);
}
.btn-edit:hover { background: rgba(56,189,248,0.18); border-color: rgba(56,189,248,0.5); }
.btn-edit:active { background: rgba(56,189,248,0.28); transform: scale(0.97); }

/* ── Edit Alert Full-Screen Overlay ─────────────────────────── */
/* Sits inside .tab-content, slides up from bottom */
.edit-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  background: rgba(5, 8, 18, 0.7);
  backdrop-filter: blur(4px);
  animation: editOverlayIn 0.2s ease;
}
@keyframes editOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.edit-alert-sheet {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid rgba(56,189,248,0.25);
  padding: 0;
  animation: sheetUp 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.edit-sheet-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 10px auto 0;
}
.edit-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.edit-sheet-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.edit-sheet-close {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.edit-sheet-close:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.edit-sheet-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.edit-sheet-coin-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
}
.edit-sheet-coin-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.edit-sheet-coin-type {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 6px;
}
.edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.edit-field label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.edit-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.input-sm {
  padding: 0.3rem 0.55rem !important;
  font-size: 0.8rem !important;
  height: 2rem;
}
.edit-sheet-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.btn-save-edit {
  flex: 1;
  background: rgba(0,232,122,0.12);
  color: var(--green, #00e87a);
  border: 1px solid rgba(0,232,122,0.3);
  border-radius: 8px;
  padding: 0.65rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.btn-save-edit:hover {
  background: rgba(0,232,122,0.22);
  border-color: rgba(0,232,122,0.55);
}
.btn-cancel-edit {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-edit:hover {
  background: var(--surface-2);
  color: var(--text);
}
.edit-multi-note {
  font-size: 0.72rem;
  color: var(--amber, #f59e0b);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
/* Alert item — position:relative for dropdown menus, overflow:visible so action buttons are clickable */
.alert-item {
  position: relative;
  overflow: visible;
}
.alert-item-actions-hint {
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 0.2rem;
}


/* ── RSI Preview Bar ────────────────────────────────────────── */
.rsi-preview {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.rsi-zones { display: flex; align-items: center; gap: 0.5rem; }
.zone-label { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.zone-bar { flex: 1; display: flex; height: 5px; border-radius: 3px; overflow: hidden; gap: 1px; }
.zone-os { width: 30%; background: var(--green); border-radius: 3px 0 0 3px; opacity: 0.6; }
.zone-neutral { flex: 1; background: var(--surface-3); }
.zone-ob { width: 30%; background: var(--red); border-radius: 0 3px 3px 0; opacity: 0.6; }

/* ── Trigger List ───────────────────────────────────────────── */
.trigger-list { display: flex; flex-direction: column; gap: 0.5rem; }
.trigger-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all var(--transition);
}
.trigger-icon { font-size: 0.9rem; flex-shrink: 0; }
.trigger-info { flex: 1; min-width: 0; }
.trigger-title { font-size: 0.82rem; font-weight: 600; }
.trigger-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.08rem; }
.trigger-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; }

/* ── Market Table v5.2 — Horizontal scroll, no rank ────────── */
.market-table-wrap {
  /* Outer wrapper: horizontal scroll on all screen sizes */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  /* vertical scroll for rows */
  max-height: 420px; overflow-y: auto;
  /* Thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.market-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.market-table-wrap::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* Scroll hint on mobile */
@media (max-width: 640px) {
  .market-table-wrap::before {
    content: '← scroll →';
    display: block; text-align: center;
    font-size: 0.6rem; color: var(--text-muted); opacity: 0.6;
    padding: 0.2rem; background: var(--surface-2);
    border-bottom: 1px solid var(--border-2);
    font-family: var(--font-mono);
  }
}

.market-table {
  min-width: 500px; /* Forces horizontal scroll before shrinking */
  width: 100%; border-collapse: collapse;
}
.market-table thead {
  background: var(--surface-2); position: sticky; top: 0; z-index: 10;
}
.market-table th {
  padding: 0.55rem 0.65rem; text-align: left;
  font-family: var(--font-mono); font-size: 0.62rem;
  font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.market-table td {
  padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border-2);
  font-size: 0.8rem; vertical-align: middle;
}
.market-table tbody tr { transition: background var(--transition); }
.market-table tbody tr:hover { background: var(--surface-2); }
.market-table tbody tr:last-child td { border-bottom: none; }

/* No rank column — hidden always */
.rank-cell, .th-rank { display: none !important; }

/* Column widths */
.th-pair   { min-width: 110px; }
.th-price  { min-width: 85px; }
.th-change { min-width: 68px; }
.th-vol    { min-width: 75px; }
.th-mcap   { min-width: 75px; }
.th-action { min-width: 58px; }

/* Always show all columns — scroll takes care of space */
.market-table .th-mcap, .market-table .mcap-cell,
.market-table .th-vol,  .market-table .volume-cell,
.market-table .th-change, .market-table .change-cell { display: table-cell !important; }

.pair-cell { display: flex; align-items: center; gap: 0.4rem; }
.pair-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; font-family: var(--font-mono);
  color: var(--green); flex-shrink: 0;
}
.pair-sym  { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; }
.pair-quote { font-size: 0.6rem; color: var(--text-muted); }
.price-cell  { font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
.change-cell { font-family: var(--font-mono); font-weight: 700; font-size: 0.76rem; white-space: nowrap; }
.volume-cell { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.mcap-cell   { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral  { color: var(--text-muted); }
.table-loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.refresh-btn { font-size: 0.78rem; }

/* Layer 1 badge on pair name */
.l1-badge {
  display: inline-block; font-size: 0.52rem;
  font-family: var(--font-mono); font-weight: 700;
  background: var(--blue-dim); color: var(--blue);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 3px; padding: 0.04rem 0.28rem;
  margin-left: 0.25rem; vertical-align: middle; line-height: 1.5;
}

/* ── Btn Add Alert ──────────────────────────────────────────── */
.btn-add-alert {
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
  padding: 0.25rem 0.55rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-add-alert:hover { background: rgba(0,255,136,0.2); }

/* ── Empty States ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 2rem 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.empty-icon { font-size: 2rem; opacity: 0.5; }
.empty-text { font-weight: 600; color: var(--text-muted); font-size: 0.875rem; }
.empty-sub { font-size: 0.78rem; color: var(--text-muted); max-width: 260px; line-height: 1.5; }

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.25rem; right: 1rem; z-index: 2000;
  display: flex; flex-direction: column-reverse; gap: 0.4rem;
  max-width: 340px; width: calc(100vw - 2rem);
}
.toast {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.75rem 1rem;
  display: flex; align-items: flex-start; gap: 0.625rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s cubic-bezier(0.4,0,0.2,1);
}
.toast.exit { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(100%); } }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.82rem; margin-bottom: 0.1rem; }
.toast-msg { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.72rem; padding: 0.1rem; flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--text); }

/* ── Loading Spinner ────────────────────────────────────────── */
.loading-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block; vertical-align: middle; margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
  position: relative; z-index: 1;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted);
  font-family: var(--font-mono);
}
.footer-left, .footer-right { display: flex; align-items: center; gap: 0.625rem; }
.footer-logo { font-weight: 700; color: var(--text-dim); letter-spacing: 0.08em; }
.footer-version { background: var(--surface-2); padding: 0.08rem 0.35rem; border-radius: 3px; }
.footer-divider { opacity: 0.3; }
.api-indicator { display: flex; align-items: center; gap: 0.35rem; }

/* ── Install Banner ─────────────────────────────────────────── */
.install-banner {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 900;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: var(--shadow-lg); font-size: 0.82rem;
  max-width: 380px; width: calc(100vw - 2rem);
  animation: slideUp 0.3s ease;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Color Classes ──────────────────────────────────────────── */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE-FIRST, SINGLE SOURCE OF TRUTH
   Breakpoints: 900 tablet-landscape | 768 tablet | 540 phone | 380 small phone
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablet landscape: collapse two-col ────────────────────── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .form-card { position: static; }          /* un-stick form */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .msp-row { flex-wrap: wrap; gap: 0.5rem; }
  .msp-group { min-width: calc(50% - 0.25rem); flex: 1 1 calc(50% - 0.25rem); }
  .msp-group-btn { min-width: 100%; flex: 0 0 100%; flex-direction: row; align-items: center; }
}

/* ── Tablet portrait ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 52px; --nav-h: 42px; }

  /* Header */
  .app-header { padding: 0 0.75rem; }
  .header-center { display: none; }

  /* Market controls */
  .market-controls-compact { flex-direction: column; gap: 0.5rem; }
  .market-controls-compact .sort-field { width: 100%; }

  /* Quick monitor input row */
  .quick-monitor { flex-wrap: nowrap; }
  .quick-monitor .input-field { flex: 1; min-width: 0; }

  /* Notification banner */
  .notification-banner { flex-wrap: wrap; }

  /* Presets */
  .preset-grid { grid-template-columns: repeat(2, 1fr); }

  /* Alert items — give actions enough room on tablet */
  .alert-item { gap: 0.5rem; padding: 0.65rem 0.75rem; }
  .alert-actions { gap: 0.25rem; }

  /* Dash utility row (Telegram + Backup) — keep side-by-side on tablet */
  /* Only collapses at 540px (phone breakpoint below) */
}

/* ── Phone ──────────────────────────────────────────────────── */
@media (max-width: 540px) {
  :root { --header-h: 50px; --nav-h: 40px; }

  /* Layout */
  .app-main { padding: 0.875rem 0.625rem 3rem; }
  .card { border-radius: 10px; }

  /* Telegram + Backup stack vertically on phone */
  .dash-utility-row { grid-template-columns: 1fr; }

  /* Header — shrink logo */
  .header-logo .logo-text { display: none; }
  .logo-mark-sm { display: flex; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.25rem; }
  .stat-icon { font-size: 1.2rem; }

  /* Quick nav — single line, scrollable */
  .alert-quick-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.3rem;
    padding-bottom: 2px;
  }
  .alert-quick-nav::-webkit-scrollbar { display: none; }
  .quick-nav-label { display: none; }           /* hide label, save space */
  .chip-btn { white-space: nowrap; flex-shrink: 0; }

  /* Alert items — stack actions below info on very small screens */
  .alert-item {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.7rem 0.75rem;
  }
  .alert-info { width: 100%; }
  .alert-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
  }
  /* Make buttons big enough to tap comfortably */
  .btn-toggle, .btn-edit, .btn-danger {
    min-height: 34px;
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
  }

  /* Presets */
  .preset-grid { grid-template-columns: 1fr 1fr; }

  /* Modal */
  .modal-box { padding: 1.5rem 1rem; }

  /* Footer */
  .app-footer { flex-direction: column; gap: 0.35rem; text-align: center; }

  /* Market table — hide MCap column, condense */
  .th-mcap, .market-table td:nth-child(5) { display: none; }
  .market-table { font-size: 0.78rem; }
  .market-table td, .market-table th { padding: 0.4rem 0.5rem; }

  /* Settings filter panel full-width */
  .msp-group { min-width: 100%; flex: 0 0 100%; }

  /* Screener: hide MCap column on phone */
  .scr-col-rsi { min-width: 40px; }
}

/* ── Small phone ────────────────────────────────────────────── */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .user-name { display: none; }
  .app-main { padding: 0.75rem 0.5rem 3rem; }
}

/* ================================================================
   MARKET PULSE v5.1 — Additional Styles
   Bell/Alert History Panel, TF Movers, Pagination, Market Cap,
   Apply-All Banner, Responsive improvements
   ================================================================ */

/* ── Bell Button (Header) ───────────────────────────────────────── */
.header-bell-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}
.header-bell-btn:hover {
  background: var(--surface-2);
  border-color: var(--green);
}
.bell-icon { font-size: 1rem; }
.header-bell-btn .badge-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 16px;
}
.bell-triggered {
  position: absolute;
  top: -4px; right: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
  animation: bell-pulse 1s ease infinite;
}
@keyframes bell-pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.3);} }

.bell-has-new {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 2px var(--green-glow);
  animation: bell-ring 0.5s ease;
}
@keyframes bell-ring {
  0%{transform:rotate(-10deg);} 20%{transform:rotate(10deg);} 40%{transform:rotate(-8deg);}
  60%{transform:rotate(8deg);} 80%{transform:rotate(-4deg);} 100%{transform:rotate(0deg);}
}

/* ── Alert History Panel ────────────────────────────────────────── */
.alert-history-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: min(380px, 100vw);
  height: calc(100vh - var(--header-h));
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 900;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slide-in-right 0.25s ease;
}
@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.ahp-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 899;
}
.ahp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-2);
  flex-shrink: 0;
}
.ahp-title {
  font-size: 0.95rem; font-weight: 600; font-family: var(--font-mono);
  color: var(--green);
}
.ahp-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 1rem;
  cursor: pointer; padding: 0.25rem;
  transition: color var(--transition);
}
.ahp-close:hover { color: var(--red); }
.ahp-list {
  flex: 1; overflow-y: auto; padding: 0.5rem;
}
.ahp-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--border-2);
  margin-bottom: 0.4rem;
  background: var(--surface-2);
  transition: background var(--transition);
}
.ahp-item:hover { background: var(--surface-3); }
.ahp-rsi   { border-left-color: var(--blue); }
.ahp-price { border-left-color: var(--amber); }
.ahp-change{ border-left-color: var(--green); }
.ahp-item-icon { font-size: 1.1rem; flex-shrink: 0; }
.ahp-item-body { flex: 1; min-width: 0; }
.ahp-item-title { font-weight: 600; font-size: 0.82rem; color: var(--text); }
.ahp-item-msg   { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.15rem; word-break: break-word; }
.ahp-item-time  { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; font-family: var(--font-mono); }

/* ── Mover TF Pills ─────────────────────────────────────────────── */
.mover-tf-row {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  padding: 0.5rem 0.5rem 0.75rem;
}
.mover-tf-pill {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem; font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.mover-tf-pill:hover { border-color: var(--green); color: var(--green); }
.mover-tf-pill.active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}
.tf-label-tag {
  font-size: 0.7rem;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* ── Mover Items Enhanced ───────────────────────────────────────── */
.mover-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-2);
  transition: background var(--transition);
}
.mover-item:last-child { border-bottom: none; }
.mover-item:hover { background: var(--surface-2); }
.mover-rank {
  font-size: 0.7rem; font-family: var(--font-mono);
  color: var(--text-muted); text-align: center;
}
.mover-sym-wrap { display: flex; gap: 0.5rem; align-items: center; }
.mover-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-family: var(--font-mono);
  color: var(--green); font-weight: 700;
  flex-shrink: 0;
}
.mover-sym  { font-weight: 600; font-size: 0.82rem; font-family: var(--font-mono); }
.mover-quote{ font-size: 0.65rem; color: var(--text-muted); }
.mover-price { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
.mover-change-wrap { display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-end; min-width: 70px; }
.mover-change { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.mover-bar-bg {
  width: 100%; height: 3px;
  background: var(--surface-3); border-radius: 2px; overflow: hidden;
}
.mover-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.5s ease;
}
.mover-bar-fill.positive { background: var(--green); }
.mover-bar-fill.negative { background: var(--red); }

/* ── Market Table Enhanced (Market Cap column) ──────────────────── */
.market-table th, .market-table td {
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
}
.th-mcap, .mcap-cell { display: table-cell; }
.mcap-cell {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { color: var(--green); }
.sort-arr { color: var(--text-muted); font-size: 0.7rem; }

/* ── Pagination ─────────────────────────────────────────────────── */
.market-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 0.75rem;
  border-top: 1px solid var(--border-2);
  flex-wrap: wrap;
}
.page-btn {
  min-width: 80px;
}
.page-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.page-total-info {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Apply-All Search Banner ────────────────────────────────────── */
.apply-all-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
  animation: fade-in 0.2s ease;
}
.apply-all-info {
  font-size: 0.8rem; color: var(--text-dim);
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
}
.apply-all-btns {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.chip-green {
  background: var(--green-dim) !important;
  border-color: var(--green) !important;
  color: var(--green) !important;
}
.chip-amber {
  background: var(--amber-dim) !important;
  border-color: var(--amber) !important;
  color: var(--amber) !important;
}
.chip-blue {
  background: var(--blue-dim) !important;
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

/* ── Search wrapper icon ────────────────────────────────────────── */
.search-wrapper { position: relative; flex: 1; display: flex; align-items: center; }
.search-icon { position: absolute; left: 0.6rem; font-size: 0.85rem; pointer-events: none; }
.search-wrapper .search-field { padding-left: 2rem !important; }

/* ── Responsive Improvements ────────────────────────────────────── */
@media (max-width: 640px) {
  .market-table .th-mcap,
  .market-table .mcap-cell { display: none; }
  .market-table .th-vol,
  .market-table .volume-cell { display: none; }

  .mover-item {
    grid-template-columns: 22px 1fr auto auto auto;
    gap: 0.3rem;
    padding: 0.5rem;
  }
  .mover-icon { width: 24px; height: 24px; font-size: 0.55rem; }
  .mover-change-wrap { min-width: 55px; }

  .alert-history-panel { width: 100vw; }

  .market-controls-compact { flex-direction: column; gap: 0.5rem; }
  .market-sort-wrap, .sort-field { width: 100% !important; }

  .mover-tf-row { gap: 0.25rem; }
  .mover-tf-pill { font-size: 0.7rem; padding: 0.2rem 0.5rem; }

  .apply-all-banner { flex-direction: column; align-items: flex-start; }

  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }

  .market-pagination { gap: 0.4rem; }
  .page-btn { min-width: 60px; font-size: 0.72rem; }
}

@media (max-width: 380px) {
  .logo-text { display: none; }
  .header-bell-btn .badge-count { display: none; }

  .market-table .th-change,
  .market-table .change-cell { display: none; }
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr) !important; }

  .mover-tf-row { gap: 0.4rem; }
}

/* ── Accordion Improvements ─────────────────────────────────────── */
.accordion-arrow { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.5rem; }

/* ── Market Row hover ───────────────────────────────────────────── */
.market-row:hover { background: var(--surface-2); }
.market-row { transition: background var(--transition); }

/* ── Fade-in animation ──────────────────────────────────────────── */
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }


/* ================================================================
   MARKET PULSE v5.2 — Consolidated Additions
   Market Settings Panel, Trigger Sym, AHP Sym, sortable headers
   ================================================================ */

/* ── Market Settings Panel ──────────────────────────────────────── */
.market-settings-panel {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.875rem;
}
.msp-title {
  font-size: 0.72rem; font-weight: 700; color: var(--green);
  font-family: var(--font-mono); letter-spacing: 0.05em;
  text-transform: uppercase; margin-bottom: 0.6rem;
}
.msp-row {
  display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap;
}
.msp-group {
  display: flex; flex-direction: column; gap: 0.2rem;
  min-width: 120px; flex: 1;
}
.msp-group-btn {
  flex-direction: row; align-items: center; gap: 0.5rem;
  min-width: auto; flex: 0 0 auto;
}
.msp-label {
  font-size: 0.63rem; color: var(--text-muted);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em;
}
.msp-select { padding: 0.35rem 1.5rem 0.35rem 0.5rem !important; font-size: 0.75rem !important; }
.msp-info { font-size: 0.7rem; color: var(--green); font-family: var(--font-mono); white-space: nowrap; }

/* ── Trigger sym highlight (in trigger list & alert history) ────── */
.trigger-sym {
  display: inline-block; font-family: var(--font-mono); font-size: 0.76rem;
  font-weight: 700; color: var(--green); background: var(--green-dim);
  border-radius: 4px; padding: 0.04rem 0.32rem;
}
.ahp-sym {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem;
  font-weight: 700; color: var(--green); background: var(--green-dim);
  border-radius: 3px; padding: 0.04rem 0.28rem; margin-left: 0.3rem;
}

/* ── Sortable column header active state ────────────────────────── */
.sortable { cursor: pointer; }
.sortable:hover { color: var(--text); }
.sort-arr { opacity: 0.4; }

/* ── Apply-all banner responsive ───────────────────────────────── */
@media (max-width: 600px) {
  .apply-all-banner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .apply-all-btns { flex-wrap: wrap; gap: 0.35rem; }
  .page-btn { min-width: 54px; font-size: 0.7rem; padding: 0.25rem 0.38rem; }
  .page-info { font-size: 0.7rem; }
}

/* ================================================================
   MARKET PULSE v5.3 — Additional CSS
   Multi-coin badge, alert history cards inline, save button,
   btn-danger-sm, confirmation dialog styling
   ================================================================ */

/* ── Multi-coin alert badge ─────────────────────────────────────── */
.multi-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  color: var(--blue); background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 5px; padding: 0.1rem 0.5rem;
}
.multi-sym-list {
  font-size: 0.68rem; color: var(--text-muted);
  font-family: var(--font-mono); margin-top: 0.2rem;
  padding: 0.2rem 0.4rem; background: var(--surface-3);
  border-radius: 3px; line-height: 1.5;
  max-height: 40px; overflow: hidden;
}

/* ── Per-tab Alert History card ─────────────────────────────────── */
.alert-history-card { border-color: rgba(59,130,246,0.15); }
.alert-history-card .card-head { border-bottom-color: rgba(59,130,246,0.1); }
.ahp-list-inline {
  max-height: 320px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.ahp-list-inline::-webkit-scrollbar { width: 3px; }
.ahp-list-inline::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

/* ── Danger-sm clear button ─────────────────────────────────────── */
.btn-danger-sm {
  background: var(--red-dim); color: var(--red);
  border: 1px solid rgba(255,71,87,0.2);
  padding: 0.2rem 0.55rem; border-radius: 4px;
  font-size: 0.72rem; transition: all var(--transition);
}
.btn-danger-sm:hover { background: rgba(255,71,87,0.2); }

/* ── Save button ────────────────────────────────────────────────── */
.btn-save-prefs {
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
  padding: 0.28rem 0.65rem; border-radius: 4px;
  font-size: 0.72rem; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-save-prefs:hover { background: rgba(0,255,136,0.2); transform: translateY(-1px); }

/* ── Mover rank + enhanced mover item ───────────────────────────── */
.mover-rank {
  font-family: var(--font-mono); font-size: 0.65rem; 
  color: var(--text-muted); width: 18px; flex-shrink: 0; text-align: right;
}
.mover-sym-wrap { display: flex; align-items: center; gap: 0.4rem; flex: 1; min-width: 0; }
.mover-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.52rem; font-weight: 700; font-family: var(--font-mono);
  color: var(--green); flex-shrink: 0;
}
.mover-change-wrap { display: flex; flex-direction: column; gap: 0.15rem; min-width: 70px; }
.mover-bar-bg { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.mover-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.mover-bar-fill.positive { background: var(--green); }
.mover-bar-fill.negative { background: var(--red); }
.mover-tf-row {
  display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.mover-tf-pill {
  padding: 0.22rem 0.65rem; font-size: 0.72rem; font-family: var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.mover-tf-pill.active, .mover-tf-pill:hover {
  background: var(--green-dim); color: var(--green);
  border-color: rgba(0,255,136,0.3);
}
.mover-quote { font-size: 0.58rem; color: var(--text-muted); }

/* ── Market Pagination ──────────────────────────────────────────── */
.market-pagination {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-top: 1px solid var(--border-2);
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.page-btn { min-width: 60px; font-size: 0.72rem; }
.page-info { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.page-total-info { font-size: 0.68rem; color: var(--text-muted); margin-left: auto; font-family: var(--font-mono); }

/* ── Apply-all banner ───────────────────────────────────────────── */
.apply-all-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.5rem; padding: 0.65rem 0.875rem; margin-bottom: 0.75rem;
  background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
}
.apply-all-info { font-size: 0.78rem; display: flex; align-items: center; gap: 0.4rem; }
.apply-all-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip-green { background: var(--green-dim); color: var(--green); border-color: rgba(0,255,136,0.2); }
.chip-amber { background: var(--amber-dim); color: var(--amber); border-color: rgba(245,166,35,0.2); }
.chip-blue  { background: var(--blue-dim);  color: var(--blue);  border-color: rgba(59,130,246,0.2); }

/* ── WS status dot ──────────────────────────────────────────────── */
.ws-dot { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Market controls ────────────────────────────────────────────── */
.market-controls-compact { display: flex; gap: 0.5rem; margin-bottom: 0.875rem; align-items: center; }
.market-controls-compact .search-wrapper { flex: 1; }
.market-controls-compact .sort-field { width: 120px; flex-shrink: 0; }
.search-wrapper { position: relative; }
.search-icon { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); font-size: 0.8rem; pointer-events: none; }
.search-field { padding-left: 2rem !important; }

/* ═══════════════════════════════════════════════════════════
   COIN TIER PICKER — v5.6
   ═══════════════════════════════════════════════════════════ */

/* Apply Tier button in alert forms */
.btn-apply-tier {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(0,255,136,0.08), rgba(59,130,246,0.06));
  border: 1px solid rgba(0,255,136,0.22);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}
.btn-apply-tier:hover {
  background: linear-gradient(135deg, rgba(0,255,136,0.14), rgba(59,130,246,0.10));
  border-color: rgba(0,255,136,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,255,136,0.12);
}
.tier-universe-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
  margin-left: auto;
}

/* Overlay backdrop */
.tier-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: tier-overlay-in 0.2s ease;
}
@keyframes tier-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal panel */
.tier-picker-panel {
  background: var(--surface);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,255,136,0.06);
  animation: tier-panel-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes tier-panel-in {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.tier-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.tier-picker-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.tier-picker-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tier-picker-close:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255,71,87,0.2);
}

/* Status line */
.tier-picker-status {
  padding: 0.6rem 1.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--green);
  background: rgba(0,255,136,0.04);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* Tier button grid — 2 columns */
.tier-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 1.25rem 1.5rem;
}

/* Individual tier button */
.tier-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.tier-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,136,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.tier-btn:hover {
  border-color: rgba(0,255,136,0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.tier-btn:hover::before { opacity: 1; }
.tier-btn:active { transform: translateY(0); }

/* Special tiers */
.tier-btn[onclick*="top10"]:hover  { border-color: rgba(255,215,0,0.4); }
.tier-btn[onclick*="top10"]::before { background: linear-gradient(135deg,rgba(255,215,0,0.06),transparent 60%); }
.tier-btn[onclick*="reputable"]:hover { border-color: rgba(59,130,246,0.4); }
.tier-btn[onclick*="reputable"]::before { background: linear-gradient(135deg,rgba(59,130,246,0.08),transparent 60%); }
.tier-btn[onclick*="meme"]:hover   { border-color: rgba(255,71,87,0.3); }
.tier-btn[onclick*="defi"]:hover   { border-color: rgba(168,85,247,0.3); }
.tier-btn[onclick*="ai"]:hover     { border-color: rgba(0,200,255,0.3); }

.tier-btn-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}
.tier-btn-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.tier-btn-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Footer note */
.tier-picker-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* Mobile: single column */
@media (max-width: 480px) {
  .tier-picker-grid { grid-template-columns: 1fr; }
  .tier-picker-panel { border-radius: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   FIREBASE AUTH + PAYMENT UI — v5.7
   ═══════════════════════════════════════════════════════════ */

/* ── Auth Modal ───────────────────────────────────────────── */
.auth-headline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}
.auth-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.btn-google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}
.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.auth-spinner {
  width: 14px; height: 14px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.auth-free-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Plan Badge (in user chip) ────────────────────────────── */
.plan-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}
.plan-badge.paid {
  background: linear-gradient(135deg, rgba(0,255,136,0.15), rgba(0,200,255,0.1));
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
}
.plan-badge.free {
  background: rgba(126,151,184,0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Upgrade Nav Button ───────────────────────────────────── */
.btn-upgrade-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, rgba(0,255,136,0.12), rgba(0,200,255,0.08));
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 7px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-upgrade-nav:hover {
  background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,200,255,0.14));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,255,136,0.15);
}

/* ── Free Plan Banner ─────────────────────────────────────── */
.free-plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.5rem;
  background: rgba(255,181,71,0.06);
  border-bottom: 1px solid rgba(255,181,71,0.15);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.fpb-left { display: flex; align-items: center; gap: 0.5rem; }
.fpb-upgrade {
  background: linear-gradient(135deg, #00e87a, #00b8f0);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.fpb-upgrade:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Plan & Credits Card ───────────────────────────────────── */
.plan-credits-card {
  padding: 0.9rem 1.1rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  transition: border-color 0.2s;
}
.pc-guest  { border-color: rgba(0,232,122,.25);  background: rgba(0,232,122,.04); }
.pc-free   { border-color: rgba(245,158,11,.2);  background: rgba(245,158,11,.04); }
.pc-pro    { border-color: rgba(0,184,212,.2);   background: rgba(0,184,212,.04); }
.pc-low    { border-color: rgba(239,68,68,.3);   background: rgba(239,68,68,.04); }

.plan-credits-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pc-left { display: flex; align-items: center; gap: 0.65rem; flex: 1; min-width: 0; }
.pc-icon { font-size: 1.3rem; flex-shrink: 0; }
.pc-info { min-width: 0; }
.pc-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #718096);
  margin-top: 1px;
  line-height: 1.3;
}
.pc-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  padding: 0.38rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}
.pc-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pc-btn-green { background: var(--green,#00e87a); color: #000; }
.pc-btn-amber { background: #f59e0b; color: #000; }
.pc-btn-dim   { background: rgba(255,255,255,.1); color: var(--text-muted,#718096); }

.pc-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.pc-bar-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.pc-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease, background 0.3s;
}
.pc-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted, #718096);
  white-space: nowrap;
}
/* ── Tab Watchlist Widget ──────────────────────────────────────── */
.tab-watchlist-card { padding: 0.85rem 1rem; }

.tab-wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.1rem;
}

.tab-wl-card {
  background: var(--surface-2, #0f1729);
  border: 1px solid var(--border, #1e2d4a);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.15s;
}
.tab-wl-card:hover { border-color: var(--green, #00e87a); }

.tab-wl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tab-wl-alert-btn {
  margin-top: 0.35rem;
  width: 100%;
  border: 1px solid var(--border, #1e2d4a);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #94a3b8);
  border-radius: 6px;
  padding: 0.22rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.tab-wl-alert-btn:hover {
  background: rgba(0,232,122,0.1);
  border-color: var(--green, #00e87a);
  color: var(--green, #00e87a);
}


/* ── Upgrade Modal ────────────────────────────────────────── */
.upgrade-modal-box {
  max-width: 460px;
  position: relative;
  text-align: center;
}
.modal-close-x {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.upgrade-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.upgrade-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #00e87a, #00b8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.upgrade-reason {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.upgrade-features {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  text-align: left;
}
.uf-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.uf-check {
  color: var(--green);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Plan Cards ───────────────────────────────────────────── */
.plan-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.plan-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-align: center;
}
.plan-card:hover { border-color: rgba(0,255,136,0.3); }
.plan-card[data-selected="true"] {
  border-color: var(--green);
  background: rgba(0,255,136,0.06);
}
.plan-card.best-value { border-color: rgba(0,200,255,0.3); }
.plan-card.best-value[data-selected="true"] { border-color: #00b8f0; background: rgba(0,200,255,0.06); }
.plan-badge-tag {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00e87a, #00b8f0);
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.plan-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.plan-price span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
.plan-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Payment Buttons ──────────────────────────────────────── */
.payment-btns {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.btn-razorpay {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #2d9cdb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-razorpay:hover { background: #2589c5; transform: translateY(-1px); }
.btn-stripe {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-stripe:hover { background: #eee; transform: translateY(-1px); }
.payment-or {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.upgrade-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── v5.8 Sign-In Fixes ─────────────────────────────────────────── */
.auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#googleSignInBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.form-error {
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: #ff4d6d;
  text-align: center;
}

/* Plan card selected state fix */
.plan-card[data-selected="true"] {
  border-color: var(--green, #00ff88) !important;
  background: rgba(0,255,136,0.06) !important;
}

/* ══════════════════════════════════════════════════════════════
   v5.9 — Guest Free Trial & Sign-In Wall Styles
   ══════════════════════════════════════════════════════════════ */

/* Free trial progress bar in login modal */
.free-trial-bar {
  margin: 1rem 0;
  background: var(--surface-2, #121e32);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.ftb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.ftb-label {
  font-size: 0.72rem;
  color: var(--text-muted, #7b94b8);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
}
.ftb-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green, #00ff88);
  font-family: var(--font-mono, monospace);
}
.ftb-track {
  height: 6px;
  background: var(--surface-3, #19273f);
  border-radius: 3px;
  overflow: hidden;
}
.ftb-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff88, #00d4ff);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ftb-fill.warn  { background: linear-gradient(90deg, #ffb020, #ff8c00); }
.ftb-fill.limit { background: linear-gradient(90deg, #ff4d6d, #ff1a4b); }

/* Start free button */
.btn-start-free {
  width: 100%;
  background: linear-gradient(135deg, #00ff88, #00d4ff);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.btn-start-free:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,255,136,0.25);
}

/* Divider between "start free" and Google sign-in */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0;
  color: var(--text-muted, #7b94b8);
  font-size: 0.72rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(255,255,255,0.08));
}

/* Sign-in wall (shown after 15 free alerts used) */
.auth-wall-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
#authModeWall .auth-headline {
  color: var(--amber, #ffb020);
}

/* Guest trial banner (top of app when not signed in) */
.guest-trial-banner {
  background: rgba(0,255,136,0.04) !important;
  border-bottom: 1px solid rgba(0,255,136,0.12) !important;
}
.fpb-sign-in {
  background: var(--green, #00ff88);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.fpb-sign-in:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,255,136,0.3);
}

/* Soft pulse on the guest banner when alerts are almost up */
@keyframes banner-warn-pulse {
  0%, 100% { background: rgba(255,176,32,0.05); }
  50%       { background: rgba(255,176,32,0.10); }
}
.guest-trial-banner.warn {
  animation: banner-warn-pulse 2s ease infinite;
  border-bottom-color: rgba(255,176,32,0.25) !important;
}

/* Modal close button (positioned top-right) */
.modal-close-x {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: var(--surface-2, #121e32);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted, #7b94b8);
  cursor: pointer;
  transition: all 0.15s;
  z-index: 10;
}
.modal-close-x:hover {
  background: var(--surface-3, #19273f);
  color: var(--text, #e2eeff);
  border-color: rgba(255,255,255,0.15);
}

/* ══════════════════════════════════════════════════════════════════
   v5.10 — Auth Tabs + Email Login Form
   ══════════════════════════════════════════════════════════════════ */

/* Tab row */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2, #0d1726);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1rem;
}
.auth-tab {
  flex: 1;
  padding: 0.38rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #7b94b8);
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body, 'Space Grotesk', sans-serif);
}
.auth-tab:hover { color: var(--text, #dde8f7); background: var(--surface-3, #1a2b42); }
.auth-tab.active { background: var(--green, #00ff88); color: #000; font-weight: 700; }

/* Auth pane */
.auth-pane { animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Email form fields */
.auth-field { margin-bottom: 0.65rem; }
.auth-label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted, #7b94b8);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.05em;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
}
.auth-input {
  width: 100%;
  background: var(--surface-2, #0d1726);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text, #dde8f7);
  outline: none;
  font-family: var(--font-body, 'Space Grotesk', sans-serif);
  transition: border-color 0.15s;
}
.auth-input::placeholder { color: var(--text-muted, #7b94b8); opacity: 0.6; }
.auth-input:focus { border-color: var(--green, #00ff88); box-shadow: 0 0 0 2px rgba(0,255,136,0.08); }

/* Email submit button */
.btn-email-submit {
  width: 100%;
  background: var(--green, #00ff88);
  color: #000;
  border: none;
  border-radius: 9px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body, 'Space Grotesk', sans-serif);
  letter-spacing: -0.01em;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn-email-submit:hover { background: #00ff9d; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,255,136,0.25); }
.btn-email-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Forgot password link */
.btn-forgot {
  background: none;
  border: none;
  color: var(--text-muted, #7b94b8);
  font-size: 0.68rem;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
  text-align: center;
  padding: 0.25rem;
  transition: color 0.15s;
  font-family: var(--font-body, 'Space Grotesk', sans-serif);
}
.btn-forgot:hover { color: var(--text, #dde8f7); text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════
   v5.10 — Inline Tier Picker (RSI + % Change tabs)
   ══════════════════════════════════════════════════════════════════ */

/* Two-col form row (timeframe + condition side by side) */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

   v5.10 FINAL — Compact Responsive Tier Grid (.tc)
   Replaces old .itier-btn / .tier-pill / .tier-cat-btn
   ══════════════════════════════════════════════════════════════════ */

/* Container */
/* ── Tier Toggle Switch ──────────────────────────────────────────── */
.tier-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.tier-toggle-checkbox {
  display: none;
}
.tier-toggle-slider {
  position: relative;
  width: 32px;
  height: 17px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(0,232,122,0.2);
  border-radius: 20px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.tier-toggle-slider::after {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.tier-toggle-checkbox:checked + .tier-toggle-slider {
  background: rgba(0,232,122,0.2);
  border-color: rgba(0,232,122,0.65);
}
.tier-toggle-checkbox:checked + .tier-toggle-slider::after {
  transform: translateX(14px);
  background: var(--green, #00e87a);
}
.tier-content {
  animation: tier-reveal 0.22s ease;
}
@keyframes tier-reveal {
  from { opacity:0; transform:translateY(-5px); }
  to   { opacity:1; transform:none; }
}
input[disabled] {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: rgba(0,0,0,0.12) !important;
}
.tcb-clear {
  margin-left: auto;
  font-size: 0.58rem;
  color: var(--text-muted, #7b94b8);
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tcb-clear:hover { color: var(--red, #ff4d6e); border-color: rgba(255,77,110,0.35); }
.tc--allbin { border-color: rgba(255,100,20,0.28); color: #ff7a30; }
.tc--allbin em { color: rgba(255,120,40,0.75); }
.tc--allbin:hover { border-color: rgba(255,100,20,0.55); background: rgba(255,100,20,0.08); }
.tier-block.tier-active {
  border-color: rgba(0,232,122,0.45);
  box-shadow: 0 0 0 2px rgba(0,232,122,0.06);
}

.tier-block {
  margin: 0.75rem 0 0.65rem;
  background: var(--surface-2, #0d1726);
  border: 1.5px solid rgba(0,232,122,0.16);
  border-radius: 12px;
  overflow: hidden;
}
.tier-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  background: rgba(0,232,122,0.04);
  border-bottom: 1px solid rgba(0,232,122,0.1);
  cursor: pointer;
}
.tier-block-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--green, #00e87a);
  letter-spacing: -0.01em;
}
.tier-block-hint {
  font-size: 0.58rem;
  color: var(--text-muted, #7b94b8);
  font-family: var(--font-mono, monospace);
  background: rgba(0,232,122,0.08);
  border: 1px solid rgba(0,232,122,0.15);
  border-radius: 20px;
  padding: 0.08rem 0.45rem;
}

/* Confirm flash */
.tier-confirm-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: rgba(0,232,122,0.07);
  border-bottom: 1px solid rgba(0,232,122,0.12);
  animation: tcb-in 0.2s ease;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--green, #00e87a);
}
@keyframes tcb-in { from { opacity:0; transform:translateY(-3px) } to { opacity:1; transform:none } }

/* 6-column grid — all 11 tiles in 2 rows */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 6px;
}

/* Single tile */
.tc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 2px 4px;
  background: var(--surface-3, #121f33);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;        /* emoji */
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
  min-height: 54px;
}
.tc span {        /* label */
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--text, #dde8f7);
  font-family: var(--font-body, sans-serif);
  line-height: 1.2;
  margin-top: 2px;
}
.tc em {          /* count */
  font-style: normal;
  font-size: 0.44rem;
  color: var(--text-muted, #7b94b8);
  font-family: var(--font-mono, monospace);
  line-height: 1;
}

/* Hover */
.tc:hover { background: rgba(0,232,122,0.07); border-color: rgba(0,232,122,0.28); transform: translateY(-1px); }

/* Tap feedback */
.tc:active {
  transform: scale(0.95) !important;
}
/* Persistent selected state */
.tc--active {
  background: rgba(0,255,136,0.18) !important;
  border-color: rgba(0,255,136,0.6) !important;
  color: var(--green) !important;
  transform: none !important;
}
.tc--active em { color: rgba(0,255,136,0.8) !important; }

/* Colour accents — top row */
.tc--gold   { border-color: rgba(255,215,0,0.25);  color: #ffd700; }
.tc--gold   em { color: rgba(255,215,0,0.7); }
.tc--gold:hover { border-color: rgba(255,215,0,0.5); background: rgba(255,215,0,0.07); }

.tc--silver { border-color: rgba(200,200,215,0.22); color: #c8d0e0; }
.tc--silver:hover { background: rgba(200,200,215,0.08); }

.tc--bronze { border-color: rgba(205,127,50,0.25); color: #cd7f32; }
.tc--bronze:hover { background: rgba(205,127,50,0.08); }

.tc--blue   { border-color: rgba(77,142,255,0.25); color: #4d8eff; }
.tc--blue   em { color: rgba(77,142,255,0.75); }
.tc--blue:hover { border-color: rgba(77,142,255,0.5); background: rgba(77,142,255,0.08); }

.tc--cyan   { border-color: rgba(0,200,255,0.25); color: #00c8ff; }
.tc--cyan   em { color: rgba(0,200,255,0.7); }
.tc--cyan:hover { border-color: rgba(0,200,255,0.5); background: rgba(0,200,255,0.07); }

/* Single coin divider */
.single-coin-divider {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.5rem 0 0.45rem;
  font-size: 0.6rem; color: var(--text-muted, #7b94b8);
}
.single-coin-divider::before,
.single-coin-divider::after {
  content:''; flex:1; height:1px;
  background: var(--border, rgba(255,255,255,0.07));
}

/* Google btn loading overlay */
#googleSignInBtn.btn-loading {
  background: rgba(255,255,255,0.06) !important;
  pointer-events: none;
}
#googleSignInBtn.btn-loading .auth-spinner {
  border-color: rgba(255,255,255,0.25);
  border-top-color: #fff;
}

/* Responsive — phones */
@media (max-width: 400px) {
  .tc { min-height: 48px; font-size: 1rem; padding: 4px 1px 3px; }
  .tc span { font-size: 0.48rem; }
  .tc em   { font-size: 0.42rem; }
  .tier-grid { gap: 3px; padding: 5px; }
}

/* ══════════════════════════════════════════════════════════════════
   STEP LABELS & MODE PILLS (Single Coin / Coin Tier toggle)
══════════════════════════════════════════════════════════════════ */
.form-step-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.step-num {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-lock-hint {
  color: var(--amber, #f59e0b);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  animation: pulse-hint 1.5s ease infinite;
}
@keyframes pulse-hint { 0%,100%{opacity:.7} 50%{opacity:1} }

/* Mode pills */
.target-mode-pills {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
}
.mode-pill {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.mode-pill.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.mode-pill.active[id$="PillTier"] {
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
}
.mode-pill:hover:not(.active) { color: var(--text-dim); }
.target-panel { animation: fadeIn 0.15s ease; }

/* Tier panel */
.tier-panel {
  background: var(--surface-2);
  border: 1px solid rgba(0,255,136,0.12);
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.1rem;
  animation: fadeIn 0.15s ease;
}
.tier-selected-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  animation: slideUp 0.18s ease;
}
.tsb-icon { font-size: 0.9rem; flex-shrink: 0; }
.tsb-text { flex: 1; color: var(--green); font-weight: 600; }
.tsb-clear {
  color: var(--text-muted);
  font-size: 0.7rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.15s;
}
.tsb-clear:hover { color: var(--red); border-color: var(--red); }
.tier-hint-row {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.35rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.settings-locked {
  opacity: 0.38;
  pointer-events: none;
  filter: blur(0.5px);
  transition: all 0.2s ease;
}
.settings-locked input,
.settings-locked select { cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════
   QUICK MONITOR — Watchlist Cards with TradingView
══════════════════════════════════════════════════════════════════ */
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 480px) {
  .watchlist-grid { grid-template-columns: repeat(2, 1fr); }
}
.wl-card {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wl-card:hover {
  border-color: rgba(0,255,136,0.25);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.wl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wl-coin {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.02em;
}
.wl-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.wl-remove:hover { color: var(--red); }
.wl-price {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
}
.wl-change {
  font-size: 0.72rem;
  font-weight: 600;
}
.wl-positive { color: var(--green); }
.wl-negative { color: var(--red); }
.wl-neutral  { color: var(--text-muted); }
.wl-tv-btn {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 0.18rem 0.45rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}
.wl-tv-btn:hover {
  color: var(--green);
  border-color: rgba(0,255,136,0.4);
  background: rgba(0,255,136,0.07);
}
.watchlist-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.75rem;
}
.quick-monitor {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.quick-monitor .input-field { flex: 1; }

/* ════════════════════════════════════════════════════════════════
   MARKET PULSE v12.8 NEW FEATURE STYLES
   ════════════════════════════════════════════════════════════════ */

/* ── Alert Sort/Filter Controls ─────────────────────────────── */
.alert-controls {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.alert-ctrl-sel {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  border-radius: 5px;
  padding: 0.26rem 0.45rem;
  font-size: 0.68rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.alert-ctrl-sel:focus { border-color: rgba(0,255,136,0.3); }

/* ── Live Value Row — close/warn states ─────────────────────── */
.live-val.close {
  color: var(--amber);
  font-weight: 700;
}
.live-val.warn {
  color: var(--green);
  font-weight: 700;
  animation: pulseGlow 1.5s ease infinite;
}
@keyframes pulseGlow {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── Template Packs — inline dashboard cards ────────────────── */
.template-packs-card .card-head {
  border-bottom: 1px solid var(--border);
}
.template-packs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
}
@media (max-width: 500px) {
  .template-packs-grid { grid-template-columns: 1fr 1fr; }
}
.tpl-card {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.tpl-card:hover {
  border-color: rgba(0,255,136,0.2);
  transform: translateY(-1px);
}
.tpl-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.18rem;
}
.tpl-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.tpl-meta {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}
.tpl-btn {
  width: 100%;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 5px;
  padding: 0.3rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.tpl-btn:hover {
  background: rgba(0,255,136,0.2);
  border-color: rgba(0,255,136,0.5);
  transform: none;
}
.tpl-btn-preview {
  background: var(--surface-2) !important;
  color: var(--text-dim) !important;
  border-color: var(--border-2) !important;
}
.tpl-btn-preview:hover {
  background: var(--surface-3) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.15) !important;
}

/* ── Onboarding Action Button ───────────────────────────────── */
.ob-action-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(0,255,136,0.12), rgba(0,200,255,0.07));
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 8px;
  padding: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.75rem;
  transition: all var(--transition);
}
.ob-action-btn:hover {
  background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,200,255,0.12));
}

/* ── Performance Tracking in Trigger History ────────────────── */
.perf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.3rem 0 0.1rem;
}
.perf-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.perf-pos {
  color: var(--green);
  background: var(--green-dim);
  border-color: rgba(0,255,136,0.2);
}
.perf-neg {
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(255,71,87,0.2);
}
.perf-pending {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ── All Binance tier button ────────────────────────────────── */
.tc--allbin {
  background: linear-gradient(135deg, rgba(255,100,50,0.1), rgba(255,60,60,0.05));
  border-color: rgba(255,100,50,0.25) !important;
}
.tc--allbin span { color: #ff6432 !important; }
.tc--allbin:hover, .tc--allbin.on {
  background: linear-gradient(135deg, rgba(255,100,50,0.2), rgba(255,60,60,0.1)) !important;
  border-color: rgba(255,100,50,0.5) !important;
}

/* ── Pack card (modal sheet version) ───────────────────────── */
.pack-card {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0.75rem;
}
.pack-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.pack-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.pack-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.pack-count {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.pack-add-btn {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 5px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all var(--transition);
  white-space: nowrap;
}
.pack-add-btn:hover { background: rgba(0,255,136,0.2); }

/* ════════════════════════════════════════════════════════════════
   MARKET PULSE v12.9 — Proximity Gauges + Volume + Screener
   ════════════════════════════════════════════════════════════════ */

/* ── Proximity Gauge Bars ──────────────────────────────────── */
.alert-proximity-wrap {
  margin: 0.3rem 0 0.25rem;
}
.prox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.22rem;
  flex-wrap: wrap;
}
.prox-price {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim);
  white-space: nowrap;
}
.prox-status {
  flex: 1;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prox-status.prox-s-close {
  color: var(--amber);
  font-weight: 600;
}
.prox-status.prox-s-hit {
  color: var(--green);
  font-weight: 700;
}
.prox-pct {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 2.8rem;
  text-align: right;
}
.prox-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.prox-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, rgba(59,130,246,0.6) 100%);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.prox-bar-fill.prox-close {
  background: linear-gradient(90deg, var(--amber) 0%, rgba(245,166,35,0.7) 100%);
  box-shadow: 0 0 6px rgba(245,166,35,0.3);
}
.prox-bar-fill.prox-triggered {
  background: linear-gradient(90deg, var(--green) 0%, rgba(0,255,136,0.6) 100%);
  box-shadow: 0 0 8px rgba(0,255,136,0.4);
  animation: barPulse 1.2s ease infinite;
}
@keyframes barPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
/* RSI indicator colors */
.rsi-ob { color: var(--red) !important; font-weight: 700; }
.rsi-os { color: var(--green) !important; font-weight: 700; }

/* ── Volume Alert Tab ───────────────────────────────────────── */
.vol-help-box {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 7px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.75rem;
}
.vol-help-icon { font-size: 0.9rem; flex-shrink: 0; }
.vol-help-box span:last-child {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Screener Tab ───────────────────────────────────────────── */
.screener-card { margin-bottom: 0.75rem; }
.screener-filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  padding: 0.75rem;
}
@media (min-width: 640px) {
  .screener-filters { grid-template-columns: repeat(4, 1fr); }
}
.scr-filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.scr-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.scr-range-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.scr-input { font-size: 0.75rem !important; padding: 0.32rem 0.5rem !important; }
.scr-sep { color: var(--text-muted); font-size: 0.8rem; flex-shrink: 0; }
.screener-filter-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.scr-preset-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Screener results */
.screener-results-card { overflow: hidden; }
.scr-results-head {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr 1.5fr 1.2fr;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.scr-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr 1.5fr 1.2fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.scr-row:hover { background: var(--surface-2); }
.scr-row:last-child { border-bottom: none; }
.scr-coin { display: flex; flex-direction: column; }
.scr-sym {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}
.scr-quote {
  font-size: 0.62rem;
  color: var(--text-muted);
}
.scr-price {
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim);
}
.scr-change {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
}
.scr-change.positive { color: var(--green); }
.scr-change.negative { color: var(--red); }
.scr-rsi {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim);
}
.scr-vol {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}
.scr-btn {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 4px;
  padding: 0.22rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.scr-btn:hover {
  background: rgba(0,255,136,0.2);
  border-color: rgba(0,255,136,0.4);
}
.scr-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ════════════════════════════════════════════════════════════════
   MARKET PULSE v12.10 — Telegram · Snooze · Target Calc · Export
   ════════════════════════════════════════════════════════════════ */

/* ── Telegram Settings Card ─────────────────────────────────── */
.tg-settings-card { border-color: rgba(0,136,204,0.2); }
.tg-settings-card:hover { border-color: rgba(0,136,204,0.35); }
.tg-icon { font-size: 1rem; }
.tg-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-2);
}
.tg-status.ok  { color: var(--green); background: var(--green-dim); border-color: rgba(0,255,136,0.2); }
.tg-status.err { color: var(--red);   background: var(--red-dim);   border-color: rgba(255,71,87,0.2); }
.tg-status.warn{ color: var(--amber); background: var(--amber-dim); border-color: rgba(245,166,35,0.2); }
.tg-body { padding: 0 0.1rem; }
.tg-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border-radius: 7px;
  border: 1px solid var(--border);
}
.tg-step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.tg-step-n {
  flex-shrink: 0;
  width: 18px; height: 18px;
  background: rgba(0,136,204,0.15);
  color: #38bdf8;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800;
}
.tg-step strong { color: var(--text); }
.tg-link { color: #38bdf8; text-decoration: none; }
.tg-link:hover { text-decoration: underline; }
.tg-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.tg-field-row { display: flex; gap: 0.4rem; }
.tg-input { font-size: 0.75rem !important; }
.tg-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Export / Import Card ───────────────────────────────────── */
.export-card {}
.export-body { padding-top: 0.25rem; }
.export-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.export-btns {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.export-btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* ── Price Target Calculator ────────────────────────────────── */
.target-calc-wrap {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.target-calc-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.target-calc-btns {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.tcalc-btn {
  flex: 1;
  min-width: 50px;
  padding: 0.3rem 0.2rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.tcalc-btn.tcalc-dn {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255,71,87,0.2);
}
.tcalc-btn.tcalc-dn:hover {
  background: rgba(255,71,87,0.2);
  border-color: rgba(255,71,87,0.4);
}
.tcalc-btn.tcalc-up {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(0,255,136,0.2);
}
.tcalc-btn.tcalc-up:hover {
  background: rgba(0,255,136,0.2);
  border-color: rgba(0,255,136,0.4);
}

/* ── Alert Snooze Button ────────────────────────────────────── */
.btn-snooze {
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-2);
  padding: 0.28rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.03em;
}
.btn-snooze:hover {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245,166,35,0.3);
}
.btn-snooze.btn-snooze-active {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245,166,35,0.3);
  font-weight: 700;
}
.snooze-dropdown-wrap {
  position: relative;
  display: inline-block;
}
.snooze-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 7px;
  min-width: 110px;
  z-index: 200;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.snooze-menu button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.snooze-menu button:hover {
  background: var(--surface-2);
  color: var(--amber);
}
.snooze-menu button + button {
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════════
   MARKET PULSE v13 — Theme · Portfolio · Notes · Sentiment Strip
   ════════════════════════════════════════════════════════════════ */

/* ── Light Theme ─────────────────────────────────────────────── */
body.theme-light {
  --bg:          #f0f4f8;
  --bg-alt:      #e8edf3;
  --surface:     #ffffff;
  --surface-2:   #f7f9fc;
  --surface-3:   #eef2f7;
  --border:      rgba(0, 100, 220, 0.12);
  --border-2:    rgba(0,0,0,0.09);
  --green:       #00a854;
  --green-dim:   rgba(0,168,84,0.1);
  --green-glow:  rgba(0,168,84,0.2);
  --amber:       #d97706;
  --amber-dim:   rgba(217,119,6,0.1);
  --red:         #dc2626;
  --red-dim:     rgba(220,38,38,0.1);
  --blue:        #2563eb;
  --blue-dim:    rgba(37,99,235,0.1);
  --purple:      #7c3aed;
  --text:        #1a2234;
  --text-muted:  #6b7280;
  --text-dim:    #4b5563;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg:   0 20px 48px rgba(0,0,0,0.18);
}

body.theme-light::before {
  background-image:
    linear-gradient(rgba(0,100,220,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,100,220,0.04) 1px, transparent 1px);
  opacity: 0.5;
}

body.theme-light::after {
  background: radial-gradient(circle, rgba(37,99,235,0.04) 0%, transparent 70%);
}

body.theme-light .app-header { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.08); }
body.theme-light .main-nav   { background: rgba(240,244,248,0.98); border-color: rgba(0,0,0,0.08); }
body.theme-light .nav-tab.active { background: rgba(37,99,235,0.12); color: var(--blue); }
body.theme-light .card { background: var(--surface); border-color: rgba(0,0,0,0.08); }
body.theme-light input, body.theme-light select { background: var(--surface-2) !important; color: var(--text) !important; border-color: rgba(0,0,0,0.12) !important; }
body.theme-light .market-table thead th { background: var(--surface-3); }
body.theme-light .alert-history-panel { background: var(--surface); }
body.theme-light .snooze-menu { background: var(--surface-2); }
body.theme-light .port-list-head { background: var(--surface-3); }

/* ── Theme Toggle Button ─────────────────────────────────────── */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  width: 34px; height: 34px;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--surface-3); border-color: var(--border); }

/* ── Market Sentiment Strip ──────────────────────────────────── */
.market-sentiment-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  padding: 0;
}
.market-sentiment-strip::-webkit-scrollbar { display: none; }
.mss-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 80px;
  gap: 0.1rem;
}
.mss-item:last-child { border-right: none; }
.mss-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.mss-val {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  transition: color var(--transition);
}

/* ── Alert Note ──────────────────────────────────────────────── */
.alert-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
  padding: 0.18rem 0.4rem;
  background: var(--surface-3);
  border-left: 2px solid var(--amber);
  border-radius: 0 3px 3px 0;
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Recurring badge ─────────────────────────────────────────── */
.recurring-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.1rem 0.35rem;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 100px;
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: 0.3rem;
}

/* ── Recurring toggle in form ────────────────────────────────── */
.recurring-toggle-row { margin-bottom: 0.5rem !important; }
.recurring-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.recurring-checkbox {
  width: 15px; height: 15px;
  cursor: pointer;
  accent-color: var(--blue);
}
.recurring-text { user-select: none; }

/* ── Watchlist Quick-Alert buttons ──────────────────────────── */
.wl-quick-btns {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
  align-items: center;
}
.wl-alert-btn {
  flex: 1;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-align: center;
}
.wl-alert-price {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245,166,35,0.2);
}
.wl-alert-price:hover { background: rgba(245,166,35,0.2); border-color: rgba(245,166,35,0.4); }
.wl-alert-rsi {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(59,130,246,0.2);
}
.wl-alert-rsi:hover { background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.4); }

/* ── Portfolio Tab ───────────────────────────────────────────── */
.port-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
@media (min-width: 600px) { .port-summary-grid { grid-template-columns: repeat(4, 1fr); } }

.port-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  text-align: center;
}
.port-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.port-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
}
.port-stat-val.port-pnl {}
.port-gain { color: var(--green) !important; }
.port-loss { color: var(--red)   !important; }

.port-form { padding: 0; }
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
@media (max-width: 560px) { .form-row-3 { grid-template-columns: 1fr; } }

/* Holdings list header */
.port-list-head {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr 1fr 1fr 1fr 1.1fr 0.4fr;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  background: var(--surface-3);
  border-radius: 5px;
  margin-bottom: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
@media (max-width: 560px) {
  .port-list-head { display: none; }
}

.port-row {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr 1fr 1fr 1fr 1.1fr 0.4fr;
  gap: 0.25rem;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--transition);
}
.port-row:hover { background: var(--surface-3); }
.port-row:last-child { border-bottom: none; }

@media (max-width: 560px) {
  .port-row {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0.65rem 0.5rem;
  }
  .port-col { font-size: 0.72rem; }
  .port-col-coin { width: 100%; }
  .port-col-act { margin-left: auto; }
}

.port-col { font-size: 0.8rem; font-family: var(--font-mono); color: var(--text-dim); }
.port-col-coin { display: flex; flex-direction: column; }
.port-coin-name { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.port-coin-usdt { font-size: 0.62rem; color: var(--text-muted); }
.port-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px;
}
.port-qty { font-weight: 600; color: var(--text); }

/* Allocation chart */
.port-alloc-chart { display: flex; flex-direction: column; gap: 0.45rem; padding-top: 0.25rem; }
.port-alloc-row { display: flex; align-items: center; gap: 0.6rem; }
.port-alloc-coin {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
  width: 50px;
  flex-shrink: 0;
}
.port-alloc-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
}
.port-alloc-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 2px;
}
.port-alloc-pct {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════
   v14: Screener visual improvements
══════════════════════════════════════════════════════════════ */
.scr-saved-badge { display:inline-flex; align-items:center; gap:4px; background:rgba(0,232,122,0.12);
  color:var(--green); border:1px solid rgba(0,232,122,0.25); border-radius:12px;
  padding:2px 8px; font-size:0.68rem; }
.scr-filter-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.scr-tag { display:inline-flex; align-items:center; gap:4px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:10px; padding:2px 8px; font-size:0.7rem;
  color:var(--text-dim); }
.scr-tag button { background:none; border:none; color:var(--text-muted); padding:0; font-size:0.65rem; cursor:pointer; line-height:1; }
.scr-stats-bar { display:flex; gap:12px; flex-wrap:wrap; padding:8px 0 4px; border-bottom:1px solid var(--border); margin-bottom:8px; }
.scr-stat { text-align:center; }
.scr-stat-val { font-size:1.1rem; font-weight:600; color:var(--text); }
.scr-stat-lbl { font-size:0.62rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }
.scr-row-mini { font-size:0.67rem; color:var(--text-muted); margin-top:2px; }
.scr-universe-note { font-size:0.7rem; color:var(--text-muted); padding:6px 0 2px; }

/* Volume tier panel */
.vol-target-pills { display:flex; gap:6px; margin-bottom:10px; }
.vol-tier-panel .tc-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.vol-tier-selected-bar {
  display: none;
  align-items: center; gap: 8px;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 6px; padding: 8px 12px; margin-top: 10px; font-size: 0.8rem;
  font-weight: 600; color: var(--green);
}
.vol-tier-selected-bar span { color: var(--green); font-weight: 600; }


/* ══════════════════════════════════════════════════════════════
   v15: Colored toast notifications — positive green, negative red
══════════════════════════════════════════════════════════════ */
.toast-success .toast-icon-bar { background: var(--green); }
.toast-error   .toast-icon-bar { background: var(--red);   }
.toast-warning .toast-icon-bar { background: var(--amber); }
.toast-info    .toast-icon-bar { background: var(--blue);  }

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red);   }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-info    { border-left: 3px solid var(--blue);  }

.toast-title-success { color: var(--green); }
.toast-title-error   { color: var(--red);   }
.toast-title-warning { color: var(--amber); }
.toast-title-info    { color: var(--blue);  }

/* Screener +Alert / +Port buttons */
.scr-btn-alert {
  background: rgba(0,255,136,0.12) !important;
  color: var(--green) !important;
  border-color: rgba(0,255,136,0.35) !important;
  font-weight: 600 !important;
}
.scr-btn-alert:hover { background: rgba(0,255,136,0.22) !important; }
.scr-btn-port {
  background: rgba(59,130,246,0.12) !important;
  color: #60a5fa !important;
  border-color: rgba(59,130,246,0.3) !important;
  font-weight: 600 !important;
}
.scr-btn-port:hover { background: rgba(59,130,246,0.2) !important; }

/* v16: Volume tier panel improvements */
.vol-tier-panel {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}
#volTierHint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(0,255,136,0.04);
  border-radius: 5px;
  border-left: 2px solid rgba(0,255,136,0.3);
}

/* v16: Screener action buttons in results */
.scr-actions { display: flex; gap: 4px; flex-shrink: 0; }
.scr-btn { 
  font-size: 0.7rem; padding: 4px 8px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: all 0.15s ease; font-family: inherit; font-weight: 600;
}

/* v16: Template pack grid responsive */
@media (max-width: 640px) {
  .template-packs-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 380px) {
  .template-packs-grid { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════════════════════════
   v17 NEW STYLES
   ══════════════════════════════════════════════════════════════ */

/* ── (v18) market-sentiment-strip replaced by btc-dom-card — styles in v18 block below ── */

/* ── (v18) alert-quick-nav styles moved to v18 block ── */

/* ── Quick Monitor alert jump strip ─────────────────────────── */
.qm-alert-jumps {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.qm-jump-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Settings Quick Links on Dashboard ──────────────────────── */
.settings-quick-links {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.sql-btn {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.sql-btn:hover { border-color: rgba(0,255,136,0.2); background: var(--surface-3); }
.sql-icon { font-size: 1.1rem; flex-shrink: 0; }
.sql-info { flex: 1; min-width: 0; }
.sql-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.sql-sub  { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.12rem; }
.sql-arrow{ color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

/* ── Volume Tab Layout ───────────────────────────────────────── */
.vol-tab-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.75rem;
  align-items: start;
}
@media (max-width: 768px) {
  .vol-tab-layout { grid-template-columns: 1fr; }
}

/* Volume alerts active list header */
.vol-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 0.6fr;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.vol-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .vol-list-header { grid-template-columns: 2fr 1fr 1fr auto; gap: 0.25rem; }
}

/* Screener: add Tier filter column */
@media (min-width: 640px) {
  .screener-filters { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .screener-filters { grid-template-columns: repeat(6, 1fr); }
}

/* Screener responsive table */
.screener-results-card { overflow: hidden; }
.scr-results-head,
.scr-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 0.8fr 1.2fr 1fr;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
}
@media (max-width: 640px) {
  .scr-results-head,
  .scr-row {
    grid-template-columns: 1.2fr 1.2fr 0.9fr 0.8fr 1fr 0.8fr;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    gap: 0.25rem;
  }
  .scr-sym { font-size: 0.72rem; }
  .scr-price, .scr-change, .scr-rsi, .scr-vol { font-size: 0.68rem; }
  .scr-btn { font-size: 0.6rem; padding: 3px 5px; }
}

/* Nav tab size: smaller text for alert tabs to show more */
.nav-tab { padding: 0.55rem 0.6rem; }
.tab-label { font-size: 0.72rem; }
@media (max-width: 480px) {
  .nav-tab { padding: 0.45rem 0.5rem; }
  .tab-label { font-size: 0.65rem; }
  .tab-icon { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════
   v18 NEW STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── Quick nav chips & label ────────────────────────────────── */
.quick-nav-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip-rsi    { background: rgba(99,102,241,0.12); color: #818cf8; border-color: rgba(99,102,241,0.25); }
.chip-price  { background: rgba(245,166,35,0.12);  color: var(--amber); border-color: rgba(245,166,35,0.25); }
.chip-change { background: rgba(0,255,136,0.08);   color: var(--green); border-color: rgba(0,255,136,0.2); }

/* ── Alert ON/OFF Toggle Button ─────────────────────────────── */
.btn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 0.28rem 0.55rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative; z-index: 5;
  letter-spacing: 0.04em;
}
.btn-toggle-on {
  background: rgba(0,255,136,0.12);
  color: var(--green);
  border-color: rgba(0,255,136,0.35);
}
.btn-toggle-on:hover {
  background: rgba(0,255,136,0.22);
  border-color: rgba(0,255,136,0.6);
}
.btn-toggle-on:active { transform: scale(0.95); }

.btn-toggle-off {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
  border-color: rgba(100,116,139,0.3);
}
.btn-toggle-off:hover {
  background: rgba(100,116,139,0.22);
  color: var(--text-dim);
  border-color: rgba(100,116,139,0.5);
}
.btn-toggle-off:active { transform: scale(0.95); }

/* ── Paused alert item visual ───────────────────────────────── */
.alert-item-paused {
  opacity: 0.55;
  border-color: rgba(100,116,139,0.2) !important;
}
.alert-item-paused:hover { opacity: 0.75; }
.badge-paused {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100,116,139,0.25);
}

/* ── BTC Dom Card ───────────────────────────────────────────── */
.btc-dom-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.btc-dom-main {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.btc-dom-main::-webkit-scrollbar { display: none; }
.btc-dom-block {
  padding: 0.65rem 1rem;
  border-right: 1px solid var(--border);
  min-width: 130px;
  flex-shrink: 0;
}
.btc-dom-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.btc-dom-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.35rem;
}
.btc-dom-bar-wrap {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.btc-dom-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease, background 0.5s ease;
  background: var(--green);
}
.mss-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
  align-self: stretch;
}
.mss-mini-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.875rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  min-width: max-content;
}
.mss-mini-item:last-child { border-right: none; }
.mss-chg {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ── Dashboard utility row (Telegram + Backup side by side) ── */
.dash-utility-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dash-tg-card { border-color: rgba(0,136,204,0.2); }
.dash-tg-card:hover { border-color: rgba(0,136,204,0.35); }
.dash-backup-card { border-color: rgba(0,255,136,0.1); }

/* ── Quick nav chip colour variants ────────────────────────── */
.chip-screener { background: rgba(56,189,248,0.08); color: #38bdf8; border-color: rgba(56,189,248,0.22); }
.chip-settings { background: rgba(148,163,184,0.08); color: var(--text-dim); border-color: rgba(148,163,184,0.22); }

/* ── Alert quick nav — no wrap, horizontal scroll ─────────── */
.alert-quick-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex-wrap: nowrap;
}
.alert-quick-nav::-webkit-scrollbar { display: none; }

/* ── Screener: hide RSI col on narrow phones ────────────────── */
@media (max-width: 420px) {
  .scr-results-head,
  .scr-row {
    grid-template-columns: 1.4fr 1.4fr 1fr 1.2fr 0.7fr;
  }
  .scr-col-rsi, .scr-row > div:nth-child(4) { display: none; }
}

/* ── Market table: hide MCap + Vol on very small ────────────── */
@media (max-width: 420px) {
  .th-mcap, .market-table td:nth-child(5),
  .th-vol,  .market-table td:nth-child(4) { display: none; }
}

/* ── Tier grid: 3 cols on phone ─────────────────────────────── */
@media (max-width: 540px) {
  .tier-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Edit overlay: full-width on phone ──────────────────────── */
@media (max-width: 600px) {
  .edit-alert-sheet { max-width: 100%; border-radius: 18px 18px 0 0; }
}

/* ── Export buttons side by side ────────────────────────────── */
.export-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.export-btn { flex: 1; min-width: 100px; }

/* ── Telegram actions row ───────────────────────────────────── */
.tg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.tg-actions .btn-primary { flex: 1; min-width: 80px; }

/* ═══════════════════════════════════════════════════════════════
   v19 NEW STYLES — Confirm Dialog + Delete All Button
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Confirm Dialog ──────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 6, 9, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.confirm-overlay.confirm-visible {
  opacity: 1;
}
.confirm-box {
  background: var(--surface, #0a1220);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,255,136,0.05);
  transform: scale(0.96);
  transition: transform 0.2s ease;
  text-align: center;
}
.confirm-overlay.confirm-visible .confirm-box {
  transform: scale(1);
}
.confirm-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  line-height: 1;
}
.confirm-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono, monospace);
}
.confirm-msg {
  font-size: 0.78rem;
  color: var(--text-muted, #4a6080);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}
.confirm-actions {
  display: flex;
  gap: 0.625rem;
}
.confirm-btn-cancel {
  flex: 1;
  background: var(--surface-3, #111e33);
  border: 1px solid var(--border-2, rgba(0,255,136,0.1));
  color: var(--text-dim, #94a3b8);
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-mono, monospace);
  touch-action: manipulation;
}
.confirm-btn-cancel:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.confirm-btn-cancel:active { transform: scale(0.97); }

/* OK button reuses .btn-danger styles — override size */
#confirmOk.btn-danger {
  flex: 1.4;
  padding: 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  touch-action: manipulation;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Delete All Button ──────────────────────────────────────── */
.btn-delete-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,71,87,0.08);
  color: var(--red, #ff4757);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: 5px;
  padding: 0.22rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-mono, monospace);
  transition: all 0.18s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-delete-all:hover {
  background: rgba(255,71,87,0.16);
  border-color: rgba(255,71,87,0.4);
}
.btn-delete-all:active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════════
   v20 — Recurring ON badge + cooldown selector + flash
   ═══════════════════════════════════════════════════════════════ */

/* Recurring always-on row */
.recurring-toggle-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}
.recurring-always-on {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
}
.recurring-on-badge {
  background: rgba(0,255,136,0.1);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}
.recurring-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cooldown-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cooldown-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.cooldown-sel {
  flex: 1;
  font-size: 0.75rem !important;
  padding: 0.35rem 0.6rem !important;
}

/* New item slide-in flash */
@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert-item-new {
  animation: alertSlideIn 0.22s ease forwards;
}

/* Add button success flash */
.btn-primary.btn-flash-success {
  background: var(--green) !important;
  color: #0a0e1a !important;
  transform: scale(1.01);
}

/* ═══════════════════════════════════════════════════════════════
   v22 — Dashboard settings strip (replaces Telegram+Backup cards)
   ═══════════════════════════════════════════════════════════════ */
.dash-settings-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--surface-2, #0e1828);
  border: 1px solid var(--border, rgba(0,255,136,0.07));
  border-radius: 9px;
  padding: 0.55rem 0.875rem;
  margin-bottom: 0.75rem;
}
.dss-label {
  font-size: 0.65rem;
  color: var(--text-muted, #4a6080);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 0.15rem;
}
.dss-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-3, #131f30);
  border: 1px solid var(--border, rgba(0,255,136,0.07));
  color: var(--text-dim, #94a3b8);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dss-btn:hover, .dss-btn:active {
  border-color: rgba(0,255,136,0.2);
  color: var(--text, #e2e8f0);
  background: rgba(0,255,136,0.05);
}
.dss-tg {
  border-color: rgba(0,136,204,0.2);
  color: #38bdf8;
}
.dss-tg:hover {
  border-color: rgba(56,189,248,0.35);
  background: rgba(56,189,248,0.06);
}
.dss-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dss-dot-on  { background: var(--green, #00ff88); }
.dss-dot-off { background: var(--text-muted, #4a6080); }
