/* ==========================================================================
   FindRivals — design system
   Nautical-chart identity: cool chart paper, deep ink, chart-magenta accent.
   Tokens are defined once on :root (light), then redefined for dark mode
   (system preference and explicit data-theme toggle).
   ========================================================================== */

:root {
  color-scheme: light;
  /* surfaces */
  --paper: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #eaf1f3;
  --surface-3: #dde8ec;
  /* ink */
  --ink: #0f2536;
  --ink-2: #3e5667;
  --ink-3: #587083;
  --rule: #d5e0e5;
  --rule-strong: #b3c4cd;
  /* brand */
  --accent: #a8175f;
  --accent-hover: #8c114e;
  --accent-ink: #ffffff;
  --accent-soft: #f8e4ee;
  --accent-text: #9c1457;
  --sea: #0e6f7c;
  --sea-soft: #dbeeef;
  /* status */
  --good: #13703f;
  --good-soft: #dff2e7;
  --warn: #9a5a00;
  --warn-soft: #fbefd6;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --info: #1f5fae;
  --info-soft: #e1ecfa;
  /* chart series: slot 0 = "You", then competitors (validated order) */
  --s0: #a8175f;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #4a3aa7;
  --s6: #008300;
  --s7: #e34948;
  --s-other: #8a9aa6;
  --grid: #e3eaee;
  --contour: rgba(14, 111, 124, 0.13);
  /* type */
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Public Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.3125rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: 2.125rem;
  --fs-4xl: 2.75rem;
  --fs-5xl: 3.5rem;
  /* shape + depth */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(15, 37, 54, 0.06), 0 1px 1px rgba(15, 37, 54, 0.04);
  --shadow-2: 0 10px 30px -12px rgba(15, 37, 54, 0.25), 0 2px 6px rgba(15, 37, 54, 0.06);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b1620;
    --surface: #112231;
    --surface-2: #16293a;
    --surface-3: #1d3447;
    --ink: #e4edf2;
    --ink-2: #b1c3cf;
    --ink-3: #8ea4b3;
    --rule: #22394b;
    --rule-strong: #35516a;
    --accent: #d6509a;
    --accent-hover: #e46aa8;
    --accent-ink: #1a0611;
    --accent-soft: #3a1729;
    --accent-text: #f07cb6;
    --sea: #4cc0c9;
    --sea-soft: #12393f;
    --good: #5fd08f;
    --good-soft: #143525;
    --warn: #f0b451;
    --warn-soft: #3a2c10;
    --bad: #f08a82;
    --bad-soft: #3d1a18;
    --info: #7fb2f2;
    --info-soft: #152c47;
    --s0: #d6509a;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #9085e9;
    --s6: #008300;
    --s7: #e66767;
    --s-other: #6f8494;
    --grid: #1c3144;
    --contour: rgba(76, 192, 201, 0.12);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b1620;
  --surface: #112231;
  --surface-2: #16293a;
  --surface-3: #1d3447;
  --ink: #e4edf2;
  --ink-2: #b1c3cf;
  --ink-3: #8ea4b3;
  --rule: #22394b;
  --rule-strong: #35516a;
  --accent: #d6509a;
  --accent-hover: #e46aa8;
  --accent-ink: #1a0611;
  --accent-soft: #3a1729;
  --accent-text: #f07cb6;
  --sea: #4cc0c9;
  --sea-soft: #12393f;
  --good: #5fd08f;
  --good-soft: #143525;
  --warn: #f0b451;
  --warn-soft: #3a2c10;
  --bad: #f08a82;
  --bad-soft: #3d1a18;
  --info: #7fb2f2;
  --info-soft: #152c47;
  --s0: #d6509a;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #9085e9;
  --s6: #008300;
  --s7: #e66767;
  --s-other: #6f8494;
  --grid: #1c3144;
  --contour: rgba(76, 192, 201, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
code, kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
table { font-variant-numeric: tabular-nums; }
.num, .tnum { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-stretch: 112%;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, var(--fs-5xl)); font-weight: 780; font-stretch: 118%; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, var(--fs-3xl)); font-weight: 740; }
h3 { font-size: var(--fs-xl); font-weight: 700; font-stretch: 108%; }
h4 { font-size: var(--fs-lg); font-weight: 680; font-stretch: 104%; }
p { margin: 0 0 1em; }
.lede { font-size: var(--fs-lg); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 12px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 820px; }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section + .section { border-top: 1px solid var(--rule); }
.stack > * + * { margin-top: 16px; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.split { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); font-size: var(--fs-lg); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-display); font-stretch: 122%; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--accent-text); }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 560;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
@media (max-width: 1020px) {
  .menu-toggle { display: inline-grid; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 16px; box-shadow: var(--shadow-2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
  .header-actions { margin-left: auto; }
  .header-actions .header-cta { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--rule-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 0.95rem/1.2 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.btn-primary:hover { --btn-bg: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ink { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-bd: var(--ink); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn-xs { min-height: 28px; padding: 4px 9px; font-size: var(--fs-xs); border-radius: 5px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
input[type="text"], input[type="url"], input[type="email"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: 400 0.95rem/1.4 var(--font-ui);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 25%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.input-sm { min-height: 34px !important; padding: 5px 9px !important; font-size: var(--fs-sm) !important; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: var(--fs-sm); cursor: pointer; }
.error-text { color: var(--bad); font-size: var(--fs-sm); }
.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 14px; font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer; min-height: 38px; }
.segmented button + button { border-left: 1px solid var(--rule); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- panels, chips, badges ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: clamp(16px, 2.5vw, 24px); }
.panel-flat { background: var(--surface-2); border-radius: var(--r-md); padding: clamp(16px, 2.5vw, 24px); }
.panel-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.panel-title h3, .panel-title h4 { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.chip-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip-sea { background: var(--sea-soft); color: var(--sea); border-color: transparent; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.kpi { display: grid; gap: 2px; }
.kpi-value { font-family: var(--font-display); font-stretch: 110%; font-weight: 760; font-size: var(--fs-2xl); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.kpi-sub { font-size: var(--fs-xs); color: var(--ink-2); }
.kpi-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.kpi-row > .kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; }
.callout { border: 1px solid color-mix(in srgb, var(--sea) 30%, transparent); background: var(--sea-soft); padding: 12px 16px; border-radius: var(--r-sm); color: var(--ink); font-size: var(--fs-sm); }
.callout-accent { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.table thead th { font-weight: 650; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table td.num, .table th.num { text-align: right; }
.table .row-you td { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.table-compact th, .table-compact td { padding: 6px 8px; }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { font-size: var(--fs-sm); color: var(--ink-3); padding-top: 20px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule-strong); }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding-block: 28px 36px; border-bottom: 1px solid var(--rule); background:
  radial-gradient(1200px 300px at 85% -40%, var(--contour), transparent 70%); }
.page-hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, var(--fs-4xl)); margin-top: 14px; }
.page-hero .lede { margin-bottom: 0; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-sm); color: var(--ink-3); margin-top: 16px; }

/* ---------- home hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 6vw, 72px) clamp(40px, 6vw, 80px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%);
  opacity: .7;
}
.hero > .wrap { position: relative; }
.hero h1 { max-width: 15ch; }
.hero-coords { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; margin-bottom: 10px; }
.finder { margin-top: 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: clamp(16px, 2.4vw, 22px); box-shadow: var(--shadow-2); }
.finder-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.finder-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: var(--fs-sm); color: var(--ink-2); }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 16px; height: 16px; color: var(--sea); }
.hero-map { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 14px 10px; box-shadow: var(--shadow-2); }
.hero-map figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); padding: 4px 4px 8px; }
.hero-map svg { display: block; width: 100%; height: auto; }

/* ---------- feature list ---------- */
.feature { display: grid; gap: 8px; align-content: start; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); }
.feature h3 { font-size: var(--fs-lg); margin: 0; }
.feature p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.feature .glyph { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); }
.feature .glyph svg { width: 20px; height: 20px; }
.feature a.more { font-size: var(--fs-sm); font-weight: 600; margin-top: 4px; }
.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.steps li { list-style: none; counter-increment: step; position: relative; padding: 18px 18px 18px 18px; border-top: 2px solid var(--ink); }
.steps li::before { content: "Step " counter(step); display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-text); margin-bottom: 6px; }
.steps h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.link-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-weight: 560; }
.link-list a:hover { color: var(--accent-text); }
.link-list small { color: var(--ink-3); font-weight: 400; }
.card-link { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease; align-content: start; }
.card-link:hover { border-color: var(--accent); }
.card-link strong { font-family: var(--font-display); font-stretch: 108%; font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; }
.card-link span { color: var(--ink-2); font-size: var(--fs-sm); }
.card-link .chip { justify-self: start; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; font-weight: 640; font-size: var(--fs-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--ink-3); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 16px; color: var(--ink-2); max-width: 70ch; }

/* ---------- article (guides) ---------- */
.article { font-family: var(--font-read); font-size: 1.125rem; line-height: 1.72; color: var(--ink); }
.article > * { max-width: 68ch; }
.article h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); margin-top: 2em; }
.article h3 { font-size: 1.3rem; margin-top: 1.6em; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: 0.45em; }
.article blockquote { margin: 1.5em 0; padding: 0 0 0 1.4em; color: var(--ink-2); font-style: italic; position: relative; }
.article blockquote::before { content: "\201C"; position: absolute; left: -0.1em; top: -0.25em; font-size: 2.4em; line-height: 1; color: var(--rule-strong); font-style: normal; }
.article table { font-family: var(--font-ui); font-size: var(--fs-sm); }
.article .table-wrap { max-width: 100%; margin: 1.4em 0; }
.article .callout { font-family: var(--font-ui); max-width: 68ch; margin: 1.5em 0; }
.article-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .article-layout { grid-template-columns: minmax(0, 1fr) 280px; } }
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: var(--fs-sm); display: grid; gap: 14px; align-self: start; }
.toc nav ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.toc nav a { color: var(--ink-2); text-decoration: none; }
.toc nav a:hover { color: var(--accent-text); }
@media (max-width: 1079px) { .toc { position: static; } }
.author-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface-2); border-radius: var(--r-md); font-family: var(--font-ui); font-size: var(--fs-sm); max-width: 68ch; }
.author-box .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; font-family: var(--font-display); }

/* ---------- pricing ---------- */
.price-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow-2); }
.plan h3 { margin: 0; font-size: var(--fs-xl); }
.plan .for { color: var(--ink-2); font-size: var(--fs-sm); margin: 0; min-height: 2.8em; }
.plan .price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan .amount { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .per { color: var(--ink-3); font-size: var(--fs-sm); }
.plan .billed { font-size: var(--fs-xs); color: var(--ink-3); min-height: 1.4em; margin: 0; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; color: var(--good); flex-shrink: 0; margin-top: 3px; }
.plan .btn { margin-top: auto; }
.plan-tag { align-self: flex-start; }
.pricing-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }

/* ---------- ads ---------- */
.ad-slot { display: block; margin: 28px auto; max-width: 100%; text-align: center; }
.ad-slot[data-state="placeholder"] { min-height: 120px; display: grid; place-items: center; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); color: var(--ink-3); font-size: var(--fs-xs); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--surface-2) 10px 11px); }
.ad-slot[data-format="rectangle"] { min-height: 250px; }
.ad-slot[data-format="leaderboard"] { min-height: 100px; }
.ad-label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .03em; }

/* ---------- footer ---------- */
.site-footer { margin-top: 0; border-top: 1px solid var(--rule); background: var(--surface); padding-block: 48px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-sm); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.footer-grid h2 { font-size: var(--fs-sm); font-family: var(--font-ui); font-stretch: 100%; font-weight: 700; color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--ink-3); }
.footer-about { max-width: 34ch; color: var(--ink-2); }

/* ---------- consent + toast + modal ---------- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60; max-width: 560px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: 18px;
  font-size: var(--fs-sm);
}
.consent h2 { font-size: var(--fs-md); font-family: var(--font-ui); font-stretch: 100%; margin-bottom: 6px; }
.consent p { color: var(--ink-2); margin-bottom: 12px; }
.consent .cluster { justify-content: flex-end; }
.consent-options { display: grid; gap: 10px; margin: 10px 0 14px; }
.toast-host { position: fixed; z-index: 80; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--fs-sm); display: flex; gap: 12px; align-items: center; justify-content: space-between; animation: toast-in .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.modal { border: 1px solid var(--rule-strong); border-radius: var(--r-lg); padding: 0; width: min(94vw, 620px); max-height: 88vh; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
dialog.modal::backdrop { background: rgba(8, 20, 30, 0.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.modal-head h2 { font-size: var(--fs-xl); margin: 0; }
.modal-body { padding: 18px 20px; overflow: auto; max-height: calc(88vh - 140px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--rule); flex-wrap: wrap; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-2); font-family: var(--font-ui); font-size: 11px; }
.chart .axis-title { fill: var(--ink-3); font-size: 11px; font-weight: 600; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--rule-strong); stroke-width: 1; }
.chart .quad-label { fill: var(--ink-3); font-size: 11px; font-weight: 600; }
.chart .pt-label { fill: var(--ink); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .value-label { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .whitespace { fill: none; stroke: var(--sea); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .whitespace-label { fill: var(--sea); font-weight: 700; font-size: 11px; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--paper);
  padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  box-shadow: var(--shadow-2); max-width: 240px; transform: translate(-50%, calc(-100% - 12px));
  white-space: normal;
}
.chart-tip b { font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .sw-line { width: 16px; height: 3px; border-radius: 2px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 56px; gap: 10px; align-items: center; font-size: var(--fs-sm); padding: 5px 0; }
.bar-row .bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.bar-row .bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--sea); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- print (report) ---------- */
@media print {
  .site-header, .site-footer, .no-print, .ad-slot, .consent, .toast-host, .app-side, .app-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { break-inside: avoid; border-color: #ccc; }
  a { color: #000; }
}

/* ==========================================================================
   Workspace (app.html)
   ========================================================================== */
.app-intro { padding-block: 22px 8px; }
.app-intro h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); margin-bottom: 6px; }
.app-intro p { margin: 0; color: var(--ink-2); max-width: 72ch; }
.app-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); z-index: 30; background: var(--surface); border-block: 1px solid var(--rule); }
.app-bar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 8px; }
.app-bar select { width: auto; max-width: 260px; }
.save-status { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.save-status.bad { color: var(--bad); }
.app-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; padding-block: 22px 56px; }
.app-side { position: sticky; top: calc(var(--header-h) + 72px); max-height: calc(100vh - var(--header-h) - 96px); overflow: auto; padding-right: 4px; }
.app-side .grp { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin: 14px 10px 6px; }
.app-side .grp:first-child { margin-top: 0; }
.app-side button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font: 560 0.92rem/1.3 var(--font-ui); cursor: pointer; }
.app-side button:hover { background: var(--surface-2); color: var(--ink); }
.app-side button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); }
.app-side button svg { width: 17px; height: 17px; flex-shrink: 0; }
.app-side .badge { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 920px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 12px; }
  .app-side { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .app-side .grp { display: none; }
  .app-side button { width: auto; white-space: nowrap; border: 1px solid var(--rule); background: var(--surface); }
  .app-side .badge { display: none; }
  .save-status { margin-left: 0; width: 100%; }
}
.app-main { min-width: 0; display: grid; gap: 20px; }
.app-main:focus { outline: none; }
.module-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.module-head h2 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.module-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }
.two-col { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.sample-banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); font-size: var(--fs-sm); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.empty { padding: 26px; text-align: center; border: 1px dashed var(--rule-strong); border-radius: var(--r-md); color: var(--ink-2); background: var(--surface); }
.empty p { margin: 0 0 12px; }
.grid-input { width: 68px !important; min-height: 34px !important; padding: 4px 6px !important; text-align: center; font-variant-numeric: tabular-nums; }
.cell-btn { min-width: 44px; height: 32px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); color: var(--ink-3); cursor: pointer; font: 700 12px/1 var(--font-ui); }
.cell-btn[data-v="1"] { background: var(--good-soft); color: var(--good); border-color: transparent; }
.cell-btn[data-v="0.5"] { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.th-ent { display: inline-flex; align-items: center; gap: 6px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.entity-card { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.entity-card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.entity-card > summary::-webkit-details-marker { display: none; }
.entity-card > summary .ent-name { font-weight: 700; font-size: var(--fs-lg); }
.entity-card > summary .spacer { margin-left: auto; }
.entity-card[open] > summary { border-bottom: 1px solid var(--rule); }
.entity-body { padding: 16px; display: grid; gap: 16px; }
.sub-label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.link-chips a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: var(--fs-xs); font-weight: 560; }
.link-chips a:hover { border-color: var(--accent); color: var(--accent-text); }
.link-chips a svg { width: 12px; height: 12px; color: var(--ink-3); }
.player-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.player { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); min-width: 0; }
.player > div { min-width: 0; }
.player strong { display: block; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player small { display: block; color: var(--ink-3); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-result { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.ai-result .cluster { justify-content: space-between; }
.ai-note { font-size: var(--fs-xs); color: var(--ink-3); }
.swot-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.swot-box { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); padding: 16px; display: grid; gap: 4px; align-content: start; }
.swot-box h3 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); margin: 0 0 6px; }
.swot-item { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--rule); font-size: var(--fs-sm); }
.swot-item .chip { margin-left: 4px; }
.swot-add { display: flex; gap: 6px; margin-top: 8px; }
.battle { display: grid; gap: 14px; }
.battle textarea { min-height: 96px; font-size: var(--fs-sm); }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px 16px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); font-size: var(--fs-sm); }
@media (max-width: 560px) { .q-row { grid-template-columns: minmax(0, 1fr); } }
.q-scale { display: flex; gap: 4px; }
.q-scale button { flex: 1; min-height: 34px; border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 6px; cursor: pointer; font: 600 13px/1 var(--font-ui); color: var(--ink-2); }
.q-scale button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.report-doc { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: clamp(18px, 3vw, 36px); display: grid; gap: 22px; }
.report-doc h3 { margin-bottom: 8px; }
.report-doc ul { margin: 0; padding-left: 1.2em; }
.plan-block { border-top: 1px solid var(--rule); padding-top: 12px; }
.plan-block:first-child { border-top: 0; padding-top: 0; }
.plan-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(90px, 1fr) minmax(110px, 1.2fr) minmax(110px, 1fr) 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 640px) { .plan-row { grid-template-columns: 1fr 1fr; } }
.stat-note { font-size: var(--fs-xs); color: var(--ink-3); }
.kbd-note { font-size: var(--fs-xs); color: var(--ink-3); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-main { grid-template-columns: minmax(0, 1fr); }
.app-main > * { min-width: 0; }
select.input-sm { padding-right: 30px !important; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.bar-track, .bar-fill { display: block; }
.score-table th, .score-table td { text-align: center; }
.score-table th:first-child, .score-table td:first-child { text-align: left; min-width: 170px; }
@media (max-width: 920px) {
  .app-bar { position: static; }
  .app-bar .btn-ghost .lbl { display: none; }
  .app-bar .btn-ghost { padding-inline: 10px; }
}

/* ==========================================================================
   FindRivals — 2026 visual upgrade: depth, motion, 3D hero, auth UI
   Appended tokens and components. The light/dark theme system above is
   untouched; these rules layer on top of it.
   ========================================================================== */

:root {
  /* richer depth */
  --shadow-3: 0 24px 60px -20px rgba(15, 37, 54, 0.35), 0 4px 12px rgba(15, 37, 54, 0.08);
  --shadow-glow-sea: 0 0 0 1px color-mix(in srgb, var(--sea) 35%, transparent), 0 8px 28px -8px color-mix(in srgb, var(--sea) 45%, transparent);
  --grad-accent: linear-gradient(135deg, #c2247f 0%, var(--accent) 55%, #7d0f4b 100%);
  --grad-sea: linear-gradient(135deg, #5fd3da 0%, var(--sea) 60%, #0a4a55 100%);
  --grad-hero-dark: radial-gradient(1100px 480px at 78% 8%, rgba(76, 192, 201, 0.16), transparent 65%),
    radial-gradient(800px 420px at 12% 90%, rgba(224, 96, 156, 0.10), transparent 60%);
  --grad-hero-light: radial-gradient(1100px 480px at 78% 8%, rgba(14, 111, 124, 0.10), transparent 65%),
    radial-gradient(800px 420px at 12% 90%, rgba(168, 23, 95, 0.07), transparent 60%);
  --ring: 0 0 0 3px color-mix(in srgb, var(--sea) 30%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-3: 0 26px 64px -20px rgba(0, 0, 0, 0.8), 0 4px 14px rgba(0, 0, 0, 0.4);
    --grad-accent: linear-gradient(135deg, #e0609c 0%, #c93a86 55%, #93306a 100%);
  }
}
:root[data-theme="dark"] {
  --shadow-3: 0 26px 64px -20px rgba(0, 0, 0, 0.8), 0 4px 14px rgba(0, 0, 0, 0.4);
  --grad-accent: linear-gradient(135deg, #e0609c 0%, #c93a86 55%, #93306a 100%);
}

/* ---------- upgraded buttons ---------- */
.btn { box-shadow: var(--shadow-1); }
.btn:hover { box-shadow: var(--shadow-2); }
.btn-primary {
  --btn-bg: var(--accent);
  background-image: var(--grad-accent);
  border: 0;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 65%, transparent), var(--shadow-1);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn-primary:hover {
  --btn-bg: var(--accent-hover);
  border: 0;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -12px color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow-2);
}
.btn-primary:active { transform: translateY(0); }
.btn-ink:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* ---------- upgraded cards ---------- */
.card-link {
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-link:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--rule));
  transform: translateY(-3px);
  box-shadow: var(--shadow-3);
}
.feature { box-shadow: var(--shadow-1); transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.plan { box-shadow: var(--shadow-1); transition: transform .18s ease, box-shadow .18s ease; }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.plan.featured { position: relative; overflow: hidden; }
.plan.featured::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--grad-accent);
}
.panel { box-shadow: var(--shadow-1); }
.module { transition: background-color .15s ease; border-radius: var(--r-sm); }
.module:hover { background: var(--surface-2); }

/* ---------- upgraded forms ---------- */
input[type="text"], input[type="url"], input[type="email"], input[type="number"],
input[type="search"], input[type="date"], select, textarea {
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(15, 37, 54, 0.05);
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: var(--ring), inset 0 1px 2px rgba(15, 37, 54, 0.04);
}

/* ---------- richer hero ---------- */
.hero { background: var(--grad-hero-light); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { background: var(--grad-hero-dark); }
}
:root[data-theme="dark"] .hero { background: var(--grad-hero-dark); }
.hero h1 {
  background: linear-gradient(120deg, var(--ink) 30%, var(--accent-text) 75%, var(--sea) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 { color: var(--ink); background: none; }
}
.finder {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(8px);
  -webkit-backdrop-filter: saturate(1.3) blur(8px);
  box-shadow: var(--shadow-3);
  border: 1px solid color-mix(in srgb, var(--rule-strong) 70%, transparent);
}
.hero-map { box-shadow: var(--shadow-3); transition: transform .25s ease, box-shadow .25s ease; }
.hero-map:hover { transform: translateY(-2px); }

/* ---------- 3D hero ---------- */
.hero-visual { display: grid; gap: 16px; align-content: start; }
.hero-3d { display: none; }
.hero-3d.on {
  display: block;
  position: relative;
  aspect-ratio: 16 / 12.5;
  min-height: 300px;
  border-radius: var(--r-lg);
  border: 1px solid var(--rule);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(76, 192, 201, 0.14), transparent 60%),
    linear-gradient(160deg, #0e2233 0%, #0f2536 45%, #0a1a27 100%);
}
.hero-3d.on::after {
  content: "Live competitor network · rendered in 3D";
  position: absolute; left: 12px; bottom: 10px;
  font-size: var(--fs-xs); color: rgba(228, 237, 242, 0.65);
  pointer-events: none;
}
/* app page band */
.app-intro { position: relative; overflow: hidden; }
.app-3d { display: none; }
.app-3d.on {
  display: block;
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.app-intro .wrap { position: relative; }

/* ---------- stats band ---------- */
.stats-band { border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.stats-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.stat { display: grid; gap: 2px; text-align: center; padding: 6px 4px; }
.stat-num {
  font-family: var(--font-display); font-stretch: 116%; font-weight: 800;
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: var(--grad-sea);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat-num { color: var(--sea); background: none; }
}
.stat-label { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }

/* ---------- scroll reveals (JS adds .rv, IO adds .in) ---------- */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.rv.in { opacity: 1; transform: none; will-change: auto; }

/* ---------- auth UI ---------- */
.auth-area { display: inline-flex; align-items: center; }
.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 600 var(--fs-sm)/1 var(--font-ui); cursor: pointer;
  max-width: 220px;
}
.user-chip:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-1); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--grad-sea); color: #062a30;
  font-weight: 800; font-size: 0.8rem;
}
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge { font-size: 0.68rem; padding: 2px 8px; }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 230px;
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  padding: 6px; display: grid; gap: 2px;
}
.user-drop-head { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.user-drop-head strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }
.user-drop a, .user-drop button[data-auth-out] {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink);
  font: 560 var(--fs-sm)/1.3 var(--font-ui); text-decoration: none; cursor: pointer;
}
.user-drop a:hover, .user-drop button[data-auth-out]:hover { background: var(--surface-2); }
.auth-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: -2px -2px 16px; padding: 0 2px; }
.auth-tabs [role="tab"] {
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 14px; font: 700 var(--fs-sm)/1 var(--font-ui); color: var(--ink-3);
  box-shadow: inset 0 -2px 0 transparent;
}
.auth-tabs [role="tab"][aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.auth-form .btn-block { margin-top: 4px; }

/* ---------- cloud sync buttons ---------- */
.cloud-area { display: inline-flex; gap: 8px; align-items: center; }
.cloud-area:empty { display: none; }

/* ---------- newsletter ---------- */
.newsletter { display: flex; gap: 8px; max-width: 340px; }
.newsletter input { min-height: 38px; }
.newsletter .btn { flex-shrink: 0; }

/* ---------- focus visibility upgrade ---------- */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sea) 75%, var(--accent) 25%);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .hero-3d.on { min-height: 240px; aspect-ratio: 16 / 13; }
  .user-name { display: none; }
  .user-chip { padding-right: 4px; }
  .newsletter { max-width: none; }
}
