/* ============================================================
   TailWins — design system v2
   Premium fintech aesthetic. Self-contained, no build step.
   ============================================================ */

:root {
  /* brand — navy + sky */
  --navy: #0b1f3a;
  --navy-800: #0a1a30;
  --sky: #2f7bf6;
  --sky-600: #1f6aec;
  --sky-700: #1657cf;
  --sky-tint: #eaf2fe;

  /* aliases kept so component rules read cleanly */
  --brand: var(--sky);
  --brand-600: var(--sky-600);
  --brand-700: var(--sky-700);
  --brand-tint: var(--sky-tint);
  --brand-ink: #1a5fd0;
  --indigo: #486089;
  --indigo-tint: #eef2f8;

  /* neutrals (cool) */
  --ink: #0b1f3a;
  --ink-2: #465a77;
  --muted: #8493a9;
  --faint: #aab6c7;
  --line: #e7ebf2;
  --line-2: #dde3ec;
  --bg: #f5f8fd;
  --bg-2: #eaeff7;
  --card: #ffffff;
  --hover: #f5f9ff;

  /* semantic (muted, not casino) */
  --up: #14a06b;
  --down: #e0483c;
  --amber: #d98a2b;
  --amber-tint: #fbf1e3;
  --gold: #b9c3d4;
  --silver: #c3ccd9;
  --bronze: #cdb79a;

  /* elevation */
  --sh-xs: 0 1px 2px rgba(11, 15, 25, .04);
  --sh-sm: 0 1px 3px rgba(11, 15, 25, .06), 0 1px 2px rgba(11, 15, 25, .04);
  --sh-md: 0 4px 16px rgba(11, 15, 25, .07), 0 1px 3px rgba(11, 15, 25, .05);
  --sh-lg: 0 24px 60px rgba(11, 15, 25, .14), 0 6px 18px rgba(11, 15, 25, .08);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --maxw: 1160px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 .4em; font-weight: 780; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.7rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-2); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv01"; }
.center { text-align: center; }
.hidden { display: none !important; }
.spark { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 20px; font-weight: 640; font-size: .94rem; font-family: inherit;
  cursor: pointer; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform .12s cubic-bezier(.2,.8,.3,1), box-shadow .15s, background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sky); color: #fff; box-shadow: 0 1px 2px rgba(20,60,140,.28), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { background: var(--sky-600); box-shadow: 0 8px 20px rgba(47,123,246,.32); }
/* --ink flips near-white in dark mode, so text must be var(--bg), not #fff,
   or the dark button becomes white-on-white. This inverts cleanly in both modes. */
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: color-mix(in srgb, var(--ink) 88%, var(--bg)); box-shadow: var(--sh-md); }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--faint); background: var(--hover); }
/* Ghost button placed on a dark panel (same look in both color schemes). */
.btn-ghost-invert { background: transparent; border-color: rgba(255,255,255,.28); color: #fff; }
.btn-ghost-invert:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.btn-sm { padding: 7px 14px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 1.14rem; letter-spacing: -0.035em; color: var(--ink); }
.brand .tw-mark { display: block; flex: 0 0 auto; }
.brand-name { line-height: 1; }
.tw-ico { vertical-align: middle; flex: 0 0 auto; }
.nav-links { display: flex; gap: 2px; margin-left: 8px; }
.nav-links a {
  padding: 8px 13px; border-radius: 9px; font-weight: 520; color: var(--ink-2);
  font-size: .93rem; transition: background .12s, color .12s;
}
.nav-links a:hover { background: var(--bg-2); color: var(--ink); }
.nav-links a.active { color: var(--ink); background: var(--bg-2); font-weight: 600; }
.nav-spacer { flex: 1; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-auth { display: flex; gap: 10px; align-items: center; }
.auth-form input { width: 100%; }
.field-label { display: block; font-size: .72rem; font-weight: 640; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.auth-error { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-tint, #fff4f4); border: 1px solid var(--line-2); color: var(--down, #c0392b); font-size: .88rem; }
.nav-user { font-size: .86rem; font-weight: 600; color: var(--ink-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-pro { background: var(--brand-tint); color: var(--brand-ink); font-weight: 700; letter-spacing: .04em; }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -35% -10% auto -10%; height: 640px; z-index: 0;
  background:
    radial-gradient(52% 74% at 80% 4%, rgba(47,123,246,.14), transparent 62%),
    radial-gradient(46% 64% at 8% 0%, rgba(11,31,58,.06), transparent 58%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 52px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--brand-ink);
  padding: 6px 8px 6px 12px; border-radius: 999px; font-weight: 600; font-size: .8rem;
  margin-bottom: 22px; border: 1px solid var(--line-2); box-shadow: var(--sh-xs);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.hero h1 { margin-bottom: .3em; }
.hero p.lead { font-size: 1.16rem; max-width: 520px; color: var(--ink-2); }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-trust { margin-top: 32px; display: flex; gap: 30px; flex-wrap: wrap; }
.hero-trust .stat b { font-size: 1.6rem; display: block; letter-spacing: -0.03em; }
.hero-trust .stat span { color: var(--muted); font-size: .84rem; }

/* app-preview card */
.preview-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); overflow: hidden;
}
.preview-top { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.preview-top .dots { display: flex; gap: 6px; }
.preview-top .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.preview-chart { padding: 8px 8px 0; }
.preview-list { padding: 8px 8px 14px; }
.preview-row {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px;
}
.preview-row:hover { background: var(--hover); }
.rank { color: var(--faint); font-weight: 700; text-align: center; font-size: .9rem; }

/* ---------- Sections ---------- */
section.block { padding: 62px 0; }
.section-head { max-width: 620px; margin-bottom: 38px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head .kicker { color: var(--brand-600); font-weight: 650; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; box-shadow: var(--sh-xs); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-2); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 18px; background: var(--sky-tint); border: 1px solid #d4e5fd; color: var(--sky);
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; font-size: .94rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: var(--sh-xs); }
.step .n {
  width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; margin-bottom: 14px; font-size: .95rem;
}

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .78rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), var(--sh-xs); letter-spacing: -0.02em;
}
.avatar.lg { width: 54px; height: 54px; font-size: 1rem; border-radius: 14px; }
.avatar.sm { width: 30px; height: 30px; font-size: .68rem; border-radius: 9px; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px; font-size: .72rem; font-weight: 600;
  background: var(--bg-2); color: var(--ink-2); white-space: nowrap; letter-spacing: -0.01em;
}
.chip.cat { background: var(--indigo-tint); color: #3a5075; }
.badge-hft { background: var(--amber-tint); color: #a9701f; border: 1px solid #ecd7b3; }
.badge-hft svg { width: 12px; height: 12px; }
.badge-verified { color: var(--sky); display: inline-flex; }
.badge-verified svg { width: 14px; height: 14px; }
.pro-pill { background: var(--sky); color: #fff; font-weight: 700; letter-spacing: .02em; }
.callout .i svg { width: 18px; height: 18px; display: block; }

.risk-dots { display: inline-flex; gap: 3px; align-items: center; }
.risk-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--line-2); }
.risk-dots i.on { background: var(--amber); }
.risk-dots i.on.r5 { background: var(--down); }

/* rank badges */
.rank-badge {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px;
  font-size: .8rem; font-weight: 700; color: var(--muted); background: transparent;
}
.rank-badge.medal { background: var(--sky-tint); color: var(--sky-700); font-weight: 800; }
.rank-badge.gold { background: var(--sky); color: #fff; }
.rank-badge.silver { background: var(--sky-tint); color: var(--sky-700); }
.rank-badge.bronze { background: var(--sky-tint); color: var(--sky-700); }

/* ---------- Toolbar / filters ---------- */
.page-head { padding: 40px 0 10px; }
.toolbar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; box-shadow: var(--sh-sm); margin-bottom: 18px;
  /* Scrolls away with the page so it never covers the trader list. */
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .7rem; font-weight: 640; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
select, input[type="text"], input[type="number"], input[type="email"], input[type="password"] {
  font-family: inherit; font-size: .92rem; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; background: var(--card);
  min-height: 40px; transition: border-color .12s, box-shadow .12s;
}
select:focus, input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 8px;
  font-weight: 600; font-size: .85rem; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: color .12s, background .12s, box-shadow .12s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--sh-xs); }

.switch { display: inline-flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 520; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .16s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform .16s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

.cash-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 4px; margin-top: 4px; border-top: 1px dashed var(--line-2); }
.cash-dot { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 5px, #b4bece 5px, #b4bece 10px); }
.trader-link { color: inherit; text-decoration: none; cursor: pointer; }
.trader-link:hover { color: var(--brand-ink); text-decoration: underline; }

/* ---------- Trader detail page ---------- */
.detail-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.detail-head .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-head .who h1 { margin: 0; font-size: 1.6rem; display: flex; align-items: center; gap: 8px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-xs); }
.stat-card .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 640; }
.stat-card .value { font-size: 1.5rem; font-weight: 760; margin-top: 6px; letter-spacing: -0.02em; }
.chart-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh-sm); margin-bottom: 22px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pnl-chart { width: 100%; height: 260px; display: block; }
.chart-wrap { position: relative; touch-action: none; cursor: crosshair; }
.chart-crosshair { position: absolute; top: 0; bottom: 22px; width: 1px; background: var(--line-2); pointer-events: none; display: none; z-index: 2; }
.chart-band { position: absolute; top: 0; bottom: 22px; background: rgba(90,150,220,.15); pointer-events: none; display: none; z-index: 1; }
.chart-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; transform: translate(-50%,-50%); display: none; z-index: 3; }
.chart-tip { position: absolute; pointer-events: none; background: #0f2038; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .76rem; line-height: 1.35; box-shadow: var(--sh-md); white-space: nowrap; transform: translate(-50%, -120%); z-index: 4; display: none; border: 1px solid rgba(255,255,255,.12); }
.pnl-pos { color: var(--up); font-weight: 700; }
.pnl-neg { color: var(--down); font-weight: 700; }
.wl-chip { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; }
.wl-chip b { font-weight: 700; }
.trade-row-side { font-weight: 700; }
.side-buy { color: var(--up); }
.side-sell { color: var(--down); }
@media (max-width: 720px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }

/* Mirrorability score cell (leaderboard) */
.mscore { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 54px; }
.mscore-num { font-weight: 750; font-size: .98rem; }
.mscore-top { display: inline-flex; align-items: center; }
.mscore-trend { font-size: .82rem; font-weight: 700; margin-left: 4px; }

/* Info dot + Mirror-score formula popover */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.lookup-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--brand); border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; }
.lookup-banner .lb-main { flex: 1; min-width: 220px; }
.lookup-banner .lb-title { font-weight: 700; font-size: .95rem; }
.lookup-banner .lb-sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.lookup-banner .lb-addr { font-family: ui-monospace, monospace; color: var(--brand-ink, var(--brand)); }

.info-dot { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; vertical-align: middle; margin-left: 5px; border-radius: 50%; transition: color .12s; }
.info-dot:hover, .info-dot:focus-visible { color: var(--brand); outline: none; }
.score-pop { position: absolute; z-index: 60; width: 360px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); padding: 16px 18px; font-size: .84rem; line-height: 1.5; display: none; box-sizing: border-box; }
.score-pop.open { display: block; }
.score-pop h4 { margin: 0 0 4px; font-size: .98rem; }
.score-pop .sub { color: var(--muted); font-size: .8rem; margin: 0 0 12px; }
.score-pop ol { margin: 0; padding-left: 0; list-style: none; counter-reset: sp; }
.score-pop li { position: relative; padding: 0 0 11px 30px; counter-increment: sp; }
.score-pop li:last-child { padding-bottom: 2px; }
.score-pop li::before { content: counter(sp); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); color: var(--brand); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.score-pop li b { font-weight: 700; }
.score-pop .tag { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--up); background: rgba(46,160,67,.14); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.score-pop .foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.mscore-bar { width: 54px; height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.mscore-bar > span { display: block; height: 100%; border-radius: 3px; }

/* ---------- Trader table ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); }
.table-scroll { overflow-x: auto; }
table.traders { width: 100%; border-collapse: collapse; min-width: 720px; }
table.traders thead th {
  text-align: right; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 640; padding: 14px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none;
}
table.traders thead th:first-child, table.traders thead th.left { text-align: left; }
table.traders thead th:hover { color: var(--ink-2); }
table.traders thead th.sorted { color: var(--ink); }
table.traders thead th .arrow { font-size: .64rem; margin-left: 3px; }
table.traders tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
table.traders tbody td.left { text-align: left; }
table.traders tbody tr { transition: background .1s; }
table.traders tbody tr:hover { background: var(--hover); }
table.traders tbody tr:last-child td { border-bottom: 0; }
.trader-id { display: flex; align-items: center; gap: 12px; }
.trader-id .name { font-weight: 680; display: flex; align-items: center; gap: 6px; letter-spacing: -0.015em; }
.trader-id .sub { color: var(--muted); font-size: .8rem; }
.cats { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-start; }
.count-note { color: var(--muted); font-size: .88rem; margin: 4px 2px 18px; }
.count-note strong { color: var(--ink); }
.trades-cell b { font-weight: 700; }
.trades-cell span { color: var(--muted); font-size: .74rem; display: block; }
tr.is-hft td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

/* ---------- Portfolio builder ---------- */
.builder { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-sm); }
.panel .panel-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel .panel-body { padding: 10px 20px 20px; }
.alloc-row { display: grid; grid-template-columns: minmax(0,1fr) 1.1fr auto auto; gap: 16px; align-items: center; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.alloc-row:last-child { border-bottom: 0; }
.alloc-row input[type="range"] { width: 100%; accent-color: var(--brand); height: 4px; }
.alloc-pct { width: 76px; }
.alloc-pct input { width: 100%; text-align: right; }
.remove-x { border: 0; background: var(--bg-2); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 1rem; transition: background .12s, color .12s; }
.remove-x:hover { background: #ffe9e6; color: var(--down); }
.empty-slot { padding: 34px 18px; text-align: center; color: var(--muted); }

.summary-num { font-size: 2.05rem; font-weight: 800; letter-spacing: -0.035em; }
.alloc-bar { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; display: flex; }
.alloc-bar > span { height: 100%; transition: width .2s; }
.cash-input { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 4px 14px; transition: border-color .12s, box-shadow .12s; }
.cash-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.cash-input span { color: var(--muted); font-weight: 700; font-size: 1.1rem; }
.cash-input input { border: 0; padding: 8px 0; font-size: 1.45rem; font-weight: 700; width: 100%; background: transparent; }
.cash-input input:focus { outline: none; box-shadow: none; }

.plan-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.plan-table th, .plan-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--line); font-size: .9rem; }
.plan-table th { color: var(--muted); font-weight: 640; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.plan-table th.left, .plan-table td.left { text-align: left; }
.plan-table tfoot td { border-bottom: 0; }

.callout {
  border-radius: 12px; padding: 14px 16px; font-size: .9rem; display: flex; gap: 11px;
  align-items: flex-start; margin: 14px 0; line-height: 1.5;
}
.callout .i { font-size: 1.05rem; line-height: 1.3; flex: 0 0 auto; }
.callout.warn { background: var(--amber-tint); border: 1px solid #f6dcc0; color: #8a5215; }
.callout.info { background: var(--indigo-tint); border: 1px solid #d8ddff; color: #3a45a8; }
.callout.danger { background: #fff0ee; border: 1px solid #ffd3cd; color: #a02b1f; }
.callout code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 5px; font-size: .85em; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 880px; margin: 0 auto; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--sh-sm); position: relative; }
.price-card.featured { border: 1.5px solid var(--brand); box-shadow: 0 20px 50px rgba(0,168,110,.14); }
.price-card .tag { position: absolute; top: -13px; right: 26px; background: var(--brand); color: #04231a; padding: 5px 13px; border-radius: 999px; font-size: .76rem; font-weight: 700; box-shadow: var(--sh-sm); }
.price-amt { font-size: 3.1rem; font-weight: 800; letter-spacing: -0.04em; }
.price-amt small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0 24px; }
.price-card li { padding: 8px 0; display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: .94rem; }
.price-card li .ck { color: var(--brand-600); font-weight: 800; }
.price-card li.off { color: var(--faint); }
.price-card li.off .ck { color: var(--line-2); }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--line); background: var(--card); margin-top: 48px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px; padding: 52px 0 32px; }
.foot-grid h5 { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.foot-grid a { display: block; padding: 5px 0; color: var(--ink-2); font-size: .92rem; }
.foot-grid a:hover { color: var(--ink); }
.foot-bottom { border-top: 1px solid var(--line); padding: 20px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .82rem; }
.disclaimer { background: var(--bg); border-top: 1px solid var(--line); }
.disclaimer .container { padding: 20px 24px; color: var(--muted); font-size: .78rem; line-height: 1.6; }

/* ---------- Modal / toast ---------- */
/* Fixed dark pill (NOT var(--ink), which flips near-white in dark mode -> white-on-white). */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0f2038; color: #fff; border: 1px solid rgba(255,255,255,.12); padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--sh-lg); opacity: 0; pointer-events: none; transition: all .22s cubic-bezier(.2,.8,.3,1); z-index: 200; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid, .builder, .price-grid, .feature-grid, .steps, .foot-grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 24px; }
  .hero-grid { gap: 34px; }
  .nav-links { display: none; }
  .toolbar { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero-trust { gap: 20px; }
  .foot-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #dbe6f7;                 /* flips light so navy text stays legible */
    --sky: #4d9bff; --sky-600: #6aabff; --sky-700: #8ec0ff;
    --ink: #eaf1fb; --ink-2: #a9b6c9; --muted: #7c899d; --faint: #566173;
    --line: #1a2740; --line-2: #243350; --bg: #070d18; --bg-2: #10192b;
    --card: #0e1626; --hover: #141f33;
    --brand-tint: #10233f; --brand-ink: #7fb4ff;
    --indigo-tint: #16243c; --indigo: #93a8c9;
    --amber-tint: #2a2011;
    --gold: #24344f; --silver: #1e2c44; --bronze: #24344f;
  }
  .btn-primary { color: #fff; }
  .eyebrow { background: var(--bg-2); }
  .feature .ico { border-color: #21324e; }
  .badge-hft { background: var(--amber-tint); border-color: #4a3a1c; color: #e8b877; }
  .callout.danger { background: #2a1513; border-color: #4a221d; color: #f0a79c; }
  .rank-badge.gold { color: #fff; }
  .remove-x:hover { background: #3a1d1a; }
  .preview-top .dots i { background: var(--line-2); }
}
