:root {
  --navy-950: #071d2c;
  --navy-900: #0b2e44;
  --navy-800: #0b3954;
  --blue-700: #176b87;
  --blue-500: #2f8fa8;
  --blue-100: #e8f4f7;
  --teal-700: #147d72;
  --teal-100: #e4f5f2;
  --orange-700: #c8661c;
  --orange-500: #ee8b3a;
  --orange-100: #fff1e6;
  --amber-700: #9b6808;
  --amber-100: #fff5d8;
  --red-800: #9b2434;
  --red-100: #fde9ec;
  --slate-900: #17222d;
  --slate-700: #43515e;
  --slate-500: #71808d;
  --slate-300: #c9d2d9;
  --slate-200: #dfe5e9;
  --slate-100: #f2f5f7;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgb(7 29 44 / 0.06), 0 4px 12px rgb(7 29 44 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(7 29 44 / 0.08), 0 12px 28px rgb(7 29 44 / 0.12);
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-ui: 0.2s ease-in-out;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--slate-900);
  background:
    radial-gradient(circle at 12% -10%, rgb(47 143 168 / 0.1), transparent 32%),
    radial-gradient(circle at 92% 4%, rgb(238 139 58 / 0.08), transparent 30%),
    #f4f7f9;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--blue-500);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  color: var(--white);
  background: rgb(7 29 44 / 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  border-radius: var(--radius-sm);
  transition: opacity var(--ease-ui);
}

.brand:hover { opacity: 0.92; }
.brand:active { opacity: 0.85; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--orange-500), #f5a962);
  color: var(--navy-950);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-title,
.brand small { display: block; }

.brand-title {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.brand small {
  margin-top: 0.15rem;
  color: #a8bcc8;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
}

.header-actions { display: flex; gap: 0.5rem; }

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  color: var(--white);
  background: rgb(255 255 255 / 0.07);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--ease-ui), border-color var(--ease-ui), transform var(--ease-ui), opacity var(--ease-ui);
}

.icon-button:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.18);
}

.icon-button:active:not(:disabled) { transform: scale(0.98); }

.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

main { width: min(1320px, 100%); margin: 0 auto; }

.progress-shell { padding: 1.1rem clamp(1rem, 3vw, 2.5rem) 0; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--slate-700);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.progress-track {
  height: 6px;
  margin-top: 0.5rem;
  overflow: hidden;
  background: var(--slate-200);
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--teal-700));
  border-radius: inherit;
  transition: width 0.32s ease-in-out;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.26fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 2.75rem;
}

.patient-summary {
  align-self: start;
  position: sticky;
  top: 88px;
  min-height: 140px;
  padding: 1.15rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.patient-summary h2 {
  margin: 0 0 0.75rem;
  color: var(--navy-800);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.summary-empty {
  color: var(--slate-500);
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: 28ch;
}

.summary-list { display: grid; gap: 0.65rem; }

.summary-item {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--slate-200);
}

.summary-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-item span {
  display: block;
  color: var(--slate-500);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-value {
  display: block;
  margin-top: 0.2rem;
  color: var(--slate-900);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.workspace { min-width: 0; }

.screen { animation: enter 0.28s ease-in-out both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--white);
  background:
    linear-gradient(118deg, rgb(11 57 84 / 0.97), rgb(23 107 135 / 0.92)),
    radial-gradient(circle at 88% 0, rgb(238 139 58 / 0.35), transparent 36%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-kicker {
  color: #c5e4ec;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 42rem;
  margin: 0.45rem 0 0.65rem;
  font-size: clamp(1.65rem, 4.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.hero p {
  max-width: 42rem;
  margin: 0;
  color: #d8e8ed;
  font-size: 1rem;
  line-height: 1.6;
}

.section-heading { margin: 1.75rem 0 1rem; }

.section-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section-heading p {
  margin: 0.4rem 0 0;
  max-width: 52rem;
  color: var(--slate-700);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pathway-grid,
.choice-grid,
.result-grid,
.metric-grid { display: grid; gap: 0.85rem; }

.pathway-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0.25rem; }
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid.single { grid-template-columns: 1fr; }
.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pathway-card,
.choice-card {
  position: relative;
  width: 100%;
  min-height: 140px;
  padding: 1.15rem 1.2rem;
  text-align: left;
  color: var(--slate-900);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--ease-ui),
    border-color var(--ease-ui),
    box-shadow var(--ease-ui),
    background var(--ease-ui);
}

.pathway-card:hover,
.choice-card:hover {
  transform: translateY(-2px);
  border-color: #a8d4e0;
  box-shadow: var(--shadow-md);
}

.pathway-card:active,
.choice-card:active { transform: translateY(0); }

.pathway-card.selected,
.choice-card.selected {
  background: var(--blue-100);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 1px rgb(47 143 168 / 0.25);
}

.pathway-card .number {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--orange-500);
  font-size: 0.875rem;
  font-weight: 600;
}

.pathway-card h3,
.choice-card h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.pathway-card p,
.choice-card p {
  margin: 0.45rem 0 0;
  color: var(--slate-700);
  font-size: 0.875rem;
  line-height: 1.55;
}

.choice-card .choice-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--blue-700);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.choice-card.danger { background: var(--red-100); border-color: #e8c4ca; }
.choice-card.warning { background: var(--amber-100); border-color: #e5d49a; }
.choice-card.success { background: var(--teal-100); border-color: #a8d9d2; }

.question-panel {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.question-head {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  color: var(--white);
}

.question-head .eyebrow {
  color: #c5e4ec;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-head h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.question-head p {
  margin: 0.65rem 0 0;
  max-width: 52rem;
  color: #d5e6eb;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.question-body { padding: clamp(1rem, 3vw, 1.5rem); }

.auto-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--slate-500);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auto-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal-700);
  box-shadow: 0 0 0 4px rgb(20 125 114 / 0.12);
}

.alert {
  margin: 0 0 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 0.875rem;
  line-height: 1.55;
}

.alert-title {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
  line-height: 1.35;
}

.alert.info { background: var(--blue-100); border-color: var(--blue-500); }
.alert.warning { background: var(--amber-100); border-color: #d89a23; }
.alert.danger { background: var(--red-100); border-color: var(--red-800); }
.alert.success { background: var(--teal-100); border-color: var(--teal-700); }

.result-shell { display: grid; gap: 1rem; }

.result-banner {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--white);
  background: linear-gradient(125deg, var(--navy-900), var(--blue-700));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.result-banner.danger { background: linear-gradient(125deg, #6f1725, var(--red-800)); }
.result-banner.success { background: linear-gradient(125deg, #0f665d, var(--teal-700)); }
.result-banner.warning { background: linear-gradient(125deg, #795007, var(--amber-700)); }

.result-banner .eyebrow {
  color: rgb(255 255 255 / 0.75);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-banner h1 {
  margin: 0.45rem 0 0.4rem;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.result-banner p {
  margin: 0;
  max-width: 52rem;
  color: rgb(255 255 255 / 0.88);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.result-card {
  padding: 1.15rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.result-card.full { grid-column: 1 / -1; }

.result-card h2 {
  margin: 0 0 0.75rem;
  color: var(--navy-900);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.result-card h3 {
  margin: 0 0 0.35rem;
  color: var(--navy-900);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.result-card p {
  margin: 0.35rem 0;
  color: var(--slate-700);
  font-size: 0.875rem;
  line-height: 1.58;
}

.result-card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  color: var(--slate-700);
  font-size: 0.875rem;
  line-height: 1.65;
}

.result-card li + li { margin-top: 0.35rem; }

.regimen-card {
  padding: clamp(1.15rem, 2.5vw, 1.5rem) clamp(1.2rem, 2.5vw, 1.65rem);
}

.regimen-card-head {
  margin-bottom: 0.25rem;
}

.regimen-card-head h2 {
  margin: 0;
  font-size: 1.0625rem;
}

.regimen-card-lead {
  margin: 0.45rem 0 0;
  max-width: 52rem;
  color: var(--slate-500);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.regimen-steps {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.regimen-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--slate-200);
}

.regimen-step:last-child { border-bottom: 0; padding-bottom: 0; }

.regimen-step-marker {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.regimen-step:first-child .regimen-step-marker {
  background: var(--navy-800);
  color: var(--white);
}

.regimen-step-body { min-width: 0; }

.regimen-step-title {
  margin: 0 0 0.4rem;
  color: var(--navy-900);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.regimen-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  /* max-width: 68ch; */
}

.regimen-step-text,
.regimen-step-line {
  margin: 0;
  color: var(--slate-900);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.55;
}

.regimen-step-footnote {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-left: 3px solid var(--teal-700);
  border-radius: var(--radius-sm);
}

.regimen-footnote-lines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.regimen-footnote-line {
  margin: 0;
  color: var(--slate-700);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.regimen-footnote-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--teal-700);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.regimen-highlights {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
}

.regimen-highlights-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--slate-500);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge.orange { background: var(--orange-100); color: var(--orange-700); }
.badge.red { background: var(--red-100); color: var(--red-800); }
.badge.teal { background: var(--teal-100); color: var(--teal-700); }
.badge.amber { background: var(--amber-100); color: var(--amber-700); }

.metric {
  padding: 0.85rem 0.95rem;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--ease-ui);
}

.metric span {
  display: block;
  color: var(--slate-500);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 0.25rem;
  color: var(--navy-900);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.action-button {
  min-height: 44px;
  padding: 0.65rem 1.05rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--navy-800);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--ease-ui), transform var(--ease-ui), opacity var(--ease-ui);
}

.action-button:hover { background: var(--navy-900); }
.action-button:active { transform: scale(0.98); }
.action-button:disabled { opacity: 0.5; cursor: not-allowed; }

.action-button.secondary {
  color: var(--navy-800);
  background: var(--blue-100);
}

.action-button.secondary:hover { background: #dceef3; }

.action-button.orange {
  color: var(--navy-950);
  background: var(--orange-500);
}

.action-button.orange:hover { background: #e07d2f; }

.action-button.danger { background: var(--red-800); }
.action-button.danger:hover { background: #852030; }

.details {
  margin-top: 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.details summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: var(--navy-900);
  background: var(--slate-100);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--ease-ui);
  list-style-position: outside;
}

.details summary:hover { background: #e8edf0; }

.details-content { padding: 1rem; }

.site-footer {
  padding: 1.35rem clamp(1rem, 3vw, 2.5rem) 2.25rem;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-200);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: rgb(255 255 255 / 0.5);
}

.site-footer p {
  max-width: 68rem;
  margin: 0.35rem auto;
}

.footer-lead {
  color: var(--slate-700);
  font-weight: 500;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--navy-950);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--ease-ui), transform var(--ease-ui);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.noscript {
  padding: 1rem;
  color: var(--white);
  background: var(--red-800);
  text-align: center;
  font-size: 0.9375rem;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .patient-summary { position: static; min-height: 0; }
  .summary-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .brand small,
  .button-label { display: none; }
  .pathway-grid,
  .choice-grid,
  .choice-grid.three,
  .result-grid,
  .metric-grid { grid-template-columns: 1fr; }
  .pathway-card,
  .choice-card { min-height: 0; }
  .summary-list { grid-template-columns: 1fr 1fr; }
  .result-card.full { grid-column: auto; }
}

@media print {
  .site-header,
  .progress-shell,
  .patient-summary,
  .site-footer,
  .action-row,
  .auto-note { display: none !important; }
  body { background: white; }
  .app-shell { display: block; padding: 0; }
  .result-card,
  .result-banner { break-inside: avoid; box-shadow: none; }
}
