:root {
  --bg: #08090a;
  --surface: #0f1012;
  --surface-2: #151619;
  --border: #1e2024;
  --border-strong: #2a2d33;
  --text: #edeef0;
  --muted: #8b8f98;
  --faint: #5c606a;
  --accent: #edeef0;
  --accent-ink: #08090a;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --bad: #f2555a;
  --brand: #8b7cf6;
  --radius: 10px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.55 "Geist", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 44px; font-weight: 600; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(8,9,10,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo .mark { width: 20px; height: 20px; border-radius: 6px; background: conic-gradient(from 200deg, var(--brand), #3ecf8e, var(--brand)); }
.nav .links { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav .links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav .links a:hover { color: var(--text); }
@media (max-width: 640px) { .nav .links .hide-sm { display: none; } h1 { font-size: 32px; } }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3a3e46; background: #1b1d21; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: default; }
input, select, textarea { width: 100%; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: none; border-color: #4b505a; box-shadow: 0 0 0 3px rgba(139,124,246,.18); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: -3px; }
input[type=range] { padding: 0; accent-color: var(--brand); }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 auto !important; min-width: 0; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 6px; }
.okmsg { color: var(--ok); font-size: 13px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .g2, .g3 { grid-template-columns: 1fr; } }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pill.brand { color: #c9c1ff; border-color: #3b3570; background: rgba(139,124,246,.08); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(62,207,142,.15); }
.dot.error { background: var(--bad); box-shadow: 0 0 0 3px rgba(242,85,90,.15); }
.dot.pending, .dot.paused { background: var(--warn); }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* Big number + progress */
.big { font-family: var(--mono); font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.big .of { font-size: 18px; color: var(--muted); letter-spacing: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 99px; transition: width .4s ease; }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.bar .tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.stat { font-family: var(--mono); font-size: 20px; }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.chart .b { flex: 1 1 0; background: #2b2e35; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart .b.today { background: var(--brand); }
.chart .b.future { background: transparent; border: 1px dashed var(--border); border-bottom: 0; }
.chart .b:hover { background: #4a4e57; }
.chart .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-strong); padding: 3px 7px; border-radius: 6px; font: 11px var(--mono); white-space: nowrap; z-index: 2; color: var(--text); }
.chart-axis { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--faint); margin-top: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; gap: 2px; background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--text); }

/* App layout */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--border); padding: 16px 10px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13px; }
.side a:hover { color: var(--text); background: var(--surface); }
.side a.on { color: var(--text); background: var(--surface-2); }
.main { padding: 28px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head h2 { margin: 0; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .side a { flex: none; }
  .main { padding: 18px 16px; }
}
.banner { border: 1px solid #3b3570; background: rgba(139,124,246,.07); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.bad { border-color: #5a2427; background: rgba(242,85,90,.07); }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }

/* Auth */
.auth { max-width: 380px; margin: 64px auto; padding: 0 16px; }
.auth .card { padding: 28px; }
.auth h2 { font-size: 20px; }
.qr { background: #fff; padding: 12px; border-radius: 8px; display: inline-block; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); background: var(--bg); border: 1px solid var(--border); padding: 12px; border-radius: 8px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { max-width: 460px; width: 100%; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: 13px; }

/* Chips (thresholds) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted); font: 500 13px var(--mono); cursor: pointer; }
.chip.on { background: rgba(139,124,246,.14); border-color: #5b50b8; color: #d9d3ff; }

/* Landing */
.hero { padding: 88px 0 56px; text-align: center; }
.hero h1 { font-size: 56px; max-width: 760px; margin: 18px auto 16px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
@media (max-width: 640px) { .hero { padding: 56px 0 40px; } .hero h1 { font-size: 36px; } }
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section > .wrap > h2 { text-align: center; }
.section > .wrap > p.sub { text-align: center; color: var(--muted); margin-bottom: 32px; }
.feature h3 { margin-top: 12px; }
.feature .ic { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); display: grid; place-items: center; color: var(--brand); }
.price-card { display: flex; flex-direction: column; }
.price-card .amt { font-family: var(--mono); font-size: 36px; letter-spacing: -0.03em; margin: 8px 0 2px; }
.price-card ul { padding: 0; list-style: none; margin: 16px 0 20px; flex: 1; }
.price-card li { padding: 5px 0 5px 22px; position: relative; color: var(--muted); font-size: 13px; }
.price-card li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 10px; height: 6px; border-left: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok); transform: rotate(-45deg); }
.price-card.hl { border-color: #3b3570; box-shadow: 0 0 0 1px #3b3570, 0 20px 60px -20px rgba(139,124,246,.25); }
.strike { text-decoration: line-through; color: var(--faint); font-size: 18px; margin-left: 6px; }
.deal { display: flex; justify-content: center; gap: 10px; align-items: center; padding: 9px 16px; background: rgba(139,124,246,.08); border-bottom: 1px solid #2c2852; font-size: 13px; flex-wrap: wrap; text-align: center; }
.deal .mono { color: #d9d3ff; }
.footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.prose { max-width: 720px; margin: 0 auto; padding: 48px 20px 80px; }
.prose h1 { font-size: 34px; }
.prose h2 { font-size: 19px; margin-top: 32px; }
.prose p, .prose li { color: #c4c7ce; }
.prose code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }
.prose ol li, .prose ul li { margin-bottom: 6px; }
.demo-frame { border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; background: var(--surface); }
.demo-frame .top { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: center; }
.demo-frame .top i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.alert-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.alert-row:last-child { border-bottom: 0; }
.feedback-tab { position: fixed; right: 0; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: right bottom; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom: 0; padding: 6px 12px; border-radius: 8px 8px 0 0; font-size: 12px; cursor: pointer; color: var(--muted); z-index: 20; }
.feedback-tab:hover { color: var(--text); }
.hidden { display: none !important; }
#nav-right { display: flex; gap: 16px; align-items: center; }
@media (max-width: 820px) { .feedback-tab { top: auto; bottom: 16px; right: 16px; transform: none; border: 1px solid var(--border-strong); border-radius: 99px; } }
.nav .links a.btn.primary { color: var(--accent-ink); }
.chart .b { max-width: 48px; }
