/* ─── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #1d4ed8;
  --blue-light:  #dbeafe;
  --blue-mid:    #3b82f6;
  --surface:     #f8fafc;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --border-soft: #f1f5f9;
  --text:        #0f172a;
  --text-2:      #334155;
  --text-3:      #64748b;
  --text-4:      #94a3b8;
  /* Risk-band palette — blue / amber / red (not green/red: colour-vision safe) */
  --band-low:    #2563EB;
  --band-low-bg: #eff6ff;
  --band-mod:    #D97706;
  --band-mod-bg: #fffbeb;
  --band-high:   #DC2626;
  --band-high-bg:#fef2f2;
  --band-grey:   #475569;
  --band-grey-bg:#f1f5f9;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 32px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   18px;
  --transition:  .18s ease;
}

html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--surface); color: var(--text); line-height: 1.5; min-height: 100vh; }

a { color: var(--blue); }

/* ─── Top navigation ───────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 120;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 2rem;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.nav-brand .logo-mark { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; }
.nav-brand-text .brand-name { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.nav-brand-text .brand-sub  { font-size: .72rem; color: var(--text-3); margin-top: 1px; }

.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  padding: .45rem .8rem; border-radius: var(--radius-sm);
  font-size: .87rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; cursor: pointer; transition: var(--transition);
  background: none; border: none; font-family: inherit;
}
.nav-link:hover { color: var(--blue); background: var(--blue-light); }
.nav-cta {
  padding: .5rem 1.1rem; background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: inherit; font-size: .87rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); box-shadow: 0 2px 8px rgba(29,78,216,.25);
}
.nav-cta:hover { background: #1e40af; }

/* ─── Hero / Overview ──────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 78% -10%, #e0ecff 0%, rgba(224,236,255,0) 60%),
    radial-gradient(900px 420px at 8% 110%, #eef4ff 0%, rgba(238,244,255,0) 55%),
    linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 4rem 1.5rem 3.5rem; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem;
  border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 1.3rem;
}
.hero-eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-mid); }
.hero h1 { font-size: 2.5rem; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; color: var(--text); max-width: 20ch; }
.hero h1 .accent { color: var(--blue); }
.hero-lead { margin-top: 1.2rem; font-size: 1.06rem; line-height: 1.6; color: var(--text-2); max-width: 46rem; }
.hero-fullname { margin-top: .8rem; font-size: .9rem; color: var(--text-3); font-style: italic; }
.hero-actions { margin-top: 2rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.btn-hero-primary {
  padding: .85rem 1.8rem; background: var(--blue); color: #fff; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: .98rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: .55rem; box-shadow: 0 6px 20px rgba(29,78,216,.35); transition: var(--transition);
}
.btn-hero-primary:hover { background: #1e40af; transform: translateY(-1px); }
.btn-hero-ghost {
  padding: .85rem 1.5rem; background: var(--card); color: var(--text-2);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: .98rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.btn-hero-ghost:hover { border-color: var(--blue-mid); color: var(--blue); }
.hero-stats { margin-top: 2.5rem; display: flex; gap: 2.5rem; flex-wrap: wrap; }
.hero-stat .num { font-size: 1.7rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.hero-stat .lbl { font-size: .8rem; color: var(--text-3); margin-top: 2px; }

/* ─── Generic content section ──────────────────────────────────────────────── */
.site-section { max-width: 1080px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-band { background: linear-gradient(180deg, var(--surface), #fff); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); margin-bottom: .6rem; }
.section-head h2 { font-size: 1.85rem; font-weight: 700; letter-spacing: -.025em; color: var(--text); }
.section-head p  { margin-top: .7rem; font-size: 1rem; line-height: 1.6; color: var(--text-2); }

/* ─── Methodology ──────────────────────────────────────────────────────────── */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.method-step { position: relative; padding-left: 3.2rem; }
.method-step .num-badge {
  position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--text); color: #fff; font-weight: 700;
}
.method-step h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.method-step p  { font-size: .88rem; line-height: 1.55; color: var(--text-3); }

.disclaimer-box {
  margin-top: 2.5rem; padding: 1.25rem 1.5rem; display: flex; gap: .9rem; align-items: flex-start;
  background: var(--blue-light); border: 1px solid #bfdbfe; border-radius: var(--radius);
  font-size: .9rem; line-height: 1.6; color: #1e3a8a;
}
.disclaimer-box svg { flex-shrink: 0; margin-top: 2px; }
.disclaimer-box strong { color: #1e3a8a; }

/* ─── Predicted outcomes ───────────────────────────────────────────────────── */
.outcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.outcome-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm); transition: var(--transition);
  display: flex; flex-direction: column;
}
.outcome-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--blue-mid); }
.outcome-card-logo { width: 46px; height: 46px; object-fit: contain; margin-bottom: 1rem; }
.outcome-card h3 { font-size: 1.04rem; font-weight: 600; }
.outcome-card p  { margin-top: .5rem; font-size: .88rem; line-height: 1.55; color: var(--text-3); flex: 1; }
.outcome-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-link {
  display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .78rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  text-decoration: none; transition: var(--transition);
}
.btn-link:hover { border-color: var(--blue-mid); color: var(--blue); }

/* ─── Calculator ───────────────────────────────────────────────────────────── */
.calc-wrap { background: var(--surface); }
.app-main { max-width: 960px; margin: 0 auto; padding: 0 1.5rem 4rem; }

.calc-notice { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.25rem; padding: 1rem 1.15rem; background: var(--band-mod-bg); border: 1px solid #fcd7a1; border-left: 4px solid var(--band-mod); border-radius: var(--radius); color: #7c2d12; font-size: .9rem; line-height: 1.55; }
.calc-notice svg { flex-shrink: 0; color: var(--band-mod); margin-top: 1px; }
.calc-notice strong { color: #7c2d12; }

/* Hover/focus warning badge with tooltip (used on underpowered outcome cards) */
.warn-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; color: var(--band-mod); cursor: help; vertical-align: middle; margin-left: .4rem; }
.warn-badge svg { display: block; }
.warn-badge .tip { visibility: hidden; opacity: 0; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 260px; max-width: 78vw; background: var(--text); color: #fff; font-size: .78rem; font-weight: 400; line-height: 1.45; text-align: left; padding: .6rem .75rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); z-index: 50; transition: opacity .15s; pointer-events: none; }
.warn-badge .tip::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--text); }
.warn-badge:hover .tip, .warn-badge:focus .tip, .warn-badge:focus-within .tip { visibility: visible; opacity: 1; }

.form-group {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: .9rem; overflow: hidden; box-shadow: var(--shadow-sm);
}
.form-group-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; user-select: none; transition: background var(--transition); }
.form-group-header:hover { background: var(--border-soft); }
.form-group-title { display: flex; align-items: center; gap: .7rem; font-weight: 600; font-size: .95rem; }
.form-group-logo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.form-group-count { font-size: .75rem; font-weight: 500; color: var(--text-3); background: var(--border-soft); padding: .1rem .5rem; border-radius: 999px; }
.form-group-chevron { color: var(--text-4); transition: transform var(--transition); margin-left: auto; padding-left: .75rem; }
.form-group.collapsed .form-group-chevron { transform: rotate(-90deg); }
.form-group.collapsed .form-group-body { display: none; }
.form-group-body { padding: .25rem 1.25rem 1.25rem; border-top: 1px solid var(--border-soft); }

.anat-figure { margin: .9rem 0 .25rem; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: center; }
.anat-figure img { max-width: 100%; height: auto; border-radius: var(--radius-sm); display: inline-block; }
.anat-figure figcaption { margin-top: .6rem; font-size: .78rem; color: var(--text-3); line-height: 1.45; }

.fields-stack { padding-top: .9rem; display: flex; flex-direction: column; gap: .75rem; }

/* Optional prospective-validation email field */
.email-card { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin-bottom: .9rem; }
.email-card-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.email-card p { font-size: .8rem; color: var(--text-3); line-height: 1.5; margin-bottom: .75rem; max-width: 60ch; }
.email-card input[type=email] { width: 100%; max-width: 360px; padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-family: inherit; font-size: .88rem; outline: none; transition: border-color var(--transition); }
.email-card input[type=email]:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px var(--blue-light); }
.email-badge { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-4); background: var(--border-soft); padding: .12rem .5rem; border-radius: 999px; }
.field-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.field-label-wrap { flex: 0 0 240px; }
.field-label { font-size: .88rem; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: .4rem; }
.field-unit { font-size: .78rem; color: var(--text-4); display: block; margin-top: 1px; }
.field-hint { font-size: .75rem; color: var(--text-3); font-style: italic; margin-top: 3px; max-width: 420px; }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  border-radius: 50%; border: 1.2px solid var(--text-4); color: var(--text-4);
  font-size: .62rem; font-weight: 700; text-decoration: none; flex-shrink: 0;
}
.info-icon:hover { border-color: var(--blue); color: var(--blue); }
.field-input-wrap { flex: 1; min-width: 150px; display: flex; align-items: center; gap: .5rem; }
input[type=number], select {
  width: 100%; padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font-family: inherit; font-size: .88rem;
  appearance: none; -webkit-appearance: none; transition: border-color var(--transition); outline: none;
}
input[type=number]:focus, select:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px var(--blue-light); }
input[type=number] { max-width: 150px; }
select { cursor: pointer; max-width: 300px; }

.sex-group { display: flex; gap: .5rem; }
.sex-opt {
  flex: 0 0 auto; min-width: 90px; padding: .45rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); text-align: center; font-size: .85rem; font-weight: 500; color: var(--text-3);
  cursor: pointer; transition: var(--transition); user-select: none;
}
.sex-opt:hover { border-color: var(--blue-mid); color: var(--blue); }
.sex-opt.active { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 600; }

.bool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem .7rem; padding-top: .9rem; }
.toggle-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--card); transition: var(--transition); user-select: none; }
.toggle-item:hover { border-color: var(--blue-mid); background: #f0f5ff; }
.toggle-item input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.toggle-track { flex-shrink: 0; position: relative; width: 36px; height: 20px; border-radius: 10px; background: #cbd5e1; transition: background .18s; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s cubic-bezier(.4,0,.2,1); }
.toggle-item input:checked + .toggle-track { background: var(--blue); }
.toggle-item input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-item:has(input:checked) { border-color: #93c5fd; background: #eff6ff; }
.toggle-label { font-size: .85rem; color: var(--text-2); line-height: 1.3; flex: 1; }

.form-footer { margin-top: 1.75rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn-predict {
  padding: .85rem 2.5rem; background: var(--blue); color: #fff; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition); box-shadow: 0 4px 14px rgba(29,78,216,.35);
  display: flex; align-items: center; gap: .5rem;
}
.btn-predict:hover { background: #1e40af; }
.btn-predict:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-predict.loading .spinner { display: block; }
.form-disclaimer { font-size: .78rem; color: var(--text-4); max-width: 460px; }

/* ─── Results ──────────────────────────────────────────────────────────────── */
.results-wrap { margin-top: 2.5rem; }
.results-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.results-top h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.results-top .spacer { flex: 1; }
.btn-secondary {
  padding: .55rem 1.1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text-2); font-family: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: .45rem;
}
.btn-secondary:hover { border-color: var(--blue-mid); color: var(--blue); }

.risk-cards { display: flex; flex-direction: column; gap: 1rem; }
.risk-card {
  background: var(--card); border: 1px solid var(--border); border-left-width: 5px; border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem; box-shadow: var(--shadow-sm);
}
.risk-card.band-low  { border-left-color: var(--band-low); }
.risk-card.band-moderate { border-left-color: var(--band-mod); }
.risk-card.band-high { border-left-color: var(--band-high); }
.risk-card.band-grey { border-left-color: var(--band-grey); }

.risk-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .9rem; flex-wrap: wrap; }
.risk-head { display: flex; align-items: flex-start; gap: .8rem; }
.risk-head img { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.risk-title { font-weight: 600; font-size: 1.02rem; }
.risk-desc  { font-size: .8rem; color: var(--text-3); margin-top: 3px; max-width: 46ch; }
.risk-right { display: flex; align-items: center; gap: .9rem; flex-shrink: 0; }
.risk-pct { font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.risk-pct.muted { font-size: 1.25rem; color: var(--text-3); font-weight: 700; }

.band-chip { padding: .3rem .8rem; border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.band-chip.band-low  { background: var(--band-low-bg);  color: var(--band-low); }
.band-chip.band-moderate { background: var(--band-mod-bg);  color: #b45309; }
.band-chip.band-high { background: var(--band-high-bg); color: var(--band-high); }
.band-chip.band-grey { background: var(--band-grey-bg); color: var(--band-grey); }

.risk-bar-wrap { margin: 1rem 0 .3rem; }
.risk-track { position: relative; width: 100%; height: 10px; background: var(--border); border-radius: 99px; }
.risk-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1); min-width: 4px; }
.risk-fill.band-low { background: var(--band-low); }
.risk-fill.band-moderate { background: var(--band-mod); }
.risk-fill.band-high { background: var(--band-high); }
.risk-fill.band-grey { background: var(--band-grey); }
.risk-tick { position: absolute; top: -3px; width: 2px; height: 16px; border-radius: 1px; background: var(--text-3); transform: translateX(-50%); }
.risk-tick-label { position: absolute; top: 17px; font-size: .66rem; color: var(--text-4); transform: translateX(-50%); white-space: nowrap; }
.risk-scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-4); margin-top: 1.5rem; }

.risk-meta { margin-top: 1.1rem; display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-3); }
.risk-meta b { color: var(--text-2); }
.interp-line { margin-top: .9rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .84rem; line-height: 1.5; color: var(--text-2); }

.risk-card.error { border-left-color: var(--band-high); background: #fff5f5; }
.error-msg { font-size: .85rem; color: var(--band-high); margin-top: .4rem; }

/* Inverted / underpowered card */
.caveat-line { margin-bottom: 1rem; padding: .75rem 1rem; background: var(--band-grey-bg); border: 1px solid var(--border); border-left: 4px solid var(--band-grey); border-radius: var(--radius-sm); font-size: .85rem; line-height: 1.55; color: var(--text-2); }
.caution-box { display: flex; gap: .7rem; align-items: flex-start; margin-top: .9rem; padding: .8rem 1rem; background: var(--band-mod-bg); border: 1px solid #fcd7a1; border-left: 4px solid var(--band-mod); border-radius: var(--radius-sm); font-size: .84rem; line-height: 1.55; color: #7c2d12; }
.caution-box svg { flex-shrink: 0; color: var(--band-mod); margin-top: 1px; }
.caution-box strong { color: #7c2d12; }
.assoc-block { margin-top: .5rem; }
.assoc-header { font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: .75rem; line-height: 1.45; }
.assoc-list { display: flex; flex-direction: column; gap: .4rem; }
.assoc-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .86rem; }
.assoc-item.present { background: var(--band-mod-bg); border-color: #fcd7a1; }
.assoc-item.absent { color: var(--text-4); }
.assoc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-4); }
.assoc-item.present .assoc-dot { background: var(--band-mod); }
.assoc-name { flex: 1; }
.assoc-val { font-weight: 600; color: var(--text-2); }
.assoc-item.absent .assoc-val { color: var(--text-4); font-weight: 500; }
.assoc-sub { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); margin: 1rem 0 .5rem; }

.firth-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .84rem; }
.firth-table caption { text-align: left; font-size: .8rem; color: var(--text-3); margin-bottom: .6rem; line-height: 1.45; }
.firth-table th, .firth-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.firth-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-4); font-weight: 600; }
.firth-table tr.hit td { background: var(--band-mod-bg); font-weight: 600; }
.firth-table td:nth-child(2), .firth-table td:nth-child(3), .firth-table th:nth-child(2), .firth-table th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }

.muted-prob { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.muted-prob .lbl { font-size: .8rem; color: var(--text-3); }

details.strong-pred { margin-top: 1rem; }
details.strong-pred summary { font-size: .8rem; font-weight: 600; color: var(--text-2); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .35rem; }
details.strong-pred summary::-webkit-details-marker { display: none; }
details.strong-pred summary::before { content: "▸"; color: var(--text-4); transition: transform .15s; }
details.strong-pred[open] summary::before { transform: rotate(90deg); }
.strong-list { margin: .6rem 0 0 .2rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.strong-list li { font-size: .8rem; padding: .3rem .65rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); }

.clinical-note { margin-top: 1.75rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border-soft); font-size: .8rem; color: var(--text-3); line-height: 1.55; }
.clinical-note strong { color: var(--text-2); }

/* ─── About ────────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 2rem; }
.about-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); }
.about-stat .num { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--blue); }
.about-stat .lbl { font-size: .8rem; color: var(--text-3); margin-top: .25rem; }
.about-sub { margin-top: 2.5rem; }
.about-sub h3 { font-size: .82rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.about-sub p { font-size: .92rem; line-height: 1.65; color: var(--text-2); margin-bottom: .8rem; }
.perf-table, .bands-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.perf-table th, .perf-table td, .bands-table th, .bands-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
.perf-table th, .bands-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-4); font-weight: 600; }
.perf-table td:nth-child(3), .perf-table td:nth-child(4), .perf-table th:nth-child(3), .perf-table th:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.about-contact { margin-top: 1rem; font-size: .92rem; line-height: 1.7; color: var(--text-2); }

.author-group { margin-bottom: 1.5rem; }
.author-group-label { font-size: .8rem; font-weight: 600; color: var(--blue); margin-bottom: .75rem; }
.author-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; }
.author-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); }
.author-name { font-weight: 600; font-size: .95rem; }
.author-role { font-size: .82rem; color: var(--text-3); margin-top: 2px; }
.author-aff { font-size: .8rem; color: var(--text-4); margin-top: .35rem; line-height: 1.45; }
.author-note { font-size: .88rem; line-height: 1.65; color: var(--text-2); margin-bottom: 1.25rem; }

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: #0b1220; color: #cbd5e1; }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 3rem 1.5rem 2rem; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
.footer-brand .logo-mark { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 1rem; }
.footer-brand p { font-size: .86rem; line-height: 1.6; color: #94a3b8; max-width: 28rem; }
.footer-col h4 { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: 1rem; }
.footer-col a, .footer-col button { display: block; background: none; border: none; padding: 0; text-align: left; font-family: inherit; font-size: .88rem; color: #cbd5e1; text-decoration: none; margin-bottom: .65rem; cursor: pointer; transition: color .15s; }
.footer-col a:hover, .footer-col button:hover { color: #fff; }
.footer-bottom { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.5rem 2.5rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; color: #64748b; }

/* ─── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border-radius: var(--radius-lg); max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); max-height: 85vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; gap: .8rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-head img { width: 34px; height: 34px; object-fit: contain; }
.modal-head h3 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 1.4rem; line-height: 1; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-body p { font-size: .88rem; color: var(--text-3); margin-bottom: 1rem; line-height: 1.55; }
.modal-body ol { margin: 0; padding-left: 1.2rem; }
.modal-body li { font-size: .9rem; color: var(--text-2); margin-bottom: .55rem; line-height: 1.45; }

/* ─── Toast ────────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--text); color: #fff; padding: .65rem 1.25rem; border-radius: var(--radius); font-size: .85rem; font-weight: 500; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 400; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Print report ─────────────────────────────────────────────────────────── */
#print-report { display: none; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero h1 { font-size: 2.05rem; }
}
@media (max-width: 600px) {
  .site-nav { padding: .7rem 1rem; }
  .site-section { padding: 3rem 1.25rem; }
  .field-label-wrap { flex: 0 0 100%; }
  .field-input-wrap { width: 100%; }
  input[type=number], select { max-width: 100%; }
  .bool-grid { grid-template-columns: 1fr; }
}

@media print {
  /* Hide everything except the report by removing it from flow (visibility:hidden
     would keep the space and produce blank pages). */
  body > *:not(#print-report) { display: none !important; }
  #print-report { display: block; position: static; width: auto; padding: 0; font-size: 11px; color: #000; }
  #print-report h1 { font-size: 18px; margin-bottom: .25rem; }
  #print-report h2 { font-size: 13px; margin: 1rem 0 .4rem; border-bottom: 1px solid #999; padding-bottom: .2rem; }
  #print-report table { width: 100%; border-collapse: collapse; }
  #print-report th, #print-report td { border: 1px solid #ccc; padding: 3px 6px; text-align: left; font-size: 10px; }
  #print-report .pr-disclaimer { margin-top: 1rem; font-size: 9px; color: #333; line-height: 1.4; }
  @page { margin: 1.2cm; }
}

/* ── shell: platform bar, footer, small utilities ─────────────────────────── */
.site-bar { display:flex; align-items:center; gap:1rem; padding:.55rem 1.5rem; background:#0f172a; color:#e2e8f0; font-size:.85rem; }
.site-bar-brand { color:#fff; font-weight:700; letter-spacing:-.01em; text-decoration:none; }
.site-bar-tag { color:#94a3b8; }
.site-bar-link { margin-left:auto; color:#cbd5e1; text-decoration:none; }
.site-bar-link:hover { color:#fff; }
.platform-footer { border-top:1px solid var(--border-soft); padding:1.25rem 1.5rem; font-size:.82rem; color:var(--text-3); display:flex; flex-wrap:wrap; gap:.5rem 2rem; justify-content:space-between; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.results-version { margin-top:1rem; font-size:.8rem; color:var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.note-small { font-size:.82rem; color:var(--text-4); margin-top:.5rem; }
.calc-intro { padding-bottom:2rem; }
.calc-intro .section-head { margin-bottom:1.5rem; }
.field-error { border-color: var(--band-high) !important; }
/* ── landing B: cards ─────────────────────────────────────────────────────── */
.landing-b-hero h1 { max-width: none; }
.calc-cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap:1.25rem; margin-bottom:2rem; }
.calc-card { background:#fff; border:1px solid var(--border-soft); border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; gap:.6rem; }
.calc-card h2 { font-size:1.25rem; letter-spacing:-.02em; }
.calc-card-logo { width:52px; height:52px; object-fit:contain; }
.calc-card-logo.placeholder { border-radius:12px; background:var(--border-soft); }
.calc-card-tag { color: var(--text-3); font-size:.9rem; margin-top:-.4rem; }
.calc-card > p { color: var(--text-2); font-size:.95rem; }
.outcome-chips { list-style:none; padding:0; margin:.2rem 0; display:flex; flex-wrap:wrap; gap:.4rem; }
.outcome-chips li { font-size:.78rem; padding:.2rem .6rem; border-radius:999px; background:#eff6ff; color:#1e3a8a; }
.outcome-chips li.warn { background:#fef3c7; color:#92400e; }
.calc-card-foot { display:flex; justify-content:space-between; font-size:.8rem; color:var(--text-3); margin-top:auto; padding-top:.5rem; }
.calc-card .btn-hero-primary { align-self:flex-start; margin-top:.4rem; }

@media print { .site-bar, .platform-footer { display:none !important; } }

/* ── four-band scale, band colour on the percentage, error page ─────────────── */
:root { --band-vhigh: #991b1b; --band-vhigh-bg: #fee2e2; }
.risk-card.band-very-high { border-left-color: var(--band-vhigh); }
.band-chip.band-very-high { background: var(--band-vhigh-bg); color: var(--band-vhigh); }
.risk-fill.band-very-high { background: var(--band-vhigh); }
.risk-pct.band-low { color: var(--band-low); }
.risk-pct.band-moderate { color: var(--band-mod); }
.risk-pct.band-high { color: var(--band-high); }
.risk-pct.band-very-high { color: var(--band-vhigh); }
.error-page { max-width: 640px; margin: 4rem auto; padding: 0 1.5rem; }
.band-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .5rem; font-size: .78rem; color: var(--text-3); }
.band-legend span.current { font-weight: 700; }
.band-legend .band-low { color: var(--band-low); }
.band-legend .band-moderate { color: var(--band-mod); }
.band-legend .band-high { color: var(--band-high); }
.band-legend .band-very-high { color: var(--band-vhigh); }
