/* BlendFi mockup design system — extracted from the Expo app.
   Light mode only. Aubergine ink + violet accent, flat white cards, hairline borders. */

:root {
  /* Brand */
  --purple: #260E49;        /* primary ink / brand aubergine */
  --purple-50: #F3F3F9;
  --purple-100: #E2E0E4;
  --purple-200: #9B8BB8;    /* tertiary text */
  --purple-300: #6D5A94;    /* secondary text */
  --purple-400: #3D2066;
  --purple-600: #1E0B3A;
  --purple-700: #16082B;

  --violet: #6051D6;        /* THE accent */
  --violet-50: #ECEAFC;     /* tinted chips / icon tiles */
  --violet-100: #D9D5F9;    /* soft borders */
  --violet-300: #8D81ED;
  --violet-600: #4A3DB8;

  /* Neutrals */
  --card: #FFFFFF;
  --bg-editorial: #F8F7FB;  /* Home / Wealth Horizon */
  --bg-page: #F0F0F0;       /* Money / Crypto / Invest */
  --gray-100: #F3F3F9;
  --gray-300: #E2E0E4;      /* border / divider / track */
  --gray-400: #C4C2C8;
  --gray-500: #9B99A0;
  --gray-600: #727078;

  /* Semantic */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --downside: #FF6B57;

  /* Accents */
  --cyan: #00D4FF;
  --alloc-cyan: #00AFCB;
  --gold: #D4AF37;
  --lightning: #FFD700;
  --btc: #FF9800; --btc-tile: #FFF3E0;
  --eth: #627EEA; --eth-tile: #E8E8FF;
  --usdc: #4CAF50; --usdc-tile: #E8F5E9;
  --amber-tile: #FFF3E0;

  /* Tints */
  --pos-bg: rgba(16,185,129,0.1);
  --neg-bg: rgba(239,68,68,0.1);
  --ontrack-bg: #E6F8F1; --ontrack-text: #087A58;
  --adjust-bg: #FFF4D8; --adjust-text: #8A5400;
  --lightning-bg: #FFF8E7; --lightning-border: #E6D5A8; --lightning-text: #8B6914;
  --custody-bg: #FFFBEB;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { background-color: #F0F0F0; }
body {
  font-family: var(--font-sans);
  color: var(--purple);
  background:
    radial-gradient(circle at 25% 10%, rgba(96, 81, 214, 0.10), transparent 34rem),
    #E9E7ED;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Phone shell: full-bleed on mobile, centered frame on desktop ---- */
.phone {
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-page);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone.editorial { background: var(--bg-editorial); }
@media (min-width: 480px) {
  body { padding: 32px 0; }
  .phone {
    height: calc(100vh - 64px);
    border-radius: 40px;
    box-shadow: 0 4px 20px rgba(38, 14, 73, 0.08), 0 24px 60px rgba(38,14,73,0.10);
    border: 1px solid var(--gray-300);
  }
}
.screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 120px;
}

/* ---- Typography roles ---- */
.eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--violet);
}
.hero-headline { font-size: 44px; font-weight: 800; line-height: 45px; letter-spacing: -1.8px; }
.screen-title { font-size: 28px; font-weight: 700; }
.section-title { font-size: 18px; font-weight: 800; }
.section-title-legacy { font-size: 18px; font-weight: 600; }
.big-money { font-size: 40px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.big-money-md { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.metric-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.body-copy { font-size: 14px; line-height: 21px; color: var(--purple-300); }
.meta { font-size: 12px; color: var(--purple-200); }
.micro { font-size: 10px; line-height: 15px; color: var(--purple-200); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--success); }
.neg { color: var(--error); }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-editorial {
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
}
.card-hero { border-radius: 24px; padding: 24px; }
.card-selectable { border: 2px solid transparent; }
.card-selectable.selected { border-color: var(--violet); }

/* ---- Buttons ---- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--violet); color: #FFF;
  border: none; border-radius: 16px; min-height: 56px; width: 100%;
  font-family: var(--font-sans); font-size: 16px; font-weight: 800; cursor: pointer;
}
.btn-primary:active { transform: scale(0.97); }
.btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 2px solid var(--violet); color: var(--violet);
  border-radius: 12px; padding: 14px; width: 100%;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; cursor: pointer;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; background: #FFF;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: var(--purple); position: relative;
}
.icon-btn .dot {
  position: absolute; top: 10px; right: 10px; width: 8px; height: 8px;
  border-radius: 4px; background: var(--error);
}

/* ---- Pills & chips ---- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--violet-50); color: var(--violet);
  border-radius: 12px; padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.pill-ontrack { background: var(--ontrack-bg); color: var(--ontrack-text); }
.pill-adjust { background: var(--adjust-bg); color: var(--adjust-text); }
.pill-pos { background: var(--pos-bg); color: var(--success); }
.pill-neg { background: var(--neg-bg); color: var(--error); }
.pill-warn { background: rgba(245,158,11,0.1); color: var(--warning); }
.chip {
  display: inline-flex; align-items: center;
  background: #FFF; color: var(--purple-300);
  border-radius: 18px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
}
.chip.active { background: var(--purple); color: var(--bg-page); }
.credential {
  background: var(--gray-100); color: var(--purple-300);
  border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 500;
  display: inline-block;
}

/* ---- Segmented control (Wealth Horizon style) ---- */
.segmented { display: flex; gap: 8px; }
.segmented button {
  flex: 1; border: 1px solid var(--gray-300); background: transparent;
  color: var(--purple-300); font-family: var(--font-sans);
  font-size: 12px; font-weight: 800; border-radius: 14px; padding: 10px 0; cursor: pointer;
}
.segmented button.active { background: var(--purple); border-color: var(--purple); color: #FFF; }

/* ---- Icon tiles ---- */
.tile {
  width: 44px; height: 44px; border-radius: 22px;
  background: var(--violet-50); color: var(--violet);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px;
}
.tile-sq { border-radius: 12px; }
.tile-btc { background: var(--btc-tile); color: var(--btc); }
.tile-eth { background: var(--eth-tile); color: var(--eth); }
.tile-usdc { background: var(--usdc-tile); color: var(--usdc); }
.tile-amber { background: var(--amber-tile); color: var(--warning); }
.tile-green { background: var(--pos-bg); color: var(--success); }
.tile-red { background: var(--neg-bg); color: var(--error); }

/* ---- List rows ---- */
.row {
  display: flex; align-items: center; gap: 12px;
  background: #FFF; border-radius: 18px; padding: 14px 16px; margin-bottom: 8px;
}
.row-flat {
  display: flex; align-items: center; gap: 12px;
  background: none; border-radius: 0; padding: 14px 0; margin: 0;
  border-bottom: 1px solid var(--gray-300);
}
.row-flat:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; }
.row-meta { font-size: 12px; color: var(--purple-200); margin-top: 2px; }
.row-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* ---- Progress ---- */
.progress { height: 6px; border-radius: 3px; background: var(--gray-300); overflow: hidden; }
.progress > div { height: 100%; border-radius: 3px; background: var(--violet); }
.progress-lg { height: 8px; border-radius: 4px; }
.stack-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }

/* ---- Toggle (custom pill, Wealth Horizon style) ---- */
.toggle {
  width: 38px; height: 22px; border-radius: 11px; background: var(--gray-300);
  position: relative; border: none; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 8px; background: #FFF;
  transition: left 0.15s;
}
.toggle.on { background: var(--violet); }
.toggle.on::after { left: 19px; }

/* ---- Headers ---- */
.tab-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 8px;
}
.stack-header {
  display: flex; align-items: center; min-height: 52px; padding: 8px 12px;
}
.stack-header .back {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--purple); cursor: pointer; font-size: 22px;
}
.stack-header .title { flex: 1; text-align: center; font-size: 18px; font-weight: 700; }
.stack-header .spacer { width: 44px; }

/* ---- Bottom tab bar ---- */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #FFF; border-top: 1px solid var(--gray-300);
  box-shadow: 0 -2px 8px rgba(38,14,73,0.08);
  display: flex; padding: 8px 0 28px; z-index: 50;
}
.tabbar a, .tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--purple-200); cursor: pointer;
}
.tabbar .tab.active, .tabbar a.active { color: var(--violet); }
.tabbar .tab-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
.tabbar ion-icon { font-size: 24px; }

/* ---- Sticky CTA bar ---- */
.sticky-cta {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 20px 32px;
  background: rgba(248,247,251,0.8);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--gray-300); z-index: 50;
}

/* ---- Misc ---- */
.divider { height: 1px; background: var(--gray-300); margin: 16px 0; }
.grid-dashed-note { border-top: 1px dashed var(--gray-300); }
.disclosure { font-size: 10px; line-height: 15px; color: var(--purple-200); margin-top: 12px; }
.badge-featured {
  background: var(--violet); color: #FFF; border-radius: 12px;
  padding: 4px 10px; font-size: 11px; font-weight: 700; display: inline-block;
}
.lightning-note {
  background: var(--lightning-bg); border: 1px solid var(--lightning-border);
  color: var(--lightning-text); border-radius: 12px; padding: 10px 12px;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.quick-actions { display: flex; gap: 12px; }
.quick-action {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #FFF; border-radius: 16px; padding: 16px 8px; border: none; cursor: pointer;
  color: var(--purple); font-family: var(--font-sans); font-size: 12px; font-weight: 600;
}
.wordmark { font-weight: 800; letter-spacing: -0.5px; }
.wordmark .fi { color: var(--violet); }
