/* clinic-monitor shared design tokens + component primitives.
 *
 * Used by every public + portal page. Brand accent colour is set
 * per-page via inline `<style>:root { --accent: #... }</style>` because
 * it's partner-branded in the portal — the rest is constant.
 *
 * Do not duplicate these primitives in page-specific styles. If a
 * primitive doesn't exist here yet, add it here, not inline. */

:root {
  /* Neutrals + semantic colours (Tailwind slate ramp).
     New palette: light slate page, white inset cards, deep slate ink,
     indigo accent used sparingly for highlights only. Black is the
     dominant interaction colour (CTAs, primary surfaces) — Cal.com /
     Airmeet / Ion-style monochrome confidence rather than the previous
     cream + dull teal "wellness brand" look. */
  --ink: #0F172A;        /* slate-900 — primary type */
  --muted: #64748B;      /* slate-500 — secondary type */
  --line: #E2E8F0;       /* slate-200 — hairlines */
  --bg: #F1F5F9;         /* slate-100 — outer page bg */
  --card: #ffffff;       /* white — hero / form stage card */
  --critical: #DC2626;   /* red-600 */
  --high: #EA580C;       /* orange-600 */
  --medium: #CA8A04;     /* yellow-600 */
  --low: #16A34A;        /* green-600 */
  --info: #475569;       /* slate-600 */
  --accent: #0F766E;            /* teal-700 — primary brand colour */
  --accent-hover: #0D9488;      /* teal-600 */
  --accent-tint: #F0FDFA;       /* teal-50 */
  --accent-tint-strong: #CCFBF1; /* teal-100 */
  --accent-on-tint: #115E59;    /* teal-800 */
  /* Primary CTA is teal — distinct from the black-CTA Cal.com pattern
     and the purple herd of monitoring SaaS. Health-tech adjacent
     without being clinical. */
  --btn-primary-bg: #0F766E;    /* teal-700 */
  --btn-primary-hover: #0D9488; /* teal-600 */
  /* Dark inverted surface (ROI tile, hero accents) uses a deep
     near-teal-black rather than pure ink. */
  --surface-dark: #134E4A;      /* teal-900 */

  /* Border radius — locked to 3 values. Bumped from 6/8 to 10/14 to
     match the softer modern-SaaS feel of the landing page mockups. */
  --radius-sm: 10px;    /* buttons, inputs, chips, smaller cards */
  --radius-md: 14px;    /* finding cards, larger cards */
  --radius-full: 999px; /* pills, severity badges, status dots */

  /* Type scale — 7 stops covering 11px to 34px. Round all inline sizes
     to the nearest stop. Numbers (table cells, KPI values) get
     tabular figures via .num-tabular or font-variant-numeric. */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 32px;
  --text-3xl: 40px;
}

/* Tabular figures — stops digits from jumping width as they change.
   Applied automatically to tables, KPI tile values, and the
   .num-tabular helper for inline counts. */
table th, table td,
.kpi .value, .num-tabular,
.sev { font-variant-numeric: tabular-nums; }

* { box-sizing: border-box; }

/* Typography — Geist Sans for body + Instrument Serif for accent quotes.
 * Geist is Vercel's open-source variable font; Instrument Serif is a
 * distinctive low-contrast display serif (Google Fonts) used sparingly
 * for an emphasis word in headings. Pairing breaks out of the
 * default-system-font "AI template" aesthetic. */
body {
  margin: 0;
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss03', 'ss01';
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.serif-accent {
  font-family: 'Instrument Serif', 'Times New Roman', serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
}

/* Section eyebrow chip — small pill with a leading accent dot, sits
   above an H1 or section heading to set context. Pulled from the
   landing page so every portal page can use the same pattern. */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; color: var(--ink);
  margin: 0 0 14px;
}
.section-eyebrow::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

/* Proof chip — same shape but tinted teal, used to highlight a stat
   or proof point. Stronger visual weight than the neutral eyebrow. */
.proof-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: var(--accent-tint);
  border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  margin: 0 0 18px;
}
.proof-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.proof-chip b { font-weight: 700; color: var(--ink); }

/* Filter chip — used in lists where the user can narrow by a few enum
   values. Pill-shaped button, active state inverts to accent. Count
   pills use the existing .meta class. */
.filter-chip {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-chip:hover { border-color: var(--ink); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-chip.active .meta { color: rgba(255,255,255,0.8); }
.filter-chip .meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

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

h1 { font-size: var(--text-2xl); margin: 0 0 4px; letter-spacing: -0.022em; font-weight: 700; }
h2 { font-size: 18px; margin: 28px 0 12px; letter-spacing: -0.012em; font-weight: 600; }

/* ── Display typography (marketing/hero surfaces) ──────────────
 * Pages add `class="display"` on h1 / .lead / .eyebrow to opt in
 * to the larger, tighter-tracked hero treatment. Portal stays on
 * the dense h1 above. */
h1.display {
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 18ch;
}
@media (max-width: 720px) {
  h1.display { font-size: 36px; letter-spacing: -0.025em; }
}
.lead.display {
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 0 40px;
}
.eyebrow.display {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 80px 24px 64px;
}
@media (max-width: 720px) {
  .hero-shell { padding: 56px 24px 48px; }
}

/* ── Layout ────────────────────────────────────────────────── */
.sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.meta { color: var(--muted); font-size: 13px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ── Cards ─────────────────────────────────────────────────── *
 * Linear/Vercel-style soft elevation: an inset 0-0-0-1px shadow
 * gives a hairline edge that reads softer than a solid border, and
 * the 0-1-2 outer adds barely-perceptible lift against the cream bg.
 * Removes the boxy "outline-style" feel that 1px solid borders had. */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 0 0 16px;
  box-shadow: 0 0 0 1px rgba(14, 22, 32, 0.05),
              0 1px 2px rgba(14, 22, 32, 0.04);
}

/* ── KPI tiles ─────────────────────────────────────────────── */
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 28px;
}
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 0 0 1px rgba(14, 22, 32, 0.05),
              0 1px 2px rgba(14, 22, 32, 0.04);
}
.kpi .label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi .value { font-size: 30px; font-weight: 700; margin: 6px 0 0; line-height: 1; }
.kpi .sub2 { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ── Tables ────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
th {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }
tr.clickable:hover { background: #f9fbfc; cursor: pointer; }

/* ── Severity badges ──────────────────────────────────────────
 * Linear/Stripe-style quiet chip: small coloured dot + sentence-case
 * label, subtle tint + hairline border. Drops the previous all-caps
 * pastel pill which read as loud across mixed-severity dashboards.
 * The dot keeps the colour-cue strong while the label de-emphasises. */
.sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid;
  line-height: 1.4;
}
.sev::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  flex-shrink: 0;
}
.sev.critical { color: var(--critical); border-color: #f3c2bb; background: #fdf2f0; }
.sev.high     { color: var(--high);     border-color: #f5d8b5; background: #fdf8f1; }
.sev.medium   { color: #6b5300;         border-color: #ead9a8; background: #fbf6e6; }
.sev.low      { color: var(--low);      border-color: #c7e0b5; background: #f3f8ee; }
.sev.info     { color: var(--info);     border-color: #d3dae3; background: #f4f6f8; }
.sev.suggestion { color: #4a5b73; border-color: #c8d1de; background: #eef2f7; }

/* ── Buttons ───────────────────────────────────────────────── *
 * Default .btn is a black solid pill, Cal.com / Airmeet style. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--btn-primary-bg);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: var(--btn-primary-hover); text-decoration: none; color: white; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.ghost:hover { background: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--accent);
  text-decoration: none;
  background: white;
  margin-right: 6px;
}
.pill-link:hover { background: var(--accent-tint); }

/* ── Forms ─────────────────────────────────────────────────── */
.input, input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  font-family: inherit;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
label.field, .field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 5px;
}
label.field .req, .field.req::after, .req { color: var(--critical); }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }

/* ── Findings (per-clinic card list) ───────────────────────── *
 * Same elevation as .card, plus a 4px severity-coloured left bar
 * as the hierarchy cue. Hover lifts the shadow slightly for cards
 * inside <a> tags. */
.finding {
  background: var(--card);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 0 0 10px;
  box-shadow: 0 0 0 1px rgba(14, 22, 32, 0.05),
              0 1px 2px rgba(14, 22, 32, 0.04);
}
a > .finding:hover, .finding-link:hover .finding {
  box-shadow: 0 0 0 1px rgba(14, 22, 32, 0.08),
              0 2px 6px rgba(14, 22, 32, 0.06);
}
.finding.critical { border-left-color: var(--critical); }
.finding.high     { border-left-color: var(--high); }
.finding.medium   { border-left-color: var(--medium); }
.finding.low      { border-left-color: var(--low); }
.finding.info     { border-left-color: var(--info); }
.finding h3 { margin: 0 0 6px; font-size: 15px; }
.finding .note { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

/* ── Status dots ──────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green { background: var(--low); }
.status-dot.amber { background: #d4a017; }
.status-dot.red   { background: var(--critical); }
.status-dot.grey  { background: #b5bec9; }

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.channel-row:last-child { border-bottom: none; }

/* ── Site chrome: header + footer ──────────────────────────── *
 * Used on /, /partners, /showcase, /results/<id>. Portal has its
 * own internal nav and doesn't include these.
 *
 * Header sits flush on white so it contrasts the cream body.
 * Footer is darker ink-tinted so the page has a real visual
 * "bottom" instead of trailing off into cream. */
.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--ink); opacity: 0.85; }
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-mark svg {
  color: #2dd4bf;
  overflow: visible;
}
/* Faint always-on baseline so the mark reads as an ECG screen even
   between sweeps — keeps the silhouette legible at 22px nav scale. */
.brand-mark .brand-track {
  stroke: rgba(45, 212, 191, 0.18);
}
/* The trace itself — draws left-to-right on each loop, then fades and
   redraws (like a real heart monitor capturing a beat). */
.brand-mark .brand-ecg {
  stroke: currentColor;
  filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.55));
  stroke-dasharray: 40 40;
  stroke-dashoffset: 40;
  animation: brand-pulse-sweep 2.6s linear infinite;
}
@keyframes brand-pulse-sweep {
  0%   { stroke-dashoffset: 40; opacity: 1; }
  58%  { stroke-dashoffset: 0;  opacity: 1; }
  82%  { stroke-dashoffset: 0;  opacity: 1; }
  92%  { stroke-dashoffset: -10; opacity: 0; }
  93%  { opacity: 0; }
  100% { stroke-dashoffset: 40; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark .brand-ecg { animation: none; stroke-dashoffset: 0; }
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
}
.nav-link:hover { color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--ink); font-weight: 600; }
.site-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.nav-signin {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.nav-signin:hover { color: var(--accent); text-decoration: none; }
.nav-btn {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--btn-primary-bg);
  color: #fff;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-btn:hover { background: var(--btn-primary-hover); color: #fff; text-decoration: none; }
@media (max-width: 760px) {
  .site-header-inner { gap: 16px; padding: 14px 18px; }
  .site-nav { display: none; }
  .nav-signin { display: none; }
}

.site-footer {
  background: #0e1620;
  color: #c1cad6;
  margin-top: 96px;
}
.site-footer a { color: #c1cad6; }
.site-footer a:hover { color: #ffffff; text-decoration: none; }
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
}
@media (max-width: 760px) {
  .site-footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px 24px; }
}
.footer-brand .brand-footer { color: #ffffff; font-size: 17px; }
.footer-brand .brand-footer svg { color: var(--accent); overflow: visible; }
.footer-brand .brand-footer .brand-track { stroke: currentColor; opacity: 0.22; }
.footer-brand .brand-footer .brand-ecg {
  stroke: currentColor;
  stroke-dasharray: 40 40;
  stroke-dashoffset: 40;
  animation: brand-pulse-sweep 2.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .footer-brand .brand-footer .brand-ecg { animation: none; stroke-dashoffset: 0; }
}
.footer-tag {
  font-size: 13px;
  color: #8a96a6;
  max-width: 32ch;
  margin: 14px 0 0;
  line-height: 1.55;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 520px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
.footer-col h4 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a96a6;
  margin: 0 0 14px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  font-size: 14px;
  margin: 0 0 10px;
  text-decoration: none;
}
.site-footer-base {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: #6a7585;
  flex-wrap: wrap;
}

/* ── Section banding ───────────────────────────────────────────
 * Marketing pages alternate between cream (page bg) and white
 * full-width sections so the page reads as a series of bands
 * instead of one flat slab. Use .band-white to opt in. */
.band-white {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.band-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px;
}

/* ── Inline code ───────────────────────────────────────────── */
code {
  background: #f4f6f8;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
pre {
  background: #f4f6f8;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }
