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

/* Theme tokens. Each theme is 2-tone (body vs card) with full palette.
   --bg-body  : outermost background
   --bg-card  : primary panel fill
   --bg-card-2: secondary/darker panel tone (used for gradients + stripes + inset cards)
   --bg-topbar: top nav / status bar
   --border   : standard 1px separator
   --border-strong: stronger border (on hover/active)
   --text     : body text
   --text-dim : muted text
   --accent   : brand accent (buttons, toggles, highlights)
   --accent-soft: translucent accent for tints + borders
*/
:root {
  --bg-body: #08090d; --bg-card: #0c0d12; --bg-card-2: #131420; --bg-topbar: #0c0d12;
  --border: rgba(255,255,255,0.06); --border-strong: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.88); --text-dim: rgba(255,255,255,0.45);
  --accent: #22c55e; --accent-soft: rgba(34,197,94,0.1);
}
body[data-theme="slate"]    { --bg-body: #0a0f1c; --bg-card: #0e1424; --bg-card-2: #141c33; --bg-topbar: #0c1220; --accent: #3b82f6; --accent-soft: rgba(59,130,246,0.12); }
body[data-theme="discord"]  { --bg-body: #1e1f22; --bg-card: #2b2d31; --bg-card-2: #313338; --bg-topbar: #1e1f22; --accent: #5865f2; --accent-soft: rgba(88,101,242,0.16); --border: rgba(255,255,255,0.08); }
body[data-theme="purple"]   { --bg-body: #15101f; --bg-card: #1d1630; --bg-card-2: #2a1f48; --bg-topbar: #181124; --accent: #a855f7; --accent-soft: rgba(168,85,247,0.16); }
body[data-theme="crimson"]  { --bg-body: #1a0a0f; --bg-card: #251015; --bg-card-2: #371820; --bg-topbar: #1e0c12; --accent: #ef4444; --accent-soft: rgba(239,68,68,0.16); }
body[data-theme="mint"]     { --bg-body: #0a1914; --bg-card: #0e2320; --bg-card-2: #143b34; --bg-topbar: #0c1d18; --accent: #2dd4bf; --accent-soft: rgba(45,212,191,0.16); }
body[data-theme="gold"]     { --bg-body: #1a1508; --bg-card: #22190b; --bg-card-2: #302311; --bg-topbar: #1e170a; --accent: #eab308; --accent-soft: rgba(234,179,8,0.16); }
body[data-theme="light"]    { --bg-body: #f6f6f8; --bg-card: #ffffff; --bg-card-2: #f0f0f4; --bg-topbar: #fafafa; --border: rgba(0,0,0,0.08); --border-strong: rgba(0,0,0,0.16); --text: rgba(0,0,0,0.85); --text-dim: rgba(0,0,0,0.5); --accent: #3b82f6; --accent-soft: rgba(59,130,246,0.1); }

html, body { width: 100%; height: 100%; background: var(--bg-body); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif; font-size: 13px; overflow: hidden; }
body { display: flex; flex-direction: column; }
.brand-or { color: #ef4444; }
a { color: inherit; }

/* ── Splash ── */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg-body); z-index: 100; }
.splash[hidden], .app[hidden] { display: none !important; }
.splash-logo { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; color: rgba(255,255,255,0.9); }
.splash-sub { font-size: 12px; color: rgba(255,255,255,0.35); }

/* ── App layout ── */
.app { width: 100%; height: 100%; display: flex; flex-direction: column; }

/* ── Top bar ── */
.topbar { flex: 0 0 52px; display: flex; align-items: center; gap: 24px; padding: 0 20px; background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border-bottom: 1px solid var(--border); user-select: none; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.4px; color: rgba(255,255,255,0.95); }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #ef4444); box-shadow: 0 0 10px rgba(239,68,68,0.4); }
.brand-name { font-weight: 800; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-btn { background: transparent; border: none; color: rgba(255,255,255,0.55); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.12s; }
.nav-btn:hover { color: rgba(255,255,255,0.95); background: rgba(255,255,255,0.04); }
.nav-btn.active { color: #fff; background: rgba(34,197,94,0.1); }
.nav-btn .nav-badge { background: rgba(234,179,8,0.18); color: #eab308; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.3px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.session-chip { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 5px 10px; border-radius: 5px; letter-spacing: 0.3px; font-variant-numeric: tabular-nums; }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.12s; }
.icon-btn:hover { background: rgba(239,68,68,0.08); color: #ef4444; border-color: rgba(239,68,68,0.3); }

/* ── Body ── */
.body { flex: 1; min-height: 0; overflow: auto; padding: 24px 28px; }
.view { display: none; }
.view.active { display: block; }

/* ── Home: greeting + stat cards + recent + quick tiles ── */
.home-header { margin-bottom: 22px; }
.home-greeting { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.home-sub { font-size: 13px; color: rgba(255,255,255,0.45); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-card { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; transition: border-color 0.15s; position: relative; overflow: hidden; }
.stat-card:hover { border-color: rgba(255,255,255,0.12); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent, #22c55e); opacity: 0.7; }
.stat-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.stat-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub.up { color: #22c55e; }
.stat-sub.down { color: #ef4444; }

.section { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); letter-spacing: 0.2px; }
.section-link { font-size: 11px; color: rgba(34,197,94,0.8); text-decoration: none; font-weight: 600; }
.section-link:hover { color: #22c55e; }
.section-empty { font-size: 12px; color: rgba(255,255,255,0.4); padding: 24px 0; text-align: center; }

.tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; padding: 16px; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 8px; color: rgba(255,255,255,0.85); }
.tile:hover { border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.04); }
.tile-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); }
.tile:hover .tile-icon { background: rgba(34,197,94,0.1); color: #22c55e; }
.tile-name { font-size: 13px; font-weight: 700; color: #fff; }
.tile-desc { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.4; }

/* ── Stub views ── */
.view-stub { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; gap: 12px; color: rgba(255,255,255,0.5); text-align: center; padding: 40px 20px; }
.view-stub-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.35); }
.view-stub-title { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.85); }
.view-stub-desc { font-size: 12px; max-width: 320px; line-height: 1.5; }

/* ── Status bar ── */
.statusbar { flex: 0 0 30px; display: flex; align-items: center; padding: 0 16px; background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border-top: 1px solid var(--border); font-size: 11px; color: rgba(255,255,255,0.55); gap: 14px; font-variant-numeric: tabular-nums; }
.status-item { display: inline-flex; align-items: center; gap: 5px; }
.status-label { color: rgba(255,255,255,0.35); font-weight: 500; font-size: 10px; letter-spacing: 0.4px; text-transform: uppercase; }
.status-val { color: rgba(255,255,255,0.85); font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e66; }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 6px #ef444466; }
.status-spacer { flex: 1; }

/* ── Shared form controls ── */
input[type="text"], input[type="number"], select { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: #fff; font-family: inherit; font-size: 13px; padding: 9px 12px; border-radius: 6px; outline: none; width: 100%; transition: border-color 0.12s, background 0.12s; }
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: rgba(34,197,94,0.45); background: rgba(255,255,255,0.06); }
input[type="text"]::placeholder, input[type="number"]::placeholder { color: rgba(255,255,255,0.25); }
select { appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="%23ffffff80" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>'); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.select-w { max-width: 240px; }

.row-buttons { display: flex; gap: 8px; margin-top: 10px; }
.btn-primary { background: #22c55e; color: #000; border: none; padding: 8px 14px; border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.12s; }
.btn-primary:hover:not(:disabled) { background: #16a34a; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary.btn-wide { width: 100%; justify-content: center; padding: 11px; margin-top: 14px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); padding: 8px 14px; border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.12s; }
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: #fff; }

.tag { font-size: 9px; font-weight: 800; letter-spacing: 0.6px; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55); text-transform: uppercase; }
.tag-ok { background: rgba(34,197,94,0.15); color: #22c55e; }

.section-sub { font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 12px; line-height: 1.5; }
.sub-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; text-transform: uppercase; margin: 14px 0 8px; }

.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }

.code-box { font-family: 'SF Mono', 'Courier New', monospace; letter-spacing: 3px; text-align: center; font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.85); }

/* ── Slider ── */
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: rgba(255,255,255,0.6); }
.slider-row input[type=range] { flex: 1; max-width: 280px; appearance: none; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; outline: none; }
.slider-row input[type=range]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; cursor: pointer; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.slider-val { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums; min-width: 36px; }

/* ── Alert type cards ── */
.alert-type-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.alert-type-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 8px; padding: 14px; text-align: center; cursor: pointer; transition: all 0.12s; }
.alert-type-card:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
.alert-type-card.active { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.06); }
.alert-type-card svg { margin-bottom: 8px; color: rgba(255,255,255,0.6); }
.alert-type-card.active svg { color: #22c55e; }
.at-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.at-desc { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.4; }

/* ── Filter chips ── */
.filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter-chip { background: rgba(255,255,255,0.02); border: 1px solid var(--border); color: rgba(255,255,255,0.7); font-family: inherit; font-size: 12px; font-weight: 600; padding: 11px; border-radius: 8px; cursor: pointer; transition: all 0.12s; }
.filter-chip:hover { border-color: rgba(255,255,255,0.15); color: #fff; }
.filter-chip.active { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.06); color: #22c55e; }

/* ── Trading Quick Trade card ── */
.qt-field { margin-bottom: 14px; }
.qt-field label { display: block; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.qt-amount-row { display: flex; gap: 6px; }
.qt-amount-row input { flex: 1; }
.pill { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); font-family: inherit; font-size: 12px; font-weight: 600; padding: 0 12px; border-radius: 6px; cursor: pointer; transition: all 0.12s; }
.pill:hover { border-color: rgba(34,197,94,0.4); color: #22c55e; }
.qt-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.btn-buy { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); color: #22c55e; padding: 11px; border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.12s; }
.btn-buy:hover:not(:disabled) { background: rgba(34,197,94,0.2); }
.btn-buy:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sell { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); color: #ef4444; padding: 11px; border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.12s; }
.btn-sell:hover:not(:disabled) { background: rgba(239,68,68,0.2); }
.btn-sell:disabled { opacity: 0.4; cursor: not-allowed; }
.qt-hint { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 10px; line-height: 1.5; }

/* ── Tracker ── */
.tracker-view { height: 100%; }
.tracker-chrome { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tracker-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tracker-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.tracker-filters { display: flex; gap: 5px; }
.chip { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: rgba(255,255,255,0.65); font-family: inherit; font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 5px; cursor: pointer; transition: all 0.12s; }
.chip:hover { border-color: rgba(255,255,255,0.15); color: #fff; }
.chip.active { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.4); color: #22c55e; }

.tracker-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Tracker unified panels — Axiom-style horizontal column grid. Each panel
   owns its vertical space + scrolls independently. Chat strip stays on top.
   Responsive: 4→2→1 columns as viewport narrows. */
.tpanel-grid { display: grid; grid-template-columns: repeat(var(--tpanel-cols, 4), 1fr); gap: 10px; margin-top: 12px; flex: 1; min-height: 0; }
.tpanel { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.tpanel-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tpanel-head-left { min-width: 0; }
.tpanel-title { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.92); display: flex; align-items: center; gap: 6px; }
.tpanel-title::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent, #22c55e); }
.tpanel-hint { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* Filter icon button + popover inside each panel head */
.filter-icon-btn { background: transparent; border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.55); width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.12s; flex-shrink: 0; }
.filter-icon-btn:hover { background: rgba(34,197,94,0.08); color: #22c55e; border-color: rgba(34,197,94,0.3); }
.filter-icon-btn.open { background: rgba(34,197,94,0.12); color: #22c55e; border-color: rgba(34,197,94,0.4); }

.filter-pop { position: absolute; top: calc(100% + 6px); right: 10px; z-index: 20; min-width: 200px; max-width: 280px; background: #0f1117; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 10px 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.filter-pop[hidden] { display: none; }
.filter-pop-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.filter-pop .tracker-filters { gap: 5px; }
.tpanel-body { flex: 1; min-height: 200px; overflow: auto; }

/* Tracker row hover → Quick Buy overlay (Axiom pattern). Button lives inside
   the MC cell as position:absolute, hidden until row hover. */
.rn-trade-row { border-bottom: 1px solid rgba(255,255,255,0.03); }
.rn-trade-row:hover { filter: brightness(1.15); }
.rn-trade-row:hover .rn-qbuy { opacity: 1 !important; pointer-events: auto !important; }
.rn-trade-row:hover .rn-mc-val { opacity: 0.3; transition: opacity .12s; }
.rn-mc-val { pointer-events: none; }
.rn-qbuy:hover { background: rgba(34,197,94,0.22) !important; border-color: rgba(34,197,94,0.7) !important; }
.rn-wallet-link:hover { color: #fff !important; text-decoration: underline; }
@media (max-width: 1100px) { .tpanel-grid { --tpanel-cols: 2; } }
@media (max-width: 640px) { .tpanel-grid { --tpanel-cols: 1; } }

/* Wallets/Presets config rows in Settings */
.list-row { display: grid; grid-template-columns: 32px 1fr 110px auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: rgba(255,255,255,0.02); }
.list-row input, .list-row select { padding: 6px 10px; font-size: 12px; }
.list-row .emoji { text-align: center; font-size: 18px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; padding: 4px 0; }
.list-row .del { background: transparent; border: none; color: rgba(239,68,68,0.7); cursor: pointer; padding: 4px 6px; }
.list-row .del:hover { color: #ef4444; }
.list-add { display: grid; grid-template-columns: 60px 1fr 110px 80px; gap: 8px; margin-top: 10px; }
.list-add .btn-primary { padding: 8px 12px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.toggle-row + .toggle-row { border-top: 1px solid rgba(255,255,255,0.04); }
.toggle-row-meta { flex: 1; }
.toggle-row-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); }
.toggle-row-desc { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 22px; background: rgba(255,255,255,0.12); transition: background 0.15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch input:checked ~ .switch-track { background: #22c55e; }
.switch input:checked ~ .switch-thumb { left: 19px; }

.preset-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.preset-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preset-name { font-size: 13px; font-weight: 700; color: #fff; }
.preset-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset-fields label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; text-transform: uppercase; display: block; margin-bottom: 4px; }
.preset-fields input { padding: 7px 10px; font-size: 12px; }

/* Copy Trader rows */
.copy-row { display: grid; grid-template-columns: auto 1fr 80px 110px 32px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: rgba(255,255,255,0.02); }
.copy-wallet { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-preset { padding: 6px 10px; font-size: 12px; }
.copy-add { display: grid; grid-template-columns: 1fr 80px 110px 100px; gap: 8px; margin-top: 10px; }
.copy-add .btn-primary { padding: 8px 12px; }

/* Social Sniper — 3-column layout: left sidebar, middle feed, right history.
   Left + right are identical widths for symmetric framing. */
.sn-layout { display: grid; grid-template-columns: 300px 1fr 300px; gap: 12px; align-items: start; }
.sn-col-left, .sn-col-right { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.sn-col-mid { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1280px) { .sn-layout { grid-template-columns: 240px 1fr; } .sn-col-right { display: none; } }
@media (max-width: 880px) { .sn-layout { grid-template-columns: 1fr; } .sn-col-left { position: static; } }

/* Left column: intro card + config cards */
.sn-intro { background: linear-gradient(135deg, rgba(168,85,247,0.06), rgba(168,85,247,0)); border-color: rgba(168,85,247,0.2); }
.sn-intro-body { font-size: 11px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 10px; }
.sn-intro-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.intro-chip { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 4px; background: rgba(255,255,255,0.04); letter-spacing: 0.3px; }

/* Left column: Open Positions panel */
.sn-positions { max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.pos-body { flex: 1; overflow: auto; }

/* Compact config strip at top of middle column */
.sn-config-strip { display: grid; grid-template-columns: 1fr 120px 2fr; gap: 10px; padding: 12px 14px; background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; }
.cfg-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cfg-cell-wide .sn-webhook-row { gap: 4px; }
.cfg-cell-wide .sn-webhook-row input { flex: 1; min-width: 0; }
.cfg-label { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.5px; text-transform: uppercase; }
.cfg-input { font-size: 12px !important; padding: 7px 10px !important; }
@media (max-width: 900px) { .sn-config-strip { grid-template-columns: 1fr; } }

/* Right column: execution history */
.sn-history { max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.sn-history-tabs { display: flex; gap: 4px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; }
.hist-tab { background: transparent; border: 1px solid transparent; color: rgba(255,255,255,0.5); font-family: inherit; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 5px; cursor: pointer; transition: all 0.12s; }
.hist-tab:hover { color: #fff; background: rgba(255,255,255,0.04); }
.hist-tab.on { background: rgba(255,255,255,0.08); color: #fff; }
.hist-search { flex: 1; min-width: 100px; padding: 4px 8px !important; font-size: 11px !important; border-radius: 5px !important; }
.sn-history-body { flex: 1; overflow: auto; }

/* Legacy grid reference (no longer used — kept to not break anything transient) */
.sn-shared-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.sn-card { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.sn-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.sn-card-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: rgba(59,130,246,0.12); color: #60a5fa; display: inline-flex; align-items: center; justify-content: center; }
.sn-card-title { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.95); }
.sn-card-sub { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.sn-card-chev { margin-left: auto; color: rgba(255,255,255,0.35); font-size: 14px; }
.sn-card-body select, .sn-card-body input { font-size: 12px; padding: 8px 10px; width: 100%; }
.sn-card-body .sn-select-dim { margin-top: 8px; background: rgba(255,255,255,0.02); color: rgba(255,255,255,0.65); font-size: 11px; }

/* Wallet pill — address + label + balance + primary badge */
.sn-wallet-pill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(59,130,246,0.06); border: 1px solid rgba(59,130,246,0.2); border-radius: 8px; font-size: 12px; }
.sn-wallet-addr { font-family: 'SF Mono', monospace; color: rgba(255,255,255,0.9); font-weight: 600; }
.sn-wallet-default { color: rgba(255,255,255,0.7); font-weight: 600; flex: 1; }
.sn-wallet-balance { color: rgba(255,255,255,0.55); font-variant-numeric: tabular-nums; }
.tag-primary { background: rgba(59,130,246,0.18); color: #60a5fa; }
.tag-beta { background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(59,130,246,0.25)); color: #c084fc; border: 1px solid rgba(168,85,247,0.4); font-size: 9px; }

/* AI Sniper section gets a distinctive gradient border */
.sn-section-ai { background: linear-gradient(180deg, rgba(168,85,247,0.04), rgba(59,130,246,0.02)), linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border-color: rgba(168,85,247,0.25); }
.sn-section-ai .sn-type-icon { background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(59,130,246,0.2)); color: #c084fc; }

/* Discord webhook row — input + eye + send */
.sn-webhook-row { display: flex; gap: 6px; align-items: stretch; }
.sn-webhook-row input { flex: 1; }
.sn-icon-btn { width: 36px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.65); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.12s; }
.sn-icon-btn:hover { background: rgba(34,197,94,0.08); color: #22c55e; border-color: rgba(34,197,94,0.3); }

/* Master-tasks card — full width, lightning icon */
.sn-master-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.2); border-radius: 10px; margin-bottom: 12px; }
.sn-master-left { display: flex; align-items: center; gap: 10px; }
.sn-master-card .sn-card-icon { background: rgba(239,68,68,0.12); }

/* Per-type section — add icon + title + add button */
.sn-section-head-left { display: flex; align-items: flex-start; gap: 10px; }
.sn-type-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: rgba(168,85,247,0.12); color: #c084fc; display: inline-flex; align-items: center; justify-content: center; }
.sn-section:nth-child(odd) .sn-type-icon { background: rgba(239,68,68,0.12); color: #f87171; }

@media (max-width: 760px) { .sn-shared-grid { grid-template-columns: 1fr; } }

/* ── Settings: sidebar layout ── */
.settings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.settings-nav { background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: 10px; padding: 14px 10px; position: sticky; top: 0; }
.settings-nav-head { padding: 4px 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.settings-nav-title { display: flex; align-items: center; gap: 8px; }
.settings-nav-name { font-size: 13px; font-weight: 800; color: var(--text); }
.settings-nav-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.settings-nav-group { margin-bottom: 14px; }
.settings-nav-group:last-child { margin-bottom: 0; }
.settings-nav-group-label { font-size: 9px; font-weight: 800; color: #eab308; letter-spacing: 0.8px; padding: 0 8px 6px; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; width: 100%; border: none; background: transparent; color: var(--text-dim); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all 0.12s; text-align: left; }
.settings-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.settings-nav-item.on { background: linear-gradient(90deg, rgba(234,179,8,0.25), rgba(234,179,8,0.05)); color: #eab308; }
.settings-nav-item.on .sni-icon { color: #eab308; }
.sni-icon { opacity: 0.7; display: inline-flex; }
.settings-nav-item.on .sni-icon { opacity: 1; }

.settings-content { min-width: 0; }
.settings-pane { }
.settings-pane-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.settings-pane-title { display: flex; align-items: center; gap: 10px; }

.trackers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } .settings-nav { position: static; } .trackers-grid { grid-template-columns: 1fr; } }

/* ── Theme picker grid ── */
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-card { background: transparent; border: 2px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px; cursor: pointer; transition: all 0.12s; }
.theme-card:hover { border-color: rgba(255,255,255,0.2); }
.theme-card.on { border-color: var(--accent, #22c55e); box-shadow: 0 0 0 1px var(--accent, #22c55e); }
.theme-swatch { width: 100%; aspect-ratio: 16/9; border-radius: 6px; position: relative; margin-bottom: 8px; }
.theme-dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.theme-name { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); text-align: center; }
@media (max-width: 600px) { .theme-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Per-tracker alert cards ── */
.al-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; transition: border-color 0.15s; }
.al-card.on { border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.03); }
.al-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.al-meta { flex: 1; }
.al-name { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.92); }
.al-desc { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.al-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.04); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.al-card:not(.on) .al-body { opacity: 0.4; pointer-events: none; }
.al-row .al-sub { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 6px; }
.al-row select { font-size: 12px; padding: 7px 10px; }
.al-chips { display: flex; gap: 5px; }
.al-chip { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.65); font-family: inherit; font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 5px; cursor: pointer; transition: all 0.12s; }
.al-chip:hover { border-color: rgba(255,255,255,0.18); color: #fff; }
.al-chip.on { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.45); color: #22c55e; }
.al-extra { grid-column: 1 / -1; }
.al-extra label { display: block; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 6px; }
.al-extra input { font-size: 12px; padding: 7px 10px; max-width: 200px; }

/* ── Trigger modal (Add CA / Keyword / Image / Interaction / Post / Activity) ── */
.sn-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.sn-modal-ov { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.sn-modal-dialog { position: relative; width: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 40px); background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.sn-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sn-modal-title { font-size: 15px; font-weight: 700; color: #fff; }
.sn-modal-x { background: transparent; border: none; color: rgba(255,255,255,0.5); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; transition: color 0.12s; }
.sn-modal-x:hover { color: #fff; }
.sn-modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.sn-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.sn-modal-foot .btn-primary { padding: 9px 16px; }

/* Form fields inside the modal */
.fm-field { margin-bottom: 14px; }
.fm-field > label { display: block; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.65); letter-spacing: 0.3px; margin-bottom: 6px; }
.fm-field > label .fm-muted { font-weight: 400; color: rgba(255,255,255,0.4); text-transform: none; letter-spacing: 0; }
.fm-muted { font-size: 11px; color: rgba(255,255,255,0.4); }
.fm-info { padding: 10px 12px; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); border-radius: 8px; color: rgba(255,255,255,0.85); font-size: 12px; margin-bottom: 14px; }
.fm-input-row { display: flex; gap: 6px; }
.fm-input-row input { flex: 1; }
.fm-sublabel { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.5); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 4px; }
.fm-fees { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.fm-pill-row { display: flex; gap: 6px; }
.fm-pill { flex: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.65); font-family: inherit; font-size: 12px; font-weight: 600; padding: 9px; border-radius: 8px; cursor: pointer; transition: all 0.12s; }
.fm-pill:hover { border-color: rgba(255,255,255,0.18); color: #fff; }
.fm-pill.on { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Activity chip toggles */
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-chip { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); font-family: inherit; font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 999px; cursor: pointer; transition: all 0.12s; }
.act-chip:hover { border-color: rgba(59,130,246,0.4); color: #fff; }
.act-chip.on { background: rgba(59,130,246,0.18); border-color: #3b82f6; color: #60a5fa; }

/* Toggle rows */
.fm-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.fm-toggle-row + .fm-toggle-row { border-top: 1px solid rgba(255,255,255,0.04); }
.fm-toggle-name { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.9); }
.fm-toggle-desc { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }

/* Per-type sniper section + rule rows */
.sn-section { padding-top: 14px; padding-bottom: 14px; }
.sn-section .section-head .btn-primary.sn-add-btn { padding: 6px 12px; font-size: 11px; }
.sn-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.sn-row { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(59,130,246,0.04); border: 1px solid rgba(59,130,246,0.2); border-radius: 8px; }
.sn-row-body { min-width: 0; }
.sn-row-head { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-row-stats { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.sn-row-mint { font-family: 'SF Mono', monospace; font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-row-icon { background: transparent; border: none; color: rgba(255,255,255,0.55); width: 26px; height: 26px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.12s; }
.sn-row-icon:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sn-row-icon.del:hover { color: #ef4444; background: rgba(239,68,68,0.08); }

@media (max-width: 760px) { .sn-shared { grid-template-columns: 1fr; } }

/* Popout mode — chrome-free layout when ?popout=1.
   Single combined feed replaces the 4-panel grid; chat strip is on top. */
body.popout .topbar, body.popout .statusbar { display: none !important; }
body.popout .body { padding: 0; overflow: hidden; }
body.popout .view { height: 100%; display: flex; flex-direction: column; }
body.popout .tracker-view { height: 100%; display: flex; flex-direction: column; }

.popout-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2)); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.popout-title { font-size: 13px; font-weight: 800; letter-spacing: 0.4px; color: rgba(255,255,255,0.9); }

.feed-cols { display: grid; grid-template-columns: 70px 110px 1fr 90px; gap: 10px; padding: 8px 14px; background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.5px; text-transform: uppercase; flex: 0 0 auto; }
.feed-body { flex: 1; overflow: auto; min-height: 0; }

.tracker-chat { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.05); }
.tracker-chat-input { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; padding: 7px 11px; color: rgba(255,255,255,0.9); font-size: 12px; font-family: inherit; outline: none; }
.tracker-chat-input::placeholder { color: rgba(255,255,255,0.3); }
.tracker-chat-status { font-size: 10px; color: rgba(255,255,255,0.35); white-space: nowrap; padding: 0 4px; }

.tracker-cols { display: grid; grid-template-columns: 70px 150px 1fr 100px 90px; gap: 12px; padding: 9px 16px; background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 0.5px; text-transform: uppercase; }
.tracker-body { min-height: 320px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .body { padding: 18px; }
}
