:root {
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #171d2a;
  --border: #222a3a;
  --border-strong: #2d3749;
  --text: #e7eaf0;
  --muted: #8b94a7;
  --faint: #5d677b;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #f0505a;
  --red-bg: rgba(240, 80, 90, 0.12);
  --amber: #f59e0b;
  --radius: 10px;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 20px; margin: 0 0 6px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  height: 56px; padding: 0 20px;
  background: rgba(11, 14, 20, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand-mark { color: var(--accent); font-size: 18px; margin-right: 4px; }
.tabs { display: flex; gap: 2px; }
.tabs a {
  background: none; border: 0; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-weight: 500;
}
.tabs a:hover { color: var(--text); background: var(--panel); }
.tabs a.active { color: var(--text); background: var(--panel-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.stat-mini { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-mini .label { margin: 0; font-size: 10px; }
.status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.on .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.status.on { color: var(--text); }
.status.warn .dot { background: var(--amber); }

/* buttons */
.btn {
  border: 1px solid var(--border-strong); background: var(--panel-2);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { border-color: #3b475d; background: #1c2333; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #7c4dee; border-color: #7c4dee; }
.btn-buy, .btn-buy-q { color: var(--green); }
.btn-buy { background: var(--green); border-color: var(--green); color: #05230f; }
.btn-buy:hover { background: #2fd46a; border-color: #2fd46a; }
.btn-buy-q:hover { background: var(--green-bg); border-color: rgba(34,197,94,.5); }
.btn-sell-q { color: var(--red); }
.btn-sell-q:hover { background: var(--red-bg); border-color: rgba(240,80,90,.5); }
.btn-sell { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sell:hover { background: #ff606a; border-color: #ff606a; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); margin-top: 10px; }

/* layout */
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* search */
.search { display: flex; gap: 10px; margin-bottom: 16px; }
.search input {
  flex: 1; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 14px; font-family: var(--mono); font-size: 13px; outline: none;
}
.search input:focus { border-color: var(--accent); }

.empty-state { text-align: center; padding: 48px 20px 36px; color: var(--muted); }
.empty-state h2 { color: var(--text); }
.empty-state p { max-width: 520px; margin: 0 auto; }
.small-empty { padding: 28px 10px; }
.recent-label { margin: 28px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip .muted { font-weight: 400; margin-left: 4px; }

/* trade grid */
.trade-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-bottom: 16px; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.token-head { display: flex; gap: 14px; align-items: center; }
.token-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.token-img.placeholder { display: grid; place-items: center; background: var(--panel-2); color: var(--faint); font-weight: 700; }
.token-title { font-size: 20px; font-weight: 700; }
.token-title .muted { font-size: 14px; font-weight: 400; }
.token-mint { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.token-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.token-stats span:last-child { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-card { padding: 0; overflow: hidden; height: 500px; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); }
.chart-head h3 { margin: 0; }
.chart-head { gap: 10px; flex-wrap: wrap; }
.chart-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.own-chart { flex: 1; min-height: 0; position: relative; }
.trade-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.tmark { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--green); background: var(--panel-2); overflow: hidden; display: grid; place-items: center;
  pointer-events: auto; cursor: default; box-shadow: 0 1px 6px rgba(0,0,0,.5); will-change: transform; }
.tmark.sell { border-color: var(--red); }
.tmark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tmark .ini { font-size: 11px; font-weight: 700; color: var(--text); }
.tmark .em { font-size: 12px; line-height: 1; }
.tmark.me { width: 28px; height: 28px; left: -14px; top: -14px; border-width: 3px; z-index: 2; }
.tmark.me .ini { font-size: 13px; }
.tmark.wallet { width: 18px; height: 18px; left: -9px; top: -9px; border-style: dashed; opacity: .9; }
.tmark:hover { z-index: 5; transform-origin: center; filter: brightness(1.2); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar { overflow: hidden; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.avatar-edit { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.avatar-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.avatar-actions .btn { cursor: pointer; }
.avatar-actions .link-btn.danger { margin-top: 0; }
#chart-switch { padding: 2px; }
#chart-switch button { padding: 3px 9px; font-size: 12px; }
.chart-card iframe { flex: 1; }
.chart-card iframe { width: 100%; border: 0; display: block; }
.chart-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }

.trade-card h3 { margin: 0; }
.quick-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 8px; }
.quick-buttons.sell { grid-template-columns: 1fr 1fr 1fr; margin-top: 14px; }
.quick-buttons.presets { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 4px; }
.quick-buttons.presets .btn { padding: 8px 4px; }
.btn-buy-q.selected { background: var(--green-bg); border-color: var(--green); }
.preset-input { width: 100%; min-width: 0; text-align: center; background: var(--bg); border: 1px solid var(--accent);
  border-radius: 8px; padding: 7px 2px; color: var(--text); outline: none; font-weight: 600; }
.preset-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; font-size: 12px; }
.muted-link { color: var(--muted); }
.buy-custom { display: flex; gap: 8px; }
.buy-custom input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 10px; outline: none;
}
.buy-custom input:focus { border-color: var(--green); }
.position { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.pos-none { color: var(--faint); padding: 8px 0 2px; }
.pnl-big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.pnl-sub { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.fine-print { color: var(--faint); font-size: 11px; margin-top: 12px; }
.trade-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); }
.trade-tabs button { border: 0; background: none; color: var(--muted); font-weight: 650; padding: 8px; border-radius: 7px; cursor: pointer; }
.trade-tabs button:hover { color: var(--text); }
.trade-tabs button[data-mode="buy"].active { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px rgba(31, 209, 127, .4); }
.trade-tabs button[data-mode="sell"].active { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(246, 70, 93, .4); }
.pane-info { margin-bottom: 2px; }
.btn-sell-q.selected { background: var(--red-bg); border-color: var(--red); }
.sell-tools { justify-content: space-between; align-items: center; }
.btn-initials { color: var(--amber); border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .08); }
.btn-initials:hover { background: rgba(245, 158, 11, .16); border-color: var(--amber); }
.btn-initials.selected { background: rgba(245, 158, 11, .2); border-color: var(--amber); }
.sell-range { width: 100%; margin: 4px 0 10px; accent-color: var(--red); }
.pct-input { flex: 1; min-width: 0; position: relative; display: flex; }
.pct-input input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 28px 8px 10px; outline: none; color: var(--text); }
.pct-input input:focus { border-color: var(--red); }
.pct-input span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.sell-none { color: var(--faint); padding: 14px 0 6px; }
.quote { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; font-variant-numeric: tabular-nums; }
.quote div { display: flex; justify-content: space-between; gap: 10px; line-height: 1.7; }
.quote span { color: var(--muted); }
.quote .q-fill { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border); }
.quote .q-fill.hidden { display: none; }
.pos-quote { margin-top: 12px; background: var(--panel); }

.activity { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.act-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.act-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tables */
.positions-card { margin-top: 0; }
.summary-line { display: flex; gap: 18px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.summary-line b { color: var(--text); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table th.num { text-align: right; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.token-link { font-weight: 600; color: var(--text); cursor: pointer; }
.token-link:hover { color: var(--accent-2); text-decoration: none; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn { padding: 4px 10px; font-size: 12px; }
.empty-row { padding: 14px 10px; }
.closed-details { margin-top: 12px; }
.closed-details summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }

/* feed */
.feed-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.segmented button { background: none; border: 0; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.segmented button.active { background: var(--panel-2); color: var(--text); }
.inline-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.inline-field input, .feed-search {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 10px; outline: none;
}
.inline-field input { width: 80px; }
.feed-search { width: 240px; }
.feed-card { padding: 4px 6px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.pill.buy { color: var(--green); background: var(--green-bg); }
.pill.sell { color: var(--red); background: var(--red-bg); }
.feed-table tr.fresh { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(139, 92, 246, 0.22); } to { background: transparent; } }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 8px; min-width: 260px; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slide .2s ease-out;
}
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1100px) {
  .period-cards { grid-template-columns: repeat(2, 1fr); }
  .stats-grid, .settings-grid { grid-template-columns: 1fr; }
  .trade-grid { grid-template-columns: 1fr; }
  .token-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .stat-mini, #account-name { display: none; }
  .topbar { gap: 12px; padding: 0 12px; }
  .period-cards { grid-template-columns: 1fr; }
}

/* ===== website additions ===== */
.tabs a { display: inline-block; text-decoration: none; }
h1 { font-size: 24px; margin: 0 0 4px; }
.center { text-align: center; }
.hint { color: var(--faint); font-size: 12px; font-weight: 400; }
.row-gap { display: flex; align-items: center; gap: 14px; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(139,92,246,.18); color: var(--accent-2); text-transform: uppercase; vertical-align: middle; margin-left: 4px; }
.page-head { margin: 4px 0 18px; }
.page-head p { margin: 0; }
.full { width: 100%; }

/* auth */
.auth-screen { min-height: 100%; display: grid; place-items: center; padding: 40px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(139,92,246,.18), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.brand.big { font-size: 26px; text-align: center; margin-bottom: 6px; }
.auth-card > p { margin: 0 0 22px; }
.segmented.full { display: flex; width: 100%; margin-bottom: 18px; }
.segmented.full button { flex: 1; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.form input:not([type=checkbox]) {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; outline: none; font-weight: 400;
}
.form input:focus { border-color: var(--accent); }
.form .hint { margin: 0; }
.code-input { font-family: var(--mono); font-size: 26px !important; letter-spacing: .5em; text-align: center; }
.dev-mail { display: block; margin-top: 6px; padding: 10px 12px; border: 1px dashed rgba(245,158,11,.5); border-radius: 8px; color: var(--amber); font-size: 13px; text-align: center; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.toggle { flex-direction: row !important; align-items: center; flex-wrap: wrap; gap: 8px !important; font-weight: 500 !important; }
.toggle .hint { flex-basis: 100%; margin-left: 24px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

/* top bar account */
.account-link { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; text-decoration: none !important; padding: 4px 8px; border-radius: 8px; }
.account-link:hover { background: var(--panel); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.btn-refill { background: var(--green-bg); border-color: rgba(34,197,94,.45); color: var(--green); }
.btn-refill:hover { background: rgba(34,197,94,.2); border-color: var(--green); }
.btn-danger-outline { color: var(--red); margin-top: 16px; }
.btn-danger-outline:hover { background: var(--red-bg); border-color: rgba(240,80,90,.5); }

/* stats */
.period-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.period-card .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 4px 0 2px; }
.period-card .sub { font-size: 13px; font-variant-numeric: tabular-nums; }
.period-card .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.period-card .extremes { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; max-width: 980px; }
.settings-grid .form { margin-top: 4px; }
#password-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-variant-numeric: tabular-nums; }
.kv dt, .kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 600; }
.pnl-chart { height: 240px; }
.pnl-chart svg { width: 100%; height: 100%; display: block; }
.pnl-chart .zero { stroke: var(--border-strong); stroke-dasharray: 4 4; }
.pnl-chart .line-pos { stroke: var(--green); }
.pnl-chart .line-neg { stroke: var(--red); }
.pnl-chart .axis { fill: var(--faint); font-size: 11px; }
.pnl-empty { height: 100%; display: grid; place-items: center; color: var(--muted); }

/* leaderboard */
.lb-table td.rank, .lb-table th.rank { width: 56px; color: var(--muted); }
.lb-table tr.me td { background: rgba(139,92,246,.10); }
.lb-table .medal { font-size: 16px; }
.lb-table .hidden-name { color: var(--muted); font-style: italic; }
.my-rank { margin-bottom: 16px; display: flex; gap: 28px; align-items: center; font-variant-numeric: tabular-nums; }
.my-rank .big { font-size: 22px; font-weight: 700; }

/* ===== tracked wallets, amounts, mini leaderboard ===== */
.row-gap.wrap { flex-wrap: wrap; justify-content: flex-end; }
.amount-pick { display: flex; align-items: center; gap: 10px; }
.amount-pick input[type=range] { flex: 1; accent-color: var(--accent); }
.amount-pick input[type=number] { width: 80px; text-align: right; }
.trade-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mini-lb-list { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-lb-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.mini-lb-list li.me { background: rgba(139,92,246,.10); }
.mini-lb-list .r { color: var(--muted); text-align: center; }
.mini-lb-list .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-lb-list .empty { display: block; color: var(--muted); font-size: 13px; padding: 8px 0; }
.small-seg button { padding: 3px 9px; font-size: 12px; }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.mono-input { font-family: var(--mono); font-size: 12px !important; }
.grow { flex: 1; }
.emoji-field { width: 90px; }
.form textarea, .form input[type=file] {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; outline: none;
  color: var(--text); font: 12px/1.4 var(--mono); resize: vertical;
}
.form input[type=file] { font-family: inherit; font-size: 13px; }
.import-result { margin-top: 14px; padding: 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.import-result ul { margin: 8px 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.import-result .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.wallet-name { font-weight: 600; }
.wallet-name .edit { margin-left: 6px; opacity: 0; }
tr:hover .wallet-name .edit { opacity: 1; }
.addr { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.switch { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.icon-btn { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--red); background: var(--red-bg); }
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: 14px; padding: 24px; width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.6); }
@media (max-width: 1100px) {
  .trade-bottom, .manage-grid { grid-template-columns: 1fr; }
}
.mini-lb-list li.none { display: block; }
.coin-cell { display: flex; flex-direction: column; line-height: 1.25; }
.coin-cell .muted { font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.dev-badge { display: inline-block; padding: 1px 7px; border-radius: 6px; background: rgba(245,158,11,.14); color: var(--amber); font-weight: 600; font-size: 12px; }
#launch-table tr.tracked td { background: rgba(245,158,11,.06); }
.btn-trade { padding: 4px 12px; font-size: 12px; }

/* ===== new coins board ===== */
.pulse-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.pulse-bar h1 { margin: 0 6px 0 0; font-size: 20px; }
.quick-amount { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px;
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.35); color: var(--accent-2); font-weight: 700; }
.quick-amount input { width: 64px; background: transparent; border: 0; outline: none; color: var(--text); font-weight: 700; text-align: right; }
.pulse-tabs { display: none; }
.pulse-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pulse-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; }
.pulse-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.paused-tag { margin-left: auto; font-size: 11px; color: var(--amber); visibility: hidden; }
@media (hover: hover) and (pointer: fine) { .pulse-col:hover .paused-tag { visibility: visible; } }
.paused-tag { margin-left: auto; }
.filter-btn { background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--muted); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.filter-btn:hover, .filter-btn.on { color: var(--text); border-color: var(--accent); }
.fcount { margin-left: 5px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.pfilters { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2); max-height: 60vh; overflow-y: auto; }
.frow { display: grid; grid-template-columns: 1fr; gap: 4px; margin-bottom: 10px; }
.frow label { font-size: 12px; color: var(--muted); }
.frow .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frow input { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 9px; outline: none; color: var(--text); width: 100%; min-width: 0; }
.frow input:focus { border-color: var(--accent); }
.factions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.factions .note { font-size: 11px; color: var(--faint); align-self: center; }
.viewers { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.pulse-list { height: calc(100vh - 190px); min-height: 420px; overflow-y: auto; }
.pulse-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.pcard:hover { background: rgba(255,255,255,0.025); }
.pcard.fresh { animation: flash 1.6s ease-out; }
.pcard.tracked { box-shadow: inset 3px 0 0 var(--amber); }
.pimg { position: relative; width: 64px; }
.pimg img, .pimg .ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; display: block; background: var(--panel-2); }
.pimg .ph { display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--faint); }
.pimg progress { display: block; width: 64px; height: 5px; margin-top: 5px; border: 0; border-radius: 3px; overflow: hidden; background: var(--panel-2); appearance: none; }
.pimg progress::-webkit-progress-bar { background: var(--panel-2); }
.pimg progress::-webkit-progress-value { background: var(--green); }
.pimg progress::-moz-progress-bar { background: var(--green); }
.pimg progress.hot::-webkit-progress-value { background: var(--amber); }
.pimg progress.hot::-moz-progress-bar { background: var(--amber); }
.pimg .pct { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pbody { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.prow { display: flex; align-items: center; gap: 8px; min-width: 0; font-variant-numeric: tabular-nums; }
.prow .grow { flex: 1; min-width: 0; }
.psym { font-weight: 700; font-size: 15px; white-space: nowrap; }
.pname { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmc { margin-left: auto; white-space: nowrap; font-size: 13px; }
.pmc b { color: #60a5fa; font-size: 15px; }
.k { color: var(--faint); font-size: 12px; margin-right: 2px; }
.page { color: var(--green); font-weight: 600; font-size: 13px; }
.psoc { display: inline-flex; gap: 6px; }
.psoc a { color: var(--muted); font-size: 12px; text-decoration: none; padding: 0 2px; }
.psoc a:hover { color: var(--text); }
.pstat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pstat .b { color: var(--green); }
.pstat .s { color: var(--red); }
.qbuy { margin-left: auto; padding: 4px 10px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; }
.qbuy:hover { background: #7c4dee; }
.qbuy:disabled { opacity: .5; }
@media (max-width: 1100px) {
  .pulse-tabs { display: inline-flex; }
  .pulse-grid { grid-template-columns: 1fr; }
  .pulse-col { display: none; }
  .pulse-col.active { display: flex; }
}
.tabs a { white-space: nowrap; }
@media (max-width: 1000px) { .tabs { overflow-x: auto; } .tabs a { padding: 8px 9px; } }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }

.tm-tip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; min-width: 180px;
  background: rgba(18, 23, 34, .97); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 12px; font-variant-numeric: tabular-nums; }
.tm-tip div { display: flex; justify-content: space-between; gap: 14px; line-height: 1.6; }
.tm-tip span { color: var(--muted); }
.tm-tip .tt-head { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.tm-tip .tt-head.buy { color: var(--green); }
.tm-tip .tt-head.sell { color: var(--red); }

/* =====================================================================
   SolSandbox theme v2 — professional layout (overrides the base above)
   ===================================================================== */
@font-face {
  font-family: "Inter";
  src: url("/static/vendor/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #07080b;
  --panel: #0e1016;
  --panel-2: #151821;
  --panel-3: #1b1f2a;
  --border: #1b1f2a;
  --border-strong: #272c3a;
  --text: #e8eaf0;
  --muted: #8b91a3;
  --faint: #5a6072;
  --accent: #7c5cff;
  --accent-2: #a594ff;
  --green: #1fd17f;
  --green-bg: rgba(31, 209, 127, 0.12);
  --red: #f6465d;
  --red-bg: rgba(246, 70, 93, 0.12);
  --blue: #5ea3ff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.003em;
  background:
    radial-gradient(900px 420px at 15% -8%, rgba(124, 92, 255, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
h3 { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
a { color: var(--accent-2); }
::selection { background: rgba(124, 92, 255, 0.35); }
* { scrollbar-width: thin; scrollbar-color: #2a2f3d transparent; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important;
  font-weight: 650; font-size: 15.5px; letter-spacing: -0.02em; }
.logo-mark { width: 26px; height: 26px; border-radius: 8px; flex: none; position: relative;
  background: linear-gradient(135deg, #7c5cff 0%, #5ea3ff 55%, #1fd17f 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 4px 14px rgba(124, 92, 255, 0.35); }
.logo-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 4px; background: var(--bg); opacity: .9; }
.brand.big { justify-content: center; font-size: 24px; gap: 12px; }
.brand.big .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
.brand.big .logo-mark::after { inset: 9px; border-radius: 5px; }

/* ---- top bar ---- */
.topbar { display: grid; grid-template-columns: auto auto minmax(220px, 520px) 1fr; align-items: center;
  gap: 20px; height: 60px; padding: 0 20px; background: rgba(7, 8, 11, 0.82);
  backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--border); }
.tabs { gap: 2px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px;
  color: var(--muted); font-weight: 550; text-decoration: none !important; transition: color .12s, background .12s; }
.tabs a svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:hover { color: var(--text); background: var(--panel-2); }
.tabs a.active { color: var(--text); background: var(--panel-3); box-shadow: 0 0 0 1px var(--border-strong) inset; }
.global-search { position: relative; display: flex; align-items: center; }
.global-search svg { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: var(--faint);
  stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.global-search input { width: 100%; height: 38px; padding: 0 42px 0 38px; border-radius: 10px; outline: none;
  background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); transition: border-color .12s, background .12s; }
.global-search input::placeholder { color: var(--faint); }
.global-search input:focus { border-color: var(--accent); background: var(--panel-2); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15); }
.global-search kbd { position: absolute; right: 10px; font: 600 11px/1 "Inter", sans-serif; color: var(--faint);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.global-search input:focus ~ kbd { display: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.balance-chip { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border-strong); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sol-mark { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, #9945ff, #14f195); }
.account { position: relative; }
.account-link { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; cursor: pointer; }
.account-link:hover { border-color: #3a4152; }
.account-link .avatar { width: 26px; height: 26px; }
.caret { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.menu { position: absolute; right: 0; top: 42px; min-width: 200px; padding: 6px; z-index: 30;
  background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0;
  background: none; color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--panel-3); }
.menu #menu-logout { color: var(--red); }
.btn-refill { height: 34px; border-radius: 999px; }

/* ---- general surfaces ---- */
main { max-width: 1720px; padding: 18px 20px 40px; }
.card { border-radius: var(--radius); background: var(--panel); border-color: var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset; }
.btn { border-radius: 9px; font-weight: 600; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #6b49f5; border-color: #6b49f5; }
.btn-buy { background: var(--green); border-color: var(--green); color: #032313; }
.btn-buy:hover { background: #35e08f; border-color: #35e08f; }
.btn-sell { background: var(--red); border-color: var(--red); }
.segmented { border-radius: 9px; background: var(--panel); border-color: var(--border-strong); }
.segmented button.active { background: var(--panel-3); box-shadow: 0 0 0 1px var(--border-strong) inset; }
.table th { color: var(--faint); font-size: 11px; letter-spacing: .06em; }
.table td { border-bottom-color: var(--border); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg);
  animation: pulse-dot 2s infinite; flex: none; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 6px rgba(31, 209, 127, 0); } }
.page-head { margin: 2px 0 16px; }
.toast { border-radius: 10px; background: var(--panel-2); }

/* ---- coin page: chart + trade panel + live new-pairs strip ---- */
.coin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px 272px; gap: 14px; align-items: start; }
.coin-layout.rail-collapsed { grid-template-columns: minmax(0, 1fr) 340px 46px; }
.coin-layout .col-main, .coin-layout .col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-side { position: sticky; top: 74px; }
.back-link { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--border-strong); color: var(--muted); }
.back-link:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.back-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.token-img { width: 48px; height: 48px; border-radius: 12px; }
.token-title { font-size: 21px; letter-spacing: -0.02em; }
.token-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.token-stats span:last-child { font-size: 16px; }
.chart-card { height: 540px; }
.rail { position: sticky; top: 74px; height: calc(100vh - 92px); display: flex; flex-direction: column; min-width: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rail-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rail-toggle { margin-left: auto; color: var(--muted); }
.rail-tabs { padding: 2px; }
.rail-tabs button { padding: 3px 8px; font-size: 11.5px; }
.rail-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; transition: transform .15s; }
.rail-toggle:hover { color: var(--text); background: var(--panel-3); }
.rail-list { flex: 1; overflow-y: auto; }
.rail-more { display: block; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 12px; }
.rrow { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.rrow:hover { background: rgba(255, 255, 255, 0.025); }
.rrow.current { background: rgba(124, 92, 255, 0.10); box-shadow: inset 3px 0 0 var(--accent); }
.rrow.tracked { box-shadow: inset 3px 0 0 var(--amber); }
.rrow.fresh { animation: flash 1.6s ease-out; }
.rimg img, .rimg .ph { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; display: grid; place-items: center;
  background: var(--panel-2); color: var(--faint); font-weight: 700; }
.rbody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rtop, .rbot { display: flex; align-items: center; gap: 8px; min-width: 0; font-variant-numeric: tabular-nums; }
.rtop b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcap { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 12.5px; }
.rbot { font-size: 11.5px; }
.rbot .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbuy.sm { padding: 2px 8px; font-size: 11px; }
.coin-layout.rail-collapsed .rail-list, .coin-layout.rail-collapsed .rail-more,
.coin-layout.rail-collapsed .rail-head .rail-tabs, .coin-layout.rail-collapsed .rail-head .live-dot { display: none; }
.coin-layout.rail-collapsed .rail-head { padding: 11px 0; justify-content: center; border-bottom: 0; }
.coin-layout.rail-collapsed .rail-toggle { margin: 0; }
.coin-layout.rail-collapsed .rail-toggle svg { transform: rotate(180deg); }

/* ---- discover ---- */
.pulse-bar h1 { font-size: 22px; }
.pulse-col { border-radius: var(--radius); }
.pulse-head { gap: 8px; align-items: center; }
.pulse-list { height: calc(100vh - 182px); }
.pcard { padding: 12px 14px; }
.pmc b { color: var(--blue); }
.filter-btn { border-radius: 7px; }

/* ---- portfolio ---- */
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.scard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.scard b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.scard small { font-size: 13px; font-weight: 500; color: var(--muted); }
.portfolio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.portfolio-grid .col-main, .portfolio-grid .col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.portfolio-grid .period-cards { margin-bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- news & roadmap ---- */
.news-btn { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border-strong); color: var(--muted); }
.news-btn:hover { color: var(--text); text-decoration: none; }
.news-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.news-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg); }
.news-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.16), rgba(94, 163, 255, 0.06)); border: 1px solid rgba(124, 92, 255, 0.35); }
.news-banner .nb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-banner a { white-space: nowrap; font-weight: 600; }
.news-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.news-posts { display: flex; flex-direction: column; gap: 14px; }
.post { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.post h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -0.01em; }
.post .when { color: var(--faint); font-size: 12px; }
.post .body { margin-top: 10px; white-space: pre-line; color: #c9cdd8; line-height: 1.6; }
.post.new { border-color: rgba(124, 92, 255, 0.45); }
.post .new-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--accent-2); margin-left: 8px; vertical-align: middle; }
.roadmap { position: sticky; top: 74px; }
.active-count { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; }
.active-count b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.active-count span { color: var(--muted); }
.ms { padding: 12px 0; border-top: 1px solid var(--border); }
.ms-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ms-top b { font-weight: 600; }
.ms-goal { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ms p { margin: 4px 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.ms-bar { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.ms-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.ms.done .ms-bar span { background: var(--green); }
.ms.done .ms-goal { color: var(--green); font-weight: 600; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.admin-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.admin-item .grow { min-width: 0; }
.admin-item .muted { font-size: 12px; }
.ms-edit { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto auto auto; gap: 8px; align-items: center; width: 100%; }
.ms-edit input { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 8px; color: var(--text); min-width: 0; }
.ms-edit .desc { grid-column: 1 / -1; }
.ms-target { width: 110px; }
.ms-new { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .news-grid, .admin-grid { grid-template-columns: 1fr; } .roadmap { position: static; } }

/* ---- auth ---- */
.auth-card { border-radius: 16px; box-shadow: var(--shadow); }

/* ---- responsive ---- */
@media (max-width: 1400px) {
  .coin-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .coin-layout.rail-collapsed { grid-template-columns: minmax(0, 1fr) 330px; }
  .rail { grid-column: 1 / -1; position: static; height: auto; max-height: 340px; }
  .coin-layout.rail-collapsed .rail { max-height: 46px; }
  .coin-layout.rail-collapsed .rail-head .rail-tabs { display: inline-flex; }
  .coin-layout.rail-collapsed .rail-head .live-dot { display: inline-block; }
  .coin-layout.rail-collapsed .rail-head { justify-content: flex-start; padding: 11px 12px; }
  .coin-layout.rail-collapsed .rail-toggle { margin-left: auto; }
  .portfolio-grid .period-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto auto minmax(140px, 1fr) auto; gap: 12px; }
  .tabs a { font-size: 0; gap: 0; padding: 8px; }
  .tabs a svg { width: 18px; height: 18px; }
  .coin-layout, .coin-layout.rail-collapsed, .portfolio-grid { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar { grid-template-columns: auto 1fr auto; grid-template-rows: 56px 48px; height: auto; padding: 0 12px; row-gap: 0; }
  .brand .site-name, #account-name, .global-search kbd { display: none; }
  .tabs { grid-row: 2; grid-column: 1 / -1; justify-content: space-around; padding-bottom: 6px; }
  .global-search { grid-column: 2; }
  .top-right .balance-chip { display: none; }
  main { padding: 14px 12px 32px; }
  .token-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { height: 420px; }
}

/* ---------------------------------------------------------------- ad slots */
.ad-slot { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; min-height: 120px; }
.ad-slot:empty { display: none; }
.ad-slot.ad-wide { min-height: 90px; margin-bottom: 14px; }
#view-trade .ad-slot, #view-stats .ad-slot { margin-top: 14px; }
.ad-slot .ad-link { display: block; width: 100%; line-height: 0; }
.ad-slot:has(.ad-link) { min-height: 0; }
.ad-slot .ad-link img { width: 100%; height: auto; display: block; }
.ad-slot.ad-wide .ad-link img { max-height: 180px; object-fit: cover; }
.ad-slot iframe { border: 0; max-width: 100%; display: block; background: transparent; }
.ad-tag { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); background: rgba(7, 8, 11, 0.72); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.ad-slot.ad-empty { border-style: dashed; border-color: var(--border-strong); background: transparent; }
.ad-house { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%;
  min-height: inherit; padding: 18px; text-align: center; color: var(--muted); text-decoration: none; font-size: 13px; }
.ad-wide .ad-house { flex-direction: row; gap: 14px; flex-wrap: wrap; }
.ad-house b { color: var(--text); font-size: 14px; }
.ad-house .ad-cta { color: var(--accent-2); font-weight: 600; }
a.ad-house:hover { background: var(--panel); color: var(--text); }
a.ad-house:hover .ad-cta { text-decoration: underline; }

/* admin ads */
#admin-ads-card { margin-top: 16px; }
#admin-ads-card .table-wrap { overflow-x: auto; }
#ads-table tr.dim td { opacity: 0.55; }
.ad-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.ad-cell img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.ad-cell .muted { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-kind { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 40px; border-radius: 6px;
  border: 1px dashed var(--border-strong); color: var(--muted); font-size: 11px; }
.ad-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); max-width: 640px; }
.ad-form h4 { margin: 0 0 4px; }

/* Settings: one column on narrow screens (the older rule above was overridden by the later grid rule) */
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }

/* auth: forgot password */
.center-btn { display: block; margin: 2px auto 0; }
#forgot-form h2 { margin: 0; font-size: 18px; }

/* footer */
.site-footer { margin-top: 32px; padding: 32px 4px 8px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.ft-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
.ft-brand .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.ft-name { font-weight: 700; font-size: 16px; }
.ft-brand p { margin: 10px 0 14px; max-width: 300px; line-height: 1.5; }
.ft-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ft-col h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.site-footer a, .auth-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover, .auth-footer a:hover { color: var(--text); }
.ft-label { margin-top: 6px; font-size: 12px; color: var(--faint); }
.ft-x { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border: 1px solid var(--border-strong);
  border-radius: 999px; }
.ft-x:hover { border-color: var(--muted); }
.x-icon { width: 14px; height: 14px; fill: currentColor; flex: none; }
.ft-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; }
@media (max-width: 900px) { .ft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ft-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.auth-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; margin-top: 18px;
  font-size: 12px; }
.auth-footer .ft-x { padding: 4px 10px 4px 8px; }
.auth-screen { align-content: center; gap: 0; }
.auth-card .brand .site-name { display: inline; }  /* keep the name on the login card on phones */
p.hint.center { text-align: center; }

/* ---------------------------------------------------------------- guests (no account) */
.guest-actions, .guest-bar { display: none; }
body.guest .guest-actions { display: flex; gap: 8px; }
body.guest .balance-chip, body.guest .account, body.guest #refill-btn, body.guest #refill-wait,
body.guest #activity-card, body.guest .trade-card .position { display: none !important; }
body.guest .guest-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 9px 16px; background: linear-gradient(90deg, rgba(124, 92, 255, 0.16), rgba(94, 163, 255, 0.10));
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; }
body.guest .guest-bar b { color: var(--text); }
/* the login card as a pop-up over the site */
.auth-close { display: none; }
.auth-screen.as-modal { position: fixed; inset: 0; z-index: 200; min-height: 0; background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(4px); overflow-y: auto; align-content: start; padding: 32px 16px; }
@media (min-height: 900px) { .auth-screen.as-modal { align-content: center; } }
.auth-screen.as-modal .auth-card { position: relative; box-shadow: var(--shadow); }
.auth-screen.as-modal .auth-close { display: inline-flex; position: absolute; top: 10px; right: 10px; }
.join-why { margin: 4px 0 2px; padding: 9px 12px; border-radius: 10px; background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.35); color: var(--text); font-size: 13px; text-align: center; }
@media (max-width: 700px) { body.guest .guest-actions .btn { padding: 6px 10px; } }

/* balance pop-up: what the balance is and how free refills work */
.balance-wrap { position: relative; }
.balance-chip { cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--border); }
.balance-pop { display: none; position: absolute; right: 0; top: calc(100% + 10px); z-index: 120; width: 300px;
  padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 13px; color: var(--muted); text-align: left; }
.balance-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }  /* hover bridge */
@media (hover: hover) { .balance-wrap:hover .balance-pop { display: block; } }
.balance-wrap.open .balance-pop, .balance-wrap:focus-within .balance-pop { display: block; }
.bp-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.bp-row b { color: var(--text); white-space: nowrap; }
.bp-row small { color: var(--faint); }
.bp-title { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; }
.balance-pop p { margin: 6px 0 10px; line-height: 1.5; }
.balance-pop p b { color: var(--text); }
.bp-status { padding: 8px 10px; border-radius: 8px; background: var(--panel-3); color: var(--text); }
.refill-hint { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(124, 92, 255, 0.10);
  border: 1px solid rgba(124, 92, 255, 0.3); font-size: 12px; color: var(--muted); }
.refill-hint b, .refill-hint .link-btn { color: var(--text); }

/* admin: usage & limits */
#usage-card { margin-bottom: 16px; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 12px; }
.um { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.um-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.um-top b { color: var(--text); white-space: nowrap; }
.um-bar { height: 6px; margin-top: 9px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.um-bar span { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.um-bar.warn span { background: #f5a623; }
.um-bar.bad span { background: var(--red); }
.um-note { margin-top: 7px; font-size: 12px; color: var(--faint); line-height: 1.5; }
.um-note b { color: var(--muted); }
.warn-t { color: #f5a623 !important; }
.ad-form .input-row { flex-wrap: wrap; }
.ad-form select { max-width: 100%; }

/* emoji picker for tracked wallets */
.emoji-field { display: flex; flex-direction: column; gap: 6px; width: auto; }
.emoji-field .field-label { font-size: 13px; color: var(--muted); }
.emoji-pick { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; height: 40px; min-width: 76px;
  padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-2);
  color: var(--text); font-size: 20px; cursor: pointer; }
.emoji-pick:hover { border-color: var(--muted); }
.emoji-pick svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; }
.emoji-pick.empty span { opacity: 0.45; filter: grayscale(1); }
.emoji-picker { position: fixed; z-index: 300; width: 316px; padding: 10px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.ep-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; max-height: 232px;
  overflow-y: auto; overflow-x: hidden;
  padding-right: 4px; overscroll-behavior: contain; scrollbar-width: thin; }
.ep-grid button, .emoji-pick span, .emoji-btn { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.ep-grid button { height: 34px; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 20px; cursor: pointer; line-height: 1; }
.ep-grid button:hover { background: var(--panel-3); }
.ep-grid button.on { background: rgba(124, 92, 255, 0.25); box-shadow: inset 0 0 0 1px var(--accent); }
.ep-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.ep-foot input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--text); font-size: 13px; }
.emoji-btn { width: 30px; height: 30px; margin-right: 6px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  font-size: 17px; cursor: pointer; vertical-align: middle; }
.emoji-btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.emoji-btn.empty { color: var(--faint); font-size: 14px; }
@media (max-width: 400px) { .emoji-picker { width: calc(100vw - 16px); } }

/* admin: ad slot cards + dark dropdowns */
.form select, .table select { color-scheme: dark; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.table select { height: 32px; font-size: 13px; }
input[type=file] { color-scheme: dark; }
.slot-pick { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.slot-pick legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.slot-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--panel-2); cursor: pointer; }
.slot-card:hover { border-color: var(--muted); }
.slot-card input { position: absolute; opacity: 0; pointer-events: none; }
.slot-card:has(input:checked) { border-color: var(--accent); background: rgba(124, 92, 255, 0.12); box-shadow: 0 0 0 1px var(--accent); }
.slot-card:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.slot-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.slot-text small { color: var(--muted); font-size: 12px; }
/* little page sketches: grey blocks, the ad spot in purple */
.slot-mini { position: relative; flex: none; width: 56px; height: 40px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg); }
.slot-mini i { position: absolute; border-radius: 2px; background: var(--panel-3); }
.slot-top i:nth-child(1) { left: 4px; right: 4px; top: 4px; height: 8px; background: var(--accent); }
.slot-top i:nth-child(2) { left: 4px; width: 22px; top: 15px; bottom: 4px; }
.slot-top i:nth-child(3) { right: 4px; width: 22px; top: 15px; bottom: 4px; }
.slot-coin i:nth-child(1) { left: 4px; width: 30px; top: 4px; bottom: 4px; }
.slot-coin i:nth-child(2) { right: 4px; width: 14px; top: 4px; height: 16px; }
.slot-coin i:nth-child(3) { right: 4px; width: 14px; top: 23px; bottom: 4px; background: var(--accent); }
.slot-port i:nth-child(1) { left: 4px; width: 30px; top: 4px; bottom: 4px; }
.slot-port i:nth-child(2) { right: 4px; width: 14px; top: 4px; height: 12px; }
.slot-port i:nth-child(3) { right: 4px; width: 14px; top: 19px; bottom: 4px; background: var(--accent); }
.form .slot-card { flex-direction: row; align-items: center; }
