:root {
  --bg: #0d0d0f;
  --panel: #16161a;
  --panel-2: #1d1d22;
  --line: #2a2a31;
  --text: #ecebe6;
  --muted: #9a988f;
  --gold: #d4a64a;
  --gold-2: #f0cf7d;
  --up: #3fbf7f;
  --down: #e5604f;
  --warn: #e8b33a;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--gold-2); }
button, input, select { font: inherit; color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: baseline; gap: 6px; margin: 0 6px 22px; }
.brand b { font-size: 19px; letter-spacing: .5px; color: var(--gold); font-style: italic; font-weight: 800; }
.brand span { white-space: nowrap; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--muted);
  text-decoration: none; margin-bottom: 2px; }
.nav a.on, .nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { box-shadow: inset 3px 0 0 var(--gold); }
.main { padding: 26px 30px 90px; max-width: 1180px; width: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 16px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }

.mode-pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.mode-pill button { background: none; border: 0; padding: 6px 14px; cursor: pointer; color: var(--muted); }
.mode-pill button.on { background: var(--panel-2); color: var(--text); }
.mode-pill button.on.live { color: #111; background: var(--gold); }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.stat .val { font-size: 24px; margin-top: 4px; font-family: var(--mono); }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
td.r, th.r { text-align: right; }
.tablewrap { overflow-x: auto; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel-2); }

.btn { color: var(--text); text-decoration: none; display: inline-block; background: var(--panel-2); border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: #3a3a44; }
.btn.gold { background: var(--gold); color: #141414; border-color: var(--gold); font-weight: 600; }
.btn.gold:hover { background: var(--gold-2); }
.btn.danger { color: var(--down); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.running { color: var(--up); border-color: #2c5a43; }
.tag.paused { color: var(--warn); border-color: #5c4a20; }
.tag.live { color: #141414; background: var(--gold); border-color: var(--gold); }
.tag.finished { color: var(--muted); }

form .field, .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
label { font-size: 13px; color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus { outline: 2px solid #5a4a26; border-color: var(--gold); }
.hint { font-size: 12px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }

.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch .txt { flex: 1; } .switch .txt b { display: block; font-weight: 500; }
.toggle { display: inline-block; position: relative; width: 42px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #33333b; border-radius: 99px; cursor: pointer; transition: .15s; }
.toggle span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #ddd; transition: .15s; }
.toggle input:checked + span { background: var(--gold); }
.toggle input:checked + span::after { transform: translateX(18px); background: #141414; }

.notice { border: 1px solid #5c4a20; background: #221c10; color: #f1dca5; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice.bad { border-color: #6a2b24; background: #24120f; color: #f3b5ab; }
.notice.good { border-color: #2c5a43; background: #0f2219; color: #b4e9cd; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 1px solid var(--line); padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button.on { color: var(--text); border-color: var(--gold); }

.gates { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.gate { font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); }
.gate.pass { color: var(--up); border-color: #2c5a43; } .gate.fail { color: var(--down); border-color: #6a2b24; }
.chart { width: 100%; height: 140px; display: block; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 400px; padding: 26px; }
.auth .brand { justify-content: center; margin-bottom: 18px; }
.qr svg { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 8px; }
code.secret { font-family: var(--mono); background: var(--bg); padding: 4px 8px; border-radius: 6px; word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; }
.toast.bad { border-color: #6a2b24; color: #f3b5ab; }
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { max-width: 440px; width: 100%; }

.bottomnav { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 16px 96px; }
  .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g2 { grid-template-columns: 1fr; }
  .stat .val { font-size: 20px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #111114f2; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; backdrop-filter: blur(8px); }
  .bottomnav a { flex: 1; text-align: center; color: var(--muted); text-decoration: none; font-size: 11px; padding: 4px 0; }
  .bottomnav a svg { display: block; margin: 0 auto 2px; }
  .bottomnav a.on { color: var(--gold); }
  .mobile-brand { display: block !important; }
}
.mobile-brand { display: none; }

/* live markets */
.livebadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--up); border: 1px solid #2c5a43; border-radius: 999px; padding: 3px 10px; }
.livebadge i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: pulse 1.6s infinite; }
.livebadge.off { color: var(--down); border-color: #6a2b24; } .livebadge.off i { background: var(--down); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); }
table.mkt td { padding-top: 8px; padding-bottom: 8px; }
.star { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 2px; }
.star.on { color: var(--gold); }
.flash-up { animation: fu 1.2s ease-out; } .flash-dn { animation: fd 1.2s ease-out; }
@keyframes fu { 0% { background: #1d4a33; color: #8ff0bd; } 100% { background: transparent; } }
@keyframes fd { 0% { background: #4e1f1a; color: #ffb3a8; } 100% { background: transparent; } }
.movers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.mover { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; }
.mover:hover { border-color: var(--gold); }
.bigprice { font-size: 34px; font-weight: 500; letter-spacing: -.5px; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.quotebox { gap: 18px; font-size: 13px; } .quotebox .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.candlebox { width: 100%; overflow: hidden; }
svg.candles { display: block; touch-action: pan-y; }
svg.candles .gl { stroke: var(--line); stroke-width: 1; }
svg.candles .ax { fill: var(--muted); font: 11px var(--mono); }
svg.candles .cu { fill: var(--up); } svg.candles .cd { fill: var(--down); }
svg.candles .cuw { stroke: var(--up); } svg.candles .cdw { stroke: var(--down); }
svg.candles .vol { opacity: .35; }
svg.candles .lastline { stroke-dasharray: 4 4; stroke-width: 1; }
svg.candles .lastlab { fill: #101010; font: 600 11px var(--mono); }
svg.candles .xh { stroke: #6b6a63; stroke-dasharray: 3 3; }
@media (max-width: 860px) {
  .hide-sm { display: none; }
  .bigprice { font-size: 28px; }
  .quotebox { grid-template-columns: repeat(2, 1fr) !important; width: 100%; }
}

/* proven bots */
.tabs .btn.tabon { border-color: var(--gold); color: var(--gold-2); }
.card.proven.proven { box-shadow: inset 0 3px 0 var(--gold); }
.pstats { gap: 12px; } .pstats .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.pstats .big { font-size: 20px; margin-top: 2px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details[open] summary { margin-bottom: 8px; }
