/* Kundli Krab design system.
   Tokens → base → shell (sidebar / top bar / tab bar) → components → pages. */

@font-face {
  font-family: "Inter";
  src: url("brand/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-elev: #fbf9f6;
  --surface: #ffffff;
  --surface-2: #f2ede6;
  --surface-3: #ebe4da;
  --text: #1b1613;
  --text-2: #4a413b;
  --muted: #80766e;
  --line: #e7e0d6;
  --line-soft: rgba(27, 22, 19, 0.06);
  --brand: #9f1239;
  --brand-2: #e11d48;
  --brand-ink: #ffffff;
  --brand-soft: #fde8ee;
  --brand-line: rgba(159, 18, 57, 0.22);
  --accent: #c2410c;
  --accent-2: #f59e0b;
  --accent-soft: #fff1dc;
  --good: #15803d;
  --good-soft: #e3f6e8;
  --warn: #b45309;
  --warn-soft: #fdf0d8;
  --bad: #b91c1c;
  --bad-soft: #fde4e4;
  --glow-1: rgba(225, 29, 72, 0.10);
  --glow-2: rgba(245, 158, 11, 0.10);
  --shadow-sm: 0 1px 2px rgba(27, 22, 19, 0.05);
  --shadow: 0 1px 2px rgba(27, 22, 19, 0.04), 0 6px 20px -6px rgba(27, 22, 19, 0.10);
  --shadow-lg: 0 2px 6px rgba(27, 22, 19, 0.05), 0 24px 48px -16px rgba(27, 22, 19, 0.22);
  --ring: 0 0 0 4px var(--brand-soft);
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0c0b;
    --bg-elev: #141110;
    --surface: #1a1614;
    --surface-2: #231e1b;
    --surface-3: #2d2723;
    --text: #f6f1ec;
    --text-2: #d6cdc5;
    --muted: #9b8f86;
    --line: #2f2824;
    --line-soft: rgba(255, 255, 255, 0.06);
    --brand: #fb7185;
    --brand-2: #f43f5e;
    --brand-ink: #1a0910;
    --brand-soft: rgba(251, 113, 133, 0.14);
    --brand-line: rgba(251, 113, 133, 0.35);
    --accent: #fb923c;
    --accent-2: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.12);
    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, 0.12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.12);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.12);
    --glow-1: rgba(244, 63, 94, 0.12);
    --glow-2: rgba(251, 146, 60, 0.07);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 56px -18px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0c0b;
  --bg-elev: #141110;
  --surface: #1a1614;
  --surface-2: #231e1b;
  --surface-3: #2d2723;
  --text: #f6f1ec;
  --text-2: #d6cdc5;
  --muted: #9b8f86;
  --line: #2f2824;
  --line-soft: rgba(255, 255, 255, 0.06);
  --brand: #fb7185;
  --brand-2: #f43f5e;
  --brand-ink: #1a0910;
  --brand-soft: rgba(251, 113, 133, 0.14);
  --brand-line: rgba(251, 113, 133, 0.35);
  --accent: #fb923c;
  --accent-2: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.12);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --glow-1: rgba(244, 63, 94, 0.12);
  --glow-2: rgba(251, 146, 60, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 56px -18px rgba(0, 0, 0, 0.7);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(800px 420px at 12% -120px, var(--glow-1), transparent 70%),
    radial-gradient(700px 380px at 92% -160px, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::selection { background: var(--brand-soft); }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 750; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; }
h3 {
  font-size: 12px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.section { margin-top: 16px; }
.tnum { font-variant-numeric: tabular-nums; }

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ----------------------------------------------------------------- shell */
.shell { min-height: 100dvh; }
.main-col { min-width: 0; }
.app { max-width: 1120px; margin: 0 auto; padding: 0 20px 56px; }
.page { animation: enter 0.32s var(--ease) both; }
.narrow { max-width: 600px; margin-left: auto; margin-right: auto; }

/* Top bar (phones, tablets, and logged-out desktop) */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none;
  font-weight: 750; letter-spacing: -0.02em; font-size: 17px;
}
.logo .krab { color: var(--brand); }
.logo-mark { width: 32px; height: 32px; display: block; flex: none; }

/* Segmented tabs (top bar on tablets; demo sub-tabs) */
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 4px; border-radius: 999px; border: 1px solid var(--line-soft); }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 550; color: var(--muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab svg { width: 16px; height: 16px; }
.count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-size: 11px; line-height: 18px; text-align: center;
}

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); display: grid; place-items: center; padding: 0;
  transition: background 0.15s, transform 0.08s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }

/* Sidebar (desktop, signed in) */
.sidebar { display: none; }
@media (min-width: 960px) {
  .shell.onboarded { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .shell.onboarded .topbar { display: none; }
  .shell.onboarded .app { padding-top: 36px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; padding: 22px 14px 18px;
    border-right: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .sidebar .logo { padding: 2px 10px 18px; }
  .side-link {
    display: flex; align-items: center; gap: 11px; width: 100%;
    border: 1px solid transparent; background: transparent; color: var(--text-2); text-align: left;
    padding: 9px 12px; border-radius: 11px; font-size: 14px; font-weight: 550;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
  }
  .side-link svg { width: 18px; height: 18px; flex: none; opacity: 0.8; }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border-color: var(--line-soft); }
  .side-link.active svg { color: var(--brand); opacity: 1; }
  .side-link .count { margin-left: auto; }
  .sidebar .btn.primary { margin: 14px 4px 10px; }
  .sidebar-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 6px; }
  .sidebar-foot .credit { font-size: 12px; color: var(--muted); line-height: 1.5; }
  .sidebar-foot .credit b { color: var(--text); }
  .shell.onboarded .footer { display: none; }
}

/* Phone tab bar */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .app { padding: 0 16px 104px; }
  .topbar .tabs.main-nav {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 40; justify-content: space-around; padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  .topbar .tabs.main-nav .tab { flex: 1; flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 4px; border-radius: 16px; }
  .topbar .tabs.main-nav .tab svg { width: 22px; height: 22px; }
  .topbar .tabs.main-nav .tab.active { color: var(--brand); }
  .toast { bottom: 100px !important; }
}

.footer { margin: 40px auto 24px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.9; max-width: 1120px; padding: 0 20px; }
.footer .credit b { color: var(--text); }
.footer a { color: inherit; }

/* ------------------------------------------------------------ components */
.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px;
}
.card.flat { box-shadow: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.08s var(--ease), background 0.15s, box-shadow 0.15s, filter 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.primary {
  border: 0; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 92%, white), var(--brand));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -6px var(--brand);
}
:root[data-theme="dark"] .btn.primary { color: #1a0910; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #1a0910; } }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 92%, white), var(--brand)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; font-weight: 550; }
.btn.small-pad { min-height: 38px; padding: 8px 14px; }
.btn.lg { min-height: 50px; padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Inputs */
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-line); box-shadow: var(--ring); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }

/* Chips */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--surface); padding: 7px 13px;
  border-radius: 999px; font-size: 13.5px; font-weight: 550; color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--brand-line); color: var(--text); }
.chip.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.chip .x { border: 0; background: none; color: inherit; margin-left: 4px; padding: 0; font-size: 15px; line-height: 1; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; justify-content: center; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.brand { background: var(--brand-soft); color: var(--brand); }

/* Avatars */
.av { width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden; }
.av svg, .av img { width: 100%; height: 100%; display: block; }

/* Lists */
.list { display: grid; gap: 10px; }
.item {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; color: inherit;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s;
}
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line); }
.item .av { width: 48px; height: 48px; }
.item .score { font-weight: 700; color: var(--brand); }

/* Evidence & insights */
.reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 14px; color: var(--text-2); }
.reasons li { display: flex; gap: 10px; }
.reasons li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-top: 8px; }
.reasons.evidence li::before { background: var(--brand); opacity: 0.6; }
.headline { font-size: 19px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.35; margin: 0 0 14px; color: var(--text); }
.insight {
  font-size: 13px; font-weight: 550; color: var(--text-2);
  background: linear-gradient(90deg, var(--brand-soft), transparent); border-left: 2px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 7px 10px; margin-top: 8px;
}
.reveal { border-left: 3px solid var(--accent-2); background: var(--accent-soft); padding: 12px 14px; border-radius: 0 12px 12px 0; font-size: 14.5px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.kundli-preview { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }

/* Picked-up chips */
.picked { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pick { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.pick::before { content: "picked up · "; font-weight: 500; opacity: 0.75; }
.pick.ai { color: var(--good); background: var(--good-soft); }
.pick.ai::before { content: "AI · "; }

/* Bars */
.bars { display: grid; gap: 12px; }
.bar .label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar .track, .koota .track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bar .fill.alt { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.stated .label b::after { content: " · you said"; font-weight: 500; color: var(--muted); }

/* Guna */
.guna-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.05; }
.ring .ring-label b { font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring .ring-label span { font-size: 11px; color: var(--muted); }
.ring.mini .ring-label b { font-size: 11.5px; letter-spacing: -0.02em; }
.ring.mini .ring-label span { display: none; }
.koota { display: grid; grid-template-columns: 112px 1fr 48px; gap: 12px; align-items: center; font-size: 13.5px; padding: 4px 0; }
.koota .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.koota .pts { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.verdict { font-size: 13px; font-weight: 600; }

/* Stepper */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 4px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.step::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.step .dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); transition: all 0.2s var(--ease); }
.step.done .dot { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.step.current .dot { border-color: var(--brand); box-shadow: var(--ring); }
.step.current { color: var(--text); font-weight: 650; }
.history { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; }

/* Progress */
.progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 0 0 22px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width 0.3s var(--ease); }

/* Options (quiz) */
.option {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 14px 16px; font-weight: 550; transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.option:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.option:active { transform: scale(0.99); }

/* Editor / upload */
.editor { margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--bg-elev); }
.editor .field:last-child { margin-bottom: 0; }
.upload-pick { cursor: pointer; margin-bottom: 8px; }
.upload-thumb { display: block; max-width: 100%; max-height: 260px; margin: 10px auto; border-radius: 12px; border: 1px solid var(--line); }
details > summary { color: var(--brand); font-weight: 600; cursor: pointer; list-style: none; font-size: 13.5px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "＋ "; }
details[open] > summary::before { content: "－ "; }
.ai-toggle { font-size: 13px; color: var(--muted); margin-top: 12px; }
.ai-toggle b { color: var(--text); }

/* Chat */
.chat { display: grid; gap: 10px; margin-bottom: 12px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; animation: pop 0.2s var(--ease); }
.msg.mine { align-items: flex-end; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px 16px 16px 5px; background: var(--surface-2); font-size: 14.5px; }
.msg.mine .bubble { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; border-radius: 16px 16px 5px 16px; }
.starters { margin-bottom: 10px; }
.starters .chip { font-size: 12.5px; padding: 6px 11px; }
.compose input { flex: 1; }

/* Sheet / toast / empty */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 8, 7, 0.45); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: enter 0.2s both; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 22px 18px 32px; animation: up 0.28s var(--ease); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; max-height: 88dvh; } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  width: calc(100% - 32px); max-width: 440px; background: var(--text); color: var(--bg);
  border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-lg);
  animation: up 0.25s var(--ease);
}
.toast .btn { min-height: 34px; padding: 6px 12px; }
.empty { text-align: center; padding: 48px 16px; max-width: 520px; margin: 0 auto; }
.empty .big { font-size: 44px; margin-bottom: 10px; }
.empty img { width: 104px; height: 104px; margin-bottom: 14px; }

/* --------------------------------------------------------------- landing */
.landing { display: grid; gap: 40px; padding: 28px 0 8px; align-items: center; }
@media (min-width: 960px) { .landing { grid-template-columns: 1.05fr 0.95fr; gap: 56px; padding: 56px 0 24px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2);
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.eyebrow img { width: 22px; height: 22px; }
.gradient-text { background: linear-gradient(100deg, var(--brand), var(--brand-2) 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 17px; line-height: 1.6; color: var(--text-2); margin: 18px 0 26px; max-width: 560px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.preview-stack { position: relative; }
.preview-card { animation: pop 0.5s var(--ease) both; }
.preview-card + .preview-card { margin-top: 12px; animation-delay: 0.12s; }
.features { display: grid; gap: 14px; margin-top: 40px; }
@media (min-width: 760px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 22px; }
.feature .ficon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.feature .ficon svg { width: 20px; height: 20px; }
.feature h4 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-2); font-size: 14px; }
.privacy-band { margin-top: 14px; display: flex; gap: 14px; align-items: center; padding: 16px 20px; font-size: 14px; color: var(--text-2); }
.privacy-band b { color: var(--text); }
.privacy-band .lock { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--good-soft); color: var(--good); flex: none; }
.privacy-band .lock svg { width: 18px; height: 18px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.onboard { max-width: 560px; margin: 24px auto 0; }

/* ------------------------------------------------------------- tracker */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 34px); }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-sm); min-width: 130px; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }

/* Pipeline board: columns on desktop, stacked groups on phones */
.board { display: grid; gap: 18px; }
@media (min-width: 960px) {
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .col { background: color-mix(in srgb, var(--surface-2) 55%, transparent); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 10px; min-height: 180px; }
}
@media (max-width: 959px) { .col.is-empty { display: none; } }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.col-head h3 { margin: 0; }
.col-head .count { background: var(--surface-3); color: var(--text-2); }
.col-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 18px 6px; border: 1px dashed var(--line); border-radius: 12px; }
.pcard {
  display: block; width: 100%; text-align: left; color: inherit; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line); }
.pcard .top { display: flex; gap: 10px; align-items: center; }
.pcard .av { width: 38px; height: 38px; }
.pcard .name { font-weight: 650; letter-spacing: -0.01em; }
.pcard .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); gap: 8px; }

/* Prospect detail: two columns on desktop */
.detail-grid { display: grid; gap: 16px; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: 0.92fr 1.08fr; align-items: start; gap: 20px; } .detail-grid > div > .section:first-child { margin-top: 0; } }
.profile-hero { display: flex; gap: 16px; align-items: center; }
.profile-hero .av { width: 72px; height: 72px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.profile-hero h2 { font-size: 24px; }

/* Demo */
.demo-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 14px; padding: 10px 14px; margin: 4px 0 12px; }
.demo-tabs { width: max-content; margin-bottom: 14px; }
.profile { padding: 0; overflow: hidden; max-width: 480px; margin: 0 auto; }
.profile .head { padding: 28px 20px 16px; text-align: center; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.profile .head .av { width: 128px; height: 128px; margin: 0 auto 14px; }
.profile .body { padding: 4px 20px 20px; }
.actions { display: flex; justify-content: center; gap: 20px; margin: 22px 0 6px; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 24px; display: grid; place-items: center; transition: transform 0.1s; }
.round:active { transform: scale(0.92); }
.round.like { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border: 0; color: #fff; }
.hint { text-align: center; font-size: 12px; color: var(--muted); }

/* Boot screen */
.boot { min-height: 70dvh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.boot-crab { width: 72px; height: 72px; animation: bob 1.2s ease-in-out infinite; }
body:has(.shell) .boot { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Full-bleed top bar; content inside stays aligned with the page. */
.topbar { max-width: none; padding-left: max(20px, calc((100% - 1080px) / 2)); padding-right: max(20px, calc((100% - 1080px) / 2)); }
@media (max-width: 640px) { .topbar { padding-left: 16px; padding-right: 16px; } }

/* ---------- Mutual-fit verdict ---------- */
.field-error { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: -4px 0 14px; }
.verdict { border-top: 4px solid var(--border); }
.verdict.good { border-top-color: var(--good); }
.verdict.warn { border-top-color: var(--warn); }
.verdict.bad { border-top-color: var(--bad); }
.verdict .vhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.verdict .vlabel { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.verdict .vband { margin: 2px 0 2px; font-size: 22px; }
.verdict.good .vband { color: var(--good); }
.verdict.warn .vband { color: var(--warn); }
.verdict.bad .vband { color: var(--bad); }
.verdict .vscore { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; padding: 6px 10px; border-radius: 14px; background: var(--surface-2); }
.verdict .vbars { display: grid; gap: 10px; margin-bottom: 12px; }
.vpoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vpoint { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.vpoint.bad { background: var(--bad-soft); }
.vpoint.warn { background: var(--warn-soft); }
.vpoint.good { background: var(--good-soft); }
.vpoint .vicon { width: 20px; text-align: center; flex: none; font-weight: 700; }
.vpoint.bad .vicon { color: var(--bad); }
.vpoint.warn .vicon { color: var(--warn); }
.vpoint.good .vicon { color: var(--good); }
.vev { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
.vev li { border-left: 2px solid var(--border); padding-left: 8px; font-style: italic; }
.tag.neutral { background: var(--surface-2); color: var(--muted); }

/* Buttons never push past the screen edge: long labels wrap on phones. */
.btn { max-width: 100%; }
@media (max-width: 640px) { .btn { white-space: normal; text-align: center; } }
@media (max-width: 640px) {
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stat { min-width: 0; }
  .footer { margin-bottom: 112px; }
  .card { padding: 18px; }
  .page-head { flex-wrap: wrap; gap: 12px; }
}
/* Prospect page: slots own the spacing; on phones, one column with the verdict first. */
.detail-grid .slot:empty { display: none; }
.detail-grid .slot > * { margin-top: 0; }
.detail-grid .slot:not(:empty) ~ .slot:not(:empty) { margin-top: 16px; }
@media (max-width: 959px) {
  .detail-grid { display: flex; flex-direction: column; gap: 14px; }
  .detail-grid > div { display: contents; }
  .detail-grid .slot:not(:empty) ~ .slot:not(:empty) { margin-top: 0; }
  .detail-grid .o1 { order: 1; } .detail-grid .o2 { order: 2; } .detail-grid .o3 { order: 3; }
  .detail-grid .o4 { order: 4; } .detail-grid .o5 { order: 5; } .detail-grid .o6 { order: 6; } .detail-grid .o7 { order: 7; }
}
