/* LynxCap - flat, white/black with dark-blue accents. No gradients. */
:root {
  --ink: #0a0b0d;        /* near-black text */
  --navy: #0f2348;       /* dark blue accent */
  --navy-deep: #081530;  /* deeper navy */
  --paper: #ffffff;
  --soft: #f7f8fa;       /* very light gray panel */
  --line: #e7e8ec;
  --line-strong: #d4d6dc;
  --muted: #6b7079;
  --green: #157347;
  --red: #b42318;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: var(--navy); }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand-logo { height: 22px; width: auto; display: block; }
.topnav { display: flex; gap: 4px; flex: 1; }
.navlink {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 6px;
}
.navlink:hover { color: var(--ink); background: var(--soft); }
.navlink.active { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 13px; color: var(--muted); }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.status-pill.pending { background: var(--soft); color: var(--muted); border: 1px solid var(--line-strong); }
.status-pill.verified { background: rgba(21,115,71,0.12); color: var(--green); }

/* compliance gate banner */
.gate-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line-strong); background: var(--soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.gate-banner .gb-text strong { display: block; font-size: 14px; }
.gate-banner .gb-text span { font-size: 13px; color: var(--muted); }
.gate-banner .btn { white-space: nowrap; }

/* deposit card preview chips */
.dep-coins-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.dep-coin-chip { font-size: 11px; font-weight: 700; color: var(--navy); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 8px; }
.dep-coin-chip.more { color: var(--muted); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 11, 13, 0.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1000; }
.modal { background: var(--paper); border-radius: var(--radius); width: 100%; max-width: 460px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal-loading { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

.dm-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.dm-chip-label { font-size: 12px; color: var(--muted); }
.dm-chip { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 20px; padding: 5px 12px; cursor: pointer; }
.dm-chip:hover { border-color: var(--navy); }

.dm-usd-box { margin: 18px 0; padding: 16px; background: var(--soft); border-radius: 8px; }
.dm-usd-main { font-size: 22px; letter-spacing: -0.4px; }
.dm-usd-main strong { font-weight: 800; }
.dm-usd-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

.dm-equiv-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.dm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-equiv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.dm-eq-sym { font-size: 12px; font-weight: 700; color: var(--muted); }
.dm-eq-amt { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.view { max-width: 1040px; margin: 0 auto; padding: 40px 24px 80px; }
.view-narrow { max-width: 460px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Login / centered ---------- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { height: 30px; margin-bottom: 28px; color: var(--ink); }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 26px; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 22px; }
.card + .card { margin-top: 18px; }
.card-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 0 0 16px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong);
  border-radius: 6px; font-size: 14px; background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--navy); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.input-suffix { position: relative; }
.input-suffix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- Buttons (flat) ---------- */
.btn { cursor: pointer; border-radius: 6px; font-size: 14px; font-weight: 600; padding: 11px 18px; border: 1px solid transparent; transition: background 0.12s, border-color 0.12s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Checkboxes ---------- */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check:last-of-type { border-bottom: none; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--navy); }

/* ---------- Portfolio ---------- */
.value-hero { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 18px; }
.value-hero .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.value-hero .amount { font-size: 40px; font-weight: 700; letter-spacing: -1px; }
.value-hero .amount .ccy { font-size: 20px; color: var(--muted); font-weight: 600; margin-left: 6px; }

.holdings { width: 100%; border-collapse: collapse; }
.holdings th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.holdings td { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.holdings tr:last-child td { border-bottom: none; }
.holdings .asset { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.holdings .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 0; }

.asset-badge { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; letter-spacing: -0.2px; font-weight: 700; color: var(--navy); }

/* ---------- Token page ---------- */
.token-head { display: flex; align-items: flex-start; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.token-mark { width: 52px; height: 52px; border-radius: 12px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.token-head h2 { margin: 0 0 2px; font-size: 20px; }
.token-head .meta { color: var(--muted); font-size: 13px; }
.token-facts { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.token-facts .fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.token-facts .fact .v { font-size: 15px; font-weight: 600; }
.contract { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }

.calc-out { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.calc-out .k { color: var(--muted); font-size: 13px; }
.calc-out .v { font-size: 22px; font-weight: 700; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.seg button { background: var(--paper); border: none; padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--ink); color: #fff; }

/* ---------- Banners / notes ---------- */
.note { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 10px 12px; margin-top: 14px; }
.inline-msg { font-size: 13px; margin-top: 10px; }
.inline-msg.err { color: var(--red); }
.inline-msg.ok { color: var(--green); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--ink); color: #fff; border-radius: 8px; padding: 14px 16px; max-width: 360px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); animation: slidein 0.18s ease; }
.toast h4 { margin: 0 0 4px; font-size: 13px; }
.toast a { color: #a9c2ff; word-break: break-all; }
.toast .tx { font-family: ui-monospace, monospace; font-size: 11px; color: #9aa3b2; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- KYB onboarding wizard ---------- */
.kyb { max-width: 680px; margin: 0 auto; padding: 36px 24px 70px; }
.kyb-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.kyb-head .rail-logo { height: 22px; color: var(--ink); }
.kyb-stagetag { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--soft); border: 1px solid var(--line-strong); border-radius: 20px; padding: 6px 12px; white-space: nowrap; }

.kyb-main { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; min-height: 360px; }
.kyb-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.kyb-progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 22px; }
.kyb-progress > i { display: block; height: 100%; background: var(--navy); border-radius: 99px; transition: width 0.45s ease; }
.kyb-step-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 600; }
.kyb-main h2 { font-size: 21px; margin: 4px 0 6px; letter-spacing: -0.3px; }
.kyb-main .lead { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

/* system action loader */
.sys-steps { list-style: none; margin: 18px 0; padding: 0; }
.sys-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sys-steps li:last-child { border-bottom: none; }
.sys-steps li.done { color: var(--ink); }
.sys-steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; position: relative; }
.sys-steps li.running .dot { border-color: var(--navy); border-top-color: transparent; animation: spin 0.7s linear infinite; }
.sys-steps li.done .dot { border-color: var(--navy); background: var(--navy); }
.sys-steps li.done .dot::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.3px; }
.pill.ubo { background: var(--navy); color: #fff; }
.pill.minor { background: var(--soft); color: var(--muted); border: 1px solid var(--line-strong); }
.pill.trust { background: var(--ink); color: #fff; }
.pill.ok { background: rgba(21,115,71,0.12); color: var(--green); }
.pill.pending { background: var(--soft); color: var(--muted); border: 1px solid var(--line-strong); }

.party-card { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.party-card .pc-left { display: flex; align-items: center; gap: 12px; }
.party-card .pc-name { font-weight: 600; font-size: 14px; }
.party-card .pc-meta { font-size: 12px; color: var(--muted); }

.upload-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.upload-row .ur-info .ur-name { font-weight: 600; font-size: 14px; }
.upload-row .ur-info .ur-sub { font-size: 12px; color: var(--muted); }
.upload-row .req { font-size: 11px; color: var(--red); font-weight: 600; }
.upload-row .opt { font-size: 11px; color: var(--muted); }
.upload-row.uploaded { border-color: var(--navy); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.formk-block { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.formk-block h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.legal { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 12px; }

.kyb-actions { display: flex; gap: 10px; margin-top: 22px; }
.kyb-actions .spacer { flex: 1; }
.link-btn { background: none; border: none; color: var(--navy); font-size: 13px; cursor: pointer; padding: 0; text-decoration: underline; }
.magic-link { font-family: ui-monospace, monospace; font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 10px; word-break: break-all; margin: 10px 0; }
.success-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.success-mark svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2.5; fill: none; }

/* ---------- Flat icons ---------- */
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muted { color: var(--muted); }
.spaced { margin-top: 18px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
