/* Urinary Stone Passage Calculator - public page styles */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #0050b3;
  --primary-dark: #003a82;
  --text: #1f2933;
  --heading: #102a43;
  --muted: #5a7184;
  --border: #d8e2f2;
  --border-soft: #e5edf5;
  --bg: #f7fafc;
  --bg-alt: #eef4ff;
  --card: #ffffff;
  --green: #15803d;
  --green-bg: #dcfce7;
  --orange: #c2410c;
  --orange-bg: #ffedd5;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --amber: #92400e;
  --amber-bg: #fffbeb;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.1);
  --header-height: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

body.tooltip-open {
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Merriweather", Georgia, serif;
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 0.9rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1140px, calc(100% - 3.2rem));
  margin: 0 auto;
}

.section {
  padding: 3.4rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(8px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

/* Calculator header fit refinements */
.brand {
  flex: 0 0 auto;
  min-width: 245px;
}

.brand-link {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-dark);
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: var(--primary-dark);
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.42rem;
  font-size: 0.86rem;
}

.main-nav a {
  color: #334e68;
  padding: 0.32rem 0.48rem;
  border-radius: 999px;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: #d0e8ff;
  color: var(--primary-dark);
  text-decoration: none;
}

.main-nav a.active {
  background: var(--primary);
  color: #fff;
}

/* Hero */
.checker-hero {
  background: linear-gradient(135deg, #e3f0ff 0%, #ffffff 52%, #e0f7ff 100%);
  padding: 4.2rem 0 3.6rem;
}

.checker-hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero-subtitle {
  max-width: 46rem;
  color: #334e68;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.6rem 1.22rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 80, 179, 0.24);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid #c0d4f5;
}

.btn-secondary:hover {
  background: #e5edf9;
}

.hero-safety-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  max-width: 48rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #fffbeb 0%, #fff7da 100%);
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.08);
}

.safety-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 0.1rem;
}

.hero-safety-note p {
  margin: 0;
  color: #6b3a08;
  font-size: 0.91rem;
}

.checker-summary-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.checker-summary-card h2 {
  font-size: 1.25rem;
}

.summary-list {
  padding-left: 1.15rem;
  margin: 0 0 1rem;
}

.summary-list li {
  margin-bottom: 0.45rem;
}

.privacy-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--primary-dark);
  border: 1px solid #cfe4ff;
  padding: 0.28rem 0.55rem;
  font-size: 0.79rem;
  font-weight: 700;
}

/* Calculator layout */
.checker-layout {
  display: grid;
  gap: 1.4rem;
  align-items: start;
}

.checker-form {
  display: grid;
  gap: 1rem;
}

.form-section-card,
.empty-result,
.result-content,
.result-key-card,
.seo-intro-card,
.guidance-card,
.clinician-card,
.faq-card,
.review-cta-card,
.medical-review-card,
.references-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: clamp(1.25rem, 2.1vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}

.form-section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
  font-size: 1.22rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
}

.form-grid {
  display: grid;
  gap: 0.95rem;
}

.field-group {
  min-width: 0;
}

.label-row,
.checkbox-group legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.6rem;
}

.label-row label,
.checkbox-group legend {
  color: #334e68;
  font-size: 0.92rem;
  font-weight: 760;
}

.field-group select {
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid #c4d4eb;
  border-radius: 0.7rem;
  background: #fff;
  color: var(--text);
  padding: 0.55rem 0.72rem;
  font: inherit;
  margin-top: 0.28rem;
}

.field-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 80, 179, 0.15);
}

.field-group select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.checkbox-group {
  border: 0;
  padding: 0;
  margin: 1rem 0 0;
}

.checkbox-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.78rem;
  background: #f8fbff;
}

.check-row input {
  margin-top: 0.25rem;
}

.check-row label {
  color: #334e68;
  font-size: 0.91rem;
}

.info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.22rem;
  height: 1.22rem;
  padding: 0;
  border: 1px solid #a9c9f5;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.info-button:hover,
.info-button:focus,
.info-button[aria-expanded="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  outline: none;
}

.info-button.mini {
  width: 1.12rem;
  height: 1.12rem;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.info-popover {
  display: none;
}

.info-popover.tooltip-floating {
  position: fixed;
  display: block;
  z-index: 2000;
  width: min(310px, calc(100vw - 2rem));
  padding: 0.72rem 0.82rem;
  border: 1px solid #bfd7fb;
  border-radius: 0.82rem;
  background: #fff;
  color: #334e68;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-size: 0.88rem;
  line-height: 1.45;
}

.info-popover.tooltip-floating::before {
  content: "";
  position: absolute;
  left: var(--arrow-left, 50%);
  top: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: #fff;
  border-left: 1px solid #bfd7fb;
  border-top: 1px solid #bfd7fb;
}

.info-popover.tooltip-floating.below::before {
  top: -7px;
}

.info-popover.tooltip-floating.above::before {
  top: auto;
  bottom: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid #bfd7fb;
  border-bottom: 1px solid #bfd7fb;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Results */
.result-panel {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.empty-result,
.result-content {
  min-height: 13rem;
}

.empty-result {
  border-style: dashed;
  background: #f8fbff;
  color: #334e68;
}

.result-content {
  border-top: 6px solid var(--primary);
}

.result-content.result-green {
  border-top-color: var(--green);
}

.result-content.result-orange {
  border-top-color: var(--orange);
}

.result-content.result-red {
  border-top-color: var(--red);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.34rem 0.72rem;
  color: #fff;
  background: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}

.result-badge.green {
  background: var(--green);
}

.result-badge.orange {
  background: var(--orange);
}

.result-badge.red {
  background: var(--red);
}

/* Result passage card */
.passage-card {
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  background: #f8fbff;
  padding: 0.95rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.passage-card.passage-safety {
  background: linear-gradient(180deg, #fffafa 0%, #fff 100%);
  border-color: #f4b8b8;
}

.passage-card.passage-review {
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
  border-color: #f8d79a;
}

.passage-card.passage-na {
  background: #f8fbff;
}

.passage-head {
  display: grid;
  gap: 0.45rem;
  align-items: start;
  justify-items: start;
}

.passage-head h3 {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.25;
}

.passage-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--primary-dark);
  border: 1px solid #cfe4ff;
  padding: 0.24rem 0.62rem;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.passage-safety .passage-label {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.passage-review .passage-label {
  background: #fff3cd;
  border-color: #f8d79a;
  color: #92400e;
}

.passage-na .passage-label {
  background: #eef4ff;
  color: #334e68;
}

.meter {
  height: 0.62rem;
  border-radius: 999px;
  background: #e5edf5;
  overflow: hidden;
  margin: 0.7rem 0 0.5rem;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.result-green .meter span {
  background: var(--green);
}

.result-orange .meter span {
  background: var(--orange);
}

.result-red .meter span {
  background: var(--red);
}

#passageText {
  margin: 0.55rem 0 0;
  color: #334e68;
  font-size: 0.92rem;
  line-height: 1.55;
}

.passage-safety #passageText,
.passage-review #passageText {
  color: #243b53;
}

.result-lead {
  color: #334e68;
}

.result-block {
  border-top: 1px solid var(--border-soft);
  margin-top: 0.95rem;
  padding-top: 0.85rem;
}

.result-block h3 {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.result-block ul {
  margin: 0;
  padding-left: 1.15rem;
}

.result-block li {
  margin-bottom: 0.35rem;
}

/* Result guide */
.result-key-card {
  display: grid;
  gap: 1rem;
}

.result-key-grid {
  display: grid;
  gap: 0.7rem;
}

.key-chip {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #fff;
  padding: 0.62rem 0.85rem;
}

.key-chip div {
  display: grid;
  gap: 0.05rem;
}

.key-chip strong {
  line-height: 1.1;
}

.key-chip span:not(.key-dot) {
  color: var(--muted);
  font-size: 0.85rem;
}

.key-dot {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 0.85rem;
  border-radius: 999px;
}

.key-green .key-dot {
  background: var(--green);
}

.key-orange .key-dot {
  background: var(--orange);
}

.key-red .key-dot {
  background: var(--red);
}

/* SEO and guidance sections */
.seo-intro-card,
.guidance-card,
.clinician-card,
.faq-card,
.references-card {
  max-width: none;
}

.result-key-card > p,
.seo-intro-card > p,
.guidance-card > p,
.clinician-card > div > p,
.faq-card > p,
.review-cta-card > div > p,
.medical-review-card p,
.references-card > p {
  max-width: none;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Keep the post-calculator information cards visually connected. */
.result-key-section,
.seo-intro-section,
.stone-guide-section,
.clinician-section {
  padding: 0.42rem 0;
}

.result-key-section {
  padding-top: 0.9rem;
}

.clinician-section {
  padding-bottom: 1.2rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 0.85rem;
}

.guidance-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fff;
}

.guidance-table th,
.guidance-table td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.guidance-table th {
  background: #eef6ff;
  color: var(--primary-dark);
  font-weight: 850;
}

.guidance-table tr:last-child td {
  border-bottom: 0;
}

.clinician-card {
  display: grid;
  gap: 1rem;
}

.clinician-grid {
  display: grid;
  gap: 0.85rem;
}

.clinician-point {
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  background: #f8fbff;
  padding: 0.95rem;
}

.clinician-point h3 {
  font-family: system-ui, sans-serif;
  margin-bottom: 0.35rem;
}

.clinician-point p {
  margin-bottom: 0;
  color: #334e68;
  font-size: 0.92rem;
}

/* FAQ */
.faq-accordion {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: 0.9rem;
  background: #fff;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  color: var(--heading);
  font-weight: 800;
  cursor: pointer;
}

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

.faq-item summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 1.45rem;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--primary);
  color: #fff;
}

.faq-answer {
  padding: 0 1rem 1rem;
  color: #334e68;
}

.faq-answer p {
  margin-bottom: 0;
}

/* CTA, review, references */
.review-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-left: 5px solid var(--primary);
}

.review-cta-card p {
  margin-bottom: 0;
}

.medical-review-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.reference-list {
  margin: 0;
  padding-left: 1.25rem;
}

.reference-list li {
  margin-bottom: 0.72rem;
}

/* Footer */
.footer {
  background: hsl(210, 100%, 25%);
  color: #fff;
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: hsl(197, 71%, 78%);
  font-weight: 700;
}

/* Responsive */
@media (min-width: 760px) {
  .checker-hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checker-layout {
    grid-template-columns: minmax(0, 1.36fr) minmax(320px, 0.64fr);
  }

  .result-key-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .clinician-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  /* Mobile calculator header fit reset */
  .brand {
    min-width: 0;
  }

  .brand-title,
  .brand-subtitle {
    white-space: normal;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.2rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
  }
}

@media (max-width: 759px) {
  body {
    font-size: 15.5px;
  }

  .container {
    width: min(100% - 2rem, 1100px);
  }

  .section {
    padding: 2.4rem 0;
  }

  .result-key-section,
  .seo-intro-section,
  .stone-guide-section,
  .clinician-section {
    padding: 0.55rem 0;
  }

  .result-key-section {
    padding-top: 0.9rem;
  }

  .clinician-section {
    padding-bottom: 1.25rem;
  }

  .checker-hero {
    padding: 3rem 0 2.5rem;
  }

  .result-panel {
    position: static;
  }

  .form-actions .btn,
  .hero-actions .btn,
  .review-cta-card .btn {
    width: 100%;
  }

  .review-cta-card {
    align-items: stretch;
    flex-direction: column;
  }

  .medical-review-card {
    grid-template-columns: 1fr;
  }

  .passage-head {
    flex-direction: column;
    gap: 0.45rem;
  }

  .key-chip {
    border-radius: 0.9rem;
  }

  .brand-subtitle {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 1.4rem, 1100px);
  }

  .form-section-card,
  .empty-result,
  .result-content,
  .result-key-card,
  .seo-intro-card,
  .guidance-card,
  .clinician-card,
  .faq-card,
  .review-cta-card,
  .medical-review-card,
  .references-card,
  .checker-summary-card {
    padding: 1.08rem;
  }

  .check-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .check-row .info-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media print {
  .site-header,
  .checker-form,
  .hero-actions,
  .footer,
  .nav-toggle,
  .info-button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .result-panel {
    position: static;
  }

  .form-section-card,
  .empty-result,
  .result-content,
  .result-key-card,
  .seo-intro-card,
  .guidance-card,
  .clinician-card,
  .faq-card,
  .review-cta-card,
  .medical-review-card,
  .references-card {
    box-shadow: none;
  }
}

/* Nepali language refinements */
html[lang="ne"] .kicker {
  letter-spacing: 0.015em;
  text-transform: none;
}

html[lang="ne"] .main-nav,
html[lang="ne"] select,
html[lang="ne"] button,
html[lang="ne"] input {
  font-family: inherit;
}

/* =========
   FINAL HEADER HARMONISATION
   Match Stone Calculator header with the main website header.
   Keeps the qualification line on one row on desktop,
   prevents active menu tab from turning blue,
   and uses the same desktop/mobile breakpoint behaviour.
   ========= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #d8e2f2;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: auto;
  gap: 0.55rem;
  padding: 0.7rem 0;
}

.brand-link {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-decoration: none;
}

.brand-title {
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.2;
  color: #003a82;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  font-size: 0.70rem;
  line-height: 1.25;
  color: #5a7184;
  margin-top: 0;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.22rem;
  font-size: 0.78rem;
}

.main-nav a {
  color: #334e68;
  padding: 0.32rem 0.28rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active:hover {
  background-color: #d0e8ff;
  color: #003a82;
  text-decoration: none;
}

/* Do not show the current Stone Calculator tab as a blue pill */
.main-nav a.active {
  background-color: transparent;
  color: #334e68;
}

@media (min-width: 769px) {
  .site-header .brand {
    flex: 0 0 318px;
    min-width: 318px;
  }
}

@media (min-width: 769px) and (max-width: 1080px) {
  .site-header .brand {
    flex: 0 0 300px;
    min-width: 300px;
  }

  .site-header .brand-subtitle {
    font-size: 0.66rem;
  }

  .site-header .main-nav {
    gap: 0.18rem;
    font-size: 0.74rem;
  }

  .site-header .main-nav a {
    padding-left: 0.24rem;
    padding-right: 0.24rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-header .brand {
    min-width: 0;
  }

  .brand-title,
  .brand-subtitle {
    margin-left: 15px;
    white-space: normal;
  }

  .brand-subtitle {
    font-size: 0.8rem;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 1.2rem 0.8rem;
    gap: 0.35rem;
    background-color: #ffffff;
    border-bottom: 1px solid #d8e2f2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: 0.45rem 0.7rem;
  }
}

@media (max-width: 400px) {
  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.7rem;
  }
}
