:root {
  --bg: #edf0f8; --panel: #ffffff; --panel-2: #f2f4fc; --logobar: #ffffff;
  --text: #1a1d2e; --muted: #767d96; --border: #e3e7f3;
  --accent: #6c5ce7; --accent2: #15cdbf; --green: #12b886; --red: #f0506e; --gold: #e8920c;
  --accent-grad: linear-gradient(135deg, #7b6cff, #16cdbf);
  --shadow: 0 6px 22px rgba(60,50,120,.08);
  /* sidebar — deep indigo glass (cool), both themes */
  --sb-grad: linear-gradient(165deg, #2c2358 0%, #1d1942 55%, #15122e 100%);
  --sb-text: #bcb6dd; --sb-hi: linear-gradient(135deg, #7b6cff, #16cdbf);
  --glow: 0 6px 18px rgba(124,108,255,.45);
  --radius: 14px;
}
:root[data-theme="dark"] {
  --bg: #0b0d15; --panel: #141726; --panel-2: #1b1f30; --logobar: #0f1119;
  --text: #e8ebf5; --muted: #828aa3; --border: #242941; --shadow: 0 6px 22px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", "Hiragino Sans", sans-serif; font-size: 14px; }
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* logo bar */
#logobar { height: 62px; flex-shrink: 0; background: var(--logobar); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.lb-left { display: flex; align-items: center; gap: 10px; }
.lb-logo { flex-shrink: 0; }
.lb-name { font-size: 27px; font-weight: 900; letter-spacing: .5px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.lb-tag { font-size: 14px; font-style: italic; color: var(--muted); }
.lb-right { display: flex; align-items: center; gap: 8px; }
.lb-link { text-decoration: none; color: var(--accent); font-size: 18px; padding: 6px 8px; }
.lb-icon { background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; width: 36px; height: 36px; border-radius: 10px; }
.lb-icon:hover { background: var(--panel-2); color: var(--text); }
.lb-lang { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; }

/* body: sidebar + main */
#bodywrap { flex: 1; display: flex; padding: 16px; gap: 16px; min-height: 0; }
#sidebar { width: 224px; flex-shrink: 0; background: var(--sb-grad); border-radius: 18px; padding: 18px 14px; display: flex; flex-direction: column; }
.mode-badge { font-size: 11px; padding: 6px 12px; margin: 4px 6px 16px; border-radius: 20px; background: rgba(255,255,255,.1); color: #fff; text-align: center; font-weight: 600; }
.mode-badge.demo { background: rgba(46,200,126,.22); }
.mode-badge.live { background: rgba(240,97,109,.28); }
.mode-badge.err { background: rgba(240,97,109,.28); }
#nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; color: var(--sb-text); cursor: pointer; user-select: none; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--sb-hi); color: #fff; box-shadow: var(--glow); }
.nav-ic { font-size: 16px; width: 20px; text-align: center; }

#main { flex: 1; min-width: 0; }
#content { max-width: 1100px; }

/* page head + button group */
.page-head { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-pink { background: transparent; border: 1.6px solid var(--accent); color: var(--accent); border-radius: 22px; padding: 9px 18px; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.btn-pink:hover { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.btn-pink.ghost2 { border-color: var(--border); color: var(--muted); }
.btn-pink.ghost2:hover { background: var(--panel-2); color: var(--text); }

.banner { background: linear-gradient(100deg, #ff9a3c, #ff7a45); color: #fff; border-radius: var(--radius); padding: 16px 20px; font-size: 14px; line-height: 1.6; font-weight: 600; margin-bottom: 16px; box-shadow: var(--shadow); }
.banner.banner-live { background: linear-gradient(100deg, #f0506e, #d8324f); }
.filter-sel { width: 220px; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }

/* bot cards (gridy style) */
.bot-list { display: flex; flex-direction: column; gap: 14px; }
.bot-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bot-card.stopped { opacity: .72; }
.bot-card.spot { border-left: 4px solid var(--accent2); }
.bot-card.perp { border-left: 4px solid var(--accent); }
.bot-card.warn { border-left: 4px solid #e8943a; }
.badge.spot { background: rgba(21,205,191,.16); color: var(--accent2); }
.list-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.market-tabs { display: inline-flex; gap: 4px; }
.mtab { padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.mtab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- auth (login / register) — centered card + soft brand glow ---- */
#authScreen { position: fixed; inset: 0; z-index: 2000; overflow: auto; background: var(--bg, var(--panel)); }
.auth-bg { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(circle at 18% 18%, rgba(123,77,255,.18), transparent 42%),
  radial-gradient(circle at 84% 78%, rgba(57,197,207,.15), transparent 44%),
  radial-gradient(circle at 62% 28%, rgba(230,51,107,.10), transparent 40%); }
.auth-ctrl { position: absolute; top: 18px; right: 22px; display: flex; gap: 8px; align-items: center; z-index: 3; }
.auth-card { position: relative; z-index: 2; width: 100%; max-width: 400px; margin: 8vh auto 48px; padding: 38px 36px; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.20); text-align: center; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 18px; }
.auth-logo-t { text-align: left; }
.auth-name { font-size: 18px; font-weight: 800; color: var(--accent); line-height: 1.15; }
.auth-tag { font-size: 11px; color: var(--muted); font-style: italic; }
.auth-card h2 { font-size: 23px; margin: 6px 0 4px; color: var(--text); }
.auth-sub { font-size: 13px; color: var(--muted); margin: 0 0 24px; }
.auth-in { display: block; width: 100%; box-sizing: border-box; margin-bottom: 13px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; text-align: center; transition: border-color .15s; }
.auth-in:focus { outline: none; border-color: var(--accent); }
.auth-btn { width: 100%; padding: 13px; margin-top: 4px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.auth-btn:hover { opacity: .9; }
.auth-msg { min-height: 18px; margin-top: 12px; font-size: 13px; }
.auth-msg.err { color: var(--red); }
.auth-switch { margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-switch a { color: var(--accent); cursor: pointer; font-weight: 700; }

/* ---- landing page ---- */
#landingScreen { position: fixed; inset: 0; z-index: 1900; overflow: auto; background: var(--bg, var(--panel)); }
.lp-nav { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; max-width: 1080px; margin: 0 auto; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--accent); }
.lp-nav-r { display: flex; align-items: center; gap: 12px; }
.lp-login { color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px; }
.lp-login:hover { color: var(--accent); }
.lp-signup { padding: 8px 18px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.lp-signup:hover { opacity: .9; }
.lp-hero { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 56px auto 40px; padding: 0 24px; }
.lp-hero h1 { font-size: 40px; line-height: 1.18; margin: 0 0 18px; color: var(--text); font-weight: 800; }
.lp-hero-sub { font-size: 17px; color: var(--muted); margin: 0 0 28px; line-height: 1.6; }
.lp-cta { padding: 14px 34px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(108,92,231,.35); }
.lp-cta:hover { opacity: .92; }
.lp-exch { margin-top: 18px; font-size: 13px; color: var(--muted); }
.lp-sec { position: relative; z-index: 1; max-width: 1000px; margin: 52px auto; padding: 0 24px; text-align: center; }
.lp-sec h2 { font-size: 25px; color: var(--text); margin: 0 0 30px; font-weight: 800; }
.lp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; text-align: left; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.lp-ic { font-size: 28px; margin-bottom: 12px; }
.lp-card h3 { font-size: 16px; color: var(--text); margin: 0 0 8px; }
.lp-card p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.lp-foot { position: relative; z-index: 1; text-align: center; padding: 38px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 36px; }
@media (max-width: 720px) { .lp-cards { grid-template-columns: 1fr; } .lp-hero h1 { font-size: 30px; } .lp-nav { padding: 14px 16px; } }
#demoBadge { position: fixed; top: 0; left: 50%; transform: translateX(-50%); background: var(--gold); color: #fff; padding: 4px 16px; border-radius: 0 0 10px 10px; font-size: 12px; font-weight: 700; z-index: 1500; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.bc-body { padding: 16px 18px; }
.bc-head { display: flex; align-items: flex-start; gap: 10px; }
.bc-title { font-size: 16px; font-weight: 800; color: var(--text); }
.bc-name { font-weight: 400; font-size: 14px; color: var(--accent); }
.bc-date { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bc-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--muted); }
.bc-meta { font-size: 13px; font-weight: 400; color: var(--text); margin: 7px 0 2px; }
.bc-meta .l { color: var(--muted); margin-right: 4px; }
.bc-dot { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: inline-block; }
.badge { font-size: 10px; padding: 2px 9px; border-radius: 20px; font-weight: 700; }
.badge.ok { background: rgba(22,160,106,.16); color: var(--green); }
.badge.off { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.badge.warn { background: rgba(232,148,58,.16); color: #e8943a; }
.badge.perp { background: rgba(108,92,231,.16); color: var(--accent); }
.bc-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 760px) { .bc-stats { grid-template-columns: repeat(3, 1fr); } }
.bc-stats > div { display: flex; flex-direction: column; gap: 3px; }
.bc-stats .l { font-size: 11px; color: var(--muted); }
.bc-stats .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill-mini { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: rgba(232,146,12,.18); color: var(--gold); }
.bc-err { margin-top: 10px; font-size: 13px; color: var(--red); font-weight: 600; }
.bc-foot { display: flex; align-items: center; background: var(--panel-2); border-top: 1px solid var(--border); padding: 11px 18px; }
.bc-id { font-size: 12px; color: var(--muted); }
.bc-actions { margin-left: auto; display: flex; gap: 8px; }
.green { color: var(--green); } .red { color: var(--red); } .muted { color: var(--muted); } .warn { color: var(--gold); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* generic buttons */
button { font-family: inherit; cursor: pointer; }
.primary { background: var(--accent-grad); color: #fff; border: none; border-radius: 10px; padding: 11px; font-weight: 700; font-size: 14px; }
.primary:hover { filter: brightness(1.08); box-shadow: var(--glow); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; }
.ghost:hover { color: var(--text); }
.danger { background: rgba(239,75,94,.14); color: var(--red); border: 1px solid rgba(239,75,94,.3); border-radius: 8px; padding: 6px 12px; }
.danger:hover { background: var(--red); color: #fff; }
.sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

/* panels (create / report / settings) */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 16px; font-size: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
@media (max-width: 920px) { .cols { grid-template-columns: 1fr; } }
.right-col { display: flex; flex-direction: column; gap: 18px; }

.form-panel label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.form-panel input, .form-panel select { display: block; width: 100%; margin-top: 5px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.row2 { display: flex; gap: 10px; } .row2 label { flex: 1; }
.price-row { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; }
.live-price { font-size: 16px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.live-price.loading { opacity: .5; }
.icon-btn { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--accent); font-size: 15px; }
.icon-btn:hover { background: var(--accent); color: #fff; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.amp-val { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 78px; text-align: right; font-variant-numeric: tabular-nums; }
.amp-pm { font-size: 14px; font-weight: 700; color: var(--accent); }
.form-panel .amp-input { width: 120px; flex: 0 0 auto; margin-top: 0; text-align: right; font-variant-numeric: tabular-nums; }
.min-margin-hint { margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.min-margin-hint.hint-warn { color: var(--red); font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--panel); }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .primary { flex: 1; }
.note { font-size: 11px; margin-top: 12px; line-height: 1.6; color: var(--muted); }
.msg { font-size: 12px; margin-top: 10px; min-height: 16px; }
.msg.ok { color: var(--green); } .msg.err { color: var(--red); }
.notice { padding: 12px 14px; border-radius: 9px; margin-bottom: 12px; }
.notice.err { background: rgba(239,75,94,.12); border: 1px solid rgba(239,75,94,.3); color: var(--red); }

/* report */
.rep-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.rep-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.rep-card .l { font-size: 12px; color: var(--muted); }
.rep-card .v { font-size: 24px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* profile dropdown */
.profile-wrap { position: relative; }
.profile-menu { position: absolute; right: 0; top: 42px; width: 200px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.25); padding: 8px; z-index: 90; }
.pm-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--text); }
.pm-item:hover { background: var(--panel-2); }
.pm-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.lang-wrap { position: relative; }
.lang-menu { width: 150px; }
.sb-dashboard { display: flex; align-items: center; gap: 12px; padding: 12px 15px; margin-top: auto; border-radius: 12px; color: var(--sb-text); text-decoration: none; font-weight: 600; }
.sb-dashboard:hover { background: rgba(255,255,255,.08); color: #fff; }
.sel-api-tag { padding: 9px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* market type options */
.avail-tag { font-size: 11px; color: var(--green); font-weight: 600; }
.form-panel label.chk-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; margin-bottom: 12px; white-space: nowrap; }
.chk-row input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.drawer-mask { position: fixed; inset: 0; background: rgba(8,10,18,.5); z-index: 80; }
.detail-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(620px, 94vw); background: var(--panel); border-left: 1px solid var(--border); box-shadow: -16px 0 48px rgba(0,0,0,.28); transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1); z-index: 90; overflow-y: auto; padding: 22px 24px; }
.detail-drawer.open { transform: translateX(0); }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dd-head h3 { margin: 0; font-size: 18px; }
.dd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.dd-tab { background: none; border: none; padding: 8px 13px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ord-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ord-cols h4 { margin: 0 0 8px; font-size: 13px; }
.holding-row { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.donut { width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--accent2) calc(var(--p) * 1%), var(--accent) 0); position: relative; flex-shrink: 0; }
.donut::after { content: ''; position: absolute; inset: 24%; background: var(--panel); border-radius: 50%; }
.holding-legend { font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.holding-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.fill-row { cursor: pointer; }
.fill-row:hover { background: var(--panel-2); }
.fill-row.open { background: var(--panel-2); }
.fd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; padding: 4px 6px 10px; font-size: 12px; }
.fd-grid > div { display: flex; justify-content: space-between; gap: 10px; }
.fd-grid .l { color: var(--muted); }
.fd-block { border-bottom: 1px solid var(--border); }
.fd-block:last-of-type { border-bottom: none; }
.fd-tag { font-size: 11px; font-weight: 700; padding: 8px 6px 0; }
.fd-pnl { display: flex; justify-content: space-between; gap: 10px; padding: 10px 6px 4px; font-size: 13px; font-weight: 600; }
.fd-pnl .l { color: var(--muted); font-weight: 400; }
.fills-table th:last-child, .fill-pnl-cell { text-align: right; white-space: nowrap; }
.fill-pnl-cell { font-weight: 600; }
.fill-caret { display: inline-block; margin-left: 8px; color: var(--muted); transition: transform .15s; }
.fill-row.open .fill-caret { transform: rotate(180deg); }
.market-opts { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; }
.mkt-opt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; }
.mkt-opt.sel { border-color: var(--accent); background: rgba(124,108,255,.1); color: var(--accent); }
.mkt-opt input { accent-color: var(--accent); }
.sel-api-tag { padding: 9px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* report pnl chart */
.big-pnl { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.day-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; overflow-x: auto; padding: 8px 0 2px; }
.day-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 56px; flex-shrink: 0; }
.day-bar-cnt { font-size: 11px; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.day-bar-stack { width: 26px; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--panel-2); }
.day-seg.buy { background: var(--green); } .day-seg.sell { background: var(--red); }
.day-bar-lbl { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* exchange API page */
.conn-check { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); font-size: 13px; }
.conn-check b { color: var(--text); }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--text); }

/* settings */
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: none; padding: 9px 20px; font-size: 13px; }
.seg button.on { background: var(--accent); color: #fff; }

/* preview stats / orders */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.stat-l { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.range-wrap { margin: 6px 0 18px; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.range-track { position: relative; height: 8px; border-radius: 6px; background: linear-gradient(90deg, rgba(22,160,106,.3), rgba(22,160,106,.1) 48%, rgba(239,75,94,.1) 52%, rgba(239,75,94,.3)); }
.range-pos { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.orders-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .orders-2col { grid-template-columns: 1fr; } }
.orders-col h3 { font-size: 13px; margin: 0 0 8px; }
.orders-scroll { max-height: calc(100vh - 320px); min-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.fills-scroll { max-height: calc(100vh - 300px); min-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 6px 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600; }
tbody tr { border-top: 1px solid var(--border); }
h3 { font-size: 13px; margin: 14px 0 8px; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,40,.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { width: min(430px, calc(100vw - 40px)); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.modal-body { font-size: 13px; line-height: 1.6; }
.modal-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 12px; padding: 12px; background: var(--panel-2); border-radius: 9px; }
.modal-kv span { color: var(--muted); font-size: 12px; align-self: center; }
.modal-kv b { text-align: right; font-variant-numeric: tabular-nums; }
.modal-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); cursor: pointer; }
.modal-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions button { flex: 1; padding: 11px; border-radius: 10px; font-weight: 700; font-size: 14px; }

/* nav gap + footer + content fill */
#main { display: flex; flex-direction: column; }
#content { flex: 1; }
.nav-gap { height: 1px; background: rgba(255,255,255,.12); margin: 16px 10px; }
#footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* pricing */
.pricing-head, .help-head { text-align: center; margin: 8px 0 18px; }
.pricing-head h1, .help-head h1 { margin: 0 0 6px; font-size: 30px; }
.plan-basic { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.price-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.pc-badge { position: absolute; top: 16px; right: 16px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 12px; background: rgba(123,77,255,.18); color: #8b6bff; }
.pc-name { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.pc-price { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-price span { font-size: 13px; font-weight: 400; margin-left: 4px; }
.pc-year { font-size: 12px; margin: 4px 0 16px; }
.pc-sub { width: 100%; }
.pc-feats { list-style: none; padding: 0; margin: 18px 0 0; font-size: 13px; }
.pc-feats li { padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--muted); }
.pc-feats li:last-child { border-bottom: none; }

/* copy row + mono input */
.copy-row { display: flex; gap: 8px; align-items: center; }
.field-mono { flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* help */
.help-panel { max-width: 760px; margin: 0 auto; }
.help-h { font-size: 18px; margin: 18px 0 8px; }
.help-link { display: block; padding: 9px 0; color: var(--accent); text-decoration: none; font-size: 14px; }
.help-link:hover { text-decoration: underline; }

/* profile */
.tab-head { display: inline-block; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 16px; }
.tab-head.red { color: var(--accent); }
.pf-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.pf-l { color: var(--muted); min-width: 90px; }
.pf-edit { cursor: pointer; color: var(--muted); }
.pf-edit:hover { color: var(--accent); }
