:root {
  color-scheme: light;
  --ink: #1f2933;
  --secondary: #33454f;
  --muted: #5f6f7a;
  --line: #d7e0e6;
  --panel: #ffffff;
  --panel-alt: #fbfcfd;
  --wash: #f3f6f8;
  --brand: #0b7285;
  --brand-deep: #075e6f;
  --brand-bright: #0e899d;
  --brand-soft: #e8f6f8;
  --brand-gradient: linear-gradient(135deg, var(--brand-deep), var(--brand-bright));
  --green: #147a55;
  --green-soft: #e9f7f0;
  --amber: #a46010;
  --amber-soft: #fff3df;
  --blue: #2563a8;
  --blue-soft: #e9f1fb;
  --gray: #53616b;
  --gray-soft: #eef2f4;
  --danger: #9f2f2f;
  --shadow: 0 12px 34px rgba(31, 41, 51, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wash);
  color: var(--ink);
}

a { color: var(--brand); font-weight: 800; text-decoration-thickness: 0.08em; text-underline-offset: 0.16em; }

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

.site-shell {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--brand-gradient);
  color: white;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(11, 114, 133, 0.18);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
}

.nav-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-links a[aria-current="page"] { color: var(--brand); }

.hero {
  display: grid;
  gap: 18px;
  padding: 18px 0 12px;
}

.hero h1,
.tool-intro h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-kicker,
.tool-kicker,
.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-copy,
.tool-dek {
  max-width: 760px;
  margin: 0;
  color: var(--secondary);
  font-size: 1.04rem;
  line-height: 1.52;
}

.command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.consult-rotator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: clamp(1.28rem, 5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.08;
}

.specialty-rotator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 260px);
  min-height: 54px;
  border: 1.5px solid #9fcbd2;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #eefbfc 100%);
  color: var(--brand-deep);
  box-shadow: 0 4px 14px rgba(31, 41, 51, 0.08);
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.specialty-rotator:hover,
.specialty-rotator:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 8px 22px rgba(11, 114, 133, 0.16);
  transform: translateY(-1px);
}

.specialty-rotator.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: white;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 6px 16px rgba(11, 114, 133, 0.18);
}

.section,
.home-note {
  margin-top: 30px;
}

.section h2,
.home-note h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.home-note {
  padding: 16px;
}

.home-note p {
  max-width: 800px;
  margin: 0;
  color: var(--secondary);
  line-height: 1.5;
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tool-card,
.info-panel,
.home-note,
.references,
.dotphrase-card,
.faq-section,
.calculator {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-card {
  display: grid;
  gap: 9px;
  border: 1.5px solid #bccbd3;
  border-left: 5px solid var(--brand);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(31, 41, 51, 0.06);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.tool-card[href] { cursor: pointer; }

.tool-card:hover,
.tool-card:focus-visible {
  outline: none;
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 6px 16px rgba(31, 41, 51, 0.1);
  transform: translateY(-1px);
}

.tool-card[aria-disabled="true"] {
  border-left-color: var(--gray);
  box-shadow: none;
  cursor: default;
}

.tool-card[aria-disabled="true"]:hover {
  border-color: #bccbd3;
  border-left-color: var(--gray);
  background: var(--panel);
  transform: none;
}

.tool-card .status {
  width: max-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-card[aria-disabled="true"] .status {
  background: var(--gray-soft);
  color: var(--gray);
}

.tool-card h3,
.info-panel h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.tool-card p,
.info-panel p,
.info-panel li {
  margin: 0;
  color: var(--muted);
  line-height: 1.46;
  font-size: 0.94rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-panel { padding: 16px; }
.info-panel ul { margin: 9px 0 0; padding-left: 18px; }
.morph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.morph-grid .info-panel { box-shadow: none; }

.tool-intro {
  display: grid;
  gap: 10px;
  padding: 14px 0 18px;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbfc;
  padding: 6px 9px;
  font-weight: 800;
}

.calculator { padding: 16px; }
.trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}
.trail-item { display: inline-flex; align-items: center; }
.trail-item + .trail-item::before {
  content: ">";
  margin: 0 3px 0 0;
  color: var(--brand);
  font-weight: 900;
}
.decision { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-alt); padding: 16px; }
.decision-label { display: inline-flex; margin-bottom: 9px; border-radius: 999px; background: var(--brand-gradient); color: white; padding: 5px 9px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.decision h2 { margin: 0 0 8px; font-size: clamp(1.25rem, 2.8vw, 1.85rem); line-height: 1.1; letter-spacing: 0; }
.decision p { margin: 0; max-width: 820px; color: var(--muted); line-height: 1.48; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.choice {
  position: relative;
  border: 1.5px solid #bccbd3;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 14px 40px 14px 14px;
  text-align: left;
  cursor: pointer;
  min-height: 86px;
  box-shadow: 0 3px 10px rgba(31, 41, 51, 0.06);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.choice::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--brand);
  border-right: 2px solid var(--brand);
  transform: translateY(-50%) rotate(45deg);
}
.choice:hover,
.choice:focus-visible {
  outline: none;
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 6px 16px rgba(31, 41, 51, 0.1);
  transform: translateY(-1px);
}
.choice b { display: block; margin-bottom: 6px; font-size: 0.96rem; }
.choice span { display: block; color: var(--muted); line-height: 1.38; font-size: 0.89rem; }
.result-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: white; }
.result-banner { padding: 18px; border-bottom: 1px solid var(--line); }
.result-card.consult .result-banner { background: var(--green-soft); border-left: 6px solid var(--green); }
.result-card.pathway .result-banner { background: var(--amber-soft); border-left: 6px solid var(--amber); }
.result-card.benign .result-banner { background: var(--blue-soft); border-left: 6px solid var(--blue); }
.result-card.other .result-banner { background: var(--gray-soft); border-left: 6px solid var(--gray); }
.result-tag { display: inline-flex; margin-bottom: 8px; border-radius: 999px; color: white; padding: 5px 9px; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.result-card.consult .result-tag { background: var(--green); }
.result-card.pathway .result-tag { background: var(--amber); }
.result-card.benign .result-tag { background: var(--blue); }
.result-card.other .result-tag { background: var(--gray); }
.result-banner h2 { margin: 0 0 8px; font-size: clamp(1.45rem, 3.6vw, 2.45rem); line-height: 1.05; letter-spacing: 0; }
.result-banner p { margin: 0; max-width: 840px; color: #34464d; line-height: 1.48; font-size: 1rem; }
.result-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.detail { padding: 16px; border-top: 1px solid var(--line); }
.detail:nth-child(1), .detail:nth-child(2) { border-top: 0; }
.detail:nth-child(odd) { border-right: 1px solid var(--line); }
.detail h3 { margin: 0 0 7px; font-size: 0.84rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.detail p { margin: 0; color: var(--secondary); line-height: 1.46; font-size: 0.94rem; }
.detail ul { margin: 0; padding-left: 18px; color: var(--secondary); line-height: 1.46; font-size: 0.94rem; }
.citation { font-weight: 900; color: var(--brand); }
.controls { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.reset, .back { border-radius: 8px; padding: 11px 14px; font-weight: 850; cursor: pointer; white-space: nowrap; }
.reset { border: 0; background: var(--ink); color: white; }
.back { border: 1px solid var(--line); background: var(--gray-soft); color: var(--ink); }
.back:disabled { cursor: not-allowed; opacity: 0.45; }
.controls button[hidden] { display: none; }
.dotphrase-card,
.faq-section,
.references,
.keyword-section,
.related-links {
  margin-top: 18px;
  padding: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading-row h2,
.faq-section h2,
.references h2,
.keyword-section h2,
.related-links h2 {
  margin: 4px 0 10px;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.copy-button {
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-gradient);
  color: white;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.copy-button.copied { background: var(--green); border-color: var(--green); }

.dotphrase-text {
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink);
  padding: 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  font: 0.95rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.consult-tips {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.consult-tips h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.consult-tips ul,
.references ul { margin: 0; padding-left: 18px; }

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  padding: 12px 14px;
}

.faq-list summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.faq-list p {
  margin: 8px 0 0;
  color: var(--muted);
}

.keyword-section ul,
.related-links ul { margin: 0; padding-left: 18px; }
.keyword-section li,
.related-links li { margin: 6px 0; }
.keyword-section p { margin: 0; color: var(--muted); }
.keyword-example {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--secondary);
  margin: 8px 0 0;
  padding: 12px;
  font: 0.92rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.references a,
.related-links a { color: var(--brand); font-weight: 850; }
.fine-print { margin-top: 18px; color: #69777d; font-size: 0.82rem; line-height: 1.5; }
.cta-band { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f9fbfc; }
.cta-band p { max-width: 760px; margin: 6px 0 0; color: var(--muted); line-height: 1.48; }

@media (max-width: 820px) {
  .site-shell { width: min(100vw - 20px, 680px); padding-top: 12px; }
  .site-nav { align-items: flex-start; flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .tool-list, .info-grid, .choice-grid, .result-details { grid-template-columns: 1fr; }
  .detail, .detail:nth-child(odd) { border-right: 0; border-top: 1px solid var(--line); }
  .detail:first-child { border-top: 0; }
  .controls, .section-heading-row { align-items: stretch; flex-direction: column; }
  .consult-rotator { align-items: stretch; flex-direction: column; gap: 8px; }
  .specialty-rotator { justify-content: flex-start; width: 100%; min-height: 52px; }
  .button, .reset, .back, .copy-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .specialty-rotator,
  .tool-card,
  .choice,
  .button,
  .copy-button {
    transition: none;
  }
}
