:root {
  color-scheme: light;
  --ink: #172e32;
  --muted: #5c6d70;
  --line: #d8e3e3;
  --soft: #f2f7f6;
  --paper: #fff;
  --teal: #0f5f66;
  --teal-dark: #09484e;
  --teal-soft: #e5f2f0;
  --purple: #5b4b8a;
  --purple-soft: #f1eef9;
  --amber: #8a5a08;
  --amber-soft: #fff5dc;
  --red: #9c2f32;
  --red-soft: #fdebec;
  --shadow: 0 18px 50px rgba(25, 61, 65, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #edf6f4 0, #f8fbfa 320px, #f8fbfa 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-dark); font-weight: 700; text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #f0af2f; outline-offset: 3px; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }
.shell { width: min(100% - 32px, 980px); margin-inline: auto; }
.site-header { border-bottom: 1px solid rgba(15, 95, 102, 0.15); background: rgba(255, 255, 255, 0.92); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-inner { min-height: 82px; }
.header-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--teal);
  color: white;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}
.brand strong, .brand small { display: block; }
.brand strong { line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 0.82rem; }
.pilot-label {
  padding: 6px 10px;
  border: 1px solid #cbd9d8;
  border-radius: 999px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
}
@media (max-width: 720px) {
  .header-account { width: 100%; justify-content: flex-start; }
}
.main-layout { padding-block: 58px 70px; }
.intro { max-width: 790px; margin-bottom: 32px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.83rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 14px; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.06; letter-spacing: -0.035em; }
h2 { margin-bottom: 10px; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; }
h3 { margin-bottom: 8px; font-size: 1.08rem; }
.intro > p:not(.eyebrow) { max-width: 720px; color: var(--muted); font-size: 1.08rem; }
.safety-note {
  max-width: 790px;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  border-radius: 0 10px 10px 0;
  background: var(--amber-soft);
  color: #5c430d;
  font-size: 0.94rem;
}
.decision-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.progress-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}
.progress-track { overflow: hidden; height: 8px; border-radius: 999px; background: #e5ecec; }
#progress-bar { display: block; width: 25%; height: 100%; border-radius: inherit; background: var(--teal); transition: width 180ms ease; }
#app { padding: clamp(24px, 5vw, 46px); }
.step-copy { max-width: 720px; margin-bottom: 26px; }
.step-copy p { margin-bottom: 0; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-button {
  display: flex;
  min-height: 112px;
  align-items: flex-start;
  gap: 14px;
  padding: 19px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.choice-button:hover { transform: translateY(-2px); border-color: var(--teal); background: var(--teal-soft); }
.choice-button.type-choice { border-color: #d9d2eb; }
.choice-button.type-choice:hover { border-color: var(--purple); background: var(--purple-soft); }
.choice-icon {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.95rem;
  font-weight: 900;
}
.type-choice .choice-icon { background: var(--purple); color: white; }
.choice-text strong, .choice-text small { display: block; }
.choice-text strong { margin-bottom: 5px; line-height: 1.3; }
.choice-text small { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.choice-safety {
  display: grid;
  gap: 4px;
  margin: -8px 0 20px;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  border-radius: 0 10px 10px 0;
  background: var(--amber-soft);
  color: #5c430d;
  font-size: 0.94rem;
}
.choice-safety strong { line-height: 1.35; }
.choice-safety span { line-height: 1.5; }
.flow-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fbfdfd;
}
.button { min-height: 46px; padding: 10px 16px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 800; }
.button-quiet { border: 1px solid #cbd8d8; background: white; color: var(--teal-dark); }
.button-quiet:hover { background: var(--teal-soft); }
.button-primary { background: var(--teal); color: white; }
.button-primary:hover { background: var(--teal-dark); }
.result-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.result-badge {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: var(--purple);
  color: white;
  font-size: 1.5rem;
  font-weight: 900;
}
.result-badge.pressure { background: var(--teal); }
.result-badge.moisture { background: var(--amber); }
.result-badge.mixed { background: linear-gradient(135deg, var(--teal) 0 50%, var(--amber) 50% 100%); }
.result-badge.leg { background: #446b3c; }
.result-badge.foot { background: #66508d; font-size: .82rem; }
.result-badge.oncology { background: #7a3652; font-size: .92rem; }
.result-badge.abrasion { background: #9a4f22; font-size: .92rem; }
.result-badge.burn { background: #a33a22; font-size: .92rem; }
.result-badge.surgical { background: #2d6478; font-size: .92rem; }
.result-head p { margin-bottom: 0; color: var(--muted); }
.classification-summary {
  margin: -8px 0 22px;
  padding: 14px 16px;
  border: 1px solid #d9d2eb;
  border-radius: 12px;
  background: var(--purple-soft);
  color: #413567;
}
.classification-summary.moisture-summary { border-color: #ead6a5; background: var(--amber-soft); color: #5c430d; }
.classification-summary.mixed-summary { border-color: #bdd5d3; background: linear-gradient(90deg, var(--teal-soft), var(--amber-soft)); color: var(--ink); }
.classification-summary.leg-summary { border-color: #c9dbc4; background: #eef6eb; color: #2f5129; }
.classification-summary.foot-summary { border-color: #d8cdec; background: #f5f0fb; color: #493667; }
.classification-summary.oncology-summary { border-color: #e3c4d1; background: #fbf0f5; color: #642740; }
.classification-summary.abrasion-summary { border-color: #edcfb8; background: #fff5ed; color: #713813; }
.classification-summary.burn-summary { border-color: #efc0b3; background: #fff1ed; color: #762817; }
.classification-summary.surgical-summary { border-color: #bed8e2; background: #eef7fa; color: #214d5e; }
.protocol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.protocol-section { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fcfefe; }
.protocol-section.full { grid-column: 1 / -1; }
.protocol-section h3 { color: var(--teal-dark); }
.protocol-section ul, .status-panel ul, details ul { margin: 0; padding-left: 1.2em; }
.protocol-section li + li, .status-panel li + li, details li + li { margin-top: 6px; }
.avoid { border-color: #ead4d5; background: #fffafa; }
.avoid h3 { color: var(--red); }
.timeline-alert { margin-top: 14px; padding: 16px 18px; border-left: 4px solid var(--amber); border-radius: 0 10px 10px 0; background: var(--amber-soft); }
.timeline-alert strong { color: #654608; }
.timeline-alert.danger { border-left-color: var(--red); background: var(--red-soft); }
.timeline-alert.danger strong { color: var(--red); }
.location-note {
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 4px solid var(--teal);
  border-radius: 0 10px 10px 0;
  background: var(--teal-soft);
}
.location-note strong { color: var(--teal-dark); }
.product-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.product-tag { padding: 6px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 0.86rem; font-weight: 800; }
.product-link { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #acd0cd; cursor: pointer; text-align: left; }
.product-link:hover { border-color: var(--teal); background: #d6ebe8; }
.product-link-hint { padding-left: 7px; border-left: 1px solid #9bc3c0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.product-link.compact { padding-block: 5px; background: white; }
.inline-products { margin-top: 16px; padding-top: 13px; border-top: 1px dashed #cbdada; }
.inline-products > strong { color: var(--teal-dark); font-size: 0.88rem; }
.choice-helper { margin-top: 16px; padding: 14px; border: 1px solid #c8dcda; border-radius: 11px; background: var(--teal-soft); }
.choice-helper > strong { display: block; margin-bottom: 10px; color: var(--teal-dark); }
.choice-helper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-helper article { padding: 12px; border-radius: 9px; background: rgba(255, 255, 255, 0.78); }
.choice-helper h4 { margin: 0 0 4px; color: var(--teal-dark); font-size: 0.94rem; }
.choice-helper p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.clinical-helper { margin-top: 14px; border-color: #c8dcda; background: #fbfdfd; }
.clinical-helper summary { color: var(--teal-dark); }
.clinical-helper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.clinical-helper-grid > div { padding: 12px; border-radius: 9px; background: var(--soft); }
.clinical-helper-grid p { margin: 4px 0 0; }
.prescription-option { border-color: #d9cae7; background: #fbf7ff; }
.prescription-option h3 { color: #5d3d78; }
.source-line { margin: 18px 0 0; color: var(--muted); }
.status-panel { padding: 22px; border-radius: 14px; }
.status-panel.warning { border: 1px solid #f1c6c8; background: var(--red-soft); }
.status-panel.warning h2 { color: var(--red); }
.status-panel.redirect { border: 1px solid #ead6a5; background: var(--amber-soft); }
.status-panel.redirect h2 { color: #714d08; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
details { padding: 0 18px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
summary { padding: 18px 0; color: var(--teal-dark); cursor: pointer; font-weight: 850; }
details p, details li { color: var(--muted); font-size: 0.94rem; }
.terms-help { grid-column: 1 / -1; }
.terms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.terms-grid p { margin: 0; }
.terms-grid strong { color: var(--ink); }
.site-footer { padding-block: 22px; border-top: 1px solid var(--line); background: white; color: var(--muted); font-size: 0.85rem; }

.product-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: white;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(11, 45, 49, 0.3);
}
.product-dialog::backdrop { background: rgba(12, 35, 38, 0.66); backdrop-filter: blur(2px); }
.product-dialog-card { position: relative; padding: clamp(24px, 5vw, 42px); }
.product-dialog-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: -8px -8px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
}
.product-dialog-close:hover { background: var(--teal-soft); }
.product-summary { max-width: 650px; color: var(--muted); font-size: 1.02rem; }
.product-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.product-meta span { padding: 6px 10px; border-radius: 999px; background: var(--soft); color: var(--teal-dark); font-size: 0.82rem; font-weight: 800; }
.product-dialog-section { margin-top: 24px; }
.product-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-option { padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfd; }
.product-option h4 { margin: 0 0 5px; color: var(--teal-dark); font-size: 0.98rem; }
.product-option p { margin: 0; color: var(--muted); font-size: 0.87rem; line-height: 1.45; }
.product-suggestion { margin-top: 18px; padding: 16px 18px; border-left: 4px solid var(--teal); border-radius: 0 10px 10px 0; background: var(--teal-soft); }
.product-suggestion h3, .product-suggestion p { margin-bottom: 0; }
.product-suggestion h3 { color: var(--teal-dark); }
.product-facts { display: grid; gap: 10px; margin: 18px 0 0; }
.product-facts div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.product-facts dt { color: var(--teal-dark); font-weight: 850; }
.product-facts dd { margin: 3px 0 0; color: var(--muted); }
.product-database-note { margin: 18px 0 0; color: var(--muted); font-size: 0.86rem; }

@media (max-width: 760px) {
  .choice-grid, .choice-grid.three, .protocol-grid, .support-grid, .terms-grid, .choice-helper-grid, .clinical-helper-grid { grid-template-columns: 1fr; }
  .protocol-section.full { grid-column: auto; }
  .main-layout { padding-block: 40px 52px; }
  .header-inner { min-height: 74px; }
  .pilot-label { display: none; }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 980px); }
  .brand strong { font-size: 0.96rem; }
  .progress-row { grid-template-columns: 1fr; gap: 8px; padding-inline: 18px; }
  #app { padding: 24px 18px; }
  .flow-actions { padding-inline: 18px; }
  .choice-button { min-height: 104px; }
  .result-head { display: block; }
  .result-badge { margin-bottom: 14px; }
  .footer-inner { display: grid; }
  .product-option-grid { grid-template-columns: 1fr; }
  .product-dialog { width: calc(100% - 16px); max-height: 94vh; }
  .product-dialog-card { padding: 22px 18px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
