/* =====================================================================
   Consult+ Demo Stylesheet
   Clinical register · Liebling → Bricolage Grotesque → DM Sans
   Matches Enluma reference mockup layout
   ===================================================================== */

:root {
  /* Greens — Enluma palette */
  --g:  #3CB54A;
  --gd: #2a8f36;
  --gf: #1a5c26;
  --gp: #e8f7ea;
  --go: #f5faf5;

  /* Neutrals */
  --ink:    #1a1a18;
  --ink-2:  #3a3a36;
  --ink-3:  #6b6b66;
  --ink-4:  #9a9a93;
  --rule:   #e5e3db;
  --rule-2: #efece3;
  --bg:     #fafaf7;
  --card:   #ffffff;

  /* Clinical signal colors — understated, not candy */
  --alert:  #c43b3b;
  --alert-bg: #fbeded;
  --watch:  #b97a00;
  --watch-bg: #fcf5e4;
  --ok:     var(--g);
  --info:   #4a7a52;

  /* Typography scale */
  --t-xs:  0.75rem;
  --t-sm:  0.875rem;
  --t-md:  1rem;
  --t-lg:  1.125rem;
  --t-xl:  1.375rem;
  --t-2xl: 1.75rem;
  --t-3xl: 2.25rem;

  /* Rhythm */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 24px;
  --r-5: 32px;
  --r-6: 48px;
  --r-7: 72px;

  /* Font stacks
     Liebling is first preference — drop Liebling woff2 files into
     ./assets/fonts/ in production and the @font-face will activate.
     Falls back to Bricolage Grotesque (Google Fonts, loaded via <link>)
     and finally DM Sans. */
  --font-display: 'Liebling', 'Bricolage Grotesque', 'DM Sans', -apple-system, sans-serif;
  --font-body:    'Liebling', 'Bricolage Grotesque', 'DM Sans', -apple-system, sans-serif;
}

/* Optional @font-face — activates if Liebling files are present */
@font-face {
  font-family: 'Liebling';
  src: url('assets/fonts/Liebling-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Liebling';
  src: url('assets/fonts/Liebling-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Liebling';
  src: url('assets/fonts/Liebling-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-md);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 var(--r-2);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: var(--t-3xl); font-weight: 400; letter-spacing: -0.02em; }
h2 { font-size: var(--t-2xl); font-weight: 500; }
h3 { font-size: var(--t-lg); font-weight: 500; }

p { margin: 0 0 var(--r-3); }

a { color: var(--gd); text-decoration: none; border-bottom: 1px solid rgba(60, 181, 74, 0.3); }
a:hover { border-bottom-color: var(--gd); }

/* ===================================================================
   TOP BANNER — reference: logo + tagline left, POWERED BY + prosody right
   =================================================================== */
.app-banner {
  background: #ffffff;
  width: 100%;
}
.banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--r-3) var(--r-5) var(--r-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--r-4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--r-3);
}
.brand-lockup .consult-wordmark {
  height: 148px;
  width: auto;
  display: block;
}
.brand-lockup .lockup-divider {
  width: 1px;
  height: 76px;
  background: #d5d3c9;
  flex-shrink: 0;
}
.brand-lockup .tagline {
  height: 44px;
  width: auto;
  display: block;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: var(--r-2);
  flex-shrink: 0;
}
.powered-by .powered-label {
  font-size: 0.42rem;
  letter-spacing: 0.15em;
  color: var(--ink-4);
  font-weight: 500;
  text-transform: uppercase;
}
.powered-by .prosody-mark-img {
  height: 37px;
  width: auto;
  display: block;
  opacity: 0.65;
}

.banner-rule {
  max-width: 1200px;
  margin: 0 auto;
  height: 1px;
  background: var(--rule);
  margin-left: var(--r-5);
  margin-right: var(--r-5);
}

/* ===================================================================
   Main container
   =================================================================== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--r-5) var(--r-5);
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

/* ===================================================================
   Welcome screen — tightened per reference mockup
   =================================================================== */
.welcome {
  text-align: center;
  padding: var(--r-5) var(--r-4) var(--r-4);
  max-width: 560px;
  margin: var(--r-4) auto;
}
.welcome h1 {
  margin-bottom: var(--r-3);
  color: var(--ink);
  font-size: 2.1rem;
  font-weight: 400;
}
.welcome .lead {
  color: var(--ink-3);
  font-size: var(--t-md);
  margin-bottom: var(--r-5);
  line-height: 1.55;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.welcome .lead.scope-para {
  text-align: left;
  max-width: 520px;
  margin-bottom: var(--r-3);
}
.welcome .lead.scope-para strong {
  color: var(--ink);
  font-weight: 600;
}
.welcome .instruction-line {
  text-align: left;
  max-width: 520px;
  margin: 0 auto var(--r-5);
  font-size: var(--t-sm);
  color: var(--ink-3);
  line-height: 1.55;
  padding: var(--r-2) var(--r-3);
  background: var(--go);
  border-left: 3px solid var(--g);
  border-radius: 4px;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--r-2);
  margin-top: var(--r-3);
}
.welcome-actions .btn {
  min-width: 280px;
}

.welcome-form {
  display: flex;
  flex-direction: column;
  gap: var(--r-3);
  max-width: 380px;
  margin: 0 auto var(--r-4);
  text-align: left;
}
.welcome-form > div {
  position: relative;
}
.welcome-form label {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-bottom: 6px;
  display: block;
}
.welcome-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--t-md);
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.welcome-form input[type="text"]:focus {
  outline: none;
  border-color: var(--gd);
  box-shadow: 0 0 0 3px rgba(60, 181, 74, 0.12);
}
.welcome-form input[type="text"]::placeholder {
  color: var(--ink-4);
}

/* Validation error state — red border + X icon on the right */
.welcome-form > div.has-error input[type="text"] {
  border-color: var(--alert);
  background: #fef6f6;
  padding-right: 40px;
}
.welcome-form > div.has-error::after {
  content: '✕';
  position: absolute;
  right: 14px;
  top: 38px;
  color: var(--alert);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
  animation: shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

.legal-disclaimer {
  margin: var(--r-5) auto 0;
  max-width: 520px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-3);
  text-align: center;
  font-weight: 400;
}
.legal-disclaimer.confidential {
  margin-top: var(--r-3);
  font-weight: 500;
}

/* ===================================================================
   Progress bar + section header
   =================================================================== */
.progress-wrap {
  max-width: 720px;
  margin: var(--r-4) auto var(--r-5);
  width: 100%;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--t-xs);
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--r-2);
  font-weight: 500;
}
.progress-track {
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--g);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================
   Question card
   =================================================================== */
.intake-screen {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-prompt {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: var(--r-2);
}
.question-sub {
  color: var(--ink-3);
  font-size: var(--t-md);
  margin-bottom: var(--r-5);
  line-height: 1.5;
  white-space: pre-line;
}

.answer-area {
  margin-top: var(--r-4);
  display: flex;
  flex-direction: column;
  gap: var(--r-3);
}

/* Text inputs */
.answer-area input[type="text"],
.answer-area input[type="number"],
.answer-area input[type="date"],
.answer-area textarea,
.answer-area select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--t-md);
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.answer-area textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.answer-area input[type="text"]:focus,
.answer-area input[type="number"]:focus,
.answer-area input[type="date"]:focus,
.answer-area textarea:focus,
.answer-area select:focus {
  outline: none;
  border-color: var(--gd);
  box-shadow: 0 0 0 3px rgba(60, 181, 74, 0.12);
}

/* Yes / No and option buttons */
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--r-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: var(--r-3);
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--t-md);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  width: 100%;
}
.option-btn:hover {
  border-color: var(--gd);
  background: var(--go);
}
.option-btn:active {
  transform: translateY(1px);
}
.option-btn.selected {
  border-color: var(--gd);
  background: var(--gp);
}
.option-btn .opt-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  transition: border-color 0.15s ease;
}
.option-btn.selected .opt-marker {
  border-color: var(--gd);
}
.option-btn.selected .opt-marker::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border-radius: 50%;
  background: var(--gd);
}

/* Compound inputs */
.compound-group {
  display: flex;
  flex-direction: column;
  gap: var(--r-3);
}
.compound-field label {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-bottom: 6px;
  display: block;
  font-weight: 400;
}
.compound-field input,
.compound-field select {
  width: 100%;
}
.compound-field.inline-checkbox {
  display: flex;
  align-items: center;
  gap: var(--r-2);
  padding: var(--r-2) 0;
}
.compound-field.inline-checkbox label {
  margin: 0;
  color: var(--ink);
  font-size: var(--t-md);
}

/* ===================================================================
   Nav buttons
   =================================================================== */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--r-3);
  margin-top: var(--r-5);
  padding-top: var(--r-4);
  border-top: 1px solid var(--rule-2);
}

button.btn {
  font-family: inherit;
  font-size: var(--t-md);
  padding: 11px 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
}
button.btn:active { transform: translateY(1px); }
button.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button.btn.primary {
  background: var(--g);
  color: #fff;
  border-color: var(--g);
}
button.btn.primary:hover:not(:disabled) {
  background: var(--gd);
  border-color: var(--gd);
}
button.btn.primary:disabled {
  background: #b8e4bd;
  border-color: #b8e4bd;
  color: #fff;
  opacity: 1;
}

button.btn.ghost {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--rule);
}
button.btn.ghost:hover:not(:disabled) {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink-3);
}

button.btn.outline {
  background: transparent;
  color: var(--gd);
  border-color: var(--gd);
}
button.btn.outline:hover:not(:disabled) {
  background: var(--gp);
}

button.btn.restart-inline {
  font-size: 0.8rem;
  padding: 4px 14px;
  margin-left: 12px;
  vertical-align: middle;
}

/* ===================================================================
   Info screens (greeting, transitions, completion)
   =================================================================== */
.info-screen {
  max-width: 640px;
  margin: var(--r-5) auto;
  text-align: left;
  animation: fadeIn 0.3s ease;
}
.info-screen .info-body {
  font-family: var(--font-display);
  font-size: var(--t-xl);
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 400;
  margin-bottom: var(--r-5);
}
.info-screen .info-cta {
  text-align: right;
}

/* Transition screens — smaller, lighter */
.transition-screen .info-body {
  font-size: var(--t-lg);
  color: var(--ink-3);
  font-weight: 400;
}

/* ===================================================================
   DSP modal overlay
   =================================================================== */
.dsp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--r-4);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}
.dsp-dialog {
  background: var(--card);
  max-width: 540px;
  width: 100%;
  padding: var(--r-6);
  border-radius: 10px;
  border-top: 4px solid var(--alert);
}
.dsp-dialog h2 {
  color: var(--alert);
  font-size: var(--t-xl);
  margin-bottom: var(--r-3);
}
.dsp-dialog p {
  color: var(--ink-2);
  font-size: var(--t-md);
  line-height: 1.5;
}
.dsp-dialog .dsp-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--r-4);
}

/* ===================================================================
   Results screen — Tabs + content
   =================================================================== */
.results-screen {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}
.results-intro {
  text-align: center;
  margin-bottom: var(--r-5);
  padding-bottom: var(--r-4);
  border-bottom: 1px solid var(--rule);
}
.results-intro h1 {
  font-size: var(--t-2xl);
  margin-bottom: var(--r-2);
}
.results-intro .sub {
  color: var(--ink-3);
  font-size: var(--t-md);
}

.tabs {
  display: flex;
  gap: var(--r-1);
  margin-bottom: var(--r-5);
  border-bottom: 1px solid var(--rule);
}
.tab {
  padding: var(--r-3) var(--r-4);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: var(--t-md);
  cursor: pointer;
  margin-bottom: -1px;
  font-weight: 500;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--g);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* --- Summary panel styling --- */
.clinical-summary {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: var(--r-6);
  font-size: var(--t-md);
  line-height: 1.5;
}

.summary-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--r-4);
  margin-bottom: var(--r-5);
}
.summary-header h1 {
  font-size: var(--t-xl);
  font-weight: 500;
  margin-bottom: var(--r-1);
  color: var(--ink);
}
.summary-meta {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin: 0;
}
.patient-block {
  margin-top: var(--r-4);
  padding: var(--r-3) var(--r-4);
  background: var(--go);
  border-radius: 6px;
  border-left: 3px solid var(--g);
}

.summary-section {
  margin-bottom: var(--r-5);
}
.summary-section:last-child { margin-bottom: 0; }
.summary-section h3 {
  color: var(--gf);
  font-size: var(--t-lg);
  font-weight: 600;
  margin-bottom: var(--r-3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-2);
  letter-spacing: -0.01em;
}
.summary-section .section-sub {
  font-size: var(--t-sm);
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
}

.kv-row {
  display: flex;
  gap: var(--r-3);
  padding: 6px 0;
  align-items: flex-start;
}
.kv-label {
  flex: 0 0 180px;
  color: var(--ink-3);
  font-size: var(--t-sm);
  padding-top: 2px;
}
.kv-value {
  flex: 1;
  color: var(--ink);
  min-width: 0;
  word-wrap: break-word;
}
.kv-value.highlight { font-weight: 500; }
.kv-value .sub {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-top: 2px;
}

/* Flag table */
.flag-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--t-sm);
}
.flag-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
}
.flag-table tr:last-child td { border-bottom: none; }
.flag-table td:first-child {
  width: 50%;
  color: var(--ink-2);
  font-weight: 400;
}
.flag-table td:last-child {
  text-align: right;
  color: var(--ink-3);
}
.flag-table td.flag-value-alert { color: var(--alert); font-weight: 500; }
.flag-table td.flag-value-watch { color: var(--watch); font-weight: 500; }
.flag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* Clinical lists */
.clinical-list { margin: 0; padding-left: var(--r-4); }
.clinical-list li { margin-bottom: var(--r-2); }
.clinical-list .sub {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-top: 2px;
}

/* Family list */
.family-list {
  margin: var(--r-2) 0 var(--r-3);
  padding-left: var(--r-4);
  line-height: 1.7;
  font-size: var(--t-sm);
}
.family-list li { margin-bottom: 4px; }
.family-list .cancer-text { color: var(--alert); }
.family-list .muted { color: var(--ink-3); font-size: var(--t-xs); }

.muted-note {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-bottom: var(--r-3);
  padding: var(--r-2) var(--r-3);
  background: var(--rule-2);
  border-radius: 4px;
  border-left: 3px solid var(--rule);
}

/* Active cancer callout */
.active-cancer-callout {
  margin-top: var(--r-3);
  padding: var(--r-3) var(--r-4);
  background: var(--alert-bg);
  border-left: 3px solid var(--alert);
  border-radius: 4px;
}
.active-cancer-badge {
  display: inline-block;
  background: var(--alert);
  color: #fff;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: var(--r-2);
}

/* Key observations */
.observations {
  background: var(--go);
  border-radius: 6px;
  padding: var(--r-4) var(--r-5);
  margin-top: var(--r-5);
}
.obs-list {
  margin: 0;
  padding-left: var(--r-4);
  line-height: 1.6;
}
.obs-list li { margin-bottom: var(--r-2); font-size: var(--t-sm); }
.obs-list li strong { color: var(--gf); }

/* Summary footer */
.summary-footer {
  margin-top: var(--r-6);
  padding-top: var(--r-4);
  border-top: 1px solid var(--rule);
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: 1.5;
}
.summary-footer .disclaimer { margin-bottom: 8px; }
.summary-footer .brand { color: var(--ink-4); margin: 0; }

/* --- Pedigree panel --- */
.pedigree-container {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: var(--r-4);
}
.pedigree-container svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.pedigree-meta {
  margin-top: var(--r-4);
  padding-top: var(--r-3);
  border-top: 1px solid var(--rule-2);
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.pedigree-meta h4 {
  font-size: var(--t-sm);
  color: var(--ink-2);
  margin-bottom: var(--r-1);
  font-weight: 500;
}

/* Pedigree SVG element styles */
.pedigree-container .line { stroke: #2c2c2a; stroke-width: 1.2; fill: none; }
.pedigree-container .line-dash { stroke: #888; stroke-width: 1; fill: none; stroke-dasharray: 4 3; }
.pedigree-container .normal-stroke { stroke: #2c2c2a; fill: none; }
.pedigree-container .cancer-stroke { stroke: #8a2828; fill: none; }
.pedigree-container .cancer-fill { fill: #a32d2d; stroke: #8a2828; }
.pedigree-container .dcis-fill { fill: #f0bdbd; stroke: #a32d2d; }
.pedigree-container .proband-stroke { stroke: #2c2c2a; fill: none; }
.pedigree-container .ts { font-family: var(--font-body); font-size: 10px; fill: #3a3a36; }
.pedigree-container .th { font-family: var(--font-display); font-size: 11px; fill: #1a1a18; font-weight: 500; }
.pedigree-container .legend { font-family: var(--font-body); font-size: 9px; fill: #6b6b66; }
.pedigree-container .summary-box { fill: #f8f8f4; stroke: #d3d1c7; }

/* --- CanRisk panel --- */
.canrisk-container {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: var(--r-5);
}
.canrisk-intro {
  margin-bottom: var(--r-4);
}
.canrisk-intro h3 {
  margin-bottom: var(--r-2);
  color: var(--gf);
}
.canrisk-intro p {
  color: var(--ink-3);
  font-size: var(--t-sm);
  margin-bottom: var(--r-2);
}
.canrisk-file {
  background: #0f1814;
  color: #d9e5d8;
  border-radius: 6px;
  padding: var(--r-4);
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  max-height: 400px;
  overflow-y: auto;
}
.canrisk-download {
  margin-top: var(--r-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--r-3);
  flex-wrap: wrap;
}
.canrisk-download .note {
  font-size: var(--t-xs);
  color: var(--ink-3);
  max-width: 440px;
}

/* ===================================================================
   Mobile
   =================================================================== */
@media (max-width: 680px) {
  main { padding: var(--r-4) var(--r-3); }
  .banner-inner { padding: var(--r-3); gap: var(--r-3); flex-wrap: wrap; }
  .brand-lockup .consult-wordmark { height: 42px; }
  .brand-lockup .tagline { height: 30px; }
  .brand-lockup .lockup-divider { height: 32px; }
  .powered-by .prosody-mark-img { height: 22px; }
  .powered-by .powered-label { font-size: 0.58rem; }
  .banner-rule { margin-left: var(--r-3); margin-right: var(--r-3); }
  .question-prompt { font-size: var(--t-xl); }
  .info-screen .info-body { font-size: var(--t-lg); }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-label { flex: none; }
  .clinical-summary { padding: var(--r-4); }
  .tabs { gap: 0; }
  .tab { padding: var(--r-2) var(--r-3); font-size: var(--t-sm); }
  h1 { font-size: var(--t-2xl); }
  .welcome h1 { font-size: 1.75rem; }
}

/* ===================================================================
   Print — for summary
   =================================================================== */
@media print {
  body { background: #fff; }
  .app-banner, .tabs, .nav-row, .canrisk-download, button { display: none !important; }
  .results-intro { border-bottom: none; }
  .tab-panel { display: block !important; page-break-before: always; }
  .clinical-summary { border: none; padding: 0; box-shadow: none; }
  .summary-section h3 { color: #2a8f36 !important; -webkit-print-color-adjust: exact; }
  .active-cancer-callout { background: #fbeded !important; -webkit-print-color-adjust: exact; }
  .observations { background: #f5faf5 !important; -webkit-print-color-adjust: exact; }
}

/* ===================================================================
   FOOTER — visible "contact us" link on every screen
   =================================================================== */
.app-footer {
  margin-top: auto;
  padding: var(--r-5) var(--r-5);
  text-align: center;
  border-top: 1px solid var(--rule-2);
}
.contact-us-link {
  font-size: 0.95rem;
  color: var(--ink);
  text-transform: lowercase;
  letter-spacing: 0.01em;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-us-link:hover {
  color: var(--gd);
  border-bottom-color: var(--gd);
}

/* ===================================================================
   CONTACT MODAL — matches the existing Enluma contact page aesthetic
   =================================================================== */
.contact-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 92, 38, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--r-4);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}
.contact-dialog {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(26, 92, 38, 0.15);
  max-width: 480px;
  width: 100%;
  padding: var(--r-6) 36px;
  position: relative;
}
.contact-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--ink-4);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}
.contact-close:hover { color: var(--ink); }

.contact-dialog h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gf);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.contact-sub {
  font-size: 0.92rem;
  color: #4a7a52;
  margin-bottom: 28px;
  line-height: 1.5;
}
.contact-fg {
  margin-bottom: 16px;
}
.contact-fg label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gf);
  margin-bottom: 5px;
}
.contact-fg input,
.contact-fg textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #c4dcc6;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.25s, box-shadow 0.25s;
  background: #fff;
  resize: vertical;
  color: var(--ink);
}
.contact-fg input:focus,
.contact-fg textarea:focus {
  outline: none;
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(60, 181, 74, 0.1);
}
.contact-fg textarea { min-height: 100px; }
.contact-btn {
  width: 100%;
  padding: 14px;
  background: var(--g);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}
.contact-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(60, 181, 74, 0.3);
}
.contact-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#contact-thankyou {
  text-align: center;
  padding: 24px 0;
}
#contact-thankyou h2 {
  margin-bottom: 8px;
}
#contact-thankyou p {
  font-size: 0.92rem;
  color: #4a7a52;
}

@media (max-width: 680px) {
  .contact-dialog { padding: var(--r-5) 24px; }
  .contact-dialog h2 { font-size: 1.35rem; }
}
