.page-header {
  padding: 0.85rem 0;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}

.page-header-inner {
  width: 100%;
  max-width: 1208px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.page-nav-left {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
}

.page-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.page-logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.page-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 260px;
}

.page-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  flex-wrap: nowrap;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-menu a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  color: #475467;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.page-menu a:hover {
  color: var(--brand-blue);
  background: #f3f8ff;
}

.page-menu a.active {
  color: var(--brand-blue);
  background: #eaf2ff;
}

.header-icon-btn,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #475467;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 1.15rem;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.header-icon-btn:hover,
.nav-toggle:hover {
  color: var(--brand-blue);
  background: #f3f8ff;
  border-color: #e4ebf5;
}

.nav-toggle {
  display: none;
}

.header-search {
  margin-top: 0.75rem;
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  padding: 0.55rem 0.75rem;
  background: #f7f8fa;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.header-search-form > .bi-search {
  color: var(--text-muted);
  font-size: 1rem;
}

.header-search-form .form-control {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--brand-navy);
  font-size: 0.92rem;
}

.header-search-form .form-control:focus {
  box-shadow: none;
}

.header-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.header-search-close:hover {
  color: var(--brand-blue);
  background: #fff;
}

.calculator-container {
  max-width: 1208px;
  padding-top: 1.4rem;
  padding-bottom: 3.5rem;
}

.calculator-breadcrumb {
  margin-bottom: 1.6rem;
  font-size: 0.85rem;
}

.calculator-breadcrumb a {
  color: var(--brand-blue);
  text-decoration: none;
}

.calculator-intro {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.calculator-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  color: var(--brand-blue);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calculator-intro h1 {
  margin: 0 0 0.65rem;
  color: var(--brand-navy);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.calculator-intro p {
  margin: 0;
  color: #5f6b7a;
  font-size: 1rem;
  line-height: 1.65;
}

.calculator-card,
.bmi-reference {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(29, 33, 41, 0.06);
}

.calculator-card {
  padding: 1.6rem;
}

.calculator-card-head {
  margin-bottom: 1.25rem;
}

.calculator-card-head h2,
.bmi-reference h2,
.bmi-content h2 {
  margin: 0 0 0.35rem;
  color: var(--brand-navy);
  font-size: 1.2rem;
  font-weight: 700;
}

.calculator-card-head p,
.bmi-reference > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.unit-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-bottom: 1.4rem;
  padding: 0.25rem;
  background: #f1f4f8;
  border-radius: 10px;
}

.unit-option {
  padding: 0.65rem 0.8rem;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.unit-option.active {
  color: var(--brand-blue);
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 33, 41, 0.08);
}

.form-label {
  color: #344054;
  font-size: 0.88rem;
  font-weight: 650;
}

.calculator-input .form-control,
.calculator-input .input-group-text {
  min-height: 48px;
  border-color: #dfe3e8;
}

.calculator-input .form-control {
  color: var(--brand-navy);
  font-weight: 600;
}

.calculator-input .form-control:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.calculator-input .input-group-text {
  min-width: 48px;
  justify-content: center;
  color: #667085;
  background: #f7f8fa;
  font-size: 0.84rem;
  font-weight: 650;
}

.calculator-alert {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.86rem;
}

.calculator-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.calculate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1.35rem;
  color: #fff;
  background: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.calculate-button:hover,
.calculate-button:focus {
  color: #fff;
  background: #155fc0;
  border-color: #155fc0;
}

.reset-link {
  color: #667085;
  font-size: 0.88rem;
  text-decoration: none;
}

.reset-link:hover {
  color: var(--brand-blue);
}

.result-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1.35rem 1.5rem;
  background: #f5f9ff;
  border: 1px solid #cfe1fa;
  border-left: 5px solid var(--brand-blue);
  border-radius: 14px;
}

.result-label {
  display: block;
  margin-bottom: 0.15rem;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-number {
  color: var(--brand-navy);
  font-size: 2.5rem;
  line-height: 1;
}

.result-summary {
  padding-left: 1.5rem;
  border-left: 1px solid #d8e2ee;
}

.result-badge {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.7rem;
  color: #fff;
  background: var(--brand-blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.result-summary p {
  margin: 0;
  color: #5f6b7a;
  font-size: 0.88rem;
}

.result-underweight {
  border-left-color: #4d9aef;
}

.result-underweight .result-badge {
  background: #4d9aef;
}

.result-healthy {
  border-left-color: #22a06b;
}

.result-healthy .result-badge {
  background: #22a06b;
}

.result-overweight {
  border-left-color: #e5a323;
}

.result-overweight .result-badge {
  background: #e5a323;
}

.result-obesity {
  border-left-color: #df5b64;
}

.result-obesity .result-badge {
  background: #df5b64;
}

.bmi-reference {
  padding: 1.5rem;
}

.bmi-scale {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.5fr 2fr;
  gap: 3px;
  height: 8px;
  margin: 1.3rem 0 1rem;
  overflow: hidden;
  border-radius: 999px;
}

.scale-under,
.dot-under {
  background: #4d9aef;
}

.scale-healthy,
.dot-healthy {
  background: #22a06b;
}

.scale-over,
.dot-over {
  background: #e5a323;
}

.scale-obesity,
.dot-obesity {
  background: #df5b64;
}

.bmi-category-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bmi-category-list li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0;
  color: #475467;
  border-bottom: 1px solid #eef0f3;
  font-size: 0.84rem;
}

.bmi-category-list li:last-child {
  border-bottom: 0;
}

.bmi-category-list strong {
  color: var(--brand-navy);
  font-weight: 650;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.reference-note {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.85rem;
  color: #5f6b7a;
  background: #f7f8fa;
  border-radius: 10px;
}

.reference-note i {
  flex-shrink: 0;
  color: var(--brand-blue);
}

.reference-note p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
}

.bmi-faq {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.bmi-faq-head {
  max-width: 720px;
  margin-bottom: 1.25rem;
}

.bmi-faq-head h2 {
  margin: 0 0 0.4rem;
  color: var(--brand-navy);
  font-size: 1.35rem;
  font-weight: 700;
}

.bmi-faq-head p {
  margin: 0;
  color: #5f6b7a;
  font-size: 0.92rem;
  line-height: 1.6;
}

.bmi-faq-list {
  display: grid;
  gap: 0;
}

.bmi-faq-item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-light);
}

.bmi-faq-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.bmi-faq-item h3 {
  margin: 0 0 0.45rem;
  color: var(--brand-navy);
  font-size: 1rem;
  font-weight: 700;
}

.bmi-faq-item p {
  margin: 0;
  max-width: 920px;
  color: #5f6b7a;
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Share + disclaimer */
.tool-share {
  margin-top: 2.5rem;
  padding: 1.35rem 1.4rem 1.4rem;
  background: #f5f8fc;
  border: 1px solid #e4edf8;
  border-radius: 14px;
}

.tool-share-title {
  margin: 0 0 0.85rem;
  color: var(--brand-navy);
  font-size: 1rem;
  font-weight: 700;
}

.tool-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.tool-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  color: var(--brand-navy);
  background: #fff;
  border: 1px solid #d9e4f2;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, background 0.2s;
}

.tool-share-btn:hover {
  color: var(--brand-blue);
  border-color: rgba(26, 115, 232, 0.35);
  box-shadow: 0 2px 8px rgba(29, 33, 41, 0.06);
}

.tool-share-btn.is-copied {
  color: #157347;
  border-color: #a3d9b1;
  background: #f1faf4;
}

.tool-share-btn i {
  font-size: 1rem;
  line-height: 1;
}

.tool-share-disclaimer {
  margin: 0;
  max-width: 920px;
  padding-top: 0.95rem;
  border-top: 1px dashed #d7e3f2;
  color: #5f6b7a;
  font-size: 0.86rem;
  line-height: 1.65;
}

.tool-share-disclaimer a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tool-share-disclaimer a:hover {
  color: #1557b0;
}

.disclaimer-content h2 {
  margin: 0 0 0.45rem;
  color: var(--brand-navy);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Related tools */
.related-tools {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.related-card {
  display: block;
  height: 100%;
  padding: 1.55rem 1.1rem 1.35rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: rgba(26, 115, 232, 0.25);
  box-shadow: var(--card-hover-shadow);
  color: inherit;
}

.related-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--icon-bg);
  color: var(--brand-blue);
  font-size: 1.4rem;
}

.related-name {
  margin: 0 0 0.3rem;
  color: var(--brand-navy);
  font-size: 0.98rem;
  font-weight: 700;
}

.related-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

@media (max-width: 991.98px) {
  .page-nav {
    display: flex;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .page-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    left: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.55rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
  }

  .page-menu.is-open {
    display: flex;
  }

  .page-menu a {
    padding: 0.7rem 0.85rem;
  }
}

@media (max-width: 575.98px) {
  .page-header {
    padding: 0.7rem 0;
  }

  .page-logo {
    height: 42px;
    max-width: 200px;
  }

  .calculator-card,
  .bmi-reference {
    padding: 1.2rem;
  }

  .calculator-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reset-link {
    text-align: center;
  }

  .result-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-summary {
    padding-top: 1rem;
    padding-left: 0;
    border-top: 1px solid #d8e2ee;
    border-left: 0;
  }
}

/* Dark theme */
html.theme-dark {
  color-scheme: dark;
}

html.theme-dark body {
  color: #e8edf5;
  background: #0f141c;
}

html.theme-dark .page-header,
html.theme-dark .site-footer {
  background: #151b25;
  border-color: #2a3341;
}

html.theme-dark .page-menu a {
  color: #c4ccd8;
}

html.theme-dark .page-menu a:hover {
  color: #7eb2ff;
  background: #1d2735;
}

html.theme-dark .page-menu a.active {
  color: #8cbcff;
  background: #1a2740;
}

html.theme-dark .header-icon-btn,
html.theme-dark .nav-toggle {
  color: #c4ccd8;
}

html.theme-dark .header-icon-btn:hover,
html.theme-dark .nav-toggle:hover {
  color: #8cbcff;
  background: #1d2735;
  border-color: #2a3341;
}

html.theme-dark .header-search-form {
  background: #1a222e;
  border-color: #2a3341;
}

html.theme-dark .header-search-form .form-control {
  color: #e8edf5;
}

html.theme-dark .header-search-close:hover {
  background: #232c3a;
  color: #8cbcff;
}

html.theme-dark .tool-search-results {
  background: #151b25;
  border-color: #2a3341;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

html.theme-dark .tool-search-result:hover,
html.theme-dark .tool-search-result.is-active {
  background: #1d2735;
}

html.theme-dark .tool-search-result-icon {
  color: #8cbcff;
  background: #1a2740;
}

html.theme-dark .tool-search-result-copy strong,
html.theme-dark .tool-search-empty strong {
  color: #e8edf5;
}

html.theme-dark .tool-search-result-copy small,
html.theme-dark .tool-search-empty {
  color: #9aa6b5;
}

html.theme-dark .tool-search-status {
  color: #aeb8c6;
  background: #232c3a;
}

html.theme-dark .tool-search-all {
  border-color: #2a3341;
}

html.theme-dark .calculator-breadcrumb,
html.theme-dark .calculator-breadcrumb .breadcrumb-item,
html.theme-dark .calculator-breadcrumb .breadcrumb-item.active {
  color: #9aa6b5;
}

html.theme-dark .calculator-breadcrumb a {
  color: #8cbcff;
}

html.theme-dark .calculator-intro h1,
html.theme-dark .calculator-card-head h2,
html.theme-dark .bmi-reference h2,
html.theme-dark .bmi-faq-head h2,
html.theme-dark .bmi-faq-item h3,
html.theme-dark .info-block h3,
html.theme-dark .result-number,
html.theme-dark .form-label,
html.theme-dark .bmi-category-list strong {
  color: #e8edf5;
}

html.theme-dark .calculator-intro p,
html.theme-dark .calculator-card-head p,
html.theme-dark .bmi-reference > p,
html.theme-dark .bmi-faq-head p,
html.theme-dark .bmi-faq-item p,
html.theme-dark .result-summary p,
html.theme-dark .reference-note,
html.theme-dark .reset-link,
html.theme-dark .site-footer {
  color: #9aa6b5;
}

html.theme-dark .calculator-card,
html.theme-dark .bmi-reference {
  background: #151b25;
  border-color: #2a3341;
  box-shadow: none;
}

html.theme-dark .unit-switch {
  background: #1a222e;
}

html.theme-dark .unit-option {
  color: #9aa6b5;
}

html.theme-dark .unit-option.active {
  color: #8cbcff;
  background: #232c3a;
  box-shadow: none;
}

html.theme-dark .calculator-input .form-control,
html.theme-dark .calculator-input .input-group-text {
  color: #e8edf5;
  background: #1a222e;
  border-color: #2a3341;
}

html.theme-dark .calculator-input .form-control:focus {
  border-color: #4d8fe8;
  box-shadow: 0 0 0 3px rgba(77, 143, 232, 0.2);
}

html.theme-dark .result-card {
  background: #172033;
  border-color: #2d3f61;
}

html.theme-dark .result-summary {
  border-color: #2d3f61;
}

html.theme-dark .result-label {
  color: #9aa6b5;
}

html.theme-dark .bmi-category-list li {
  color: #9aa6b5;
  border-color: #2a3341;
}

html.theme-dark .reference-note {
  background: #1a222e;
}

html.theme-dark .bmi-faq,
html.theme-dark .bmi-faq-item,
html.theme-dark .related-tools {
  border-color: #2a3341;
}

html.theme-dark .tool-share {
  background: #172033;
  border-color: #2d3f61;
}

html.theme-dark .tool-share-title {
  color: #e8edf5;
}

html.theme-dark .tool-share-btn {
  color: #e8edf5;
  background: #1a2432;
  border-color: #334154;
}

html.theme-dark .tool-share-btn:hover {
  color: #7eb6ff;
  border-color: rgba(126, 178, 255, 0.35);
}

html.theme-dark .tool-share-btn.is-copied {
  color: #75b798;
  border-color: #2f523f;
  background: #18251d;
}

html.theme-dark .tool-share-disclaimer {
  border-top-color: #334154;
  color: #9aa6b5;
}

html.theme-dark .tool-share-disclaimer a {
  color: #7eb6ff;
}

html.theme-dark .disclaimer-content h2 {
  color: #e8edf5;
}

html.theme-dark .related-card {
  background: #151b25;
  border-color: #2a3341;
}

html.theme-dark .related-card:hover {
  border-color: rgba(126, 178, 255, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

html.theme-dark .related-icon {
  background: #1a2740;
  color: #8cbcff;
}

html.theme-dark .related-name {
  color: #e8edf5;
}

html.theme-dark .related-desc,
html.theme-dark .section-desc {
  color: #9aa6b5;
}

html.theme-dark .section-title {
  color: #e8edf5;
}

html.theme-dark .page-menu {
  background: #151b25;
  border-color: #2a3341;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
