:root {
  --bg: #06080b;
  --bg-2: #0a0d12;
  --panel: #10141b;
  --panel-2: #171c25;
  --line: #1d2330;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --up: #22c55e;
  --down: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
  --header-h: 56px;
  --tabbar-h: 0px;
  --chart-h: 420px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; line-height: 1.5; -webkit-font-smoothing: antialiased; padding-bottom: var(--tabbar-h); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(11, 14, 20, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap, .site-header .bar { height: 100%; display: flex; align-items: center; gap: 24px; }
.site-header .bar { padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff7a18); color: var(--accent-ink); font-weight: 800; font-size: 14px;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffb53d; }
.btn-ghost { background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); outline: none;
}
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 165, 36, .15); }
.form-error { color: var(--down); font-size: 13px; min-height: 18px; margin: 4px 0 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.badge.ok { color: var(--up); border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08); }
.badge.warn { color: var(--accent); border-color: rgba(245, 165, 36, .35); background: rgba(245, 165, 36, .08); }
.badge.bad { color: var(--down); border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); }

/* ---------- landing ---------- */
.ticker { border-bottom: 1px solid var(--line); min-height: 46px; background: var(--bg-2); }
.hero { padding: 72px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -.03em; margin: 12px 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.markets { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.hero-chart { height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }

.section { padding: 64px 0; }
.section h2 { font-size: clamp(26px, 3.5vw, 36px); letter-spacing: -.02em; margin: 0 0 10px; }
.section .sub { color: var(--muted); margin: 0 0 32px; max-width: 60ch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature h3 { margin: 12px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(245, 165, 36, .1); color: var(--accent); }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 20px; justify-content: center; }
.plan { display: flex; flex-direction: column; padding: 28px; position: relative; }
.plan.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 24px 60px -30px rgba(245, 165, 36, .45); }
.plan .ribbon { position: absolute; top: -12px; right: 20px; }
.plan h3 { margin: 0; font-size: 22px; }
.plan .tag { color: var(--muted); margin: 6px 0 20px; font-size: 14px; }
.price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 20px; }
.price strong { font-size: 40px; letter-spacing: -.02em; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 14px; }
.plan li::before { content: "✓"; color: var(--up); font-weight: 800; }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin: 10px 0 0; }

.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 28px 0 40px; }
.disclaimer p { margin: 0 0 8px; max-width: 90ch; }

/* ---------- auth ---------- */
.auth { min-height: calc(100dvh - var(--header-h) - var(--tabbar-h)); display: grid; place-items: center; padding: 32px 16px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { margin: 0 0 6px; font-size: 24px; }
.auth .switch { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.auth .switch a { color: var(--accent); font-weight: 600; }

/* ---------- dashboard / admin ---------- */
.page { padding: 32px 0 64px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.list { display: grid; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.row .title { font-weight: 600; }
.row .meta { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; border: 1px solid rgba(245, 165, 36, .35); background: rgba(245, 165, 36, .08); }
.notice.ok { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .08); }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 16px; }
.modal .card { width: min(440px, 100%); }
.modal h2 { margin: 0 0 8px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translateX(-50%); z-index: 200;
  background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}

/* ---------- mobile tab bar (app feel) ---------- */
.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --tabbar-h: 62px; }
  .nav, .header-actions .hide-m { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(17, 21, 29, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  .hero { padding: 40px 0 24px; }
  .hero-grid, .cols { grid-template-columns: 1fr; gap: 28px; }
  .hero-chart { height: 340px; }
  .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .plans { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .hero p.lead { font-size: 16px; }
}
