﻿:root {
  /* Light-only by design: the layout is built around a clean white canvas with
     colour carried by the stat blocks and card accents. */
  color-scheme: light;

  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --fg: #131722;
  --muted: #5d6577;
  --faint: #939bab;
  --border: #ecEEF4;
  --border-hi: #dfe3ec;
  --accent: #3b6bf0;
  --accent-fg: #ffffff;
  --accent-soft: #eaf0ff;

  --exit: #c2620c;
  --acquire: #3b6bf0;
  --ipo: #0f8a52;
  --pattern: #7c3fe4;
  --pattern-bg: #fbf8ff;
  --icp: #b06d08;
  --prospect: #0b8ba8;

  --fit-high: #0f8a52;
  --fit-mid: #b06d08;
  --fit-low: #7b8394;

  /* Stat block palette - each tile gets its own hue, pastel fill with a
     saturated number on top. */
  --c-blue-bg: #e7efff;      --c-blue-fg: #2b57cc;
  --c-violet-bg: #efe9ff;    --c-violet-fg: #6d38d6;
  --c-green-bg: #e2f7ec;     --c-green-fg: #0d7a49;
  --c-pink-bg: #ffe9f2;      --c-pink-fg: #c73374;
  --c-amber-bg: #fff2dc;     --c-amber-fg: #a96908;
  --c-teal-bg: #dff5f6;      --c-teal-fg: #0b7c8c;
  --c-lime-bg: #edf7d9;      --c-lime-fg: #5b7d16;
  --c-slate-bg: #eef0f5;     --c-slate-fg: #56607a;

  --shadow: 0 1px 2px rgba(19, 23, 34, 0.04), 0 6px 18px -8px rgba(19, 23, 34, 0.10);
  --shadow-hi: 0 2px 6px rgba(19, 23, 34, 0.06), 0 18px 40px -16px rgba(19, 23, 34, 0.18);

  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0 1.5rem 5rem;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* The old ambient gradient fought the clean white canvas - kept in the markup
   as an inert element so nothing else has to change. */
.glow { display: none; }

header, main { position: relative; z-index: 1; max-width: 940px; margin: 0 auto; }
header { padding: 3.25rem 0 0; }

.brand { display: flex; align-items: center; gap: 0.65rem; }

.mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ipo);
  box-shadow: 0 0 0 0 var(--ipo);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ipo) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h1 span { color: var(--accent); }

.region {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.15rem;
}

.subtitle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* ---------- view tabs ---------- */

/* Pill tabs on a light rail - friendlier than an underlined row. */
.views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 2.25rem 0 0;
  padding: 0.35rem;
  background: var(--surface-2);
  border-radius: 16px;
}

.view-tab {
  position: relative;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.view-tab:hover { color: var(--fg); }

.view-tab.is-active {
  color: var(--fg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.view-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tab-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.15rem;
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.25rem;
}

button#scan-btn {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 1rem 2.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 55%, transparent);
}

button#scan-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

button#scan-btn:active:not(:disabled) { transform: translateY(0); }

button#scan-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button#scan-btn:disabled { cursor: progress; opacity: 0.92; }

/* Light sweeps across the button while a scan is in flight. */
button#scan-btn.scanning::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: sweep 1.35s ease-in-out infinite;
}

@keyframes sweep { to { transform: translateX(100%); } }

#status { color: var(--muted); font-size: 0.87rem; }

/* ---------- stat blocks ----------
   Big rounded colour blocks: number first, label under it. Auto-fitting grid so
   they stay chunky at any width instead of squeezing into a thin strip. */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.9rem;
  margin-bottom: 2.25rem;
}

.stat {
  background: var(--c-slate-bg);
  color: var(--c-slate-fg);
  border: none;
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.15rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-num {
  display: block;
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: inherit;
  font-feature-settings: "tnum";
}

.stat-key {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-transform: none;
  color: inherit;
  opacity: 0.72;
  margin-top: 0.5rem;
}

/* One hue per metric. */
.stat--scanned           { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.stat--new-items         { background: var(--c-violet-bg); color: var(--c-violet-fg); }
.stat--in-the-news       { background: var(--c-green-bg);  color: var(--c-green-fg); }
.stat--inferred-signal   { background: var(--c-pink-bg);   color: var(--c-pink-fg); }
.stat--icp-fit           { background: var(--c-amber-bg);  color: var(--c-amber-fg); }
.stat--profiles          { background: var(--c-teal-bg);   color: var(--c-teal-fg); }
.stat--suggested-targets { background: var(--c-lime-bg);   color: var(--c-lime-fg); }
.stat--unverified   { background: var(--c-pink-bg);   color: var(--c-pink-fg); }
.stat--already-filed,
.stat--no-path-in   { background: var(--c-slate-bg);  color: var(--c-slate-fg); }
.stat--est-cost     { background: var(--fg);          color: #ffffff; }
.stat--est-cost .stat-num { font-size: 2rem; }

/* Dashboard home: the hero row is the first thing on Scan results, so its
   blocks run larger than the per-scan detail tiles below them. */
.dashboard { margin: 2.25rem 0 0; flex: 1; min-width: 0; }

.view-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ghost-btn {
  flex-shrink: 0;
  margin-top: 2.25rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.ghost-btn:hover { filter: brightness(0.97); transform: translateY(-1px); }
.ghost-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- manual lead form ---------- */

.lead-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem;
  margin-top: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field--wide { margin-top: 1rem; }

.field > span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0.65rem 0.8rem;
  width: 100%;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ---------- scan progress ---------- */

.progress { margin: 0 0 1.75rem; }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

#progress-stage {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

#progress-pct {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  font-feature-settings: "tnum";
}

.progress-track {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.6s ease;
}

@media (max-width: 620px) {
  .view-head { flex-direction: column; }
  .ghost-btn { margin-top: 0; align-self: flex-start; }
}

.stats--hero {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-bottom: 0;
}

.stats--hero .stat { padding: 1.75rem 1.5rem 1.5rem; }
.stats--hero .stat-num { font-size: 3rem; }
.stats--hero .stat-key { font-size: 0.82rem; margin-top: 0.6rem; }

/* Per-scan detail sits under the hero row and stays visually secondary. */
.stats--compact {
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.6rem;
}
.stats--compact .stat { padding: 0.95rem 1rem 0.85rem; border-radius: var(--radius-sm); }
.stats--compact .stat-num { font-size: 1.6rem; }
.stats--compact .stat-key { font-size: 0.68rem; margin-top: 0.3rem; }
.stats--compact .stat--est-cost .stat-num { font-size: 1.45rem; }

/* Digest and feedback reuse the block, coloured by position. */
.stat--c1 { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.stat--c2 { background: var(--c-violet-bg); color: var(--c-violet-fg); }
.stat--c3 { background: var(--c-green-bg);  color: var(--c-green-fg); }
.stat--c4 { background: var(--c-amber-bg);  color: var(--c-amber-fg); }
.stat--c5 { background: var(--c-teal-bg);   color: var(--c-teal-fg); }
.stat--c6 { background: var(--c-pink-bg);   color: var(--c-pink-fg); }
.stat--c7 { background: var(--c-lime-bg);   color: var(--c-lime-fg); }

.stat.cost { cursor: help; }

/* ---------- filter bar ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1.1rem;
  padding: 1.15rem 1.35rem;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease;
}

.filters.is-active { border-color: var(--accent); }

.filter-field { display: flex; flex-direction: column; gap: 0.2rem; }

.filter-field label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  font-weight: 600;
}

.filter-field select {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.filter-field select:hover { border-color: var(--border-hi); }

.filter-field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.filter-range { display: flex; align-items: center; gap: 0.3rem; }
.filter-range select { padding-right: 0.3rem; }
.range-dash { color: var(--faint); font-size: 0.8rem; }

.filter-clear { margin-left: auto; align-self: center; }

.result-count {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  font-family: var(--mono);
}
.result-count b { color: var(--fg); }

/* ---------- collapsible groups ---------- */

.group { margin-bottom: 1.25rem; }

.group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font: inherit;
  color: var(--fg);
  text-align: left;
  padding: 0.5rem 0.15rem;
  margin-bottom: 0.9rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: background 0.15s ease;
}

.group-head:hover { background: var(--surface-2); }
.group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.group-title {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.group-chevron {
  color: var(--faint);
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

.group.is-collapsed .group-chevron { transform: rotate(-90deg); }
.group.is-collapsed .group-body { display: none; }
.group.is-collapsed .group-head { margin-bottom: 0; }

.group-note { margin: 0 0 1.25rem; }

/* ---------- top-level blocks (Verified signals / Prospecting) ---------- */

.block { margin-bottom: 3rem; }
.block:last-child { margin-bottom: 0; }

.block-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-hi);
}

.block-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.block-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.block-flag {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--fit-mid);
  border: 1px solid color-mix(in srgb, var(--fit-mid) 40%, transparent);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  display: inline-flex;
  align-items: center;
}

.group-note {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--faint);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
}

.block.prospecting .block-head { border-bottom-color: var(--prospect); }
.block.prospecting .block-count { color: var(--prospect); background: color-mix(in srgb, var(--prospect) 14%, transparent); }

.service-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  margin: 0.8rem 0 1.2rem;
}
.mix-item {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}
.mix-item b { font-family: var(--mono); color: var(--fg); font-weight: 600; }

/* ---------- section headings ---------- */

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin: 2rem 0 0.9rem;
}
.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-heading:first-child { margin-top: 0; }
.section-heading.pattern-heading { color: var(--pattern); }

.count-pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.4rem;
}

.section-heading.prospect-heading { color: var(--prospect); }



/* ---------- cards ---------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem 1.5rem 1.9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow-hi);
  transform: translateY(-2px);
}

/* ---------- confidence hierarchy ----------
   Three weights, readable from colour alone before you read a badge:
   Confirmed  - full-height solid spine, white card, strongest shadow
   Pattern    - half-weight spine in violet, tinted card
   Hypothesis - hairline muted spine, grey card, no shadow */

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--faint);
}

/* Confirmed: the loudest tier. Spine takes the signal-type colour. */
.card.tier-confirmed { box-shadow: var(--shadow-hi); }
.card.tier-confirmed.exit::before { background: var(--exit); }
.card.tier-confirmed.acquire::before { background: var(--acquire); }
.card.tier-confirmed.ipo::before { background: var(--ipo); }

/* Pattern: middle weight - narrower, softer spine and a violet wash. */
.card.tier-pattern {
  background: var(--pattern-bg);
  border-color: color-mix(in srgb, var(--pattern) 20%, var(--border));
}
.card.tier-pattern::before {
  width: 4px;
  background: color-mix(in srgb, var(--pattern) 55%, #ffffff);
}

/* Hypothesis: quietest - thin muted spine, recessive fill, flat. */
.card.tier-hypothesis {
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: none;
}
.card.tier-hypothesis::before {
  width: 3px;
  background: color-mix(in srgb, var(--prospect) 30%, #ffffff);
}
.card.tier-hypothesis h3 { font-weight: 650; }
.card.tier-hypothesis:hover { box-shadow: var(--shadow); }

.capacity {
  font-size: 0.83rem;
  color: var(--fg);
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.6rem;
  background: var(--surface-2);
  border-left: 2px solid var(--prospect);
  border-radius: 0 8px 8px 0;
}

.capacity-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* 20-50 hypotheses is a long list - two columns keeps it scannable. */
.prospect-grid { display: grid; gap: 0.75rem; }
.prospect-grid .card { margin-bottom: 0; }

@media (min-width: 760px) {
  .prospect-grid { grid-template-columns: 1fr 1fr; }
  .prospect-grid .card-main { flex-direction: column-reverse; gap: 0.75rem; }
  .prospect-grid .fit {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: auto;
    text-align: left;
    padding: 0.5rem 0.85rem;
  }
  .prospect-grid .fit-score { font-size: 1.9rem; }
  .prospect-grid .fit-meter { width: 3.5rem; margin: 0; }
}

.card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.card-body { flex: 1; min-width: 0; }

.card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.16rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.tag.exit { color: var(--exit); }
.tag.acquire { color: var(--acquire); }
.tag.ipo { color: var(--ipo); }
.tag.pattern-badge { color: var(--pattern); }
.tag.icp-badge { color: var(--icp); }
.tag.hypothesis-badge { color: var(--prospect); }

.tag.manual-badge {
  color: var(--c-violet-fg);
  background: var(--c-violet-bg);
  border-color: transparent;
}

/* Manually added leads: distinct violet spine, same weight as a news finding. */
.card.tier-manual::before { background: var(--c-violet-fg); }

.row-tag--manual {
  color: var(--c-violet-fg);
  background: var(--c-violet-bg);
}

.tag.verified-badge {
  color: var(--fit-high);
  background: color-mix(in srgb, var(--fit-high) 12%, transparent);
  cursor: help;
}

.verified-note { border-left-color: var(--fit-high); }



/* Service line is the "what would we sell them" tag - deliberately quieter
   than the signal-type tag next to it. */
.tag.service-badge {
  color: var(--muted);
  border-style: dashed;
  background: transparent;
  text-transform: none;
  letter-spacing: 0.02em;
}

.contact {
  color: var(--fg);
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}
.contact .contact-title { color: var(--muted); }

.li-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.li-link:hover { border-bottom-color: currentColor; }

.rationale { margin: 0.5rem 0; font-size: 0.97rem; line-height: 1.6; }

.fit-rationale {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.55rem 0 0;
}

.touch-note {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin: 0.65rem 0 0;
}
.touch-note::before {
  content: "â†";
  color: var(--fit-mid);
  font-size: 0.9rem;
  line-height: 1;
}

.meta {
  font-size: 0.79rem;
  color: var(--faint);
  margin: 1rem 0 0;
  letter-spacing: 0;
}
.meta a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.meta a:hover { border-bottom-color: currentColor; }

/* ---------- deal fit meter ---------- */

/* The deal-fit score is the anchor number on every card: biggest type, its own
   tinted block, aligned right so the eye lands on it while scanning. */
.fit {
  flex-shrink: 0;
  width: 6rem;
  text-align: center;
  padding: 0.9rem 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, currentColor 10%, #ffffff);
}

.fit-score {
  font-size: 2.9rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-feature-settings: "tnum";
}
.fit-score span { font-size: 0.95rem; font-weight: 600; opacity: 0.45; }

.fit-meter {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin: 0.6rem 0 0.4rem;
}
.fit-meter i {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, currentColor 20%, transparent);
}
.fit-meter i.on { background: currentColor; }

.fit-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.6;
}

.fit.fit-high { color: var(--fit-high); }
.fit.fit-mid { color: var(--fit-mid); }
.fit.fit-low { color: var(--fit-low); }
.fit.fit-unknown { color: var(--faint); }

/* ---------- linkedin draft ---------- */

.msg {
  margin-top: 1.15rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.7rem 0.7rem 0.95rem;
}

.msg-label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  font-weight: 600;
}

.msg-count {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--faint);
  margin-left: auto;
}

.msg-body {
  margin: 0;
  padding: 0 0.95rem 0.95rem;
  font-size: 0.89rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}

.copy-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  background: var(--surface-2);
  border: none;
  border-radius: 11px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.copy-btn:hover { background: var(--border-hi); transform: translateY(-1px); }
.copy-btn:active { transform: translateY(0); }

.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.copy-btn.copied {
  color: #ffffff;
  background: var(--fit-high);
}

/* ---------- CRM: status + notes ---------- */

.lead {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.lead-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.lead-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  font-weight: 600;
}

.status-select {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.status-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Colour-code the current stage so a card's state reads at a glance. */
.status-select[data-status="contacted"] { color: var(--accent); border-color: var(--accent); }
.status-select[data-status="meeting_booked"] { color: var(--pattern); border-color: var(--pattern); }
.status-select[data-status="qualified"] { color: var(--fit-high); border-color: var(--fit-high); }
.status-select[data-status="no_budget"] { color: var(--fit-mid); border-color: var(--fit-mid); }
.status-select[data-status="not_interested"],
.status-select[data-status="dead"] { color: var(--faint); }

.mark-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: 11px;
  padding: 0.55rem 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: filter 0.15s ease, transform 0.12s ease;
}
.mark-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mark-btn:active { transform: translateY(0); }
.mark-btn:disabled { opacity: 0.6; cursor: progress; }
.mark-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lead-saved {
  font-size: 0.7rem;
  color: var(--faint);
  margin-left: auto;
}
.lead-saved.ok { color: var(--fit-high); }

.lead-notes {
  width: 100%;
  font: inherit;
  font-size: 0.86rem;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  min-height: 3rem;
}

.lead-notes::placeholder { color: var(--faint); }
.lead-notes:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* Stage headings in the pipeline view, colour-matched to the status select. */
.stage-heading[data-status="contacted"] { color: var(--accent); }
.stage-heading[data-status="meeting_booked"] { color: var(--pattern); }
.stage-heading[data-status="qualified"] { color: var(--fit-high); }
.stage-heading[data-status="no_budget"] { color: var(--fit-mid); }

/* ---------- digest ---------- */

.digest-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
}
.digest-controls .lead-saved { margin-left: 0; align-self: center; }

.digest-head .stats { margin-bottom: 0.5rem; }

.digest-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.digest-list li {
  padding: 0.55rem 0.7rem;
  border-left: 2px solid var(--border-hi);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.digest-score {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.2rem;
}

.digest-meta {
  font-size: 0.76rem;
  color: var(--faint);
  font-family: var(--mono);
  margin-left: 0.3rem;
}

.digest-why {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.digest-raw { margin-top: 1.5rem; }
.digest-raw summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.digest-raw pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.78rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--fg);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05rem 0.3rem;
}

/* ---------- All Leads table ---------- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leads-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  padding: 0;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.th-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: color 0.15s ease;
}
.th-btn:hover { color: var(--fg); }
.th-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.leads-table th.is-sorted .th-btn { color: var(--accent); }
.sort-arrow { font-size: 0.6rem; }

.lead-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.lead-row:hover { background: var(--surface-2); }
.lead-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lead-row.is-open { background: var(--accent-soft); }

.lead-row td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leads-table tbody tr:last-child td { border-bottom: none; }

.row-chevron {
  display: inline-block;
  color: var(--faint);
  font-size: 0.7rem;
  margin-right: 0.5rem;
  transition: transform 0.18s ease;
}
.lead-row.is-open .row-chevron { transform: rotate(90deg); }

.col-name { font-weight: 600; white-space: nowrap; }
.name-muted { color: var(--faint); font-weight: 500; font-style: italic; }
.col-title, .col-service { color: var(--muted); }
.col-company { font-weight: 600; }

.row-tag {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--prospect);
  background: color-mix(in srgb, var(--prospect) 12%, transparent);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  vertical-align: middle;
}

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
  background: var(--c-slate-bg);
  color: var(--c-slate-fg);
}
.status-pill[data-status="contacted"]      { background: var(--c-blue-bg);   color: var(--c-blue-fg); }
.status-pill[data-status="meeting_booked"] { background: var(--c-violet-bg); color: var(--c-violet-fg); }
.status-pill[data-status="qualified"]      { background: var(--c-green-bg);  color: var(--c-green-fg); }
.status-pill[data-status="no_budget"]      { background: var(--c-amber-bg);  color: var(--c-amber-fg); }
.status-pill[data-status="not_interested"] { background: var(--c-pink-bg);   color: var(--c-pink-fg); }

.detail-row > td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.detail-body { padding: 1.4rem 1.6rem 1.5rem 2.5rem; }

.detail-line { margin: 0 0 0.6rem; font-size: 0.92rem; line-height: 1.6; }

.detail-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.detail-body .meta { margin-top: 0.9rem; }
.detail-body .lead { border-top-color: var(--border-hi); }

@media (max-width: 760px) {
  .col-title, .col-service { display: none; }
  .detail-body { padding: 1.2rem 1rem; }
}

/* ---------- feedback patterns ---------- */

.pattern-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.75rem;
  font-size: 0.85rem;
}

.pattern-table th,
.pattern-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.pattern-table thead th {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-weight: 600;
  border-bottom-color: var(--border-hi);
}

.pattern-table .num { text-align: right; font-family: var(--mono); width: 5.5rem; }
.pattern-table .rate { color: var(--fit-mid); font-weight: 600; }
.pattern-table tbody tr:hover { background: var(--surface-2); }


.tag.reject-badge { color: var(--fit-mid); }

.card.rejection { background: var(--surface); }
.card.rejection::before { background: var(--fit-mid); }
.card.rejection .rationale .capacity-label { display: block; }

/* ---------- empty / error / history ---------- */

.empty-state {
  color: var(--muted);
  padding: 3.25rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-state strong {
  display: block;
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.empty-state span { font-size: 0.88rem; }

.link-btn {
  background: var(--accent-soft);
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.55rem 1.1rem;
  border-radius: 11px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.link-btn:hover { filter: brightness(0.97); transform: translateY(-1px); }
.link-btn:active { transform: translateY(0); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- login ---------- */

/* The gate is the entire page when it shows, so it centres itself rather than
   sitting under the app header. */
.login-body {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hi);
  padding: 2rem 1.9rem;
}

.login-brand { margin-bottom: 0.45rem; }

.login-hint {
  margin: 0 0 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.login-card .field { margin-bottom: 1.1rem; }

.login-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 0.85rem 1.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform 0.12s ease, filter 0.18s ease;
}

.login-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); }
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { opacity: 0.7; cursor: progress; }
.login-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

#history-section { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
#history { margin-top: 1.25rem; }
.hidden { display: none; }

.warn-box {
  background: color-mix(in srgb, var(--fit-mid) 12%, var(--surface));
  color: var(--fit-mid);
  border: 1px solid color-mix(in srgb, var(--fit-mid) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.87rem;
}

.error-box {
  background: color-mix(in srgb, #dc2626 12%, var(--surface));
  color: #dc2626;
  border: 1px solid color-mix(in srgb, #dc2626 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.card, .stat { animation: rise 0.28s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 620px) {
  body { padding: 0 1rem 4rem; }
  header { padding-top: 2rem; }
  .card-main { flex-direction: column-reverse; gap: 0.75rem; }
  .fit { display: flex; align-items: center; gap: 0.5rem; width: auto; text-align: left; }
  .fit-meter { width: 3.5rem; margin: 0; }
}
