/* Get Trade Lead: one stylesheet, no build step.
   Sections: font · tokens · base · components · marketing site · product mock · iPhone · app · auth · motion */

/* ---------- Font (Inter, SIL Open Font License, see fonts/OFL.txt) ---------- */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --bg: #fafafa;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --fg: #09090b;
  --fg-2: #3f3f46;
  --muted-fg: #71717a;
  --faint-fg: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --primary: #18181b;
  --primary-hover: #2e2e33;
  --primary-fg: #fafafa;
  --brand: #c2410c;
  --brand-hover: #9a3412;
  --brand-fg: #ffffff;
  --brand-text: #c2410c;
  --brand-soft: #fff7ed;
  --brand-line: #fed7aa;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #a16207;
  --warn-soft: #fefce8;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  /* Chart: today in the accent, earlier days in a neutral; both >= 3:1 on the surface (validated). */
  --chart-accent: #c2410c;
  --chart-context: #8b8b94;
  --ring: color-mix(in srgb, var(--brand) 32%, transparent);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgb(9 9 11 / 0.05);
  --shadow-sm: 0 1px 2px rgb(9 9 11 / 0.04), 0 2px 8px rgb(9 9 11 / 0.04);
  --shadow-md: 0 1px 3px rgb(9 9 11 / 0.06), 0 8px 24px -6px rgb(9 9 11 / 0.1);
  --shadow-lg: 0 2px 6px rgb(9 9 11 / 0.05), 0 28px 64px -16px rgb(9 9 11 / 0.22);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #09090b;
    --bg-raised: #0e0e10;
    --surface: #111113;
    --surface-2: #18181b;
    --surface-3: #212125;
    --fg: #fafafa;
    --fg-2: #d4d4d8;
    --muted-fg: #a1a1aa;
    --faint-fg: #71717a;
    --border: #232327;
    --border-strong: #303036;
    --primary: #fafafa;
    --primary-hover: #e4e4e7;
    --primary-fg: #09090b;
    --brand: #fb923c;
    --brand-hover: #fdba74;
    --brand-fg: #1c1917;
    --brand-text: #fb923c;
    --brand-soft: rgb(251 146 60 / 0.1);
    --brand-line: rgb(251 146 60 / 0.32);
    --danger: #f87171;
    --danger-soft: rgb(248 113 113 / 0.1);
    --warn: #facc15;
    --warn-soft: rgb(250 204 21 / 0.08);
    --ok: #4ade80;
    --ok-soft: rgb(74 222 128 / 0.1);
    --info: #60a5fa;
    --info-soft: rgb(96 165 250 / 0.1);
    --chart-accent: #ea580c;
    --chart-context: #6b6b73;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4), 0 2px 8px rgb(0 0 0 / 0.25);
    --shadow-md: 0 1px 3px rgb(0 0 0 / 0.5), 0 8px 24px -6px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.4), 0 28px 64px -16px rgb(0 0 0 / 0.7);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; color: var(--fg); font-weight: 650; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: 16px; letter-spacing: -0.015em; }
h3 { font-size: 15px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted-fg); }
.small { font-size: 13px; }
.icon { width: 16px; height: 16px; flex: none; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / 0.1);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-brand { background: var(--brand); color: var(--brand-fg); box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 40%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.2); }
.btn-brand:hover { background: var(--brand-hover); }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--fg-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
label { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-size: 14.5px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--faint-fg); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled { opacity: 0.6; }
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.input {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.input-mono { font-family: var(--mono); font-size: 12.5px; }
.hint { font-size: 13px; color: var(--muted-fg); }
.hint a { color: var(--fg); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.2s var(--ease);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.5; }

/* ---------- Cards, badges, banners, toasts ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 18%, transparent); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.badge-brand { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-line); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px 14px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
}
.banner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--border-strong); }
.banner-text { flex: 1 1 280px; }
.banner-title { font-weight: 650; }
.banner-text p + p { color: var(--fg-2); }
.banner-success { background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); }
.banner-success::before { background: var(--ok); }
.banner-danger { background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface)); }
.banner-danger::before { background: var(--danger); }
.banner-warn { background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); }
.banner-warn::before { background: var(--warn); }
.banner-info { background: color-mix(in srgb, var(--info-soft) 70%, var(--surface)); }
.banner-info::before { background: var(--info); }

.code {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.empty { padding: 40px 20px; color: var(--muted-fg); text-align: center; list-style: none; }

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none; /* information only: never block clicks on what's underneath */
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: toast-in 0.25s var(--ease);
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.toast-error::before { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-fg); font-size: 12.5px; font-weight: 600; }
.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }

/* Shown only when a page is opened straight from disk (see assets/preview.js). */
.preview-note { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--warn-soft); font-size: 13.5px; text-align: center; }
.preview-note code { padding: 1px 6px; border-radius: 4px; background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; }
.preview-note a { font-weight: 650; }

/* ---------- Marketing site ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  transition: border-color 0.2s, background-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--muted-fg); font-size: 14px; font-weight: 500; text-decoration: none; transition: color 0.15s, background-color 0.15s; }
.site-nav a:hover { color: var(--fg); background: var(--surface-2); }
.site-actions { display: flex; align-items: center; gap: 6px; }

/* Hero: copy on the left, the iPhone on the right */
.hero { position: relative; padding: 64px 0 96px; overflow-x: clip; }
.hero-bg { position: absolute; inset: 0 0 auto; height: 900px; pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
.hero-visual { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.phone-wrap { width: 286px; container-type: inline-size; }
.phone-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); font-size: 13px; font-weight: 500; }
.phone-hint .icon { width: 14px; height: 14px; }
.hero-bg::before,
.hero-bg::after { content: ""; position: absolute; inset: 0; }
.hero-bg::before {
  background:
    radial-gradient(700px 420px at 78% 18%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%),
    radial-gradient(520px 320px at 8% 0%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 70%);
}
.hero-bg::after {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 20%, transparent 72%);
}
.hero-copy { position: relative; z-index: 2; max-width: 620px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 12px 3px 4px;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.pill-tag { display: inline-flex; flex: none; align-items: center; height: 22px; white-space: nowrap; padding: 0 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 650; }
.hero h1 { margin-top: 22px; font-size: clamp(40px, 6.2vw, 70px); font-weight: 700; line-height: 1.02; letter-spacing: -0.045em; }
.h1-soft { color: var(--muted-fg); }
.hero-text { max-width: 540px; margin-top: 22px; color: var(--muted-fg); font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--muted-fg); font-size: 14px; }
.checks li { display: inline-flex; align-items: center; gap: 8px; }
.checks .icon { width: 15px; height: 15px; color: var(--ok); }

/* Dashboard demo: its own section, bent at rest, straightens when you use it */
.demo-section { overflow-x: clip; }
.demo-stage { container-type: inline-size; }
.demo-scale { font-size: 12px; font-size: calc(100cqw / 96); perspective: 230em; perspective-origin: 50% 0%; }
.demo-caption { margin-top: 22px; color: var(--muted-fg); font-size: 13px; text-align: center; }

/* Sources strip */
.sources { position: relative; z-index: 3; padding: 26px 0; border-block: 1px solid var(--border); background: var(--bg-raised); }
.sources .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.sources p { color: var(--muted-fg); font-size: 12.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.sources ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sources li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg-2); font-size: 13.5px; font-weight: 550; }
.sources li .icon { width: 15px; height: 15px; color: var(--muted-fg); }

/* Sections */
.section { padding: 104px 0; }
.section-alt { border-block: 1px solid var(--border); background: var(--bg-raised); }
.section-head { max-width: 660px; margin: 0 auto 56px; text-align: center; }
.kicker { display: inline-block; margin-bottom: 14px; color: var(--brand-text); font-size: 13px; font-weight: 650; letter-spacing: 0.02em; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 650; line-height: 1.08; letter-spacing: -0.04em; }
.section-sub { margin-top: 16px; color: var(--muted-fg); font-size: 17px; line-height: 1.6; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; flex-direction: column; padding: 8px; }
.step-visual {
  display: grid;
  place-items: center;
  height: 176px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 70%),
    var(--surface-2);
}
.step-text { padding: 18px 12px 12px; }
.step-num { display: block; margin-bottom: 8px; color: var(--faint-fg); font-family: var(--mono); font-size: 12px; }
.step h3 { font-size: 17px; }
.step p { margin-top: 8px; color: var(--muted-fg); font-size: 14.5px; }

/* Small product fragments used in the steps and feature cards */
.ui-card { width: 100%; max-width: 300px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); font-size: 12.5px; }
.ui-label { color: var(--muted-fg); font-size: 11.5px; font-weight: 600; }
.ui-field { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ui-url { flex: 1; min-width: 0; overflow: hidden; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--fg-2); font-family: var(--mono); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ui-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 11.5px; font-weight: 600; }
.ui-btn .icon { width: 13px; height: 13px; }
.ui-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; align-items: center; }
.ui-kv dt { color: var(--muted-fg); font-size: 11.5px; }
.ui-kv dd { margin: 0; overflow: hidden; color: var(--fg); font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.ui-sms { width: 100%; max-width: 280px; padding: 11px 13px; border-radius: 16px 16px 16px 5px; background: var(--surface); box-shadow: var(--shadow-md); border: 1px solid var(--border); font-size: 12.5px; line-height: 1.45; }
.ui-sms-from { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--muted-fg); font-size: 11px; font-weight: 650; }
.ui-sms-out { margin-left: auto; border-radius: 16px 16px 5px 16px; background: #30b553; border-color: #30b553; color: #fff; }
.ui-sms-out .ui-sms-from { color: rgb(255 255 255 / 0.75); }
.ui-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ui-lead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); font-size: 13px; }
.ui-lead strong { font-weight: 600; white-space: nowrap; }
.ui-lead span:not(.badge) { overflow: hidden; color: var(--muted-fg); text-overflow: ellipsis; white-space: nowrap; }
.ui-lead .badge { flex: none; min-width: 64px; justify-content: center; }
.ui-time { margin-left: auto; flex: none; color: var(--faint-fg) !important; font-size: 12px; }
.ui-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ui-stat { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); }
.ui-stat strong { display: block; margin-top: 4px; font-size: 24px; font-weight: 650; letter-spacing: -0.03em; }
.ui-stat em { color: var(--ok); font-size: 12px; font-style: normal; font-weight: 600; }
.ui-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ui-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-xs); font-size: 12.5px; font-weight: 550; }
.ui-chip .icon { width: 14px; height: 14px; color: var(--muted-fg); }
.ui-draft { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); font-size: 13px; line-height: 1.55; }
.ui-draft mark { padding: 0 3px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-text); }
.ui-draft-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted-fg); font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }

/* Feature grid */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bento-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.bento-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bento-wide { grid-column: span 2; }
.bento-visual {
  display: grid;
  place-items: center;
  min-height: 196px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--brand) 5%, transparent), transparent 70%),
    var(--surface-2);
}
.bento-text { padding: 20px 22px 22px; }
.bento-text h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.bento-text p { margin-top: 6px; color: var(--muted-fg); font-size: 14.5px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 800px; margin: 28px auto 0; }
.plan { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px; }
.plan-featured {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent), 0 24px 60px -24px color-mix(in srgb, var(--brand) 45%, transparent);
}
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-head h3 { font-size: 16px; }
.plan-desc { color: var(--muted-fg); font-size: 14px; }
.price { display: flex; align-items: baseline; gap: 6px; color: var(--muted-fg); font-size: 14px; }
.price strong { color: var(--fg); font-size: 44px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.checklist { display: flex; flex: 1; flex-direction: column; gap: 10px; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--border); list-style: none; font-size: 14.5px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; }
.checklist .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
.fine-print { margin-top: 22px; color: var(--muted-fg); font-size: 14px; text-align: center; }

/* FAQ */
.faq-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.faq-intro h2 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.04em; }
.faq-intro p { margin-top: 14px; color: var(--muted-fg); font-size: 16px; }
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--muted-fg);
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 40px 22px 0; color: var(--muted-fg); font-size: 15px; }

/* Closing call to action */
.cta {
  position: relative;
  overflow: hidden;
  padding: 72px 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(600px 300px at 50% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.cta h2 { font-size: clamp(30px, 4.2vw, 44px); letter-spacing: -0.04em; }
.cta p { max-width: 520px; margin: 14px auto 0; color: var(--muted-fg); font-size: 17px; }
.cta .hero-actions { justify-content: center; }

.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--border); color: var(--muted-fg); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, minmax(0, 0.6fr)); gap: 32px; }
.footer-grid p { max-width: 320px; margin-top: 12px; }
.footer-grid h4 { margin-bottom: 12px; font-size: 13px; font-weight: 650; letter-spacing: 0; }
.footer-grid ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--fg); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; }

/* ---------- Dashboard preview (em-based so it scales with its container) ---------- */

.mock {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 1.3em;
  background: var(--surface);
  box-shadow: 0 0.2em 0.6em rgb(0 0 0 / 0.06), 0 3em 7em -2em rgb(0 0 0 / 0.3);
  color: var(--fg);
  font-size: 1em;
  line-height: 1.45;
  transform-origin: 50% 30%;
}
/* The HardCrow-style bend, on devices with a mouse. It straightens out as soon as
   you hover or tab into it, so the preview is easy to use. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .mock {
    transform: rotateX(10deg) rotateY(-9deg) rotateZ(1.5deg);
    transition: transform 0.8s var(--ease), box-shadow 0.8s var(--ease);
  }
  .demo-stage:hover .mock,
  .mock:focus-within {
    transform: none;
    box-shadow: 0 0.2em 0.6em rgb(0 0 0 / 0.06), 0 2em 5em -2em rgb(0 0 0 / 0.25);
  }
}
.mock button { font: inherit; color: inherit; }
.mock :focus-visible { outline: 0.18em solid var(--brand); outline-offset: 0.15em; }
.mock-chrome { position: relative; display: flex; align-items: center; height: 3.3em; padding: 0 1.3em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-lights { display: flex; gap: 0.55em; }
.mock-lights i { width: 0.85em; height: 0.85em; border-radius: 50%; background: var(--border-strong); }
.mock-url {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.35em 1.1em;
  border: 1px solid var(--border);
  border-radius: 0.7em;
  background: var(--surface);
  color: var(--muted-fg);
  font-family: var(--mono);
  font-size: 0.95em;
  white-space: nowrap;
  transform: translateX(-50%);
}
.mock-url svg { width: 1em; height: 1em; }
.mock-body { display: grid; grid-template-columns: 16em minmax(0, 1fr); }
.mock-side { display: flex; flex-direction: column; gap: 1.8em; padding: 1.5em 1.1em; border-right: 1px solid var(--border); background: var(--bg-raised); }
.mock-brand { display: flex; align-items: center; gap: 0.7em; padding: 0 0.4em; font-size: 1.12em; font-weight: 700; letter-spacing: -0.02em; }
.mock-brand img { width: 1.9em; height: 1.9em; border-radius: 0.5em; }
.mock-nav { display: flex; flex-direction: column; gap: 0.2em; margin: 0; padding: 0; list-style: none; }
.mock-nav li { display: flex; align-items: center; gap: 0.75em; height: 2.7em; padding: 0 0.8em; border-radius: 0.6em; color: var(--fg-2); font-size: 1.02em; font-weight: 500; }
.mock-nav svg { width: 1.15em; height: 1.15em; color: var(--muted-fg); }
.mock-nav .active { background: var(--surface-2); color: var(--fg); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.mock-nav b { margin-left: auto; min-width: 1.6em; padding: 0.1em 0.5em; border-radius: 99em; background: var(--brand); color: var(--brand-fg); font-size: 0.78em; text-align: center; }
.mock-account { display: flex; align-items: center; gap: 0.75em; margin-top: auto; padding: 0.8em; border: 1px solid var(--border); border-radius: 0.8em; background: var(--surface); }
.mock-avatar { display: grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 0.6em; background: var(--brand-soft); color: var(--brand-text); font-size: 0.85em; font-weight: 700; }
.mock-account strong { display: block; font-size: 0.95em; }
.mock-account small { color: var(--muted-fg); font-size: 0.82em; }
.mock-main { display: flex; flex-direction: column; gap: 1.5em; min-width: 0; padding: 2em 2.2em 2.2em; }
.mock-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; }
.mock-h { font-size: 1.9em; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.mock-sub { margin-top: 0.3em; color: var(--muted-fg); font-size: 1em; }
.mock-head-actions { display: flex; align-items: center; gap: 1.1em; }
.mock-live { display: inline-flex; align-items: center; gap: 0.5em; color: var(--muted-fg); font-size: 0.92em; font-weight: 600; }
.mock-live::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0.25em color-mix(in srgb, var(--ok) 20%, transparent); }
.mock-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.45em;
  height: 2.5em;
  padding: 0 0.95em;
  border: 1px solid var(--border);
  border-radius: 0.6em;
  background: var(--surface);
  font-size: 0.9em;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.mock-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.mock-btn:active { transform: translateY(1px); }
.mock-btn svg { width: 1.1em; height: 1.1em; }
.mock-btn-brand { border-color: var(--brand); background: var(--brand); color: var(--brand-fg) !important; }
.mock-btn-brand:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.mock-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1em; }
.mock-stat { padding: 1.1em 1.25em; border: 1px solid var(--border); border-radius: 1em; background: var(--surface); box-shadow: var(--shadow-xs); }
.mock-stat > span { color: var(--muted-fg); font-size: 0.9em; font-weight: 500; }
.mock-stat strong { display: block; margin-top: 0.3em; font-size: 2.15em; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.mock-stat strong small { color: var(--muted-fg); font-size: 0.5em; font-weight: 500; letter-spacing: 0; }
.mock-stat em { display: block; margin-top: 0.2em; color: var(--muted-fg); font-size: 0.85em; font-style: normal; }
.mock-stat em.pos { color: var(--ok); font-weight: 600; }
.mock-meter { display: block; height: 0.45em; margin-top: 0.75em; overflow: hidden; border-radius: 99em; background: var(--surface-3); }
.mock-meter b { display: block; width: 37%; height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.5s var(--ease); }
.mock-cols { display: grid; grid-template-columns: minmax(0, 1fr) 24em; gap: 1.2em; align-items: start; }
.mock-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 1em; background: var(--surface); box-shadow: var(--shadow-xs); }
.mock-toolbar { display: flex; align-items: center; gap: 0.9em; padding: 1em 1.2em; border-bottom: 1px solid var(--border); }
.mock-search {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.6em;
  min-width: 0;
  height: 2.6em;
  padding: 0 0.9em;
  border: 1px solid var(--border);
  border-radius: 0.65em;
  color: var(--faint-fg);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mock-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 0.25em var(--ring); }
.mock-search svg { flex: none; width: 1.1em; height: 1.1em; }
.mock-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 0.92em; }
.mock-search input::placeholder { color: var(--faint-fg); }
.mock-search input:focus-visible { outline: 0; }
.mock-tabs { display: flex; flex: none; gap: 0.2em; padding: 0.25em; border-radius: 0.65em; background: var(--surface-2); }
.mock-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.75em;
  border: 0;
  border-radius: 0.45em;
  background: transparent;
  color: var(--muted-fg);
  font-size: 0.86em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.mock-tabs button:hover { color: var(--fg); }
.mock-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.mock-tabs i { min-width: 1.6em; padding: 0 0.35em; border-radius: 99em; background: var(--surface-3); font-size: 0.86em; font-style: normal; line-height: 1.6; text-align: center; }
.mock-list { max-height: 31.5em; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; scrollbar-width: thin; }
.mock-row { padding: 1.1em 1.3em; border-bottom: 1px solid var(--border); transition: background-color 0.3s; }
.mock-row:last-child { border-bottom: 0; }
.mock-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.mock-row.is-recent { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.mock-row.is-closed { opacity: 0.7; }
.mock-row.is-flash { box-shadow: inset 0.25em 0 0 var(--brand); }
.mock-row-top { display: flex; align-items: center; gap: 0.7em; }
.mock-row-top strong { font-size: 1.05em; font-weight: 650; }
.mock-meta { margin-left: auto; color: var(--muted-fg); font-size: 0.85em; white-space: nowrap; }
.mock-row p { margin-top: 0.35em; color: var(--fg-2); font-size: 0.98em; }
.mock-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em; margin-top: 0.75em; }
.mock-chip { display: inline-flex; align-items: center; gap: 0.45em; height: 2.1em; padding: 0 0.8em; border: 1px solid var(--border); border-radius: 99em; font-size: 0.85em; font-weight: 550; white-space: nowrap; }
.mock-chip svg { width: 1.05em; height: 1.05em; color: var(--muted-fg); }
.mock-seg { display: inline-flex; margin-left: auto; overflow: hidden; border: 1px solid var(--border); border-radius: 0.55em; background: var(--surface); font-size: 0.8em; }
.mock-seg button {
  padding: 0.4em 0.8em;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted-fg);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.mock-seg button:last-child { border-right: 0; }
.mock-seg button:hover { background: var(--surface-2); color: var(--fg); }
.mock-seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
.mock-note { display: flex; align-items: center; gap: 0.4em; margin-top: 0.7em; color: var(--ok); font-size: 0.82em; font-weight: 600; }
.mock-note svg { width: 1.1em; height: 1.1em; }
.mock-empty { padding: 3em 1em; color: var(--muted-fg); text-align: center; }
.mb { display: inline-flex; flex: none; align-items: center; gap: 0.35em; height: 1.7em; padding: 0 0.6em; border-radius: 99em; font-size: 0.78em; font-weight: 650; }
.mb::before { content: ""; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; }
.mb-high { background: var(--danger-soft); color: var(--danger); }
.mb-med { background: var(--warn-soft); color: var(--warn); }
.mb-low { background: var(--ok-soft); color: var(--ok); }
.mock-aside { display: flex; flex-direction: column; gap: 1.2em; min-width: 0; }
.mock-panel-head { display: flex; align-items: baseline; justify-content: space-between; padding: 1.1em 1.2em 0; font-size: 1em; font-weight: 650; }
.mock-panel-head span { color: var(--muted-fg); font-size: 0.85em; font-weight: 500; }
.mock-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 0.4em; height: 14em; padding: 1em 1.2em 0.9em; }
.mock-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.45em; height: 100%; border-radius: 0.4em; color: var(--muted-fg); font-size: 0.78em; cursor: default; }
.mock-col i { position: relative; display: block; width: 1.8em; border-radius: 0.3em 0.3em 0 0; background: var(--chart-context); transition: height 0.5s var(--ease), filter 0.15s; }
.mock-col:nth-child(1) i { height: 4.9em; }
.mock-col:nth-child(2) i { height: 6.5em; }
.mock-col:nth-child(3) i { height: 3.3em; }
.mock-col:nth-child(4) i { height: 1.6em; }
.mock-col:nth-child(5) i { height: 3.3em; }
.mock-col:nth-child(6) i { height: 6.5em; }
.mock-col:nth-child(7) i { height: 11.4em; }
.mock-col.today { color: var(--fg); font-weight: 650; }
.mock-col.today i { background: var(--chart-accent); }
.mock-col b { color: var(--fg); }
.mock-col:hover i,
.mock-col:focus-visible i { filter: brightness(1.15); }
.mock-tip {
  position: absolute;
  bottom: calc(100% + 0.6em);
  left: 50%;
  z-index: 2;
  padding: 0.45em 0.7em;
  border-radius: 0.5em;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 1.05em;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.15s;
}
.mock-tip strong { display: block; font-weight: 650; }
.mock-col:hover .mock-tip,
.mock-col:focus-visible .mock-tip { opacity: 1; }
.mock-col:nth-child(-n + 2) .mock-tip { left: 0; transform: none; }
.mock-col:nth-child(n + 6) .mock-tip { left: auto; right: 0; transform: none; }
.mock-links { display: flex; flex-direction: column; gap: 0.7em; padding: 1em 1.2em 1.2em; }
.mock-link { display: flex; flex-direction: column; gap: 0.5em; padding: 0.85em; border: 1px solid var(--border); border-radius: 0.8em; }
.mock-link strong { font-size: 0.92em; font-weight: 600; }
.mock-link-row { display: flex; align-items: center; gap: 0.5em; }
.mock-url-text { flex: 1; min-width: 0; overflow: hidden; padding: 0.45em 0.6em; border-radius: 0.5em; background: var(--surface-2); color: var(--muted-fg); font-family: var(--mono); font-size: 0.78em; text-overflow: ellipsis; white-space: nowrap; }
.mock-link .mock-btn { height: 2.2em; padding: 0 0.7em; font-size: 0.82em; }

/* Narrower containers: drop the side column, then go single-column like the real app on a phone. */
@container (max-width: 1000px) {
  .demo-scale { font-size: calc(100cqw / 76); }
  .mock-cols { grid-template-columns: minmax(0, 1fr); }
  .mock-aside { display: none; }
}
@container (max-width: 640px) {
  .demo-scale { font-size: calc(100cqw / 30); }
  .mock-side,
  .mock-lights { display: none; }
  .mock-body { grid-template-columns: minmax(0, 1fr); }
  .mock-url { font-size: 0.85em; }
  .mock-main { gap: 1.2em; padding: 1.3em 1.1em 1.4em; }
  .mock-head { flex-wrap: wrap; align-items: center; }
  .mock-head-actions { width: 100%; justify-content: space-between; }
  .mock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7em; }
  .mock-stat { padding: 0.9em 1em; }
  .mock-stat strong { font-size: 1.7em; }
  .mock-toolbar { flex-wrap: wrap; }
  .mock-search { flex-basis: 100%; }
  .mock-tabs { width: 100%; justify-content: space-between; }
  .mock-row-top { flex-wrap: wrap; row-gap: 0.3em; }
  .mock-meta { width: 100%; margin-left: 0; }
  .mock-seg { margin-left: 0; }
  .mock-list { max-height: 34em; }
}

/* ---------- iPhone (em-based: 1em = 1/30 of the phone's width) ---------- */

.iphone {
  position: relative;
  aspect-ratio: 71.6 / 147.6;
  font-size: calc(100cqw / 30);
  border-radius: 5.5em;
  background: linear-gradient(140deg, #75757b 0%, #2c2c2f 16%, #1b1b1d 48%, #313134 80%, #8d8d93 100%);
  box-shadow:
    inset 0 0 0 0.14em rgb(255 255 255 / 0.22),
    inset 0 0 0 0.36em #1d1d1f,
    0 3em 6em -1.5em rgb(0 0 0 / 0.55),
    0 1.2em 2.4em -1em rgb(0 0 0 / 0.35);
  color: #fff;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
.iphone::before { content: ""; position: absolute; inset: 0.36em; border-radius: 5.15em; background: #030303; }
.iphone-btn { position: absolute; width: 0.34em; border-radius: 0.2em; background: linear-gradient(90deg, #2c2c2f, #7a7a80 55%, #2c2c2f); }
.iphone-btn.action { left: -0.28em; top: 17%; height: 3.3em; }
.iphone-btn.vol-up { left: -0.28em; top: 25.5%; height: 6.2em; }
.iphone-btn.vol-down { left: -0.28em; top: 35%; height: 6.2em; }
.iphone-btn.power { right: -0.28em; top: 28%; height: 9.8em; }
.iphone-screen {
  position: absolute;
  inset: 0.95em;
  z-index: 1;
  overflow: hidden;
  border-radius: 4.6em;
  background:
    radial-gradient(130% 70% at 90% 0%, rgb(234 88 12 / 0.55) 0%, transparent 58%),
    radial-gradient(100% 60% at 0% 38%, rgb(154 52 18 / 0.45) 0%, transparent 62%),
    radial-gradient(120% 70% at 50% 100%, rgb(49 46 129 / 0.45) 0%, transparent 70%),
    linear-gradient(180deg, #1f1712 0%, #0c0a09 100%);
}
.island { position: absolute; top: 1.15em; left: 50%; z-index: 3; width: 8.6em; height: 2.6em; margin-left: -4.3em; border-radius: 99em; background: #000; }
.island::after { content: ""; position: absolute; top: 50%; right: 1em; width: 1em; height: 1em; margin-top: -0.5em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2a3550, #0a0d16 60%); }
/* Time centred in the left "ear" beside the Dynamic Island, icons centred in the right one. */
.status { position: absolute; top: 1.15em; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 2.6em; }
.status-time { width: 6.9em; font-size: 1.42em; font-weight: 600; letter-spacing: -0.01em; text-align: center; }
.status-icons { display: flex; align-items: center; justify-content: center; gap: 0.38em; width: 9.75em; }
.status-icons svg { height: 1.12em; width: auto; }
.lock-date { position: absolute; top: 15%; width: 100%; color: rgb(255 255 255 / 0.88); font-size: 1.6em; font-weight: 600; text-align: center; }
.lock-time { position: absolute; top: 18.5%; width: 100%; color: rgb(255 255 255 / 0.94); font-size: 8.4em; font-weight: 700; letter-spacing: -0.035em; line-height: 1; text-align: center; }
.notifs { position: absolute; left: 1.1em; right: 1.1em; bottom: 10.5em; }
.notif {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1em;
  width: 100%;
  padding: 1.15em 1.15em 1.2em;
  border: 0;
  border-radius: 2em;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  background: rgb(246 246 248 / 0.84);
  -webkit-backdrop-filter: blur(1.4em) saturate(170%);
  backdrop-filter: blur(1.4em) saturate(170%);
  box-shadow: 0 0.4em 1.4em rgb(0 0 0 / 0.22);
  color: #111;
}
.notif:hover { transform: scale(1.025); box-shadow: 0 0.6em 1.8em rgb(0 0 0 / 0.3); }
.notif:focus-visible { outline: 0.2em solid #fff; outline-offset: 0.25em; }
.notif-stack { height: 1.2em; margin: -0.6em 1.4em 0; border-radius: 0 0 1.6em 1.6em; background: rgb(246 246 248 / 0.45); }
.notif-icon { display: grid; transition: none; flex: none; place-items: center; width: 3.9em; height: 3.9em; border-radius: 0.95em; background: linear-gradient(180deg, #67f57e 0%, #0dbd2f 100%); }
.notif-icon svg { width: 2.5em; height: 2.5em; }
.notif-text { display: block; flex: 1; min-width: 0; }
.notif-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6em; font-size: 1.4em; font-weight: 650; }
.notif-head span { color: rgb(60 60 67 / 0.62); font-size: 0.88em; font-weight: 450; }
.notif-body {
  display: -webkit-box;
  margin-top: 0.15em;
  overflow: hidden;
  color: #1b1b1d;
  font-size: 1.36em;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.lock-actions { position: absolute; left: 3.6em; right: 3.6em; bottom: 3.4em; display: flex; justify-content: space-between; }
.lock-actions span { display: grid; place-items: center; width: 4.7em; height: 4.7em; border-radius: 50%; background: rgb(255 255 255 / 0.16); -webkit-backdrop-filter: blur(1em); backdrop-filter: blur(1em); }
.lock-actions svg { width: 2em; height: 2em; }
.home-bar { position: absolute; bottom: 0.9em; left: 50%; width: 12em; height: 0.48em; margin-left: -6em; border-radius: 99em; background: rgb(255 255 255 / 0.88); }

/* ---------- App (dashboard and settings) ---------- */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-raised);
}
.sidebar .brand { padding: 4px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.side-nav a:hover { background: var(--surface-2); color: var(--fg); }
.side-nav a[aria-current="page"] { background: var(--surface-2); color: var(--fg); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.side-nav .icon { color: var(--muted-fg); }
.side-nav a[aria-current="page"] .icon { color: var(--fg); }
.side-account { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.avatar { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 700; }
.side-account-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.side-account-text strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.side-account-text span { color: var(--muted-fg); font-size: 12px; }

.app-main { min-width: 0; width: 100%; max-width: 1360px; padding: 28px 32px 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; letter-spacing: -0.03em; }
.page-head p { margin-top: 4px; color: var(--muted-fg); font-size: 14px; }
#banners { display: flex; flex-direction: column; gap: 10px; }
#banners:not(:empty) { margin-bottom: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 16px 18px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-fg); font-size: 13px; font-weight: 500; }
.stat-label .icon { width: 15px; height: 15px; color: var(--faint-fg); }
.stat-value { margin-top: 8px; font-size: 28px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; }
.stat-note { margin-top: 4px; color: var(--muted-fg); font-size: 12.5px; }
.meter { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.meter-bar { width: 0; height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.5s var(--ease); }
.meter-bar.meter-warn { background: var(--warn); }
.meter-bar.meter-full { background: var(--danger); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 16px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.feed-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 220px; }
.search .icon { position: absolute; top: 12px; left: 11px; color: var(--faint-fg); }
.search .input { padding-left: 34px; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-2); }
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); font-size: 11px; line-height: 18px; text-align: center; }

.lead-list { margin: 0; padding: 0; list-style: none; }
.lead { padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background-color 0.15s; }
.lead:last-child { border-bottom: 0; }
.lead:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.lead-closed { opacity: 0.7; }
.lead-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.lead-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.lead-title strong { font-weight: 650; letter-spacing: -0.01em; }
.lead-title .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lead-meta { color: var(--muted-fg); font-size: 13px; }
.lead-summary { margin-top: 6px; color: var(--fg-2); }
.lead-summary.pending { color: var(--muted-fg); font-style: italic; }
.lead-contact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
a.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip .icon { width: 14px; height: 14px; color: var(--muted-fg); }
.chip-plain { border-style: dashed; color: var(--muted-fg); }
.lead-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; color: var(--muted-fg); font-size: 12.5px; }
.lead-notes span { display: inline-flex; align-items: center; gap: 5px; }
.lead-notes .icon { width: 14px; height: 14px; }
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }

.segmented { display: inline-flex; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.segmented button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--surface-2); color: var(--fg); }
.segmented button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }

.lead-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.lead-panel .code { background: var(--surface); }
.panel-title { color: var(--muted-fg); font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.feed-footer { padding: 14px 20px; text-align: center; }

/* Leads this week */
.week-chart { position: relative; height: 168px; margin-top: 10px; }
.week-grid { position: absolute; inset: 0 0 24px; }
.week-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.week-tick { position: absolute; right: 0; padding-left: 6px; background: var(--surface); color: var(--muted-fg); font-size: 11px; line-height: 1; transform: translateY(-50%); }
.week-bars { position: absolute; inset: 0 26px 0 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-col { display: flex; flex-direction: column; align-items: center; height: 100%; border-radius: 6px; outline-offset: -2px; cursor: default; }
.week-plot { position: relative; display: flex; flex: 1; align-items: flex-end; justify-content: center; width: 100%; }
.week-bar { width: min(22px, 58%); border-radius: 4px 4px 0 0; background: var(--chart-context); transition: filter 0.15s; }
.week-col.is-today .week-bar { background: var(--chart-accent); }
.week-col:hover .week-bar,
.week-col:focus-visible .week-bar { filter: brightness(1.15) saturate(1.05); }
.week-cap { position: absolute; left: 0; right: 0; color: var(--fg); font-size: 11.5px; font-weight: 650; text-align: center; transform: translateY(-100%); padding-bottom: 3px; }
.week-day { height: 24px; padding-top: 6px; color: var(--muted-fg); font-size: 11.5px; line-height: 1; }
.week-col.is-today .week-day { color: var(--fg); font-weight: 650; }
.week-tip {
  position: absolute;
  z-index: 5;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
}
.week-tip strong { display: block; font-size: 13px; }

.integrations .card-body { display: flex; flex-direction: column; gap: 14px; }
.integration-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.integration { display: flex; flex-direction: column; gap: 9px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color 0.15s; }
.integration:hover { border-color: var(--border-strong); }
.integration > .row { flex-wrap: wrap; gap: 2px; margin-left: -6px; }
.integration > .row > .btn:last-child { margin-left: auto; }
.copy-row { display: flex; gap: 6px; }
.copy-row .input { height: 34px; }
.snippet { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.snippet .code { width: 100%; }
.new-link { display: flex; gap: 8px; }
.new-link select { flex: 1; min-width: 0; }
.sms-preview { padding: 12px 14px; border-radius: 16px 16px 16px 5px; background: var(--surface-2); font-size: 14px; }

/* ---------- Sign-in pages ---------- */

.auth-body { min-height: 100vh; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; }
.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 10%, transparent 70%);
}
.auth-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(520px 300px at 50% 15%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%); }
.auth { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100vh; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.auth-card .card-body { display: flex; flex-direction: column; gap: 18px; padding: 30px; }
.auth-card h1 { font-size: 22px; letter-spacing: -0.03em; }
.auth-foot { color: var(--muted-fg); font-size: 14px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row a { color: var(--fg-2); font-weight: 550; }

/* Password box with its Show / Hide button inside. */
.password-field { position: relative; }
.password-field .input { padding-right: 70px; }
.password-field .btn { position: absolute; top: 50%; right: 4px; height: 30px; transform: translateY(-50%); }
.password-field .btn:active { transform: translateY(-50%); }

/* One-time codes: big and evenly spaced, easy to check against the email or app. */
.code-input { height: 52px; font-family: var(--mono); font-size: 22px; letter-spacing: 0.25em; text-align: center; }
.code-input::placeholder { letter-spacing: normal; }

.plan-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.plan-picker legend { margin-bottom: 7px; padding: 0; font-size: 13.5px; font-weight: 600; }
.plan-option { position: relative; display: flex; cursor: pointer; }
.plan-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.plan-option-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.plan-option-text strong { color: var(--fg); font-size: 14px; }
.plan-option:hover .plan-option-text { border-color: var(--border-strong); }
.plan-option input:checked + .plan-option-text { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.plan-option input:focus-visible + .plan-option-text { outline: 2px solid var(--brand); outline-offset: 2px; }
.turnstile { min-height: 65px; }

/* ---------- Motion (all optional: reduced-motion users get a still page) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.8s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.24s; }
  .hero-visual { animation: rise 1.1s 0.2s var(--ease) both; }
  .notifs { animation: notif-in 0.7s 1.3s var(--spring) both; }
  .notif.is-arriving { animation: notif-in 0.65s var(--spring) both; }
  .mock-row.is-new { animation: new-row 2.8s ease-out both; }
  .mock-row.is-flash { animation: flash-row 1.9s ease-out; }
  .iphone { transition: transform 0.6s var(--ease); }
  .hero-visual:hover .iphone { transform: translateY(-6px); }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes notif-in { from { opacity: 0; transform: translateY(-1.4em) scale(0.94); } }
@keyframes new-row {
  0% { background: transparent; }
  12% { background: color-mix(in srgb, var(--brand) 14%, transparent); }
  100% { background: color-mix(in srgb, var(--brand) 5%, transparent); }
}
@keyframes flash-row {
  0%, 35% { background: color-mix(in srgb, var(--brand) 16%, transparent); }
  100% { background: transparent; }
}

/* Sections fade up as they scroll into view, where the browser supports scroll-driven animation. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(26px); } }

@media (prefers-reduced-motion: reduce) {
  .live::before { animation: none; }
  .mock-row.is-new { background: color-mix(in srgb, var(--brand) 5%, transparent); }
  .mock-row.is-flash { background: color-mix(in srgb, var(--brand) 12%, transparent); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}


@media (max-width: 920px) {
  .site-nav { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 52px; }
  .phone-wrap { width: 268px; }
  .steps { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento-wide { grid-column: auto; }
  .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }

  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .sidebar .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidebar .brand { padding: 0; }
  .side-nav { flex: 1; flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .side-nav a { flex: none; height: 34px; }
  .side-account { margin: 0; padding: 0; border: 0; background: none; }
  .side-account .avatar,
  .side-account-text { display: none; }
  .app-main { padding: 22px 16px 56px; }
  .side-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding-inline: 16px; }
  .site-actions .btn-ghost { display: none; }
  .hero { padding: 44px 0 64px; }
  .hero-text { font-size: 17px; }
  .phone-wrap { width: 248px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 40px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .cta { padding: 52px 20px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 23px; }
  .lead,
  .feed-tools { padding-inline: 16px; }
  .panel-head { padding: 16px 16px 0; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; justify-content: center; padding: 0 6px; }
  .side-nav a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page-head h1 { font-size: 22px; }
}

/* ---------- Lead alerts (settings) and lead highlights ---------- */

.alert-option { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.alert-option > div:first-child { flex: 1 1 260px; }
.alert-option-title { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-weight: 600; }
.lead-spam { opacity: 0.6; }
.lead.lead-flash { background: color-mix(in srgb, var(--brand) 12%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .lead.lead-flash { animation: flash-row 2.2s ease-out both; }
}

/* ---------- Lead quick actions, modal, settings extras ---------- */

.lead-contact .btn { height: 32px; }
.btn-call .icon, .btn-whatsapp .icon { width: 15px; height: 15px; }
.btn-whatsapp .icon { color: #16a34a; }
.lead-actions .segmented button:disabled,
.lead-actions .btn:disabled { cursor: not-allowed; }
.read-only .lead-actions .segmented { opacity: 0.55; }

.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgb(9 9 11 / 0.55); }
.modal-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.modal-title { font-size: 18px; letter-spacing: -0.02em; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: toast-in 0.2s var(--ease); }
}

.subsection { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--border); }
.subsection-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; }
.steps-list { margin: 0; padding-left: 20px; color: var(--muted-fg); font-size: 13.5px; line-height: 1.6; }
.steps-list code { font-family: var(--mono); font-size: 12.5px; }

/* Settings → Sign-in and security */
.security-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 18px; border-top: 1px solid var(--border); }
.security-row-text { flex: 1 1 280px; }
.security-row-text .subsection-title { margin-bottom: 2px; }
.security-block { padding-top: 18px; border-top: 1px solid var(--border); }
.security-panel { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.setup-steps { display: flex; flex-direction: column; gap: 16px; margin: 0; padding-left: 20px; }
.setup-steps > li { display: flex; flex-direction: column; gap: 10px; }
.setup-steps > li::marker { font-weight: 650; }
.qr-wrap { width: 200px; max-width: 100%; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: #ffffff; }
.qr { display: block; width: 100%; height: auto; }
.secret-key { padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; padding: 12px 16px 12px 36px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--mono); font-size: 14px; }
@media (max-width: 420px) { .recovery-codes { grid-template-columns: minmax(0, 1fr); } }
.device-list, .activity-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.device, .activity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.device:last-child, .activity:last-child { border-bottom: 0; }
.device.is-skeleton, .activity.is-skeleton { flex-direction: column; align-items: flex-start; gap: 8px; }
.activity { flex-direction: column; align-items: flex-start; gap: 2px; }
.device-text { flex: 1 1 240px; min-width: 0; }
.device-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.activity-title { font-weight: 550; }
.activity.is-warning .activity-title { color: var(--warn); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Phones and touch screens ---------- */

/* Thumb-sized targets (44x44 or larger) wherever the pointer is a finger. */
@media (max-width: 920px), (pointer: coarse) {
  .btn, .btn-sm, .lead-contact .btn { height: 44px; }
  .btn-sm { padding: 0 14px; font-size: 14px; }
  .btn-icon, .btn-sm.btn-icon { width: 44px; min-width: 44px; }
  .chip { height: 44px; padding: 0 14px; }
  .segmented button { height: 44px; padding: 0 14px; font-size: 13.5px; }
  .tabs button { height: 44px; }
  .input, .copy-row .input { height: 44px; }
  textarea.input { height: auto; }
  .switch { min-height: 44px; }
  .week-col { min-height: 44px; }
}

/* 16px stops iPhones zooming the whole page in when a field is tapped. */
@media (max-width: 920px) {
  .input { font-size: 16px; }
  .input-mono { font-size: 13.5px; }
}

/* Sticky top bar plus a bottom tab bar, instead of the sidebar. */
@media (max-width: 920px) {
  .sidebar {
    top: 0;
    min-height: 56px;
    padding: 6px 8px 6px 16px;
    padding-top: max(6px, env(safe-area-inset-top));
    background: var(--bg-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none; /* a backdrop filter would trap the fixed tab bar inside the header */
  }
  .sidebar .brand { min-height: 44px; }
  .sidebar .brand span {
    position: static; width: auto; height: auto; overflow: visible; clip: auto;
    font-size: 15px; font-weight: 650;
  }
  .side-account { margin-left: auto; }
  .side-account .btn-icon { width: 44px; height: 44px; }

  .side-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 4px 6px max(4px, env(safe-area-inset-bottom));
    overflow: visible;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .side-nav a,
  .side-nav a[aria-current="page"] {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 56px;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    background: none;
    box-shadow: none;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
  }
  .side-nav a span {
    position: static; width: auto; height: auto; overflow: hidden; clip: auto;
    max-width: 100%; text-overflow: ellipsis; white-space: nowrap;
  }
  .side-nav a .icon { width: 22px; height: 22px; }
  .side-nav a[aria-current="page"] { color: var(--brand-text); }
  .side-nav a[aria-current="page"] .icon { color: var(--brand); }

  .app-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .lead-contact .btn-call,
  .lead-contact .btn-whatsapp { flex: 1 1 140px; }
  .lead-actions .segmented { display: flex; width: 100%; }
  .lead-actions .segmented button { flex: 1; }
}

/* ---------- Help assistant (floating, draggable) ---------- */

.assistant-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-fg);
  box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--brand) 55%, transparent), var(--shadow-lg);
  cursor: grab;
  touch-action: none; /* the finger drags the button instead of scrolling the page */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), background-color 0.15s;
}
.assistant-launcher:hover { background: var(--brand-hover); }
.assistant-launcher:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.assistant-launcher-icon { display: grid; place-items: center; }
.assistant-launcher-icon .icon { width: 24px; height: 24px; }
.assistant-launcher-grip { position: absolute; top: 3px; left: 50%; display: grid; place-items: center; transform: translateX(-50%) rotate(90deg); opacity: 0.6; }
.assistant-launcher-grip .icon { width: 12px; height: 12px; }
.assistant-dragging,
.assistant-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.assistant-dragging .assistant-launcher { transform: scale(1.06); transition: none; }
@media (prefers-reduced-motion: no-preference) {
  .assistant-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: assistant-pulse 2.4s ease-out 1s 3;
    pointer-events: none;
  }
}
@keyframes assistant-pulse {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); }
  to { box-shadow: 0 0 0 16px color-mix(in srgb, var(--brand) 0%, transparent); }
}

.assistant-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: 360px;
  height: min(560px, calc(100dvh - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.assistant-panel[hidden] { display: none; }
.assistant-panel:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  .assistant-panel:not([hidden]) { animation: toast-in 0.18s var(--ease); }
}
.assistant-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 8px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.assistant-head .btn { cursor: pointer; }
.assistant-handle { display: grid; place-items: center; color: var(--faint-fg); }
.assistant-handle .icon { width: 16px; height: 16px; }
.assistant-avatar { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-text); }
.assistant-avatar .icon { width: 18px; height: 18px; }
.assistant-title { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.3; }
.assistant-title strong { font-size: 14px; font-weight: 650; }
.assistant-title span { color: var(--muted-fg); font-size: 12px; }

.assistant-pills { display: flex; flex: none; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; overscroll-behavior-x: contain; }
.assistant-pills::-webkit-scrollbar { display: none; }
.assistant-pill {
  flex: none;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.assistant-pill:hover { border-color: var(--border-strong); background: var(--surface-2); }

.assistant-feed { display: flex; flex: 1; flex-direction: column; gap: 14px; margin: 0; padding: 14px 12px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 90%; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg-user .msg-bubble { border-bottom-right-radius: 4px; background: var(--primary); color: var(--primary-fg); }
.msg-assistant .msg-bubble { border-bottom-left-radius: 4px; background: var(--surface-2); color: var(--fg); }
.msg-bubble p + p,
.msg-bubble p + ul,
.msg-bubble p + ol,
.msg-bubble ul + p,
.msg-bubble ol + p { margin-top: 8px; }
.msg-bubble ul,
.msg-bubble ol { margin: 6px 0 0; padding-left: 20px; }
.msg-bubble li + li { margin-top: 4px; }
.msg-bubble li > ul { margin-top: 4px; }
.msg-bubble code { padding: 1px 5px; border-radius: 5px; background: var(--surface-3); font-family: var(--mono); font-size: 12.5px; }
.msg-bubble a { color: var(--brand-text); font-weight: 600; text-underline-offset: 2px; }
.msg-meta { display: flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--muted-fg); font-size: 11.5px; }
.msg-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-weight: 650; }
.msg-badge .icon { width: 12px; height: 12px; }
.msg-badge-ai { background: var(--surface-3); color: var(--fg-2); }
.msg-typing { display: flex; gap: 4px; padding: 13px 14px; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-fg); opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .msg-typing span { animation: typing 1.2s infinite ease-in-out; }
  .msg-typing span:nth-child(2) { animation-delay: 0.15s; }
  .msg-typing span:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.assistant-input { display: flex; flex: none; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.assistant-input .input { flex: 1; min-width: 0; }
.assistant-input .btn-icon { width: 40px; height: 40px; }
.assistant-note { flex: none; margin: -4px 12px 10px; color: var(--muted-fg); font-size: 12.5px; }
.assistant-note[hidden] { display: none; }
.assistant-backdrop { position: fixed; inset: 0; z-index: 65; background: rgb(9 9 11 / 0.5); }
.assistant-backdrop[hidden] { display: none; }

/* Toasts sit above the launcher on computers, and at the top on phones. */
.has-assistant .toasts { bottom: 92px; }
@media (max-width: 920px) {
  .toasts,
  .has-assistant .toasts { top: max(64px, calc(env(safe-area-inset-top) + 60px)); right: 16px; bottom: auto; left: 16px; max-width: none; align-items: center; }
}

@media (pointer: coarse) {
  .assistant-pill { height: 44px; padding: 0 14px; }
  .assistant-input .btn-icon { width: 44px; height: 44px; }
}

/* Phones: a full-width sheet from the bottom. */
@media (max-width: 640px) {
  .assistant-panel {
    top: auto !important;
    right: 0;
    bottom: 0;
    left: 0 !important;
    width: 100%;
    height: min(88dvh, 680px) !important;
    padding-bottom: env(safe-area-inset-bottom);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .assistant-head { cursor: default; touch-action: auto; padding-left: 12px; }
  .assistant-handle { display: none; }
  .assistant-input .input { font-size: 16px; }
  html.assistant-locked,
  html.assistant-locked body { overflow: hidden; }
}

/* ==========================================================================
   Signed-in workspace: overview, leads, settings and billing
   ========================================================================== */

.skip-link { position: absolute; top: -60px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-fg); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
#account-banner:not(:empty) { margin-bottom: 18px; }
.card[id], form[id] { scroll-margin-top: 88px; }

/* Leads tab badge: real leads nobody has replied to yet. */
.side-nav a { position: relative; }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-fg); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-count[hidden] { display: none; }

.offline-notice {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.offline-notice[hidden] { display: none; }
.offline-notice .icon { flex: none; width: 16px; height: 16px; }

/* ---------- Toasts: green tick for success, red for errors ---------- */

.toast::before { display: none; }
.toast-icon { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.toast-icon .icon { width: 13px; height: 13px; stroke-width: 3; }
.toast-success { border-color: color-mix(in srgb, var(--ok) 38%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 88%, var(--surface)); }
.toast-success .toast-icon { background: var(--ok); color: var(--bg); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 38%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 88%, var(--surface)); }
.toast-error .toast-icon { background: var(--danger); color: var(--bg); }
.toast-info .toast-icon { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Busy buttons ---------- */

.spinner { flex: none; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.8s; } }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"],
.btn[aria-busy="true"]:disabled { opacity: 0.85; cursor: progress; }

/* ---------- Loading placeholders ---------- */

.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 300% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.3s ease-in-out infinite; }
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-line { width: 100%; height: 12px; margin-top: 9px; }
.sk-mid { width: 62%; }
.sk-short { width: 38%; }
.sk-name { width: 46%; height: 16px; }
.sk-badge { width: 58px; height: 22px; border-radius: 999px; }
.sk-button { flex: 1; height: 44px; border-radius: var(--radius-sm); }
.sk-value { width: 64px; height: 30px; }
.sk-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
.sk-chart { width: 100%; height: 150px; margin-top: 18px; }
.sk-select { width: 112px; height: 36px; }
.sk-actions { width: 160px; height: 32px; margin-left: auto; }
.sk-input { width: 100%; height: 44px; margin-top: 10px; }
.sk-progress { width: 100%; height: 12px; border-radius: 999px; }
.feed-skeleton-item { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.feed-skeleton-item:last-child { border-bottom: 0; }

/* Settings forms shimmer until the saved values arrive. */
form.is-loading .input { color: transparent; background-image: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 300% 100%; pointer-events: none; }
form.is-loading .input::placeholder { color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  form.is-loading .input { animation: shimmer 1.3s ease-in-out infinite; }
}

/* ---------- Empty, error and first-run states ---------- */

.state-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; list-style: none; text-align: center; }
.state-compact { padding: 28px 20px; }
.state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 14px; background: var(--surface-2); color: var(--muted-fg); }
.state-icon .icon { width: 24px; height: 24px; }
.state-icon-brand { background: var(--brand-soft); color: var(--brand-text); }
.state-error .state-icon { background: var(--danger-soft); color: var(--danger); }
.state-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.state-text { max-width: 440px; color: var(--muted-fg); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

/* ---------- Overview ---------- */

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label icon" "value value" "note note" "meter meter";
  align-items: center;
  gap: 4px 12px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
a.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
a.kpi:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi-text { display: contents; }
.kpi-icon { display: grid; grid-area: icon; place-items: center; justify-self: end; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--muted-fg); }
.kpi-icon .icon { width: 17px; height: 17px; }
.kpi-label { grid-area: label; color: var(--muted-fg); font-size: 13.5px; font-weight: 550; }
.kpi-value { grid-area: value; margin-top: 4px; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1.1; }
.kpi-note { grid-area: note; color: var(--muted-fg); font-size: 12.5px; }
.kpi-meter { display: block; grid-area: meter; margin-top: 8px; }
.kpi-meter .meter-bar { display: block; }
.kpi-good { border-color: color-mix(in srgb, var(--ok) 42%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 75%, var(--surface)); }
.kpi-good .kpi-value { color: var(--ok); }
.kpi-good .kpi-icon { background: var(--ok); color: var(--bg); }
.kpi-warn { border-color: color-mix(in srgb, var(--warn) 42%, var(--border)); background: color-mix(in srgb, var(--warn-soft) 75%, var(--surface)); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-warn .kpi-icon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.kpi-danger .kpi-value { color: var(--danger); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 16px; align-items: start; }
.recent { overflow: hidden; }
.recent .panel-head { padding-bottom: 6px; }
.recent-list { margin: 0; padding: 6px 0; list-style: none; }
.recent-item { display: flex; align-items: center; gap: 6px; padding: 2px 14px 2px 8px; }
.recent-item + .recent-item { border-top: 1px solid var(--border); }
.recent-link { display: flex; flex: 1; align-items: flex-start; gap: 12px; min-width: 0; padding: 10px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
a.recent-link:hover { background: var(--surface-2); }
a.recent-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.urgency-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--faint-fg); }
.urgency-high { background: var(--danger); }
.urgency-med { background: var(--warn); }
.urgency-low { background: var(--ok); }
.recent-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.recent-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recent-name strong { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-summary { overflow: hidden; color: var(--fg-2); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { color: var(--muted-fg); font-size: 12.5px; }
.status-pill { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); font-size: 11.5px; font-weight: 650; }
.status-pill.status-new { background: var(--info-soft); color: var(--info); }
.status-pill.status-contacted { background: var(--warn-soft); color: var(--warn); }
.status-pill.status-closed { background: var(--ok-soft); color: var(--ok); }

.perf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 14px 0 0; }
.perf dt { color: var(--muted-fg); font-size: 13px; font-weight: 550; }
.perf dd { margin: 0; }
.perf .perf-value { margin: 4px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }

/* ---------- Leads: filters ---------- */

.feed { overflow: hidden; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.filter-chips[hidden] { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px 0 14px; border: 1px solid var(--brand-line); border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 13px; font-weight: 600; cursor: pointer; }
.filter-chip-x { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.filter-chip-x .icon { width: 14px; height: 14px; }
.feed-body[aria-busy="true"] { min-height: 240px; }

/* ---------- Leads: quick actions and status (shared by cards and table) ---------- */

.quick-actions { display: flex; gap: 8px; }
.quick-actions > .btn { flex: 1 1 0; min-width: 0; }
.quick-actions-icons { display: inline-flex; gap: 4px; vertical-align: middle; }
.quick-actions-icons > .btn { flex: none; }
.btn-call { background: var(--brand); color: var(--brand-fg); box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 40%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.2); }
.btn-call:hover { background: var(--brand-hover); }
.btn-won { border-color: var(--border); background: var(--surface); color: var(--fg); }
.btn-won .icon { color: var(--ok); }
.btn-won:hover { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: var(--ok-soft); }
.btn-won.is-won,
.btn-won.is-won:disabled { border-color: color-mix(in srgb, var(--ok) 32%, transparent); background: var(--ok-soft); color: var(--ok); opacity: 1; cursor: default; }

/* "select." so it outranks select.input, which would hide the status dot. */
select.status-select {
  --dot: var(--faint-fg);
  width: 100%;
  height: 36px;
  padding-right: 30px;
  padding-left: 28px;
  font-size: 13.5px;
  font-weight: 600;
  background-image:
    radial-gradient(circle, var(--dot) 0 4px, transparent 4.5px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: 10px center, right 10px center;
  background-repeat: no-repeat;
  background-size: 10px 10px, 16px 16px;
}
select.status-select.status-new { --dot: var(--info); }
select.status-select.status-contacted { --dot: var(--warn); }
select.status-select.status-closed { --dot: var(--ok); }
select.status-select:disabled { cursor: not-allowed; }

.lead-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted-fg); font-size: 12.5px; }
.lead-notes span { display: inline-flex; align-items: center; gap: 5px; }
.lead-notes .icon { width: 14px; height: 14px; }
.lead-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lead-summary .pending,
.cell-summary .pending { color: var(--muted-fg); font-style: italic; }

/* ---------- Leads: table (768px and wider; never scrolls sideways) ---------- */

.lead-table-wrap { overflow: hidden; }
.lead-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lead-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted-fg); font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.lead-table th.cell-lead { width: 25%; }
.lead-table th.cell-contact { width: 17%; }
.lead-table th.cell-status { width: 164px; }
.lead-table th.cell-actions { width: 200px; }
.lead-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lead-table tr > :first-child { padding-left: 20px; }
.lead-table tr > :last-child { padding-right: 16px; }
.lead-row { cursor: pointer; transition: background-color 0.15s; }
.lead-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.lead-row.is-open { background: var(--surface-2); }
.lead-row.is-open td { border-bottom-color: transparent; }
.lead-row.is-spam > td:not(.cell-actions):not(.cell-status) { opacity: 0.6; }
.cell-lead-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cell-lead-name strong { font-weight: 650; overflow-wrap: anywhere; }
.cell-sub { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--muted-fg); font-size: 12.5px; }
.cell-sub .icon { flex: none; width: 13px; height: 13px; }
.cell-summary { display: -webkit-box; overflow: hidden; color: var(--fg-2); font-size: 14px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cell-contact a { display: block; overflow: hidden; color: var(--fg); font-size: 13.5px; font-weight: 550; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.cell-contact a + a { margin-top: 4px; color: var(--muted-fg); font-weight: 450; }
.cell-contact a:hover { text-decoration: underline; }
.cell-status select.status-select { margin-top: -6px; }
.lead-table td.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .quick-actions-icons { margin-top: -6px; }
.btn-expand { margin-top: -6px; vertical-align: middle; }
.btn-expand .icon { transition: transform 0.2s var(--ease); }
.lead-row.is-open .btn-expand .icon { transform: rotate(180deg); }
.lead-detail[hidden] { display: none; }
.lead-detail td { padding: 0 20px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); cursor: default; }
.lead-detail-body { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.lead-detail-body .lead-summary { margin: 0; color: var(--fg); }
.lead-detail-body .lead-more { margin-left: -8px; }
@media (max-width: 1023px) {
  .lead-table .cell-contact { display: none; }
  .lead-table th.cell-lead { width: 30%; }
}
@media (max-width: 920px), (pointer: coarse) {
  .lead-table th.cell-actions { width: 252px; }
  .lead-table th.cell-status { width: 172px; }
  select.status-select { height: 44px; }
}

/* ---------- Leads: cards (under 768px) ---------- */

.lead-cards { margin: 0; padding: 0; list-style: none; }
.lead-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); transition: background-color 0.15s; }
.lead-card:last-child { border-bottom: 0; }
.lead-card.is-spam > :not(.quick-actions):not(.lead-card-foot) { opacity: 0.65; }
.lead-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-name { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lead-card .lead-meta { margin-top: -6px; color: var(--muted-fg); font-size: 13px; }
.lead-card .lead-summary { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.5; }
.lead-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card .quick-actions > .btn { flex-direction: column; gap: 4px; height: 62px; padding: 0 6px; font-size: 13px; }
.lead-card .quick-actions .icon { width: 20px; height: 20px; }
.lead-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-card-foot select.status-select { flex: 1 1 150px; width: auto; height: 44px; }
.lead-card .btn-delete { width: 44px; padding: 0; }
.lead-card .btn-delete-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead-card .lead-panel { margin-top: 0; }
.lead-card.is-skeleton { gap: 4px; }
.lead-card.is-skeleton .quick-actions { margin-top: 10px; }

.lead-card.lead-flash,
.lead-row.lead-flash { background: color-mix(in srgb, var(--brand) 12%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .lead-card.lead-flash,
  .lead-row.lead-flash { animation: flash-row 2.2s ease-out both; }
}

/* ---------- Settings ---------- */

.section-nav { display: flex; gap: 6px; margin-top: -6px; overflow-x: auto; scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg-2); font-size: 13.5px; font-weight: 550; line-height: 34px; text-decoration: none; }
.section-nav a:hover { border-color: var(--border-strong); color: var(--fg); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.form-status { display: inline-flex; align-items: center; gap: 7px; color: var(--warn); font-size: 13px; font-weight: 600; }
.form-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.form-status[hidden] { display: none; }
form.is-dirty .form-actions .btn[type="submit"]:not([aria-busy]) { background: var(--brand); color: var(--brand-fg); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 550; }
.field-error[hidden] { display: none; }
.input[aria-invalid="true"],
.input[aria-invalid="true"]:hover { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }

.link-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.link-item { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.link-item.is-skeleton { gap: 0; }
.link-label { font-size: 14.5px; font-weight: 650; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; height: 44px; }
.copy-btn { flex: none; min-width: 108px; height: 44px; }
.copy-btn.btn-sm { min-width: 0; }
/* Small copy buttons stay small only where there's a mouse; fingers get 44px like every other button. */
@media (min-width: 921px) and (pointer: fine) { .copy-btn.btn-sm { height: 32px; } }
.copy-btn.is-copied,
.copy-btn.is-copied:hover { border-color: transparent; background: var(--ok); color: var(--bg); box-shadow: none; }
.link-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-left: -8px; }
.link-actions > .btn:last-child { margin-left: auto; }
.new-link { flex-direction: column; align-items: stretch; padding-top: 4px; }
.new-link[hidden] { display: none; }
.new-link-row { display: flex; gap: 8px; }
.new-link-row select { flex: 1; min-width: 0; }

/* ---------- Billing ---------- */

.billing-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plan-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.plan-price { color: var(--muted-fg); font-size: 15px; }
.plan-price strong { color: var(--fg); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.plan-period { display: flex; align-items: flex-start; gap: 8px; color: var(--fg-2); }
.plan-period .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--muted-fg); }
.plan-features { flex: none; padding-top: 14px; }
.plan-actions { margin-top: 4px; }
.usage-figure { color: var(--muted-fg); font-size: 15px; }
.usage-figure strong { margin-right: 2px; color: var(--fg); font-size: 34px; font-weight: 700; letter-spacing: -0.04em; }
.progress { height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-bar { display: block; height: 100%; border-radius: inherit; transition: width 0.6s var(--ease); }
.progress-ok { background: var(--ok); }
.progress-warn { background: var(--warn); }
.progress-danger { background: var(--danger); }
.usage-note { color: var(--fg-2); font-size: 13.5px; }
.usage-warn { color: var(--warn); font-weight: 600; }
.usage-danger { color: var(--danger); font-weight: 600; }
.plan-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-plan { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.compare-plan.is-current { border-color: var(--brand-line); background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.compare-name { font-size: 15px; font-weight: 650; }
.compare-plan .checklist { margin-top: 6px; padding-top: 12px; font-size: 14px; }
.compare-plan > .btn { margin-top: 10px; }
.account-number { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.account-number-value { font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }

/* ---------- Workspace on tablets and phones ---------- */

@media (max-width: 1180px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px) {
  /* ".side-nav a" so it beats the tab-bar label rule for spans. */
  .side-nav a .nav-count { position: absolute; top: 5px; left: calc(50% + 5px); width: auto; min-width: 18px; max-width: none; height: auto; margin: 0; padding: 0 5px; overflow: visible; font-size: 10.5px; line-height: 18px; box-shadow: 0 0 0 2px var(--bg-raised); }
  .billing-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 920px), (pointer: coarse) {
  .filter-chip { min-height: 44px; }
  .section-nav a { height: 44px; line-height: 42px; }
}

@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kpi {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon label value" "icon note value" "meter meter meter";
    gap: 2px 12px;
    padding: 14px 16px;
  }
  .kpi-icon { justify-self: start; }
  .kpi-value { margin: 0; font-size: 26px; text-align: right; }
  .recent-item { padding: 2px 10px 2px 4px; }
  .plan-compare { grid-template-columns: minmax(0, 1fr); }
  .form-actions { padding: 12px 16px; }
  .form-actions .btn { flex: 1; }
  .feed-skeleton-item,
  .filter-chips { padding-inline: 16px; }
}

/* ---------- Van mode: a glanceable, high-contrast screen for a phone in a holder ---------- */

.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.page-actions .btn[hidden] { display: none; }

.van {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #09090b;
  color: #fafafa;
  color-scheme: dark;
}
.van-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.van-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: #a1a1aa; font-size: 15px; }
.van-status strong { color: #fafafa; font-size: 17px; }
.van-dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgb(74 222 128 / 0.2); }
@media (prefers-reduced-motion: no-preference) {
  .van-dot { animation: van-pulse 2s ease-in-out infinite; }
}
@keyframes van-pulse { 50% { box-shadow: 0 0 0 8px rgb(74 222 128 / 0.05); } }
.van .btn { min-height: 52px; font-size: 16px; }
.van-exit { border: 1px solid #3f3f46; background: #18181b; color: #fafafa; box-shadow: none; }
.van-exit:hover { background: #27272a; }

.van-body { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 14px; width: 100%; max-width: 720px; margin: 24px auto; }
.van-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #a1a1aa; font-size: 17px; font-weight: 600; }
.van-urgent { padding: 3px 12px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.van-name { font-size: clamp(30px, 8vw, 46px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.van-job { color: #d4d4d8; font-size: clamp(20px, 5vw, 26px); line-height: 1.4; }
.van-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.van-actions .btn { flex: 1 1 200px; min-height: 76px; border-radius: 18px; font-size: 22px; font-weight: 700; }
.van-actions .icon { width: 28px; height: 28px; }
.van-call { background: #22c55e; color: #052e16; box-shadow: none; }
.van-call:hover { background: #4ade80; }
.van-whatsapp { border: 1px solid #3f3f46; background: #18181b; color: #fafafa; box-shadow: none; }
.van-whatsapp .icon { color: #4ade80; }
.van-number { color: #a1a1aa; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.van-repeat { align-self: flex-start; color: #d4d4d8; }
.van-repeat:hover { background: #18181b; color: #fafafa; }

.van-foot { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 720px; margin: 0 auto; padding-top: 14px; border-top: 1px solid #27272a; color: #a1a1aa; font-size: 14px; }
.van-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.van-setting label { color: #d4d4d8; font-size: 15px; font-weight: 600; }
.van-select { width: auto; min-width: 200px; height: 48px; border-color: #3f3f46; background-color: #18181b; color: #fafafa; font-size: 16px; }
.van-safety { display: flex; align-items: flex-start; gap: 8px; color: #fbbf24; }
.van-safety .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.van :focus-visible { outline: 3px solid #fb923c; outline-offset: 3px; }
