:root {
  --blue: #2055a1;
  --navy: #15306b;
  --teal: #06abeb;
  --text: #33475a;
  --ink: #1f1f38;
  --card: #eef4fb;
  --border: #c9d9ec;
  --white: #ffffff;
  --muted: #5c707a;
  --green: #1b7f5a;
  --green-bg: #e6f7f0;
  --brand-gradient: linear-gradient(90deg, #15306b 0%, #2a6fc0 55%, #06abeb 100%);
  --font-sans: "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Courier New", ui-monospace, monospace;
  --radius-card: 12px;
  --radius-btn: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 30px rgba(27, 42, 74, 0.1);
  --shadow-hover: 0 16px 40px rgba(27, 42, 74, 0.15);

  /* Component aliases keep the clinical guide styles tied to brand tokens. */
  --ink-soft: var(--muted);
  --teal-950: var(--navy);
  --teal-900: var(--blue);
  --teal-700: var(--blue);
  --teal-100: var(--border);
  --teal-50: var(--card);
  --cream: var(--white);
  --paper: var(--white);
  --line: var(--border);
  --amber: #a8610a;
  --amber-bg: #fff8e8;
  --blue-bg: var(--card);
  --red: #9f3b3b;
  --red-bg: #fff2f1;
  --shadow: var(--shadow-card);
  --radius: var(--radius-card);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #33475a;
  background-color: var(--paper);
  background-image: radial-gradient(#e4e9f2 1px, transparent 1px);
  background-size: 18px 18px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  color: var(--blue);
  font-weight: 700;
}

button,
select {
  font: inherit;
}

a {
  color: var(--teal-700);
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.shell {
  width: min(1140px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--teal-950);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand-bar {
  height: 8px;
  background: var(--brand-gradient);
}

.site-header {
  position: relative;
  z-index: 10;
  color: #33475a;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: 100%;
  min-height: 76px;
  padding: 0 max(24px, 5vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.tool-identity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.tool-name {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.tool-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border-radius: var(--radius-btn);
}

.tool-mark svg {
  width: 23px;
  height: 23px;
  stroke-width: 2;
}

.hero {
  color: #33475a;
}

.hero-inner {
  max-width: 820px;
  margin: 64px auto;
  padding: 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0;
  color: var(--teal-700);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.15;
}

.hero-copy {
  max-width: 820px;
  margin: 24px auto;
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}

.main-grid {
  display: grid;
  gap: 24px;
  padding-block: 0 76px;
}

.selector-card,
.result,
.empty-state,
.methodology {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.selector-card {
  padding: 28px;
}

.section-heading,
.result-header,
.references-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.step-label,
.card-label {
  margin: 0 0 6px;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.section-heading h2,
.result-header h2,
.references-heading h3 {
  margin: 0;
  letter-spacing: -0.025em;
}

.section-heading h2 {
  font-size: 23px;
}

.text-button {
  padding: 4px 0;
  color: var(--teal-700);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.select-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 20px;
  margin-top: 25px;
}

.field {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field b {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: var(--teal-700);
  background: var(--teal-50);
  border-radius: 50%;
  font-size: 12px;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  min-height: 52px;
  padding: 0 44px 0 15px;
  color: var(--ink);
  background: white;
  border: 1px solid #cbd7d4;
  border-radius: 11px;
  outline: 0;
  cursor: pointer;
  appearance: none;
  font-size: 15px;
  font-weight: 500;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.select-wrap select:hover:not(:disabled) {
  border-color: #8baaa5;
}

.select-wrap select:focus {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(20, 114, 106, 0.13);
}

.select-wrap select:disabled {
  color: #95a2a0;
  background: #f5f7f6;
  cursor: not-allowed;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 20px;
  height: 20px;
  color: var(--teal-700);
  pointer-events: none;
  transform: translateY(-50%);
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 44px 24px;
  text-align: center;
}

.empty-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--teal-700);
  background: var(--teal-50);
  border-radius: 20px;
}

.empty-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.3;
}

.empty-state h2 {
  margin: 0;
  font-size: 20px;
}

.empty-state p {
  max-width: 430px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.result {
  padding: 30px;
}

.result-header {
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.organ-badge {
  display: inline-flex;
  margin: 0 0 9px;
  padding: 5px 10px;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-header h2 {
  max-width: 760px;
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1.32;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--teal-700);
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--teal-50);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.guidance-card {
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.action-card {
  display: flex;
  gap: 17px;
  margin-top: 24px;
  background: var(--card);
  border-color: var(--border);
}

.action-card.urgent {
  background: var(--red-bg);
  border-color: #f0d1ce;
}

.action-card.follow-up {
  background: var(--blue-bg);
  border-color: #d6e2ed;
}

.card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.urgent .card-icon {
  color: var(--red);
}

.follow-up .card-icon {
  color: var(--blue);
}

.card-icon svg {
  width: 21px;
  height: 21px;
}

.action-copy {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.48;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.card-title-row .card-label {
  margin: 0;
}

.contrast-icon {
  width: 34px;
  height: 34px;
  color: var(--amber);
  background: var(--amber-bg);
  border-color: #f2dfb7;
}

.rationale-icon {
  width: 34px;
  height: 34px;
  color: var(--blue);
  background: var(--blue-bg);
  border-color: #d6e2ed;
}

.detail-copy {
  margin: 0;
  color: #3e514f;
  font-size: 15px;
  line-height: 1.65;
}

.references-card {
  margin-top: 18px;
  padding: 22px;
  background: #fafbfaf2;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.references-heading {
  align-items: center;
}

.references-heading h3 {
  font-size: 18px;
}

.references-heading > span {
  padding: 5px 9px;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.reference-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 18px 0 0 26px;
  border-top: 1px solid var(--line);
}

.reference-list li {
  padding-left: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.reference-list li::marker {
  color: var(--teal-700);
  font-weight: 800;
}

.reference-list a {
  display: inline;
  color: var(--teal-700);
  font-weight: 600;
  text-underline-offset: 2px;
}

.reference-list a:hover {
  color: var(--teal-950);
}

.external-icon {
  width: 13px;
  height: 13px;
  display: inline-block;
  margin-left: 4px;
  vertical-align: -2px;
}

.clinical-note {
  display: flex;
  gap: 16px;
  padding: 22px 24px;
  color: #6b4a18;
  background: var(--amber-bg);
  border: 1px solid #ead6a8;
  border-radius: 14px;
}

.clinical-note > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.clinical-note h2 {
  margin: 0 0 5px;
  font-size: 15px;
}

.clinical-note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
}

.methodology {
  overflow: hidden;
  box-shadow: none;
}

.methodology summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
}

.methodology summary::-webkit-details-marker {
  display: none;
}

.methodology summary > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.methodology summary > span svg,
.methodology .chevron {
  width: 19px;
  height: 19px;
  color: var(--teal-700);
}

.methodology .chevron {
  transition: transform 180ms ease;
}

.methodology[open] .chevron {
  transform: rotate(180deg);
}

.methodology-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.methodology-body p {
  margin: 18px 0 0;
}

.methodology-body .updated {
  color: var(--ink);
  font-weight: 700;
}

.site-footer {
  padding: 28px max(24px, 5vw);
  color: #c7d4ea;
  background: var(--teal-950);
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  padding: 11px 16px;
  color: white;
  background: var(--teal-950);
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: 13px;
  font-weight: 700;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .main-grid {
    gap: 18px;
    padding-block: 0 50px;
  }

  .selector-card,
  .result {
    padding: 21px;
  }

  .select-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .select-grid {
    gap: 16px;
    margin-top: 21px;
  }

  .empty-state {
    min-height: 240px;
  }

  .result-header {
    align-items: flex-start;
    padding-bottom: 22px;
  }

  .guidance-card,
  .references-card {
    padding: 18px;
  }

  .action-copy {
    font-size: 16px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 32px);
  }

  .header-inner {
    min-height: 64px;
    padding: 0 16px;
  }

  .hero-inner {
    margin: 48px auto;
    padding: 0;
  }

  .header-inner {
    gap: 12px;
  }

}

@media (max-width: 420px) {
  .section-heading {
    display: block;
  }

  .section-heading .text-button {
    margin-top: 8px;
  }

  .action-card {
    display: block;
  }

  .action-card .card-icon {
    margin-bottom: 13px;
  }
}

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

@media print {
  .site-header,
  .selector-card,
  .empty-state,
  .clinical-note,
  .methodology,
  .site-footer,
  .icon-button {
    display: none !important;
  }

  body,
  .hero {
    color: black;
    background: white;
  }

  .hero-inner {
    padding: 20px 0;
  }

  .hero-copy {
    color: #333;
  }

  .main-grid {
    padding: 0;
  }

  .result {
    display: block !important;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
