:root {
  --bg: #f6f2e8;
  --surface: #ffffff;
  --surface-alt: #f1ebdc;
  --surface-sunken: #ece4d1;
  --text: #322e27;
  --text-muted: #8a8172;
  --text-faint: #b3a996;
  --border: #e9e1cf;
  --border-soft: #f0e9da;
  --matcha: #7f9c5e;
  --matcha-dark: #5f7a45;
  --matcha-deep: #435a30;
  --matcha-light: #e6efdb;
  --matcha-tint: #f2f6ec;
  --good: #4f8a5b;
  --good-bg: #e6f1e6;
  --warning: #b8791f;
  --warning-bg: #fbf0dd;
  --critical: #b34a3a;
  --critical-bg: #fbe8e4;
  --info: #5a4a9e;
  --info-bg: #e3ddf6;
  --teal: #2b7a6c;
  --teal-bg: #d8f0ec;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(50, 46, 39, 0.05);
  --shadow: 0 2px 10px rgba(50, 46, 39, 0.06), 0 1px 2px rgba(50, 46, 39, 0.04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--matcha-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a:not(.btn) { color: var(--text-muted); font-weight: 600; font-size: 0.92rem; }
.nav a:not(.btn):hover { color: var(--matcha-dark); text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ---------- Type ---------- */
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 0.2rem; }
h2 { font-size: 1rem; font-weight: 700; margin: 0 0 0.65rem; letter-spacing: -0.005em; }
h3 { font-size: 0.88rem; font-weight: 700; margin: 0 0 0.4rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--matcha-dark);
  margin: 0 0 0.15rem;
}
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.1rem; }
.subtitle { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.card-tight { padding: 0.85rem 1rem; }
.card > h2:first-child, .card > .eyebrow:first-child { margin-top: 0; }

.grid { display: grid; gap: 0.85rem; }
.two-col { grid-template-columns: 1fr 1fr; align-items: start; }
.workspace-grid { grid-template-columns: 2fr 1fr; align-items: start; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
}

/* ---------- KPI cards ---------- */
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--matcha);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1rem;
}
.kpi-card.accent-info { border-top-color: var(--info); }
.kpi-card.accent-teal { border-top-color: var(--teal); }
.kpi-card.accent-matcha { border-top-color: var(--matcha-dark); }
.kpi-value { font-size: 2.15rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-label { color: var(--text-muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.2rem; }
.kpi-secondary { color: var(--text-faint); font-size: 0.8rem; margin-top: 0.3rem; }

/* legacy stat card (kept for compatibility) */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; border-color: var(--matcha); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--matcha-dark); border-color: var(--matcha-dark); color: #fff; }
.btn-primary:hover { background: var(--matcha-deep); border-color: var(--matcha-deep); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-danger { color: var(--critical); }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
th { color: var(--text-muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-new { background: var(--surface-sunken); color: var(--text-muted); }
.badge-scanned { background: #dfe9f5; color: #35618f; }
.badge-report-ready { background: var(--info-bg); color: var(--info); }
.badge-contacted { background: #f6e9d2; color: #8a5f1f; }
.badge-followup { background: var(--warning-bg); color: var(--warning); }
.badge-replied { background: var(--teal-bg); color: var(--teal); }
.badge-interested { background: var(--matcha-light); color: var(--matcha-dark); }
.badge-client { background: var(--matcha-dark); color: #fff; }
.badge-lost { background: var(--critical-bg); color: var(--critical); }

.pipeline-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pipeline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.1s ease;
}
.pipeline-pill:hover { text-decoration: none; transform: translateY(-1px); }
.pipeline-pill .count {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 0.02rem 0.45rem;
  font-weight: 800;
  font-size: 0.75rem;
}

.sev-good { color: var(--good); }
.sev-warning { color: var(--warning); }
.sev-critical { color: var(--critical); }
.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; flex-shrink: 0; }
.sev-dot.good { background: var(--good); }
.sev-dot.warning { background: var(--warning); }
.sev-dot.critical { background: var(--critical); }

/* ---------- Findings ---------- */
.finding {
  border: 1px solid var(--border-soft);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
}
.finding.good { border-left-color: var(--good); background: var(--good-bg); }
.finding.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.finding.critical { border-left-color: var(--critical); background: var(--critical-bg); }
.finding.needs-review { border-left-style: dashed; border-left-color: var(--text-faint); background: var(--surface-alt); }
.finding-title { font-weight: 700; margin-bottom: 0.15rem; font-size: 0.92rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem; }
.finding-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.finding-meta strong { color: var(--text); }
.finding-compact { padding: 0.55rem 0.75rem; margin-bottom: 0.4rem; }
.finding-compact .finding-title { display: flex; align-items: center; font-size: 0.88rem; }
.finding-compact p { margin: 0; font-size: 0.83rem; color: var(--text-muted); }

/* ---------- Scores ---------- */
.score-ring {
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 800; color: #fff;
  background: var(--matcha-dark);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.score-ring.lg { width: 104px; height: 104px; font-size: 1.6rem; }
.score-ring.warning { background: var(--warning); }
.score-ring.critical { background: var(--critical); }
.score-ring.unknown { background: var(--text-faint); }
.score-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.score-mini { text-align: center; }
.score-mini .num { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-mini .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 600; }

.health-strip { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.health-metrics { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ---------- Snapshot (business page at-a-glance) ---------- */
.snapshot-card { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.snapshot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.snapshot-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 600; margin-bottom: 0.2rem; }
.snapshot-value { font-size: 0.95rem; font-weight: 600; }
.snapshot-opportunity p { margin: 0.3rem 0; font-size: 0.92rem; }
@media (max-width: 860px) {
  .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Confidence & review states ---------- */
.confidence-pill {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
}
.confidence-pill.verified { background: var(--surface-sunken); color: var(--text-faint); }
.confidence-pill.likely { background: var(--warning-bg); color: var(--warning); }
.confidence-pill.needs_review { background: var(--surface-sunken); color: var(--text-muted); border: 1px dashed var(--text-faint); }
.confidence-pill.pitching { background: var(--matcha-light); color: var(--matcha-dark); }

.finding-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
}
.finding-controls .finding-control-item { margin-bottom: 0; }
.finding-controls select, .finding-controls input[type=number], .finding-controls input[type=text] {
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
}
.finding-controls .checkbox-row { gap: 0.3rem; white-space: nowrap; }

.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  color: var(--warning);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  font-size: 0.86rem;
  margin-bottom: 1rem;
}
.alert-banner strong { color: inherit; }
.alert-banner a { color: inherit; text-decoration: underline; }
.alert-banner.blocked { background: var(--surface-sunken); border-color: var(--border); color: var(--text-muted); }

.needs-review-card { border-color: var(--warning); background: var(--warning-bg); }
.needs-review-card h2 { color: var(--warning); }

.ai-analyst-card { border: 1px dashed var(--info); }
.ai-analyst-card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Sales Opportunities ---------- */
.sales-opp-list { display: flex; flex-direction: column; }
.sales-opp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.sales-opp-row:last-child { border-bottom: none; }
.sales-opp-title { font-weight: 700; font-size: 0.92rem; }
.sales-opp-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; white-space: nowrap; }

/* ---------- Forms ---------- */
form .field { margin-bottom: 0.85rem; }
label { display: block; font-weight: 600; font-size: 0.82rem; margin-bottom: 0.28rem; color: var(--text-muted); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--matcha-light); border-color: var(--matcha); }
textarea { resize: vertical; min-height: 4.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Quick scan ---------- */
.quickscan-card {
  background: linear-gradient(180deg, var(--matcha-tint), var(--surface) 70%);
  border: 1px solid var(--border-soft);
}
.quickscan-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; }
.quickscan-form input { flex: 1 1 260px; font-size: 1rem; padding: 0.65rem 0.85rem; }
.quickscan-form button { flex: 0 0 auto; padding: 0.65rem 1.3rem; font-size: 0.92rem; }
.quickscan-hint { color: var(--text-faint); font-size: 0.8rem; margin: 0.5rem 0 0; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.empty-state { color: var(--text-faint); font-style: italic; padding: 0.75rem 0; font-size: 0.88rem; }
.token-box {
  background: var(--surface-alt);
  border: 1px dashed var(--matcha);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }

/* ---------- Today queue ---------- */
.queue-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .queue-grid { grid-template-columns: repeat(2, 1fr); } }
.queue-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.queue-card .queue-count { font-size: 1.1rem; font-weight: 800; color: var(--matcha-dark); }
.queue-card ul { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.queue-card li { border-bottom: 1px solid var(--border-soft); }
.queue-card li:last-child { border-bottom: none; }
.queue-card li a {
  display: block;
  padding: 0.35rem 0.15rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
}
.queue-card li a:hover { background: var(--surface-alt); text-decoration: none; }
.queue-card li a span.faint { font-weight: 400; }

.filter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.filter-form .field { margin-bottom: 0; min-width: 140px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }

.copy-box {
  width: 100%;
  min-height: 7.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
}
.section-divider { border: none; border-top: 1px solid var(--border-soft); margin: 1rem 0; }
.stat-pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--surface-sunken); font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

/* ---------- Activity feed ---------- */
.activity-list { display: flex; flex-direction: column; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.3rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.86rem;
}
.activity-row:last-child { border-bottom: none; }
a.activity-row { color: var(--text); border-radius: 8px; }
a.activity-row:hover { background: var(--surface-alt); text-decoration: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-faint); }
.activity-dot.scan { background: #35618f; }
.activity-dot.report_created { background: var(--info); }
.activity-dot.report_viewed { background: var(--teal); }
.activity-dot.contacted { background: var(--warning); }
.activity-dot.replied { background: var(--teal); }
.activity-dot.client { background: var(--matcha-dark); }
.activity-main { flex: 1; min-width: 0; }
.activity-business { font-weight: 700; }
.activity-label { color: var(--text-muted); }
.activity-time { color: var(--text-faint); font-size: 0.78rem; white-space: nowrap; }

/* ---------- Details/accordion ---------- */
details.collapsible { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
details.collapsible summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; list-style: none; }
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary::before { content: "\25B8"; display: inline-block; margin-right: 0.4rem; transition: transform 0.15s ease; color: var(--matcha-dark); }
details.collapsible[open] summary::before { transform: rotate(90deg); }
details.collapsible .collapsible-body { margin-top: 0.75rem; }

/* ---------- Report (public) ---------- */
.report-shell { max-width: 760px; margin: 0 auto; }
.report-header {
  background: var(--matcha-deep);
  color: #fdfcf8;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.report-header .eyebrow { color: #cfe0bd; }
.report-header h1 { color: #fff; margin-bottom: 0.3rem; }
.report-header .subtitle { color: #dfe9d3; }
.report-kpis { grid-template-columns: repeat(5, 1fr); margin-top: 1.1rem; }
@media (max-width: 640px) { .report-kpis { grid-template-columns: repeat(2, 1fr); } }
.report-kpi { background: rgba(255,255,255,0.1); border-radius: var(--radius); padding: 0.7rem 0.4rem; }
.report-kpi .num { font-size: 1.25rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.report-kpi .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: #d8e6cb; margin-top: 0.15rem; }
.report-overall { text-align: center; margin-bottom: 0.5rem; }

.cta-box {
  background: var(--matcha-light);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  text-align: center;
  margin-top: 1rem;
}
.cta-box .btn-primary { margin-top: 0.6rem; }

/* ---------- Responsive helpers ---------- */
@media (max-width: 480px) {
  .container { padding: 1.1rem 1rem 2.5rem; }
  h1 { font-size: 1.3rem; }
  .kpi-value { font-size: 1.6rem; }
}

/* ---------- Email popup ---------- */
.email-dialog {
  width: min(640px, calc(100vw - 2rem));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm), 0 20px 50px rgba(0, 0, 0, 0.25);
}
.email-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.email-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.email-dialog-head h2 { margin: 0; font-size: 1.05rem; }
.email-row { margin-bottom: 0.7rem; }
.email-row > label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); margin-bottom: 0.25rem; }
.email-field { display: flex; gap: 0.5rem; align-items: center; }
.email-field input { flex: 1; }
.email-row textarea { width: 100%; font-family: inherit; line-height: 1.45; }
.email-actions { margin-top: 0.25rem; }
.email-sent-form { margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--border-soft); }

/* ---------- Simplified dashboard + business page ---------- */
/* Dashboard */
.dash { max-width: 760px; margin: 0 auto; }
.dash .quickscan-card { padding: 1.25rem 1.3rem; box-shadow: var(--shadow); }
.dash .quickscan-card h2 { font-size: 1.15rem; margin-bottom: 0.15rem; }
.dash .quickscan-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.85rem; }
.section-head { display: flex; align-items: center; gap: 0.5rem; margin: 1.5rem 0 0.7rem; }
.section-head h2 { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.section-head .pill { background: var(--matcha-light); color: var(--matcha-deep); font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.55rem; border-radius: 999px; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
@media (max-width: 640px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  --accent: var(--matcha-dark); --accent-bg: var(--matcha-tint);
  display: flex; flex-direction: column; gap: 0.1rem;
  background: linear-gradient(180deg, var(--accent-bg), var(--surface) 85%);
  border: 1px solid var(--border-soft); border-top: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 0.7rem 0.9rem 0.8rem; color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-tile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.stat-tile-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-tile-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.stat-tile.is-zero .stat-tile-num { opacity: 0.4; }
.tile-ready { --accent: var(--info); --accent-bg: #efeafa; }
.tile-waiting { --accent: var(--warning); --accent-bg: #fdf5e6; }
.tile-replied { --accent: var(--teal); --accent-bg: #e6f5f2; }
.tile-customers { --accent: var(--good); --accent-bg: #eaf4e8; }

.task-list { display: flex; flex-direction: column; gap: 0.6rem; }
.task-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 0.8rem 1rem;
}
.task-main { flex: 1 1 240px; min-width: 0; }
.task-name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 700; font-size: 0.98rem; letter-spacing: -0.005em; }
.task-desc { color: var(--text-muted); font-size: 0.85rem; margin: 0.15rem 0 0; }
.task-card .btn { flex: 0 0 auto; }

.empty-card {
  text-align: center; background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 1.6rem 1rem;
}
.empty-card .empty-title { font-weight: 700; }
.empty-card p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.88rem; }
.empty-card .empty-icon { font-size: 1.4rem; color: var(--matcha-dark); }

.next-step-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; color: var(--text-muted); }
.next-step-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.status-select { width: auto; padding: 0.4rem 0.6rem; font-weight: 600; }

.more-menu { position: relative; }
.more-menu summary { list-style: none; cursor: pointer; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu-body {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 0.3rem; display: flex; flex-direction: column;
}
.more-menu-body a, .more-menu-body button {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 0.5rem 0.7rem; border-radius: 6px; color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 600;
}
.more-menu-body a:hover, .more-menu-body button:hover { background: var(--surface-alt); text-decoration: none; }
.more-menu-body button.danger { color: var(--critical); }

/* ---------- Public report: score summary ---------- */
/* One flex column holds everything, so the label, ring and pills can't drift. */
.score-summary { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; width: 100%; margin: 1.1rem auto 0; text-align: center; }
.score-summary-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.score-summary .score-ring { margin: 0 auto; background: var(--band); box-shadow: 0 0 0 6px var(--band-tint), var(--shadow); }
.score-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; width: 100%; max-width: 560px; margin-top: 0.7rem; }
.score-pill {
  flex: 1 1 96px; min-width: 96px; max-width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 0.05rem;
  background: var(--band-tint); border: 1px solid var(--band-edge); border-radius: var(--radius);
  padding: 0.5rem 0.4rem 0.55rem;
}
@media (max-width: 480px) { .score-pill { flex-basis: calc(50% - 0.3rem); max-width: none; } }
.score-pill-num { font-size: 1.3rem; font-weight: 800; line-height: 1.15; color: var(--band); font-variant-numeric: tabular-nums; }
.score-pill-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.band-green   { --band: #4f8a5b; --band-tint: #e8f2e6; --band-edge: #cfe3cb; }
.band-olive   { --band: #7d8a2a; --band-tint: #f0f2dc; --band-edge: #e0e5bd; }
.band-gold    { --band: #b8841a; --band-tint: #fbf1d8; --band-edge: #f0dfae; }
.band-orange  { --band: #cc6a26; --band-tint: #fbe7d6; --band-edge: #f3cfb0; }
.band-red     { --band: #b34a3a; --band-tint: #fbe8e4; --band-edge: #f2cbc4; }
.band-unknown { --band: var(--text-faint); --band-tint: var(--surface-alt); --band-edge: var(--border); }

/* ---------- Public report: issue cards ---------- */
.issue-list { display: flex; flex-direction: column; gap: 0.55rem; }
.issue-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-sm); padding: 0.6rem 0.85rem 0.65rem;
}
.issue-card.critical { border-left-color: var(--critical); }
.issue-card.warning { border-left-color: var(--warning); }
.issue-card.good { border-left-color: var(--good); }
.issue-card.needs-review { border-left-style: dashed; }
.issue-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.issue-head .sev-dot { margin-right: 0; }
.issue-title { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.005em; }
.issue-head .issue-badge, .issue-head .confidence-pill { margin-left: auto; }
.issue-badge { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.issue-badge.critical { background: var(--critical-bg); color: var(--critical); }
.issue-badge.warning { background: var(--warning-bg); color: var(--warning); }
.issue-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.5rem; font-size: 0.85rem; line-height: 1.4; margin-top: 0.15rem; }
.issue-label { color: #a39a88; font-weight: 500; font-size: 0.75rem; padding-top: 0.08rem; white-space: nowrap; }
@media (max-width: 480px) { .issue-row { grid-template-columns: 1fr; gap: 0; margin-top: 0.3rem; } }

.task-name a.task-link { color: var(--text); cursor: pointer; }
.task-name a.task-link:hover { color: var(--matcha-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Public report: page-load reveal ---------- */
/* Order and stagger come from each element's --i (70ms per step). */
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal 260ms ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

.next-step-card { padding: 0.95rem 1.1rem; }
.next-step-card .section-divider { margin: 0.7rem 0 0.6rem; }
.next-step-hint { margin: 0.1rem 0 0.5rem; font-size: 0.9rem; }
.next-step-facts { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; font-size: 0.88rem; color: var(--text-muted); }
.next-step-facts strong { color: var(--text); }

.cta-pfp { display: block; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin: 0 auto 0.6rem; border: 2px solid #fff; box-shadow: var(--shadow-sm); }

/* Background scan states */
.badge-loading { background: var(--warning-bg); color: var(--warning); display: inline-flex; align-items: center; gap: 0.4rem; }
.badge-ready { background: var(--good-bg); color: var(--good); }
.spinner { display: inline-block; width: 0.75em; height: 0.75em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -0.05em; margin-right: 0.35rem; }
.badge-loading .spinner { margin-right: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- CureTech Watch ---------- */
.tile-critical { --accent: var(--critical); --accent-bg: var(--critical-bg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0 0.2rem; }
.chip { font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--surface-sunken); color: var(--text-muted); }
.chip-ok { background: var(--good-bg); color: var(--good); }
.chip-missing { background: var(--critical-bg); color: var(--critical); }
.chip-off { opacity: 0.5; text-decoration: line-through; }


/* ---------- Public pages (landing + report) ---------- */
/* Higher-contrast text on cream (WCAG AA), calmer surfaces. Admin is unchanged. */
body.public {
  --text: #2b2822;
  --text-muted: #5f584c;
  --text-faint: #6b6356;
  --link: var(--matcha-deep);
  --panel: #f0eadb;
  --panel-border: #e6dfcd;
  --card-border: #e9e2d1;
  /* Motion system: buttons 160ms, cards 200ms, entrances 320ms, 55ms stagger, 10px rise. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 160ms;
  --dur-card: 200ms;
  --dur-in: 320ms;
  --stagger: 55ms;
  --rise: 10px;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
.public h1, .public h2, .public h3 { color: var(--text); }
.public h1, .lp-h2, .lp-final h2, .rp-cta h2 { text-wrap: balance; }
.public p { text-wrap: pretty; }
.public a { color: var(--link); }
.public a:focus-visible, .public summary:focus-visible, .public button:focus-visible { outline: 2px solid var(--matcha-deep); outline-offset: 3px; border-radius: 6px; }
.public .btn:focus-visible { border-radius: 12px; }
html { scroll-padding-top: 16px; }
.public .ico { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ct-tech { color: var(--matcha-dark); }

.pub-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--text) !important; }
.pub-brand:hover { text-decoration: none; }
.pub-brand img { display: block; }
.pub-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.pub-link .ico { transition: transform var(--dur) var(--ease); }
.pub-link:hover { text-decoration: none; }
.pub-link:hover .ico { transform: translateX(2px); }
.pub-foot { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 8px 0 40px; }
.pub-foot a { color: inherit; }
.pub-foot a:hover { color: var(--link); }

/* Buttons: gentle lift, tactile press. */
.public .btn { gap: 8px; border-radius: 12px; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.public .btn-primary { background: var(--matcha-deep); border-color: var(--matcha-deep); color: #fff; }
.public .btn-primary:hover { background: #384c28; border-color: #384c28; }
.public .btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(43, 40, 34, 0.12); }
.public .btn:active { transform: translateY(0) scale(0.985); box-shadow: none; transition-duration: 80ms; }
.public .btn-primary:active { background: #2f4021; border-color: #2f4021; }
.public .btn:disabled { cursor: progress; transform: none; box-shadow: none; }
.public .btn .ico { transition: transform var(--dur) var(--ease); }
.public .btn:hover .ico { transform: translateX(2px); }
.btn-lg { padding: 13px 22px; font-size: 1rem; font-weight: 600; }

/* Entrances. .rise plays on load (CSS only, so it never depends on JS);
   [data-reveal] waits for site.js to mark it .is-in when scrolled into view.
   Stagger comes from each element's --i. Fill mode "backwards" hands control
   back to normal styles afterwards, so hover transitions keep working. */
@keyframes pub-in { from { opacity: 0; transform: translateY(var(--rise, 10px)); } to { opacity: 1; transform: none; } }
.pub-intro, .rise { animation: pub-in var(--dur-in) var(--ease) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }
.js [data-reveal]:not(.is-in) { opacity: 0; }
.js [data-reveal].is-in { animation: pub-in var(--dur-in) var(--ease) backwards; animation-delay: calc(var(--i, 0) * var(--stagger)); }

/* ---------- Landing ---------- */
.lp { max-width: 1104px; margin: 0 auto; padding: 0 32px; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--card-border); }
.lp-nav-mail { color: var(--text-muted) !important; font-size: 0.95rem; transition: color var(--dur) var(--ease); }
.lp-nav-mail:hover { color: var(--link) !important; text-decoration: none; }

.lp-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; align-items: center; padding: 56px 0 64px; }
.lp h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 24px; max-width: 13em; }
.lp-mark { position: relative; white-space: nowrap; }
.lp-mark::after { content: ""; position: absolute; left: 4%; right: 0; bottom: -0.16em; height: 0.18em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8.5C50 3.5 120 2.5 198 6' fill='none' stroke='%237f9c5e' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%; }
.lp-lead { font-size: 1.15rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 32px; max-width: 32em; }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.lp-cta span { color: var(--text-muted); font-size: 0.95rem; }

.lp-sample { position: relative; margin: 0; isolation: isolate; background: var(--surface); border: 1px solid var(--card-border); border-radius: 18px; box-shadow: 0 1px 2px rgba(43, 40, 34, 0.04), 0 12px 32px rgba(43, 40, 34, 0.07); padding: 28px; max-width: 420px; justify-self: end; width: 100%; }
.lp-sample::before { content: ""; position: absolute; z-index: -1; inset: -36px -48px -40px -56px; border-radius: 48% 52% 46% 54% / 55% 48% 52% 45%; background: var(--matcha-light); opacity: 0.55; }
.lp-sample::after { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: var(--surface); }
.lp-sample-cap { margin: 0 0 6px; font-size: 0.85rem; color: var(--text-muted); }
.lp-sample h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 2px; }
.lp-sample-meta { margin: 0 0 16px; font-size: 0.92rem; color: var(--text-muted); }
.lp-sample ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.lp-sample li { counter-increment: s; border-top: 1px solid var(--border-soft); padding: 14px 0; font-size: 0.95rem; line-height: 1.5; }
.lp-sample li b { display: block; font-weight: 600; margin-bottom: 2px; }
.lp-sample li b::before { content: counter(s) ". "; color: var(--matcha-dark); }
.lp-sample li span { color: var(--text-muted); }
.lp-sample-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.lp-sample-price { margin: 0; }
.lp-sample-open { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; border: 0; background: none; color: var(--link); font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.lp-sample-open[hidden] { display: none; }
.lp-sample-open::after { content: ""; position: absolute; inset: 0; border-radius: 18px; } /* whole card is the target */
.lp-sample-open .ico { transition: transform var(--dur) var(--ease); }
.lp-sample-open:focus-visible { outline: none; }
.lp-sample-open:focus-visible::after { outline: 2px solid var(--matcha-deep); outline-offset: 3px; }
.lp-sample.is-interactive { cursor: pointer; transition: transform var(--dur-card) var(--ease), box-shadow var(--dur-card) var(--ease), border-color var(--dur-card) var(--ease); }
.lp-sample.is-interactive:hover { transform: translateY(-2px); border-color: #d9d0bb; box-shadow: 0 1px 2px rgba(43, 40, 34, 0.04), 0 16px 36px rgba(43, 40, 34, 0.09); }
.lp-sample.is-interactive:hover .lp-sample-open .ico { transform: translateX(2px); }
.lp-sample.is-interactive:active { transform: translateY(0); transition-duration: 80ms; }
.lp-sample-price strong { font-size: 1.1rem; }

.lp-h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin: 0; }
.lp-what .lp-h2::after, .lp-how .lp-h2::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 12px; border-radius: 2px; background: var(--matcha); }
.lp-panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 20px; }

.lp-what { padding: 32px 32px 32px; }
.lp-what .lp-h2 { margin-bottom: 24px; }
.lp-services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-services li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: center; gap: 4px 12px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 14px; padding: 24px; transition: border-color var(--dur-card) var(--ease), background-color var(--dur-card) var(--ease); }
/* Not clickable: no lift, no pointer, just a quiet acknowledgement. */
.lp-services li:hover { border-color: #ddd3bd; background: #fffdf8; }
.lp-services .ico { box-sizing: content-box; padding: 8px; border-radius: 10px; background: var(--matcha-tint); color: var(--matcha-dark); transition: transform var(--dur-card) var(--ease), background-color var(--dur-card) var(--ease); }
.lp-services li:hover .ico { transform: rotate(-6deg); background: var(--matcha-light); }
.lp-services h3 { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.lp-services p { grid-column: 1 / -1; align-self: start; margin: 12px 0 0; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

.lp-how { padding: 56px 32px; }
.lp-how .lp-h2 { margin-bottom: 28px; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.lp-steps li { position: relative; }
.lp-step-n { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 50%; background: var(--matcha-light); color: var(--matcha-deep); font-weight: 600; font-size: 0.92rem; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1px #d6e2c6; }
/* Connectors: a faint track (::before) and a matcha line (::after) that draws
   in segment by segment once the list is in view; each step's number fills as
   the line reaches it. Text is never hidden. */
.lp-steps li:not(:last-child)::before, .lp-steps li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: 44px; right: -20px; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--panel-border); }
.lp-steps li:not(:last-child)::after { background: var(--matcha); transform-origin: left center; }
.js .lp-steps li::after { transform: scaleX(0); }
.js .lp-steps .lp-step-n { transition: background-color 240ms var(--ease), color 240ms var(--ease), box-shadow 240ms var(--ease); transition-delay: calc(var(--i) * 260ms); }
.js .lp-steps.is-in li::after { transform: none; transition: transform 300ms var(--ease) calc(var(--i) * 260ms + 120ms); }
.lp-steps .lp-step-n, .js .lp-steps.is-in .lp-step-n { background: var(--matcha-deep); color: #fff; box-shadow: 0 0 0 4px var(--bg); }
.js .lp-steps:not(.is-in) .lp-step-n { background: var(--matcha-light); color: var(--matcha-deep); box-shadow: 0 0 0 1px #d6e2c6; }
.lp-steps h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.lp-steps p { margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.55; }

.lp-about { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 40px; align-items: center; padding: 32px 48px; }
.lp-about img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; box-shadow: 0 0 0 4px #fbf8f1, 0 0 0 5px var(--panel-border); }
.lp-about > div { border-left: 1px solid var(--panel-border); padding-left: 40px; max-width: 40em; }
.lp-about .lp-h2 { margin-bottom: 8px; }
.lp-about p { margin: 0 0 8px; color: var(--text-muted); }
.lp-about p:last-child { margin-bottom: 0; }

.lp-final { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; margin: 24px 0 32px; padding: 40px 48px; border-radius: 20px; background: var(--matcha-deep); color: #f6f2e8; }
.lp-final h2 { margin: 0 0 8px; color: #fff; font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.lp-final-text { flex: 1 1 auto; }
.lp-final-text p { margin: 0; color: #e3e9d9; max-width: 34em; }
.lp-final-alt { margin-top: 16px !important; }
.lp-final-alt a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lp-final.has-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 48px; }
.lp-form { display: grid; gap: 16px; padding: 24px; border-radius: 16px; background: #fbf8f1; color: var(--text); }
.lp-field label { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 600; }
.lp-field label span { color: var(--text-muted); font-weight: 400; }
.lp-field input, .lp-field textarea { display: block; width: 100%; padding: 11px 14px; font: inherit; font-size: 1rem; color: var(--text); background: #fff; border: 1px solid #d6ccb7; border-radius: 10px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.lp-field textarea { resize: vertical; min-height: 84px; }
.lp-field input::placeholder { color: #8a8172; }
.lp-field input:hover, .lp-field textarea:hover { border-color: #b9ae96; }
.lp-field input:focus, .lp-field textarea:focus { outline: none; border-color: var(--matcha-deep); box-shadow: 0 0 0 3px rgba(67, 90, 48, 0.22); }
.lp-field [aria-invalid="true"] { border-color: #b34a3a; }
.lp-field [aria-invalid="true"]:focus { border-color: #b34a3a; box-shadow: 0 0 0 3px rgba(179, 74, 58, 0.18); }
.lp-err { margin: 6px 0 0; color: #9b3b2d; font-size: 0.92rem; }
.lp-form-alert { padding: 10px 14px; border-radius: 10px; background: var(--critical-bg); color: #7a2f24; font-size: 0.95rem; }
.lp-form .btn { justify-content: center; }
/* Label and "Sending" share one grid cell, so the button never changes size. */
.lp-submit { display: grid; place-items: center; }
.lp-submit > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; transition: opacity var(--dur) var(--ease); }
.lp-submit-busy { opacity: 0; }
.is-busy .lp-submit-label { opacity: 0; }
.is-busy .lp-submit-busy { opacity: 1; }
.lp-spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.lp-form-alert[hidden], .lp-err[hidden] { display: none; }
.lp-sent { align-content: center; justify-items: center; text-align: center; }
.lp-sent h3:focus { outline: none; }
.lp-sent.is-new > * { animation: pub-in var(--dur-in) var(--ease) backwards; }
.lp-sent.is-new > :nth-child(2) { animation-delay: var(--stagger); }
.lp-sent.is-new > :nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.lp-form-note { margin: -4px 0 0; color: var(--text-muted); font-size: 0.9rem; text-align: center; }
.lp-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lp-sent { gap: 8px; }
.lp-sent-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--matcha-light); color: var(--matcha-deep); }
.lp-sent h3 { margin: 4px 0 0; font-size: 1.2rem; }
.lp-sent p { margin: 0; color: var(--text-muted); }
.lp-final-btn { flex: none; background: #f6f2e8; border-color: #f6f2e8; color: var(--matcha-deep) !important; }
.public .lp-final-btn:hover { background: #fff; border-color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.lp-final a:focus-visible { outline-color: #f6f2e8; }

@media (max-width: 960px) {
  .lp-steps { grid-template-columns: 1fr; gap: 0; }
  .lp-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 24px; }
  .lp-step-n { margin: 0; }
  .lp-steps h3 { margin-top: 4px; }
  .lp-steps li:last-child { padding-bottom: 0; }
  .lp-steps li:not(:last-child)::before, .lp-steps li:not(:last-child)::after { top: 40px; bottom: 4px; left: 16px; right: auto; width: 2px; height: auto; margin: 0 0 0 -1px; }
  .lp-steps li:not(:last-child)::after { transform-origin: center top; }
  .js .lp-steps li::after { transform: scaleY(0); }
}
@media (max-width: 820px) {
  .lp { padding: 0 20px; }
  .lp-hero { grid-template-columns: 1fr; gap: 48px; padding: 40px 0 56px; }
  .lp-sample { justify-self: stretch; max-width: none; }
  .lp-sample::before { inset: -20px -12px -24px -12px; }
  .lp-services { grid-template-columns: 1fr; gap: 12px; }
  .lp-what { padding: 24px 16px 16px; }
  .lp-what .lp-h2 { padding: 0 4px; margin-bottom: 20px; }
  .lp-how { padding: 48px 4px; }
  .lp-how .lp-h2 { margin-bottom: 24px; }
  .lp-about { grid-template-columns: 96px minmax(0, 1fr); gap: 28px; padding: 28px; }
  .lp-about img { width: 96px; height: 96px; }
  .lp-about > div { padding-left: 28px; }
  .lp-final { flex-direction: column; align-items: stretch; padding: 32px 24px; }
  .lp-final.has-form { grid-template-columns: 1fr; gap: 24px; padding: 28px 16px 16px; }
  .lp-final.has-form .lp-final-text { padding: 0 8px; }
  .lp-form { padding: 20px; }
  .lp-final-btn { justify-content: center; }
}
@media (max-width: 600px) {
  .lp-about { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px; }
  .lp-about img { width: 88px; height: 88px; }
  .lp-about > div { border-left: 0; padding-left: 0; }
}
@media (max-width: 480px) {
  .lp-nav-mail { font-size: 0.88rem; }
  .lp-cta .btn { width: 100%; justify-content: center; }
  .lp-cta span { width: 100%; text-align: center; }
  .lp-sample { padding: 22px; }
}

/* Sample report dialog (homepage). Illustrative content only. */
.lp-dialog { width: min(660px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--card-border); border-radius: 20px; background: var(--bg); color: var(--text); box-shadow: 0 24px 64px rgba(43, 40, 34, 0.2); overflow: auto; overscroll-behavior: contain; }
.lp-dialog::backdrop { background: rgba(43, 40, 34, 0.42); }
.lp-dialog[open] { animation: dialog-in 240ms var(--ease); }
.lp-dialog[open]::backdrop { animation: fade-in 240ms var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
@keyframes fade-in { from { opacity: 0; } }
html:has(.lp-dialog[open]) { overflow: hidden; }
.lp-dialog-body { padding: 16px 28px 28px; }
.lp-dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.lp-dialog-bar .lp-sample-cap { margin: 0; }
.lp-dialog-x { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.lp-dialog-x:hover { background: var(--surface-alt); color: var(--text); }
.lp-dialog h2 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin: 0 0 20px; }
.lp-dialog .rp-summary { margin-bottom: 16px; }
.lp-dialog .rp-summary h3 { font-size: 1.2rem; font-weight: 700; color: var(--matcha-deep); margin: 0; line-height: 1.3; }
.lp-dialog .rp-issues { margin-bottom: 16px; }
.lp-dialog-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: 16px; background: var(--matcha-tint); border: 1px solid #dfe8d3; }
.lp-dialog-offer .rp-price { margin: 0; }

/* ---------- Public report ---------- */
.rp { max-width: 920px; margin: 0 auto; padding: 32px 32px 0; }
.rp h2, .rp h3 { letter-spacing: -0.015em; }
.rp-head { margin-bottom: 32px; }
.rp-head .pub-brand { margin-bottom: 40px; }
.rp-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.75rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 12px; max-width: 20ch; overflow-wrap: break-word; }
.rp-meta { margin: 0; color: var(--text-muted); font-size: 1.02rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.rp-summary { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 20px; background: var(--matcha-light); border: 1px solid #d9e4c9; border-radius: 16px; }
.rp-summary-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--matcha-deep); }
.rp-summary h2 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); font-weight: 700; color: var(--matcha-deep); margin: 0; line-height: 1.3; }
.rp-summary p { margin: 2px 0 0; color: var(--text-muted); }
.rp-note { margin-top: 12px !important; padding: 12px 16px; border-radius: 10px; background: var(--warning-bg); color: var(--text) !important; }

.rp-issues { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 16px; }
.rp-issue { background: var(--surface); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(43, 40, 34, 0.03); overflow: hidden; }
.rp-issue-head { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 26px 32px 24px 28px; }
.rp-issue-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-alt); color: var(--matcha-deep); }
.rp-issue.urgent .rp-issue-ico { background: var(--critical-bg); color: var(--critical); }
.rp-issue h3, .rp-issue h4 { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; margin: 8px 0 8px; font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem); font-weight: 650; line-height: 1.3; }
.rp-issue :is(h3, h4) > span:nth-child(2) { flex: 1 1 9em; min-width: 0; }
.rp-num { flex: none; display: grid; place-items: center; min-width: 24px; height: 24px; margin-top: 2px; padding: 0 6px; border-radius: 7px; background: var(--matcha-deep); color: #fff; font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-tag { flex: none; align-self: center; padding: 2px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--text-muted); font-size: 0.82rem; font-weight: 500; letter-spacing: 0; }
.rp-tag.urgent { background: var(--critical-bg); color: #9b3b2d; }
.rp-found { margin: 0; max-width: 62ch; color: var(--text); font-size: 1.05rem; line-height: 1.6; overflow-wrap: anywhere; }
.rp-issue-more { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; background: #fcfaf5; border-top: 1px solid var(--border-soft); font-size: 1rem; line-height: 1.6; }
.rp-issue-more > div { padding: 18px 28px 24px; }
.rp-issue-more > div:first-child { padding-left: 88px; }
.rp-issue-more > div + div { border-left: 1px solid var(--border-soft); }
.rp-issue-more dt { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--text-muted); font-size: 0.88rem; font-weight: 600; letter-spacing: 0.01em; }
.rp-issue-more dt .ico { color: var(--matcha-dark); }
.rp-issue-more dd { margin: 0; color: var(--text-muted); }
.rp-issue-more .rp-fix { background: #f6f9f1; }
.rp-issue-more .rp-fix dt { color: var(--matcha-deep); }
.rp-issue-more .rp-fix dd { color: var(--text); }
.rp-issue.urgent .rp-why dt .ico { color: var(--critical); }

/* Disclosures: native <details>; where supported the content eases open
   (interpolate-size), elsewhere it simply appears. No height measuring. */
.rp-evidence, .rp-details { interpolate-size: allow-keywords; }
.rp-evidence::details-content, .rp-details::details-content { block-size: 0; overflow: hidden; transition: block-size 220ms var(--ease), content-visibility 220ms allow-discrete; }
.rp-evidence[open]::details-content, .rp-details[open]::details-content { block-size: auto; }
.rp-evidence summary .ico, .rp-details summary .ico { transform: rotate(-90deg); transition: transform var(--dur-card) var(--ease); }
.rp-evidence[open] summary .ico, .rp-details[open] summary .ico { transform: none; }
.rp-evidence { border-top: 1px solid var(--border-soft); }
.rp-evidence summary { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 6px 0 6px 78px; padding: 6px 10px; border-radius: 8px; color: var(--text-muted); font-size: 0.92rem; font-weight: 500; cursor: pointer; list-style: none; transition: color var(--dur) var(--ease); }
.rp-evidence summary::-webkit-details-marker { display: none; }
.rp-evidence summary:hover { color: var(--text); }
.rp-evidence p { margin: 0; padding: 2px 28px 18px 88px; }
.rp-evidence code { display: block; padding: 10px 14px; border-radius: 10px; background: var(--surface-alt); color: var(--text); font-size: 0.88rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

.rp-cta { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 32px; align-items: center; padding: 36px 40px; margin: 32px 0 48px; background: #eef4e6; border: 1px solid #d5e2c4; border-radius: 20px; box-shadow: 0 1px 2px rgba(43, 40, 34, 0.04), 0 10px 28px rgba(67, 90, 48, 0.07); }
.rp-cta:not(:has(.rp-pfp)) { grid-template-columns: 1fr; }
.rp-pfp { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; box-shadow: 0 0 0 4px #f6f9f1, 0 0 0 5px #d5e2c4; }
.rp-cta h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); font-weight: 700; letter-spacing: -0.025em; margin: 0 0 8px; line-height: 1.2; }
.rp-cta p { margin: 0 0 8px; max-width: 38em; }
.rp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 6px !important; }
.rp-price span { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.rp-price strong { color: var(--matcha-deep); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rp-watch { margin: 20px 0 0 !important; padding-top: 16px; border-top: 1px solid #d5e2c4; font-size: 0.9rem; }
.public .rp-action .btn:hover .ico { transform: none; }
.rp-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 20px !important; }
.rp-action span { color: var(--text-muted); font-size: 0.95rem; }
.rp-quiet { color: var(--text-muted); font-size: 0.95rem; }

.rp-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; margin-bottom: 40px; }
.rp-split.solo { grid-template-columns: 1fr; }
.rp-split > section + section { border-left: 1px solid var(--card-border); padding-left: 48px; }
.rp-split h2, .rp-section h2 { font-size: 1.15rem; font-weight: 650; margin: 0 0 12px; }
.rp-split .rp-quiet { margin: -6px 0 16px; }
.rp-good { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rp-good li { display: flex; gap: 12px; align-items: flex-start; }
.rp-good-ico { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--good-bg); color: var(--good); }
.rp-scores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; padding: 4px 16px; }
.rp-scores li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; min-width: 0; border-top: 1px solid var(--border-soft); }
.rp-scores li:nth-child(-n+3) { border-top: 0; }
.rp-scores li.rp-score-main { grid-column: 1 / -1; padding: 10px 0 9px; border-bottom: 1px solid var(--border-soft); }
.rp-scores b { color: var(--text); font-size: 0.98rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-scores span { color: var(--text-muted); font-size: 0.92rem; line-height: 1.35; }
.rp-scores .rp-score-main span { color: var(--text); font-weight: 600; }
.rp-scores .rp-score-main b { font-size: 1.15rem; }
.rp-section { margin-bottom: 40px; }

.rp-details { margin-bottom: 32px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 14px; }
.rp-details summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none; border-radius: 14px; transition: background-color var(--dur) var(--ease); }
.rp-details summary::-webkit-details-marker { display: none; }
.rp-details summary .ico { color: var(--text-muted); }
.rp-details summary:hover { background: #fbf9f4; }
.rp-details[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.rp-details table { width: calc(100% - 40px); margin: 0 20px 16px; border-collapse: collapse; font-size: 0.92rem; }
.rp-details th, .rp-details td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-top: 1px solid var(--border-soft); }
.rp-details th { width: 11rem; color: var(--text-muted); font-weight: 500; font-size: inherit; text-transform: none; letter-spacing: normal; background: none; }
.rp-details td { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .rp { padding: 24px 20px 0; }
  .rp-head .pub-brand { margin-bottom: 28px; }
  .rp-summary { align-items: flex-start; padding: 18px; }
  .rp-issue-head { grid-template-columns: 1fr; gap: 0; padding: 20px 20px 18px; }
  .rp-issue-ico { display: none; }
  .rp-issue h3 { margin-top: 0; }
  .rp-found { font-size: 1rem; }
  .rp-issue-more { grid-auto-flow: row; }
  .rp-issue-more > div, .rp-issue-more > div:first-child { padding: 16px 20px; }
  .rp-issue-more > div + div { border-left: 0; border-top: 1px solid var(--border-soft); }
  .rp-cta { grid-template-columns: 1fr; gap: 16px; padding: 24px 20px; margin-top: 24px; }
  .rp-pfp { width: 64px; height: 64px; }
  .rp-action .btn { flex: 1 1 100%; justify-content: center; }
  .rp-split { grid-template-columns: 1fr; gap: 32px; }
  .rp-split > section + section { border-left: 0; padding-left: 0; }
  .rp-evidence summary { margin: 6px 0 6px 10px; }
  .rp-evidence p { padding: 0 20px 16px; }
  .rp-price strong { font-size: 1.75rem; }
  .lp-dialog-body { padding: 12px 16px 16px; }
  .lp-dialog-offer { padding: 16px; }
  .lp-dialog-offer .btn { flex: 1 1 100%; justify-content: center; }
  .rp-details table, .rp-details tbody, .rp-details tr, .rp-details th, .rp-details td { display: block; width: auto; }
  .rp-details table { margin: 0 20px 12px; }
  .rp-details tr { padding: 10px 0; border-top: 1px solid var(--border-soft); }
  .rp-details th, .rp-details td { padding: 0; border: 0; }
}

@media (max-width: 480px) {
  .rp-scores { grid-template-columns: 1fr; }
  .rp-scores li:nth-child(3) { border-top: 1px solid var(--border-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .pub-intro, .rise, .js [data-reveal].is-in, .lp-sent.is-new > *, .lp-dialog[open], .lp-dialog[open]::backdrop, .lp-spin { animation: none; }
  .js [data-reveal]:not(.is-in) { opacity: 1; }
  .public .btn, .public .btn .ico, .pub-link .ico, .lp-field input, .lp-field textarea, .rp-details summary, .lp-nav-mail,
  .lp-sample.is-interactive, .lp-sample-open .ico, .lp-services li, .lp-services .ico, .lp-dialog-x, .lp-submit > span,
  .rp-evidence summary, .rp-evidence summary .ico, .rp-details summary .ico, .js .lp-steps .lp-step-n, .js .lp-steps.is-in li::after { transition: none; }
  .rp-evidence::details-content, .rp-details::details-content { transition: none; }
  .public .btn:hover, .public .btn:active, .lp-sample.is-interactive:hover, .lp-services li:hover .ico { transform: none; }
  .public .btn:hover .ico, .pub-link:hover .ico, .lp-sample.is-interactive:hover .lp-sample-open .ico { transform: none; }
}

@media print {
  body.public { background: #fff; }
  .public *, .public *::before, .public *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1 !important; }
  .rp { max-width: none; padding: 0; }
  .rp-evidence::details-content, .rp-details::details-content { block-size: auto; content-visibility: visible; }
  .rp-evidence summary .ico, .rp-details summary .ico { display: none; }
  .rp-cta { box-shadow: none; }
  .rp-summary, .rp-cta { background: #fff; border-color: #ccc; }
  .rp-issue, .rp-cta, .rp-scores li, .rp-details { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  .rp-action .btn { display: none; }
  .pub-foot a { color: inherit; }
}
