:root {
  --bg: #0F1526; --bg2: #141C33; --panel: #1A2340; --panel2: #202B4D; --line: #2A3760;
  --text: #E8ECF5; --muted: #93A0BD; --gold: #F5C451; --gold2: #FFD978;
  --green: #34C77B; --red: #F06464; --blue: #6EA8FF;
  --radius: 16px; --shadow: 0 20px 50px rgba(0,0,0,.35);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
:root[data-theme="light"] {
  --bg: #F4F6FB; --bg2: #FFFFFF; --panel: #FFFFFF; --panel2: #F3F5FA; --line: #E1E6F0;
  --text: #1F2A44; --muted: #5A6475; --gold: #C9951A; --gold2: #B8860B;
  --green: #0A8A4A; --red: #C62828; --blue: #2457C5; --shadow: 0 10px 30px rgba(31,42,68,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--muted); }
.gold { color: var(--gold); }

/* ---------- nav */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -.3px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--gold), #E89A2C);
  display: grid; place-items: center; color: #1F2A44; font-weight: 900; font-size: 17px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn-gold, .nav-links a.btn-gold:hover { color: #1A2340; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 15px; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn-gold { background: var(--gold); color: #1A2340; }
.btn-gold:hover { background: var(--gold2); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--panel2); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn-danger { background: transparent; border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); color: var(--red); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }

/* ---------- landing */
.hero { padding: 88px 0 56px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -200px -200px auto auto; width: 800px; height: 800px;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 22%, transparent), transparent 65%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; position: relative; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; }
h1.display { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -2px; font-weight: 850; }
h1.display em { font-style: normal; color: var(--gold); }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin: 22px 0 30px; max-width: 540px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px; font-size: 14px; color: var(--muted); }
.trust span::before { content: "✓ "; color: var(--green); font-weight: 800; }

.mock { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 20px; }
.mock-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.mock-card { background: var(--panel2); border-radius: 12px; padding: 14px; }
.mock-card .l { font-size: 12px; color: var(--muted); }
.mock-card .v { font-size: 24px; font-weight: 800; }
.mock svg { width: 100%; height: auto; display: block; }

section.block { padding: 72px 0; }
section.block.alt { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -1px; line-height: 1.1; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--gold) 14%, transparent); margin-bottom: 14px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.step { padding: 24px; border-radius: var(--radius); border: 1px dashed var(--line); }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--gold); color: #1A2340; font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 17px; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 15px; }
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.privacy ul { list-style: none; display: grid; gap: 12px; }
.privacy li { padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.privacy li b { display: block; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--muted); margin-top: 8px; }
.final-cta { text-align: center; padding: 80px 0; }
.final-cta h2 { font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -1px; margin-bottom: 14px; }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- app */
.app-tabs { display: flex; gap: 4px; margin-left: 24px; }
.app-tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; }
.app-tabs button.on { background: var(--panel2); color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 26px 0 18px; }
.toolbar h1 { font-size: 26px; letter-spacing: -.5px; margin-right: auto; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { min-width: 0; }
.kpi .v { overflow-wrap: anywhere; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.kpi .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 14px; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card .sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.chart-box { position: relative; height: 260px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
table.data .n { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.Won { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.pill.Lost { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.pill.Sold { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.pill.Open { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.plat { font-size: 12px; font-weight: 700; color: var(--muted); }
.market-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tHigh { table-layout: fixed; }
#tHigh td:first-child { width: 128px; white-space: nowrap; color: var(--muted); }
#tHigh td:last-child { width: 110px; }
#tHigh .market-cell { max-width: none; }
.search { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 220px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 14px; color: var(--muted); }

.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 30px 20px; text-align: center; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, transparent); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.status-msg { font-size: 14px; margin-top: 12px; min-height: 20px; }
.status-msg.ok { color: var(--green); } .status-msg.err { color: var(--red); }
.wallet-list { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.wallet-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--panel2);
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
.how { font-size: 13px; color: var(--muted); margin-top: 12px; }
.how ol { padding-left: 18px; }

.empty { text-align: center; padding: 70px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; margin-top: 26px; }
.empty h2 { font-size: 28px; letter-spacing: -.5px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 22px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--panel2);
  border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); transition: .25s; z-index: 50; font-weight: 600; }
.toast.show { transform: translateX(-50%) translateY(0); }
.demo-banner { background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  color: var(--text); padding: 10px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 18px; }
.hidden { display: none !important; }

/* ---------- account + Pro */
.acct { display: flex; align-items: center; gap: 8px; }
.acct .email { font-size: 13px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pro-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); vertical-align: middle; }
body.is-pro .pro-card .pro-tag, body.is-pro .btn .pro-tag:not(.keep) { display: none; }
.pro-card { position: relative; }
.pro-lock { position: absolute; inset: 0; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px; background: color-mix(in srgb, var(--panel) 72%, transparent); backdrop-filter: blur(6px); z-index: 2; }
.pro-lock b { font-size: 17px; }
.pro-lock span { color: var(--muted); font-size: 14px; max-width: 320px; }
.locked .pro-body { filter: blur(3px); pointer-events: none; user-select: none; }
.seg button.lock { opacity: .55; }
.seg button.lock::after { content: " 🔒"; font-size: 11px; }
.modal { margin: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); padding: 28px;
  width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.modal-wide { width: min(560px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(5, 8, 18, .65); backdrop-filter: blur(3px); }
.modal h2 { font-size: 24px; letter-spacing: -.5px; margin-bottom: 6px; padding-right: 30px; }
.modal p { margin-bottom: 16px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-x button { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal { position: fixed; }
.pro-list { list-style: none; display: grid; gap: 8px; margin: 4px 0 20px; font-size: 15px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan { position: relative; display: grid; gap: 2px; text-align: left; padding: 18px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel2); transition: .15s; }
.plan:hover { border-color: var(--gold); transform: translateY(-1px); }
.plan.best { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.plan .pname { font-weight: 700; color: var(--muted); font-size: 14px; }
.plan .pprice { font-size: 30px; font-weight: 850; letter-spacing: -.5px; }
.plan .pprice small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan .pnote { font-size: 13px; color: var(--muted); }
.plan .badge { position: absolute; top: -10px; right: 12px; background: var(--gold); color: #1A2340; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.plan:disabled { opacity: .6; cursor: progress; }
@media (max-width: 1000px) { .acct .email { display: none; } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }

/* ---------- landing pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 980px; margin: 0 auto; }
.price-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.price-card.best { border: 2px solid var(--gold); }
.price-card h3 { font-size: 18px; }
.price-card .amt { font-size: 40px; font-weight: 850; letter-spacing: -1px; }
.price-card .amt small { font-size: 15px; color: var(--muted); font-weight: 600; }
.price-card ul { list-style: none; display: grid; gap: 8px; font-size: 15px; color: var(--muted); flex: 1; }
.price-card li::before { content: "✓ "; color: var(--green); font-weight: 800; }
.price-card .badge { position: absolute; top: -12px; left: 24px; background: var(--gold); color: #1A2340; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .hero-grid, .privacy, .grid2, .grid2.even, .import-grid { grid-template-columns: 1fr; }
  .features, .steps { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links a.hide-sm { display: none; }
  .app-tabs { margin-left: 0; }
  .hero { padding-top: 56px; }
}
@media (max-width: 520px) {
  .kpi .v { font-size: 22px; }
  .nav .container { gap: 10px; }
  .logo span.word, #syncAll .word { display: none; }
  .app-tabs button { padding: 8px 9px; }
  .nav .container:has(.app-tabs) { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 8px; }
  .nav .container:has(.app-tabs) .logo span.word { display: inline; }
  .app-tabs { order: 3; width: 100%; justify-content: space-between; }
  .app-tabs button { flex: 1; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 100px; }
  .nav-links { gap: 10px; }
  .search { min-width: 0; width: 100%; }
}
