:root {
  --bg: #f5f5f7;          /* light gray content area */
  --surface: #ffffff;
  --text: #1d1d1f;        /* near-black */
  --muted: #6e6e73;       /* secondary gray */
  --faint: #86868b;
  --line: #e8e8ed;        /* hairline */
  --line-strong: #d2d2d7;
  --accent: #1d1d1f;      /* black */
  --accent-hover: #000000;
  --green: #1d1d1f;       /* monochrome — distinguished by weight, not color */
  --sidebar: #1c1c1e;     /* dark sidebar */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(251, 251, 253, 0.8);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 22px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo { height: 24px; width: auto; display: block; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 13px;
  border-radius: 980px;
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  transition: 0.18s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); background: #f0f0f3; }
.nav-right { margin-left: auto; }
.wallet {
  font-size: 13px;
  color: var(--muted);
}
.wallet strong { color: var(--text); font-weight: 600; }

/* ---------- App shell: sidebar + content (viewport-locked) ---------- */
html, body { height: 100%; overflow: hidden; max-width: 100%; }
.layout { display: flex; height: 100vh; width: 100%; max-width: 100vw; overflow: hidden; align-items: stretch; }
main { overflow-x: hidden; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px 18px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.logged-out .sidebar { display: none; }

.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  padding: 4px 10px 22px;
  color: #fff;
}
.side-brand .brand-logo { filter: invert(1); }

.side-nav { display: flex; flex-direction: column; gap: 22px; }
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 0 12px 9px;
}
.side-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
  font-weight: 500;
  transition: 0.13s;
}
.side-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }

.side-foot { margin-top: auto; padding-top: 16px; }
.wallet-card {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.wallet-l { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.wallet-v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 3px; }
.topup-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.topup-btn:hover { background: rgba(255, 255, 255, 0.26); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-phone { font-size: 12px; color: rgba(255, 255, 255, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }

main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 40px 40px;
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
}
.page-title { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.4; }
.btn.btn-inline { width: auto; flex-shrink: 0; }
.see-all { color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.see-all:hover { opacity: 0.6; }

/* ---------- Dashboard ---------- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.ds-l { font-size: 13px; color: var(--muted); }
.ds-v { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 2px; }
.ds-sub { font-size: 12px; color: var(--faint); }

/* compact opportunity rows for the dashboard */
.opp-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.opp-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 2fr) auto 24px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.13s;
}
.opp-row > * { min-width: 0; }
.opp-row:first-child { border-top: none; }
.opp-row:hover { background: #fafafa; }
.opp-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-meta { font-size: 12.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-prog .progress-bar { height: 6px; }
.opp-prog-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 7px; }
.opp-roi { text-align: right; }
.opp-roi-v { font-size: 16px; font-weight: 700; }
.opp-roi-l { font-size: 11px; color: var(--faint); }
.opp-cta { color: var(--faint); font-size: 18px; text-align: right; }

.hero { margin-bottom: 56px; text-align: center; }
.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 18px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--muted);
  font-size: 21px;
  line-height: 1.45;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 24px;
}
.section-title h2 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.section-title .hint { color: var(--faint); font-size: 14px; }

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f0f0f3;
  padding: 5px 11px;
  border-radius: 980px;
}
.card-roi { font-size: 14px; font-weight: 700; color: var(--text); }
.card-roi span { font-size: 11px; font-weight: 400; color: var(--faint); }
.badge-funded {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: #eef2ee;
  padding: 5px 11px;
  border-radius: 980px;
}

.card-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.card-title { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.card-sub { font-size: 13px; color: var(--faint); margin: 5px 0 0; }

/* 2×2 metric grid — matches the portfolio ticket look */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: auto;
}
.cg-l { font-size: 11px; color: var(--faint); }
.cg-v { font-size: 16px; font-weight: 600; margin-top: 3px; letter-spacing: -0.01em; }

.progress-wrap { margin-top: 2px; }
.progress-bar {
  height: 6px;
  background: #e9e9ee;
  border-radius: 980px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 980px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 10px;
  color: var(--muted);
}
.progress-meta strong { color: var(--text); font-weight: 600; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: auto;
}
.stat { text-align: center; }
.stat .v { font-size: 16px; font-weight: 600; }
.stat .l { font-size: 11px; color: var(--faint); margin-top: 3px; }
.stat .v.green { color: var(--green); }

.btn {
  border: none;
  border-radius: 980px;
  padding: 12px 22px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: 0.18s;
}
.btn-primary { background: var(--accent); color: white; width: 100%; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #e9e9ee; color: var(--faint); cursor: not-allowed; }
.btn-ghost { background: #f0f0f3; color: var(--text); }
.btn-ghost:hover { background: #e8e8ed; }

/* ---------- Detail view ---------- */
.detail {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
}
.back-link { color: var(--accent); font-size: 15px; margin-bottom: 24px; display: inline-block; cursor: pointer; }
.back-link:hover { text-decoration: underline; }

.detail-banner {
  height: 240px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  margin-bottom: 28px;
  background: linear-gradient(150deg, #f5f5f7, #e8e8ed);
  border: 1px solid var(--line);
}
.detail h1 { font-size: 36px; margin: 0 0 8px; letter-spacing: -0.03em; font-weight: 600; }
.detail .meta-line { color: var(--faint); font-size: 15px; margin-bottom: 24px; }
.detail p.summary { color: var(--text); line-height: 1.6; font-size: 17px; }

.info-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.info-table td { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-table td:first-child { color: var(--muted); }
.info-table td:last-child { text-align: right; font-weight: 600; }

.invest-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
}
.invest-panel h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.invest-panel .raised-big { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.invest-panel .raised-big span { color: var(--faint); font-size: 16px; font-weight: 400; }

.field { margin: 22px 0 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.input-money {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: 0.15s;
}
.input-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.10); }
.input-money span { color: var(--faint); font-size: 18px; }
.input-money input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  padding: 13px 8px;
  width: 100%;
  outline: none;
  font-family: inherit;
}
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip {
  background: #f0f0f3;
  color: var(--text);
  border-radius: 980px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover { background: #e6e6eb; }

.projection {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 18px 0;
}
.projection .row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.projection .row .muted { color: var(--muted); }
.projection .row .big { color: var(--green); font-weight: 600; }

.note { font-size: 12px; color: var(--faint); margin-top: 14px; line-height: 1.5; }
.err { color: #d70015; font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: 22px;
  padding: 34px;
  max-width: 440px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: pop 0.22s ease-out;
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

/* earnings calculator */
.calc-head { font-size: 14px; color: var(--muted); margin: 22px 0 12px; }
.calc-head strong { color: var(--text); }
.calc-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.13s;
}
.calc-row:first-child { border-top: none; }
.calc-row:hover { background: #fafafa; }
.calc-main { min-width: 0; }
.calc-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.calc-amt-col { text-align: right; flex-shrink: 0; }
.calc-amt { font-size: 16px; font-weight: 700; }
.calc-amt-l { font-size: 10.5px; color: var(--faint); }
.calc-total {
  background: var(--bg);
  border-radius: 12px;
  padding: 6px 16px;
  margin-top: 14px;
}
.ct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.ct-row:last-child { border-bottom: none; }
.ct-row span { color: var(--muted); }
.ct-row strong.green { color: var(--green); }
.calc-tip { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.calc-tip strong { color: var(--text); }
.calc-empty { color: var(--faint); font-size: 14px; padding: 20px 0; text-align: center; }

/* shared modal text */
.modal-back { display: inline-block; color: var(--muted); font-size: 14px; cursor: pointer; margin-bottom: 14px; }
.modal-back:hover { color: var(--text); }
.modal-title { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.modal-sub { color: var(--muted); font-size: 14.5px; line-height: 1.45; margin: 0 0 20px; }
.modal-sub strong { color: var(--text); font-weight: 600; }

/* confirmation summary */
.confirm-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  margin-bottom: 16px;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row span { color: var(--muted); }
.confirm-row.total { font-size: 15px; }
.confirm-row.total span, .confirm-row.total strong { color: var(--text); }

.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; width: auto; }

/* payment method tiles */
.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pay-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.13s;
}
.pay-tile:hover { border-color: var(--faint); }
.pay-tile.active { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.pay-ico { font-size: 18px; line-height: 1; height: 18px; }
.pay-label { font-size: 14px; font-weight: 600; }
.pay-desc { font-size: 11.5px; color: var(--faint); }

.pay-note {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 16px;
}
.pay-note strong { color: var(--text); }
.pay-line {
  display: block;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--text);
  margin: 4px 0;
}

/* processing spinner */
.processing { text-align: center; padding: 18px 0 6px; }
.spinner {
  width: 44px; height: 44px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ticket ---------- */
.ticket {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  background: var(--bg);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.ticket::before { left: -12px; }
.ticket::after { right: -12px; }
.ticket .t-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ticket .t-emoji { font-size: 34px; }
.ticket .t-id { font-family: "SF Mono", ui-monospace, monospace; font-size: 12px; color: var(--faint); }
.ticket h4 { margin: 0 0 16px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.ticket .t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ticket .t-cell .l { font-size: 11px; color: var(--faint); }
.ticket .t-cell .v { font-size: 17px; font-weight: 600; margin-top: 3px; }
.ticket .t-cell .v.green { color: var(--green); }
.ticket .t-foot { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; font-size: 11px; color: var(--faint); }

.success-head { text-align: center; margin-bottom: 22px; }
.success-head .check {
  width: 54px; height: 54px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 14px;
}
.success-head h3 { margin: 0; font-size: 22px; font-weight: 600; }
.success-head p { color: var(--muted); font-size: 15px; margin: 6px 0 0; }

/* ---------- Portfolio ---------- */
.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.psum {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.psum .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.psum .v.green { color: var(--green); }
.psum .l { font-size: 13px; color: var(--muted); margin-top: 5px; }

.empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}
.empty .big { font-size: 52px; margin-bottom: 14px; }
.empty h2 { font-weight: 600; letter-spacing: -0.02em; }

.ticket-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* portfolio ticket + sell controls */
.pf-ticket { display: flex; flex-direction: column; gap: 10px; }
.pf-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.pf-earned { font-size: 12.5px; color: var(--muted); }
.pf-listed { font-size: 12.5px; color: var(--green); font-weight: 600; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

/* secondary-market resale cards (differentiated from primary opportunities) */
.resale-head h2 { display: flex; align-items: center; gap: 8px; }
.resale-card {
  background: #fbfbfd;
  border-style: dashed;
  border-color: var(--line-strong);
}
.resale-card:hover { border-color: var(--text); }
.resale-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--text);
  padding: 4px 10px;
  border-radius: 980px;
}

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.step .n {
  width: 36px; height: 36px;
  background: #f0f0f3;
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; margin-bottom: 16px;
}
.step h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ---------- Doc pages (FAQ / Legal) ---------- */
.doc { max-width: 680px; }
.doc-item { padding: 22px 0; border-top: 1px solid var(--line); }
.doc-item:first-child { border-top: none; padding-top: 4px; }
.doc-item h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.doc-item p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ---------- Account area (sidebar footer) ---------- */
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.nav-logout {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: 0.15s;
}
.nav-logout:hover { color: var(--text); border-color: var(--faint); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 36px 34px 30px;
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
  text-align: center;
}
.auth-logo-img { height: 56px; width: auto; }
.auth-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-sub { color: var(--muted); font-size: 15px; margin: 0 0 24px; line-height: 1.4; }

.auth-tabs {
  display: flex;
  background: #f0f0f3;
  border-radius: 980px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px;
  border-radius: 980px;
  cursor: pointer;
  transition: 0.18s;
}
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.auth-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: 0.15s;
}
.auth-input::placeholder { color: #b0b0b8; }
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,0,0,0.08); }

.phone-row { display: flex; gap: 10px; }
.phone-input { flex: 1; }

.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin: 20px 0 0; }
.auth-foot a, .auth-card a { color: var(--accent); cursor: pointer; font-weight: 500; }
.auth-foot a:hover, .auth-card a:hover { text-decoration: underline; }
.auth-legal { text-align: center; font-size: 11px; color: var(--faint); margin: 14px 0 0; }
.auth-card .btn-primary { margin-top: 4px; }
.auth-card .err { text-align: center; }

/* ---------- Country dropdown ---------- */
.cc { position: relative; }
.cc-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-height: 49px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}
.cc-btn:hover { border-color: var(--faint); }
.cc-flag { font-size: 18px; line-height: 1; }
.cc-dial { font-weight: 500; }
.cc-caret { color: var(--faint); font-size: 11px; }
.cc-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  max-width: 78vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.16);
  z-index: 30;
  overflow: hidden;
}
.cc-menu[hidden] { display: none; }
.cc-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.cc-list { max-height: 260px; overflow-y: auto; }
.cc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--text);
}
.cc-item:hover { background: #f5f5f7; }
.cc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-itemdial { color: var(--muted); font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 28px;
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 900px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .side-brand { padding: 0 12px 0 4px; }
  .side-brand span { display: none; }
  .side-nav { flex-direction: row; gap: 2px; margin-top: 0; }
  .side-group { flex-direction: row; gap: 2px; }
  .side-head { display: none; }
  .side-link { padding: 8px 12px; white-space: nowrap; }
  .side-foot { margin-top: 0; margin-left: auto; padding-top: 0; display: flex; align-items: center; gap: 10px; }
  .wallet-card { display: none; }
  .user-meta { display: none; }

  .detail { grid-template-columns: 1fr; gap: 28px; }
  .invest-panel { position: static; }
  .portfolio-summary { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .page-head { flex-direction: column; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 18px; }
  main { padding: 32px 20px 64px; }
}

/* ---------- Failed-round badge ---------- */
.badge-failed {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #f0f0f3;
  padding: 5px 11px;
  border-radius: 980px;
}

/* ---------- Public landing (logged out) ---------- */
.public-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 6px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.pb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.pb-links { display: flex; gap: 4px; margin-left: auto; }
.pb-links a {
  padding: 7px 13px;
  border-radius: 980px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
}
.pb-links a:hover { color: var(--text); background: #f0f0f3; }

/* ---------- Detail banner photo ---------- */
.detail-banner { position: relative; overflow: hidden; }
.detail-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-banner.has-photo .banner-emoji { display: none; }

/* ---------- Asset detail extras (operator / docs / payouts / updates) ---------- */
.asset-extras {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  max-width: 760px;
}
.xsec h2 { font-size: 21px; letter-spacing: -0.02em; margin: 0 0 14px; font-weight: 600; }
.xsec-empty { color: var(--faint); font-size: 14px; margin: 0; }

.op-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.op-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}
.op-name { font-weight: 600; font-size: 16px; }
.op-verified {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: #eef2ee;
  padding: 3px 9px;
  border-radius: 980px;
  margin-left: 6px;
  vertical-align: 2px;
}
.op-meta { font-size: 13px; color: var(--faint); margin-top: 3px; }
.op-track { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 10px 0 0; }

.doc-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: 0.13s;
}
.doc-row:first-child { border-top: none; }
.doc-row:hover { background: #fafafa; }
.doc-name { font-size: 14.5px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-size { font-size: 12.5px; color: var(--faint); flex-shrink: 0; }

.pay-hist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ph-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.ph-row:first-child { border-top: none; }
.ph-row span:last-child { text-align: right; }
.ph-head { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); background: #fafafa; }

.upd-list { display: flex; flex-direction: column; }
.upd-item { padding: 16px 0; border-top: 1px solid var(--line); }
.upd-item:first-child { border-top: none; padding-top: 4px; }
.upd-date { font-size: 12px; font-weight: 600; color: var(--faint); margin-bottom: 5px; }
.upd-item p { margin: 0; font-size: 14.5px; color: var(--text); line-height: 1.55; }

/* ---------- Wallet page ---------- */
.wallet-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--sidebar);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 30px;
}
.wh-l { font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.wh-v { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 6px; }
.wh-sub { font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.wh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-hero .btn-ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.wallet-hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.tx-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.tx-row:first-child { border-top: none; }
.tx-ico {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f0f0f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.tx-main { flex: 1; min-width: 0; }
.tx-label { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.tx-amt { font-size: 15px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.tx-amt.pos { color: var(--text); }
.tx-empty { padding: 34px 24px; text-align: center; color: var(--faint); font-size: 14.5px; }

/* ---------- Account page ---------- */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 900px;
}
.acc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.acc-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.kyc-status { font-size: 15px; font-weight: 600; margin: 14px 0 4px; color: var(--muted); }
.kyc-status.ok { color: var(--green); }

@media (max-width: 800px) {
  .account-grid { grid-template-columns: 1fr; }
  .ph-row { grid-template-columns: 1.1fr 1fr 1fr; }
  .ph-row span:nth-child(3) { display: none; }
  .wallet-hero { padding: 22px; }
  .wh-v { font-size: 32px; }
}
