/* Generated by scripts/build-blog.mjs. Do not edit directly. */
/* site-pricing.css */
/* Copied from top page pricing section. */

.hk-pricing-section {
  padding: 56px 14px 64px;
  background:
    linear-gradient(180deg, #f6fbf4 0%, #ffffff 50%, #eef7f1 100%);
  color: #24352d;
  font-family: var(--font-sans, 'BIZ UDPGothic', sans-serif);
  letter-spacing: 0;
}

.hk-pricing-section *,
.hk-pricing-section *::before,
.hk-pricing-section *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

.hk-pricing-card {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 24px 20px 26px;
  border: 1px solid #d8e6d7;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f0 100%);
  box-shadow: 0 18px 36px rgba(23, 79, 63, 0.10);
  text-align: center;
}

.hk-pricing-rule {
  width: min(100%, 520px);
  height: 2px;
  margin: 0 auto 20px;
  background: linear-gradient(90deg, rgba(23, 79, 63, 0), #174f3f, rgba(244, 194, 122, 0.82), rgba(23, 79, 63, 0));
  border-radius: 999px;
}

.hk-pricing-card > .hk-pricing-rule:last-child {
  margin: 22px auto 0;
}

.hk-pricing-copy {
  color: #24352d;
  max-width: 34em;
  margin: 0 auto;
  font-size: clamp(1rem, 4vw, 1.22rem);
  font-weight: 900;
  line-height: 1.65;
  text-wrap: pretty;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hk-pricing-quote {
  color: #174f3f;
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.35;
}

.hk-pricing-copy__line {
  display: block;
  max-width: 30em;
  margin: 0.25rem auto 0;
}

.hk-pricing-normal {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 18px auto 12px;
  padding: 8px 14px;
  border-top: 1px solid #d8e6d7;
  border-bottom: 1px solid #d8e6d7;
  color: #24352d;
  font-size: clamp(0.95rem, 3.6vw, 1.18rem);
  font-weight: 900;
  line-height: 1.4;
}

.hk-pricing-normal strong {
  color: #c65f26;
  font-size: 1.35em;
  font-weight: 900;
}

.hk-pricing-normal small {
  font-size: 0.82em;
  font-weight: 900;
}

.hk-pricing-offer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
}

.hk-pricing-labels {
  display: grid;
  gap: 7px;
  min-width: 94px;
}

.hk-pricing-labels span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #174f3f;
  color: #fff;
  font-size: clamp(1rem, 4vw, 1.3rem);
  font-weight: 900;
  line-height: 1.15;
  box-shadow: 0 7px 14px rgba(23, 79, 63, 0.15);
}

.hk-pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-width: 0;
  color: #c65f26;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.hk-pricing-price__num {
  font-size: clamp(4.3rem, 18vw, 7.2rem);
  letter-spacing: -0.02em;
}

.hk-pricing-price__yen {
  margin-left: 4px;
  font-size: clamp(2.1rem, 8vw, 3.6rem);
}

.hk-pricing-price__tax {
  margin-left: 4px;
  color: #315c4b;
  font-size: clamp(0.8rem, 3.2vw, 1.05rem);
  font-weight: 900;
}

.hk-pricing-deadline {
  display: grid;
  gap: 4px;
  margin: 10px auto 18px;
  padding: 12px 14px;
  border: 1px solid rgba(198, 95, 38, 0.34);
  border-radius: 14px;
  background: #fff8ef;
  color: #24352d;
  font-size: clamp(1rem, 4vw, 1.28rem);
  font-weight: 900;
  line-height: 1.35;
}

.hk-pricing-deadline p {
  margin: 0;
}

.hk-pricing-remaining {
  color: #c65f26;
  font-size: clamp(1.35rem, 5.8vw, 2rem);
}

.hk-pricing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.hk-pricing-feature {
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #174f3f 0%, #2f6f3e 100%);
  color: #fff;
  font-weight: 900;
  line-height: 1.3;
  box-shadow: 0 10px 18px rgba(23, 79, 63, 0.15);
}

.hk-pricing-feature strong,
.hk-pricing-feature span {
  display: block;
  font-size: clamp(0.78rem, 3vw, 0.96rem);
}

.hk-pricing-actions {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
}

.hk-pricing-call,
.hk-pricing-line {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: 0 12px 20px rgba(23, 79, 63, 0.14);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.hk-pricing-call {
  flex-wrap: wrap;
  padding: 15px 16px;
  background: linear-gradient(135deg, #d98934 0%, #c65f26 100%);
  font-size: clamp(1.08rem, 4.6vw, 1.45rem);
}

.hk-pricing-call small {
  width: 100%;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 900;
}

.hk-pricing-line {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(1rem, 4vw, 1.18rem);
  line-height: 1.25;
  background: linear-gradient(135deg, #198754 0%, #0f6f43 100%);
  box-shadow: 0 10px 18px rgba(15, 111, 67, 0.18);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.hk-pricing-line-note {
  margin: -2px 0 12px;
  color: #174f3f;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.65;
  text-align: center;
}

.hk-pricing-call:hover,
.hk-pricing-call:focus-visible,
.hk-pricing-line:hover,
.hk-pricing-line:focus-visible {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.hk-pricing-call svg,
.hk-pricing-line svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  stroke-width: 2.6;
}

.hk-pricing-info {
  margin: 14px 0 12px;
  color: #24352d;
  font-size: clamp(0.9rem, 3.6vw, 1rem);
  font-weight: 900;
  line-height: 1.75;
}

.hk-pricing-info p + p {
  margin-top: 4px;
  color: #5f6f66;
  font-size: 0.9em;
  font-weight: 800;
}

.hk-pricing-note {
  margin: 14px 0 0;
  color: #24352d;
  font-size: clamp(0.98rem, 4vw, 1.12rem);
  font-weight: 900;
  line-height: 1.75;
}

.hk-pricing-reassurance,
.hk-payment-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 0;
  color: #174f3f;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1.4;
}

.hk-pricing-reassurance span,
.hk-payment-methods span,
.hk-payment-methods strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d8e6d7;
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
}

.hk-payment-methods span {
  border-color: transparent;
  background: transparent;
  color: #64748b;
  padding-inline: 0;
}

@media (min-width: 1024px) {
  .hk-pricing-section {
    padding: 72px 24px 82px;
  }

  .hk-pricing-card {
    padding: 26px 26px 28px;
  }
}

@media (max-width: 480px) {
  .hk-pricing-offer {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hk-pricing-labels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .hk-pricing-price {
    width: 100%;
  }

  .hk-pricing-price__num {
    font-size: clamp(3.6rem, 19vw, 4.8rem);
  }
}

@media (max-width: 390px) {
  .hk-pricing-section {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hk-pricing-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hk-pricing-offer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .hk-pricing-price {
    flex-wrap: wrap;
  }

  .hk-pricing-price__tax {
    flex-basis: 100%;
    margin-top: 4px;
  }

  .hk-pricing-features {
    grid-template-columns: 1fr;
  }

  .hk-pricing-feature {
    min-height: 54px;
  }

  .hk-pricing-feature strong,
  .hk-pricing-feature span {
    font-size: 0.9rem;
  }
}

/* site-content-figures.css */
.symptom-context-figure {
  margin: clamp(28px, 5vw, 44px) 0 0;
}

.symptom-context-figure__link,
.symptom-context-figure__link picture,
.symptom-context-figure__link img {
  display: block;
  width: 100%;
}

.symptom-context-figure__link {
  color: inherit;
  text-decoration: none;
}

.symptom-context-figure__link img {
  height: auto;
  border: 1px solid #dfe4dc;
  background: #fffdf8;
}

.symptom-context-figure__zoom {
  display: none;
}

.symptom-context-figure figcaption {
  margin-top: 12px;
  color: #4f5c56;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.9;
}

@media (max-width: 767px) {
  .symptom-context-figure {
    margin-top: 28px;
  }

  .symptom-context-figure__zoom {
    display: inline-block;
    margin-top: 9px;
    color: #2d6048;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .symptom-context-figure figcaption {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.85;
  }
}

/* site-consultation-sections.css */
.symptom-refresh-first-view,
.symptom-refresh-section,
.symptom-refresh-director-message {
  color: #252a27;
  font-family: var(--font-sans, 'BIZ UDPGothic', sans-serif);
  letter-spacing: 0;
}

.symptom-refresh-first-view *,
.symptom-refresh-section *,
.symptom-refresh-director-message * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.symptom-refresh-first-view {
  padding: clamp(42px, 6vw, 68px) 0;
  background: #fff;
  border-top: 1px solid #dfe4dc;
  border-bottom: 1px solid #dfe4dc;
}

.symptom-refresh-first-view__card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: clamp(28px, 5vw, 52px);
  align-items: start;
}

.symptom-refresh-first-view__eyebrow,
.symptom-refresh-director-message__label {
  margin: 0 0 10px;
  color: #356b2f;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.symptom-refresh-first-view__title,
.symptom-refresh-section__title,
.symptom-refresh-director-message h2 {
  margin: 0;
  color: #252a27;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 900;
  line-height: 1.55;
}

.symptom-refresh-first-view__lead,
.symptom-refresh-section__lead {
  margin: 18px 0 0;
  color: #59635d;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.95;
}

.symptom-refresh-first-view__badges {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.symptom-refresh-first-view__badges li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dfe4dc;
  border-radius: 12px;
  background: #faf7f0;
  padding: 13px 14px;
  color: #3c453f;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.6;
}

.symptom-refresh-first-view__badges li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: .56em;
  border: 2px solid #356b2f;
  border-radius: 50%;
  flex: 0 0 auto;
}

.symptom-refresh-section {
  padding: clamp(72px, 8vw, 96px) 0;
}

.symptom-refresh-section--white {
  background: #fff;
}

.symptom-refresh-section--cream {
  background: #faf7f0;
}

.symptom-refresh-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(24px, 4vw, 36px);
  border-top: 1px solid #dfe4dc;
  border-left: 1px solid #dfe4dc;
}

.symptom-refresh-detail-card {
  min-width: 0;
  border-right: 1px solid #dfe4dc;
  border-bottom: 1px solid #dfe4dc;
  padding: clamp(26px, 4vw, 40px);
  background: rgba(255, 255, 255, .72);
}

.symptom-refresh-detail-card h3 {
  margin: 0 0 10px;
  color: #2f5130;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.55;
}

.symptom-refresh-detail-card p {
  margin: 0;
  color: #59635d;
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.85;
}

.symptom-refresh-director-message {
  padding: clamp(72px, 8vw, 96px) 0;
  background: #fff;
  border-top: 1px solid #dfe4dc;
}

.symptom-refresh-director-message__card {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: clamp(28px, 5vw, 54px);
  align-items: start;
  border: 1px solid #dfe4dc;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #faf7f0);
  padding: clamp(28px, 5vw, 46px);
}

.symptom-refresh-director-message__name {
  margin: 18px 0 0;
  color: #59635d;
  font-size: .92rem;
  font-weight: 900;
  line-height: 1.7;
}

.symptom-refresh-director-message__content {
  color: #59635d;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.95;
}

.symptom-refresh-director-message__content p {
  margin: 0;
}

.symptom-refresh-director-message__content p + p {
  margin-top: 1.05rem;
}

@media (max-width: 767px) {
  .symptom-refresh-first-view {
    padding: 38px 0;
  }

  .symptom-refresh-first-view__card,
  .symptom-refresh-director-message__card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .symptom-refresh-first-view__title,
  .symptom-refresh-section__title,
  .symptom-refresh-director-message h2 {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  .symptom-refresh-first-view__lead,
  .symptom-refresh-section__lead,
  .symptom-refresh-director-message__content {
    font-size: .95rem;
    line-height: 1.85;
  }

  .symptom-refresh-detail-grid {
    grid-template-columns: 1fr;
    border-left: 0;
  }

  .symptom-refresh-detail-card {
    border-right: 0;
    padding: 24px 4px;
  }

  .symptom-refresh-director-message__card {
    padding: 24px 18px;
  }
}

/* site-header.css */
/* Copied from ../styles/main.css top-page header styles. Keep in sync with index.html. */
    :root {
      --header-h: 58px;
      --header-max: 1240px;
      --header-green: #2d6048;
      --header-green-dark: #194533;
      --header-green-soft: #eef7f1;
      --header-navy: #18324c;
      --header-brown: #3d2817;
      --header-gold: #b59a5b;
      --header-gold-soft: #eee5cf;
      --header-beige: #fbf7ed;
      --header-border: #e4ded1;
    }
    section[id],
    main [id] {
      scroll-margin-top: calc(var(--header-h) + 16px);
    }

    .page-top-anchor {
      display: block;
      height: 0;
      width: 100%;
    }

    .page-top-button {
      position: fixed;
      right: 24px;
      bottom: 24px;
      z-index: 60;
      width: 68px;
      height: 68px;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1px;
      border: 0;
      border-radius: 999px;
      background: #d96f2f;
      color: #fff;
      font-size: 0.78rem;
      font-weight: 900;
      line-height: 1.1;
      letter-spacing: 0;
      box-shadow: 0 16px 30px rgba(217, 111, 47, 0.28);
      opacity: 0;
      pointer-events: none;
      transform: translateY(12px);
      transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .page-top-button span {
      font-size: 1.05rem;
      line-height: 1;
    }

    .page-top-button.is-visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .page-top-button:hover,
    .page-top-button:focus-visible {
      background: #bd5720;
      outline: none;
      box-shadow: 0 18px 34px rgba(189, 87, 32, 0.36);
      transform: translateY(-2px);
    }

    .site-header {
      position: static;
      background: #fffefb;
      border-top: 4px solid var(--header-gold-soft);
      color: var(--header-navy);
      letter-spacing: 0;
    }

    .site-header *,
    .site-header *::before,
    .site-header *::after {
      letter-spacing: 0;
    }

    .site-header.shadow-md {
      box-shadow: 0 12px 30px rgba(31, 41, 55, 0.1);
      border-bottom-color: #d6ccba;
    }

    .site-header__upper {
      position: static;
      background: rgba(255, 254, 251, 0.98);
    }

    .site-header__lower {
      position: sticky;
      top: 0;
      z-index: 1000;
      border-top: 1px solid var(--header-border);
      border-bottom: 1px solid var(--header-border);
      background: #fff;
      box-shadow: 0 8px 22px rgba(31, 41, 55, 0.06);
      transition: box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .site-header__lower.is-stuck {
      border-bottom-color: #d6ccba;
      box-shadow: 0 12px 28px rgba(31, 41, 55, 0.12);
    }

    .site-header__inner {
      width: min(calc(100% - 32px), var(--header-max));
      margin: 0 auto;
    }

    .site-header__inner--upper {
      min-height: 98px;
      display: grid;
      grid-template-columns: minmax(420px, 1fr) minmax(320px, 0.88fr) minmax(260px, max-content);
      gap: 24px;
      align-items: center;
      padding: 12px 0;
    }

    .site-brand {
      display: flex;
      align-items: center;
      gap: 18px;
      min-width: 0;
      border-radius: 999px;
      text-decoration: none;
      color: var(--header-navy);
    }

    .site-brand__mark {
      width: 82px;
      height: 82px;
      flex: 0 0 82px;
      display: grid;
      place-items: center;
      padding: 4px;
      border: 1px solid rgba(181, 154, 91, 0.44);
      border-radius: 999px;
      background: #fff;
      box-shadow: 0 12px 24px rgba(61, 40, 23, 0.08);
      overflow: hidden;
    }

    .site-brand__mark img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .site-brand__text {
      display: flex;
      flex-direction: column;
      min-width: 0;
      line-height: 1.25;
    }

    .site-brand__eyebrow {
      width: max-content;
      max-width: 100%;
      margin-bottom: 5px;
      padding: 0;
      border-radius: 0;
      background: transparent;
      color: var(--header-green);
      font-size: 0.94rem;
      font-weight: 900;
      line-height: 1.25;
    }

    .site-brand__name {
      color: var(--header-brown);
      font-family: var(--font-heading);
      font-size: 2.08rem;
      font-weight: 900;
      line-height: 1.12;
      white-space: nowrap;
    }

    .site-brand__note {
      width: max-content;
      max-width: 100%;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      margin-top: 6px;
      color: #3f342a;
      font-size: 0.82rem;
      font-weight: 900;
      line-height: 1.25;
    }

    .site-brand__note::before,
    .site-brand__note::after {
      content: "";
      width: 32px;
      height: 1px;
      flex: 0 0 32px;
      background: var(--header-gold);
    }

    .site-header-badges {
      display: flex;
      justify-content: center;
      gap: 12px;
      min-width: 0;
    }

    .site-header-badge {
      width: 90px;
      min-height: 80px;
      display: inline-grid;
      grid-template-rows: auto auto;
      align-items: center;
      justify-content: center;
      justify-items: center;
      gap: 5px;
      padding: 12px 10px 11px;
      border: 1px solid #d8dfd4;
      border-radius: 0;
      background: #f2f6f1;
      color: var(--header-green-dark);
      clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
      font-size: 0.82rem;
      font-weight: 900;
      line-height: 1.35;
      text-align: center;
      box-shadow: inset 0 0 0 1px rgba(181, 154, 91, 0.12);
    }

    .site-header-badge--soft {
      border-color: #e6d9be;
      background: var(--header-beige);
      color: #5f4a26;
    }

    .site-header-badge svg {
      width: 22px;
      height: 22px;
      stroke-width: 2.2;
    }

    .site-header-contact {
      justify-self: end;
      text-align: right;
      white-space: nowrap;
    }

    .site-header-contact__label {
      display: block;
      margin-bottom: 8px;
      color: var(--header-green);
      font-size: 0.92rem;
      font-weight: 900;
      line-height: 1.2;
    }

    .site-header-phone {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      color: var(--header-brown);
      text-decoration: none;
      font-weight: 900;
      line-height: 1;
    }

    .site-header-phone__icon {
      width: 40px;
      height: 40px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      background: var(--header-green-dark);
      color: #fff;
      box-shadow: 0 10px 18px rgba(25, 69, 51, 0.18);
    }

    .site-header-phone__icon svg {
      width: 19px;
      height: 19px;
      stroke-width: 2.6;
    }

    .site-header-phone__number {
      font-size: 2rem;
      font-variant-numeric: tabular-nums;
    }

    .site-nav {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      width: 100%;
      overflow: visible;
    }

    .site-nav__item {
      position: relative;
      min-height: 50px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: 7px 10px;
      border-left: 1px solid #ebe5da;
      color: #2c2b27;
      text-align: center;
      text-decoration: none;
      transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    }

    .site-nav__item:last-child {
      border-right: 1px solid #ebe5da;
    }

    .site-nav__item:hover,
    .site-nav__item:focus-visible {
      background: #fbf8ef;
      color: var(--header-green);
      box-shadow: inset 0 -2px 0 var(--header-gold);
    }

    .site-nav__item--has-dropdown {
      padding: 0;
    }

    .site-nav__item--has-dropdown:hover,
    .site-nav__item--has-dropdown:focus-within,
    .site-nav__item--has-dropdown.is-open {
      background: #fbf8ef;
      color: var(--header-green);
      box-shadow: inset 0 -2px 0 var(--header-gold);
    }

    .site-nav__trigger {
      width: 100%;
      min-height: 50px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: 7px 10px;
      border: 0;
      background: transparent;
      color: inherit;
      cursor: pointer;
      font: inherit;
      text-align: center;
      text-decoration: none;
    }

    .site-nav__trigger:focus-visible {
      outline: 3px solid rgba(36, 83, 70, 0.35);
      outline-offset: -3px;
    }

    .site-nav__label-main {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      line-height: 1.2;
    }

    .site-nav__chevron {
      font-size: 0.62rem;
      line-height: 1;
      transform: translateY(1px);
      transition: transform 0.18s ease;
    }

    .site-nav__item--has-dropdown:hover .site-nav__chevron,
    .site-nav__item--has-dropdown:focus-within .site-nav__chevron,
    .site-nav__item--has-dropdown.is-open .site-nav__chevron {
      transform: translateY(1px) rotate(180deg);
    }

    .site-nav__dropdown {
      position: absolute;
      top: 100%;
      left: 50%;
      z-index: 1010;
      width: min(300px, calc(100vw - 32px));
      display: none;
      padding: 9px;
      border: 1px solid #e4ded1;
      border-radius: 14px;
      background: #fffefb;
      box-shadow: 0 20px 34px rgba(34, 48, 38, 0.16);
      transform: translateX(-50%);
    }

    .site-nav__dropdown::before {
      content: "";
      position: absolute;
      right: 0;
      bottom: 100%;
      left: 0;
      height: 8px;
    }

    .site-nav__item--has-dropdown:hover .site-nav__dropdown,
    .site-nav__item--has-dropdown:focus-within .site-nav__dropdown,
    .site-nav__item--has-dropdown.is-open .site-nav__dropdown {
      display: grid;
      gap: 2px;
    }

    .site-nav__dropdown-link {
      min-height: 40px;
      display: flex;
      align-items: center;
      padding: 9px 12px;
      border-radius: 10px;
      color: #24423a;
      font-size: 0.9rem;
      font-weight: 900;
      line-height: 1.35;
      text-align: left;
      text-decoration: none;
      transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    }

    .site-nav__dropdown-link:hover,
    .site-nav__dropdown-link:focus-visible {
      background: #edf6ef;
      color: var(--header-green-dark);
      outline: none;
      transform: translateX(2px);
    }

    .site-nav__item--contact {
      background: #f5faf6;
      color: var(--header-green-dark);
    }

    .site-nav__item--contact:hover,
    .site-nav__item--contact:focus-visible {
      background: #edf6ef;
      color: var(--header-green-dark);
    }

    .site-nav__jp {
      font-size: 0.96rem;
      font-weight: 900;
      line-height: 1.2;
    }

    .site-nav__en {
      color: #5b574e;
      font-size: 0.7rem;
      font-weight: 900;
      line-height: 1.1;
    }

    .site-menu-toggle,
    .site-mobile-nav {
      display: none;
    }

    @media (max-width: 1079px) {
      :root {
        --header-h: 58px;
      }

      .site-header {
        border-top-width: 3px;
      }

      .site-header__inner {
        width: min(calc(100% - 24px), var(--header-max));
      }

      .site-header__inner--upper {
        min-height: 70px;
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 7px 0;
      }

      .site-header-badges,
      .site-header-contact {
        display: none;
      }

      .site-brand {
        gap: 10px;
        min-width: 0;
      }

      .site-brand__mark {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
        padding: 3px;
        box-shadow: 0 8px 18px rgba(61, 40, 23, 0.08);
      }

      .site-brand__eyebrow {
        padding: 0;
        margin-bottom: 2px;
        background: transparent;
        font-size: 0.72rem;
      }

      .site-brand__name {
        font-size: 1.2rem;
      }

      .site-brand__note {
        margin-top: 2px;
        gap: 6px;
        color: #446b5c;
        font-size: 0.7rem;
      }

      .site-brand__note::before,
      .site-brand__note::after {
        width: 14px;
        flex-basis: 14px;
      }

      .site-menu-toggle {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        flex: 0 0 auto;
        padding: 8px 11px;
        border: 1px solid #d7cdbb;
        border-radius: 999px;
        background: #fffefb;
        color: var(--header-green-dark);
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1;
        box-shadow: 0 8px 18px rgba(36, 83, 70, 0.1);
      }

      .site-menu-toggle__bars {
        width: 18px;
        display: grid;
        gap: 4px;
      }

      .site-menu-toggle__bars span {
        display: block;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
      }

      .site-menu-toggle:focus-visible {
        outline: 3px solid rgba(36, 83, 70, 0.28);
        outline-offset: 3px;
      }

      .site-header__lower {
        padding: 8px 0 9px;
      }

      .site-nav {
        display: none;
      }

      .site-mobile-nav {
        position: fixed;
        top: calc(var(--header-h, 58px) + 8px);
        right: 12px;
        z-index: 1005;
        width: min(320px, calc(100vw - 24px));
        max-height: calc(100vh - var(--header-h, 58px) - 24px);
        display: grid;
        gap: 8px;
        overflow-y: auto;
        padding: 12px;
        border: 1px solid #e4ded1;
        border-radius: 18px;
        background: rgba(255, 254, 251, 0.98);
        box-shadow: 0 24px 44px rgba(27, 46, 36, 0.2);
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
      }

      .site-mobile-nav.hidden {
        display: none;
      }

      .site-mobile-nav::-webkit-scrollbar {
        width: 6px;
      }

      .site-mobile-nav__item {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        padding: 10px 13px;
        border: 1px solid #e4ded1;
        border-radius: 12px;
        background: #fffefb;
        color: #24423a;
        font-size: 0.94rem;
        font-weight: 900;
        line-height: 1.1;
        text-decoration: none;
      }

      .site-mobile-nav__group {
        display: grid;
        gap: 8px;
        padding: 10px;
        border: 1px solid #e4ded1;
        border-radius: 14px;
        background: #f7fbf6;
      }

      .site-mobile-nav__heading {
        color: var(--header-green-dark);
        font-size: 0.82rem;
        font-weight: 900;
        line-height: 1;
      }

      .site-mobile-nav__links {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      .site-mobile-nav__subitem {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 7px 10px;
        border: 1px solid rgba(36, 66, 58, 0.13);
        border-radius: 999px;
        background: #fffefb;
        color: #24423a;
        font-size: 0.8rem;
        font-weight: 900;
        line-height: 1.15;
        text-decoration: none;
      }

      .site-mobile-nav__item--contact {
        border-color: var(--header-green-dark);
        background: var(--header-green-dark);
        color: #fff;
      }

      .hz-hero {
        padding-top: 42px !important;
      }
    }

    @media (max-width: 430px) {
      .site-header__inner {
        width: min(calc(100% - 20px), var(--header-max));
      }

      .site-brand__name {
        font-size: 1.08rem;
      }

      .site-brand__eyebrow,
      .site-brand__note {
        font-size: 0.66rem;
      }

      .site-brand__note::before,
      .site-brand__note::after {
        display: none;
      }

    }


.site-header + .site-header__lower + main .breadcrumb,
.site-header + main .breadcrumb {
  padding-top: 1rem;
}

.site-header + .site-header__lower + main.page,
.site-header + main.page {
  padding-top: 32px;
}

/* site-footer.css */
/* Copied from ../styles/main.css top-page footer styles. Keep in sync with index.html. */
    .hk-footer-section {
      background: #f4f1e9;
      color: #232116;
      font-family: var(--font-sans, 'BIZ UDPGothic', sans-serif);
      letter-spacing: 0;
    }

    .hk-footer-section *,
    .hk-footer-section *::before,
    .hk-footer-section *::after {
      box-sizing: border-box;
      letter-spacing: 0;
    }

    .hk-footer-line {
      height: 4px;
      background: #1f5b4f;
    }

    .hk-footer-inner {
      width: min(calc(100% - 32px), 1080px);
      margin: 0 auto;
      padding: 38px 0 34px;
    }

    .hk-footer-top {
      display: grid;
      grid-template-columns: minmax(260px, 0.95fr) minmax(360px, 1fr);
      gap: 36px;
      align-items: center;
      padding-bottom: 26px;
      border-bottom: 1px solid rgba(35, 33, 22, 0.18);
    }

    .hk-footer-brand {
      width: min(100%, 320px);
      display: flex;
      align-items: center;
      gap: 15px;
      color: inherit;
      text-decoration: none;
    }

    .hk-footer-brand-mark {
      width: 82px;
      height: 82px;
      flex: 0 0 82px;
      border: 1px solid rgba(181, 154, 91, 0.38);
      border-radius: 999px;
      background: #fffefb;
      object-fit: contain;
      box-shadow: 0 10px 20px rgba(61, 40, 23, 0.08);
    }

    .hk-footer-brand-text {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .hk-footer-brand-eyebrow {
      color: #1f5b4f;
      font-size: 0.88rem;
      font-weight: 900;
      line-height: 1.25;
    }

    .hk-footer-brand-name {
      color: #3d2817;
      font-family: var(--font-heading);
      font-size: 1.85rem;
      font-weight: 900;
      line-height: 1.1;
      white-space: nowrap;
    }

    .hk-footer-brand-note {
      color: #4b4034;
      font-size: 0.8rem;
      font-weight: 900;
      line-height: 1.3;
    }

    .hk-footer-info {
      display: grid;
      gap: 5px;
      justify-items: end;
      color: #2a271d;
      font-style: normal;
      font-size: 0.94rem;
      font-weight: 800;
      line-height: 1.65;
      text-align: right;
    }

    .hk-footer-info strong {
      color: #1f5b4f;
      font-size: 1.08rem;
      font-weight: 900;
    }

    .hk-footer-info a {
      color: #1f5b4f;
      font-size: 1rem;
      font-weight: 900;
      text-decoration: none;
    }

    .hk-footer-nav {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px 0;
      padding: 22px 0 18px;
      border-bottom: 1px solid rgba(35, 33, 22, 0.18);
    }

    .hk-footer-nav a {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 0 13px;
      border-right: 1px solid rgba(35, 33, 22, 0.22);
      color: #2a271d;
      font-size: 0.9rem;
      font-weight: 900;
      line-height: 1.35;
      text-decoration: none;
      transition: color 0.18s ease;
    }

    .hk-footer-nav a:first-child {
      border-left: 1px solid rgba(35, 33, 22, 0.22);
    }

    .hk-footer-nav a:hover,
    .hk-footer-nav a:focus-visible,
    .hk-footer-review a:hover,
    .hk-footer-review a:focus-visible {
      color: #1f5b4f;
    }

    .hk-footer-symptoms {
      max-width: 900px;
      margin: 18px auto 0;
      color: #3d382b;
      text-align: center;
      font-size: 0.88rem;
      font-weight: 800;
      line-height: 1.85;
    }

    .hk-footer-symptoms-label {
      margin-bottom: 3px;
      color: #1f5b4f;
      font-size: 0.8rem;
      font-weight: 900;
    }

    .hk-footer-review {
      margin: 15px 0 0;
      color: #3d382b;
      text-align: center;
      font-size: 0.9rem;
      font-weight: 900;
      line-height: 1.7;
    }

    .hk-footer-review a {
      color: #1f5b4f;
      text-decoration: underline;
      text-decoration-thickness: 1px;
      text-underline-offset: 4px;
    }

    .hk-footer-note {
      max-width: 760px;
      margin: 12px auto 0;
      color: rgba(35, 33, 22, 0.68);
      text-align: center;
      font-size: 0.75rem;
      font-weight: 800;
      line-height: 1.7;
    }

    .hk-footer-copy {
      padding: 13px 16px;
      background: #1f5b4f;
      color: #fff;
      text-align: center;
      font-size: 0.82rem;
      font-weight: 900;
      line-height: 1.5;
    }

    @media (max-width: 767px) {
      .hk-footer-inner {
        width: min(calc(100% - 28px), 1080px);
        padding: 32px 0 28px;
      }

      .hk-footer-top {
        grid-template-columns: 1fr;
        gap: 22px;
        justify-items: center;
        text-align: center;
      }

      .hk-footer-brand {
        width: min(100%, 260px);
        justify-content: center;
      }

      .hk-footer-brand-mark {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
      }

      .hk-footer-brand-eyebrow {
        font-size: 0.76rem;
      }

      .hk-footer-brand-name {
        font-size: 1.34rem;
      }

      .hk-footer-brand-note {
        font-size: 0.7rem;
      }

      .hk-footer-info {
        justify-items: center;
        text-align: center;
        font-size: 0.88rem;
      }

      .hk-footer-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      .hk-footer-nav a,
      .hk-footer-nav a:first-child {
        min-height: 42px;
        justify-content: center;
        padding: 8px 10px;
        border: 1px solid rgba(35, 33, 22, 0.18);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.45);
        font-size: 0.84rem;
      }

      .hk-footer-symptoms {
        text-align: left;
        font-size: 0.84rem;
      }

      .hk-footer-symptoms-label,
      .hk-footer-review,
      .hk-footer-note {
        text-align: center;
      }

      .hk-footer-copy {
        padding: 13px 16px 98px;
      }
    }

/* site-flow.css */
/* Copied from ../styles/main.css top-page flow slider styles. Keep in sync with index.html. */
    .flow-slider {
      background: #fff;
      border-top: 1px solid #f0e1d1;
      border-bottom: 1px solid #f0e1d1;
      padding: 72px 16px 84px;
      overflow: hidden;
      overflow-anchor: none;
      color: #2b2b2b;
      font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
      letter-spacing: 0;
    }

    .flow-slider__inner {
      max-width: 760px;
      margin: 0 auto;
    }

    .flow-slider__heading-band {
      border-left: 7px solid #e96a42;
      background: #fdebdc;
      padding: 18px 24px 20px;
      box-shadow: 0 8px 22px rgba(91, 60, 34, 0.08);
    }

    .flow-slider__eyebrow {
      margin: 0 0 4px;
      color: #1f5a43;
      font-size: 0.78rem;
      font-weight: 900;
      line-height: 1.4;
    }

    .flow-slider__title {
      margin: 0;
      color: #2b2b2b;
      font-family: var(--font-heading);
      font-size: 2.15rem;
      font-weight: 900;
      line-height: 1.45;
      letter-spacing: 0;
    }

    .flow-slider__stage {
      position: relative;
      max-width: 620px;
      margin: 0 auto;
      text-align: center;
    }

    .flow-slider__slides {
      position: relative;
      min-width: 0;
      touch-action: pan-y;
      user-select: none;
    }

    .flow-slide {
      display: block;
    }

    .flow-slide + .flow-slide {
      margin-top: 42px;
      padding-top: 36px;
      border-top: 1px solid #f0e1d1;
    }

    .flow-slider.is-enhanced .flow-slide:not(.is-active) {
      display: none;
    }

    .flow-slider.is-enhanced .flow-slide + .flow-slide {
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
    }

    .flow-slider__media {
      position: relative;
      aspect-ratio: 4 / 3;
      width: 100%;
      overflow: hidden;
      background: #f7efe6;
      border: 1px solid #eadfcc;
      box-shadow: 0 6px 18px rgba(71, 45, 22, 0.08);
    }

    .flow-slider__image {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }

    .flow-slider__placeholder {
      display: flex;
      min-height: 100%;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 48px 32px 34px;
      background: linear-gradient(135deg, #f8f1e7 0%, #fff 48%, #eaf2e8 100%);
      color: #6b5a45;
      text-align: center;
    }

    .flow-slider__photo-mark {
      display: block;
      width: 132px;
      height: 88px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.72);
      box-shadow: inset 0 0 18px rgba(55, 74, 58, 0.08);
    }

    .flow-slider__photo-label {
      color: #6b5a45;
      font-size: 1rem;
      font-weight: 900;
      line-height: 1.6;
    }

    .flow-slider__photo-note {
      color: #777;
      font-size: 0.88rem;
      font-weight: 700;
      line-height: 1.7;
    }

    .flow-slider__counter {
      display: none;
      position: absolute;
      top: 18px;
      left: 50%;
      z-index: 3;
      margin: 0;
      padding: 5px 13px;
      transform: translateX(-50%);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.88);
      color: #1f5a43;
      font-size: 0.88rem;
      font-weight: 900;
      line-height: 1.4;
    }

    .flow-slider.is-enhanced .flow-slider__counter {
      display: block;
    }

    .flow-slide__title {
      margin: 28px 0 0;
      color: #333;
      font-family: var(--font-heading);
      font-size: 2rem;
      font-weight: 900;
      line-height: 1.45;
      letter-spacing: 0;
    }

    .flow-slide__text {
      max-width: 560px;
      margin: 18px auto 0;
      color: #3f3f3f;
      font-size: 1.05rem;
      font-weight: 700;
      line-height: 1.9;
      text-align: center;
    }

    .flow-slider__arrow {
      display: none;
      position: absolute;
      top: calc(min(620px, 100vw - 32px) * 0.375);
      z-index: 4;
      align-items: center;
      justify-content: center;
      width: 56px;
      height: 56px;
      transform: translateY(-50%);
      border: 0;
      background: #f2653f;
      color: #fff;
      box-shadow: 0 10px 18px rgba(126, 59, 34, 0.22);
      cursor: pointer;
      transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    }

    .flow-slider.is-enhanced .flow-slider__arrow {
      display: flex;
    }

    .flow-slider__arrow span {
      display: block;
      margin-top: -2px;
      font-size: 2.8rem;
      font-weight: 400;
      line-height: 1;
    }

    .flow-slider__arrow--prev {
      left: -64px;
    }

    .flow-slider__arrow--next {
      right: -64px;
    }

    .flow-slider__arrow:hover,
    .flow-slider__arrow:focus-visible {
      background: #d94d2e;
      box-shadow: 0 12px 24px rgba(126, 59, 34, 0.3);
      outline: 3px solid rgba(242, 101, 63, 0.28);
      outline-offset: 3px;
    }

    .flow-slider__arrow:active {
      transform: translateY(-50%) scale(0.97);
    }

    .flow-slider__dots {
      display: none;
      justify-content: center;
      gap: 10px;
      margin-top: 28px;
    }

    .flow-slider.is-enhanced .flow-slider__dots {
      display: flex;
    }

    .flow-slider__dot {
      width: 11px;
      height: 11px;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: #d7d7d7;
      cursor: pointer;
      transition: background-color 0.2s, transform 0.2s;
    }

    .flow-slider__dot.is-active {
      background: #f2653f;
      transform: scale(1.18);
    }

    .flow-slider__dot:focus-visible {
      outline: 3px solid rgba(242, 101, 63, 0.32);
      outline-offset: 4px;
    }

    @media (max-width: 640px) {
      .flow-slider {
        padding: 56px 14px 68px;
      }

      .flow-slider__heading-band {
        padding: 15px 17px 17px;
      }

      .flow-slider__title {
        font-size: 1.75rem;
      }

      .flow-slider__arrow {
        width: 44px;
        height: 44px;
      }

      .flow-slider__arrow--prev {
        left: -2px;
      }

      .flow-slider__arrow--next {
        right: -2px;
      }

      .flow-slider__arrow span {
        font-size: 2.3rem;
      }

      .flow-slider__placeholder {
        padding: 46px 22px 28px;
      }

      .flow-slider__photo-mark {
        width: 112px;
        height: 72px;
      }

      .flow-slide__title {
        margin-top: 22px;
        font-size: 1.55rem;
      }

      .flow-slide__text {
        font-size: 0.98rem;
        line-height: 1.85;
        text-align: left;
      }
    }

    .flow-swipe-hint {
      text-align: center;
      font-size: 0.9rem;
      margin-top: 12px;
      color: #1f5f4a;
    }

    .flow-swipe-arrow {
      display: inline-block;
      margin-left: 8px;
      animation: swipeArrow 1.2s ease-in-out infinite;
    }

    @keyframes swipeArrow {
      0% { transform: translateX(0); opacity: 0.5; }
      50% { transform: translateX(8px); opacity: 1; }
      100% { transform: translateX(0); opacity: 0.5; }
    }

/* site-faq.css */
/* Copied from the top-page FAQ design for symptom detail pages. */
.faq {
  padding: 4rem 0;
  background: #f6fbf4;
}

.faq .container {
  max-width: 48rem;
}

.faq__heading {
  text-align: center;
  margin-bottom: 2rem;
}

.faq .section-title {
  color: #2f7d32;
  font-size: clamp(2rem, 4.8vw, 3rem);
  line-height: 1.35;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

.faq .section-title::after {
  width: 48px;
  height: 3px;
  background: #f28c28;
  border-radius: 999px;
}

.faq__lead {
  margin: 0;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.8;
}

.faq .lp-faq-list {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.faq .lp-faq-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.faq .lp-faq-item:last-child {
  border-bottom: 0;
}

.faq dt {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  color: #15803d;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0;
}

.faq dt span {
  color: #2563eb;
  font-weight: 900;
  flex: 0 0 auto;
  line-height: 1;
}

.faq dd {
  display: flex;
  gap: 0.55rem;
  margin: 0.45rem 0 0;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.85;
  letter-spacing: 0;
}

.faq dd span {
  color: #dc2626;
  font-weight: 900;
  flex: 0 0 auto;
}

.faq__more {
  margin-top: 1.25rem;
  text-align: center;
}

.faq__more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  color: #064e3b;
  font-size: 0.875rem;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: #86efac;
  text-underline-offset: 4px;
  transition: color 0.2s;
}

.faq__more-link:hover,
.faq__more-link:focus-visible {
  color: #047857;
}

@media (max-width: 640px) {
  .faq {
    padding: 3.5rem 0;
  }

  .faq__heading {
    margin-bottom: 1.6rem;
  }

  .faq dt {
    font-size: 1.04rem;
  }

  .faq .lp-faq-item {
    padding: 0.78rem 0;
  }

  .faq dd {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    line-height: 1.72;
  }
}

/* site-discovery.css */
.related-articles-slider{padding:3rem 0;background:linear-gradient(180deg,#fffaf3 0%,#fff 100%);border-top:1px solid #eadfce;overflow:hidden}
.related-articles-slider__inner{position:relative}
.related-articles-slider__header{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1.25rem}
.related-articles-slider__title{position:relative;margin:0;padding-left:.85rem;font-size:1.35rem;font-weight:900;line-height:1.45;color:#17324d}
.related-articles-slider__title::before{content:'';position:absolute;left:0;top:.18em;width:4px;height:1.65em;border-radius:999px;background:linear-gradient(180deg,#167044,#f2a65a)}
.related-articles-slider__all{display:inline-flex;align-items:center;gap:.25rem;min-height:44px;padding:.25rem .15rem;font-size:13px;font-weight:900;color:#167044;white-space:nowrap;text-decoration:none}
.related-articles-slider__all:hover,.related-articles-slider__all:focus-visible{text-decoration:underline;text-underline-offset:4px;outline:2px solid rgba(22,112,68,.25);outline-offset:4px;border-radius:6px}
.related-articles-slider__viewport{position:relative;max-width:100%;overflow:hidden}
.related-articles-slider__track{--related-card-size:clamp(260px,31%,320px);display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scroll-padding-inline:2.75rem;padding:.25rem 2.75rem 1rem;-webkit-overflow-scrolling:touch;scrollbar-width:none;cursor:grab;touch-action:pan-x pan-y}
.related-articles-slider__track::-webkit-scrollbar{display:none}
.related-articles-slider__track::after{content:'';flex:0 0 max(0px,calc(100% - var(--related-card-size)))}
.related-articles-slider__track.is-dragging{cursor:grabbing;scroll-snap-type:none;user-select:none}
.related-articles-slider__track:focus-visible{outline:3px solid rgba(22,112,68,.28);outline-offset:4px;border-radius:14px}
.related-articles-slider__card{flex:0 0 var(--related-card-size);display:flex;flex-direction:column;min-height:312px;background:#fff;border:1px solid #e2ded6;border-radius:12px;overflow:hidden;box-shadow:0 8px 22px rgba(23,50,77,.08);scroll-snap-align:start;text-decoration:none;color:inherit;transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease}
.related-articles-slider__card:hover,.related-articles-slider__card:focus-visible{transform:translateY(-3px);border-color:#f2a65a;box-shadow:0 14px 28px rgba(23,50,77,.12);outline:none}
.related-articles-slider__thumb{display:block;aspect-ratio:16/9;background:#f5f0e8;overflow:hidden}
.related-articles-slider__thumb img{width:100%;height:100%;object-fit:cover;transition:transform .25s ease}
.related-articles-slider__card:hover .related-articles-slider__thumb img,.related-articles-slider__card:focus-visible .related-articles-slider__thumb img{transform:scale(1.035)}
.related-articles-slider__body{display:flex;flex-direction:column;gap:.55rem;padding:.9rem .95rem 1rem;min-height:0}
.related-articles-slider__meta{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.related-articles-slider__category{display:inline-flex;align-items:center;border-radius:999px;background:#eef7f0;color:#167044;font-size:11px;font-weight:900;line-height:1;padding:.32rem .55rem;max-width:56%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.related-articles-slider__date{font-size:11px;font-weight:700;color:#7b8794;white-space:nowrap}
.related-articles-slider__card-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:.94rem;font-weight:900;line-height:1.58;color:#17324d}
.related-articles-slider__arrow{position:absolute;top:50%;z-index:2;display:grid;place-items:center;width:44px;height:44px;border:1px solid #e2ded6;border-radius:999px;background:rgba(255,255,255,.96);box-shadow:0 8px 18px rgba(23,50,77,.14);color:#167044;cursor:pointer;transform:translateY(-55%);transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,opacity .2s ease}
.related-articles-slider__arrow:hover,.related-articles-slider__arrow:focus-visible{background:#fff7ec;border-color:#f2a65a;box-shadow:0 10px 22px rgba(23,50,77,.18);outline:2px solid rgba(242,166,90,.35);outline-offset:3px}
.related-articles-slider__arrow[disabled]{opacity:0;pointer-events:none}
.related-articles-slider__arrow--prev{left:.35rem}
.related-articles-slider__arrow--next{right:.35rem}
.related-articles-slider__footer{display:grid;gap:.7rem;justify-items:center;margin-top:.25rem}
.related-articles-slider__dots{display:flex;align-items:center;justify-content:center;gap:.48rem;min-height:20px}
.related-articles-slider__dot{width:8px;height:8px;border:0;border-radius:999px;background:#d8d8d8;cursor:pointer;padding:0;transition:width .2s ease,background .2s ease}
.related-articles-slider__dot[aria-current="true"]{width:18px;background:#167044}
.related-articles-slider__dot:focus-visible{outline:2px solid rgba(22,112,68,.35);outline-offset:4px}
.related-articles-slider__hint{display:none;align-items:center;gap:.45rem;margin:0;font-size:12px;font-weight:900;color:#65758a;line-height:1.4}
.related-articles-slider__hint svg{width:16px;height:16px;color:#f2a65a;flex:0 0 auto}
@media(min-width:1200px){.related-articles-slider__track{--related-card-size:calc((100% - 36px)/3)}}
@media(min-width:768px) and (max-width:1199px){.related-articles-slider__track{--related-card-size:calc((100% - 18px)/2)}}
@media(max-width:767px){.related-articles-slider{padding:2.35rem 0}.related-articles-slider__header{align-items:flex-start;margin-bottom:.85rem}.related-articles-slider__title{font-size:1.08rem;line-height:1.55}.related-articles-slider__all{font-size:12px;min-height:38px}.related-articles-slider__viewport{margin-right:-1rem}.related-articles-slider__track{--related-card-size:min(82vw,330px);gap:13px;padding:.2rem 1rem .85rem .05rem;scroll-padding-inline:.05rem}.related-articles-slider__card{min-height:268px;border-radius:11px}.related-articles-slider__body{padding:.75rem .8rem .85rem;gap:.45rem}.related-articles-slider__category{font-size:10px;padding:.28rem .5rem}.related-articles-slider__date{font-size:10px}.related-articles-slider__card-title{font-size:.86rem;line-height:1.55;-webkit-line-clamp:3}.related-articles-slider__arrow{display:none}.related-articles-slider__hint{display:inline-flex}.related-articles-slider__dot{width:7px;height:7px}.related-articles-slider__dot[aria-current="true"]{width:16px}}
@media(max-width:420px){.related-articles-slider__header{display:grid;gap:.4rem}.related-articles-slider__all{justify-self:start}.related-articles-slider__track{--related-card-size:83vw}}
@media(prefers-reduced-motion:reduce){.related-articles-slider__track{scroll-behavior:auto}.related-articles-slider__card,.related-articles-slider__thumb img,.related-articles-slider__dot,.related-articles-slider__arrow{transition:none}}
.related-articles{padding:3.25rem 1rem;background:#f8fbff;border-top:1px solid #dbeafe}
.related-articles__eyebrow{text-align:center;font-size:13px;font-weight:900;color:#2563eb;letter-spacing:.08em;margin-bottom:.75rem}
.related-articles__title{text-align:center;font-size:1.5rem;font-weight:900;color:#1e3a8a;margin-bottom:.75rem}
.related-articles__lead{text-align:center;font-size:14px;font-weight:700;color:#475569;line-height:1.9;margin:0 auto 2rem;max-width:42rem}
.related-articles__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.related-article-card{display:flex;flex-direction:column;gap:.75rem;background:#fff;border:1px solid #dbeafe;border-radius:8px;padding:1.25rem;text-decoration:none;box-shadow:0 2px 10px rgba(37,99,235,.06);transition:transform .2s,border-color .2s,box-shadow .2s}
.related-article-card:hover,.related-article-card:focus-visible{transform:translateY(-2px);border-color:#93c5fd;box-shadow:0 10px 20px rgba(37,99,235,.12);outline:none}
.related-article-card__meta{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.related-article-card__pill{display:inline-flex;align-items:center;border-radius:9999px;background:#eff6ff;color:#2563eb;font-size:11px;font-weight:900;padding:.25rem .625rem}
.related-article-card__time{font-size:11px;font-weight:700;color:#64748b}
.related-article-card__title{font-size:1rem;font-weight:900;color:#1e3a8a;line-height:1.5}
.related-article-card__desc{font-size:13px;font-weight:700;color:#475569;line-height:1.8}
.related-article-card__link{display:inline-flex;align-items:center;gap:.35rem;font-size:13px;font-weight:900;color:#2563eb}
.related-symptoms{padding:3.25rem 1rem;background:#fff;border-top:1px solid #dfe4dc}
.related-symptoms__eyebrow{text-align:center;font-size:12px;font-weight:900;color:#356b2f;letter-spacing:.1em;margin:0 0 .7rem}
.related-symptoms__title{text-align:center;font-size:1.45rem;font-weight:900;color:#223b2d;line-height:1.55;margin:0 0 .75rem}
.related-symptoms__lead{text-align:center;font-size:14px;font-weight:700;color:#59635d;line-height:1.9;margin:0 auto 2rem;max-width:42rem}
.related-symptoms__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.9rem}
.related-symptom-card{position:relative;display:flex;flex-direction:column;gap:.55rem;min-height:118px;background:#fff;border:1px solid #dfe4dc;border-radius:8px;padding:1rem 3.25rem 1rem 1rem;text-decoration:none;transition:transform .2s,border-color .2s,background .2s,box-shadow .2s}
.related-symptom-card:hover,.related-symptom-card:focus-visible{transform:translateY(-2px);background:#fafcf8;border-color:#9bb596;box-shadow:0 8px 18px rgba(35,77,36,.09);outline:3px solid rgba(53,107,47,.16);outline-offset:2px}
.related-symptom-card__label{font-size:1rem;font-weight:900;color:#234d24;line-height:1.5}
.related-symptom-card__description{font-size:13px;font-weight:700;color:#59635d;line-height:1.75}
.related-symptom-card__arrow{position:absolute;right:1rem;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#f6f9f3;border:1px solid #cbd8c6;color:#356b2f;font-size:22px;font-weight:900;line-height:1;transition:background .2s ease,color .2s ease,border-color .2s ease,transform .2s ease}
.related-symptom-card:hover .related-symptom-card__arrow,.related-symptom-card:focus-visible .related-symptom-card__arrow{background:#356b2f;border-color:#356b2f;color:#fff;transform:translateY(-50%) translateX(2px)}
.related-symptoms__all{display:flex;justify-content:center;margin-top:1.35rem}
.related-symptoms__all-link{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:44px;border-bottom:1px solid #8aa384;color:#234d24;font-size:14px;font-weight:900;text-decoration:none}
.related-symptoms__all-link:hover,.related-symptoms__all-link:focus-visible{color:#356b2f;border-color:#356b2f;outline:3px solid rgba(53,107,47,.16);outline-offset:5px}
@media(max-width:640px){.related-symptoms{padding:2.75rem 1rem}.related-symptoms__grid{grid-template-columns:1fr}.related-symptom-card{min-height:104px;padding-right:3rem}.related-symptom-card__arrow{right:.85rem;width:30px;height:30px;font-size:20px}}
.symptom-mid-cta{padding:2.75rem 1rem;background:#fff;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0}
.symptom-mid-cta__inner{display:grid;gap:1.25rem;align-items:center;background:#f8fbff;border:1px solid #bfdbfe;border-radius:8px;padding:1.5rem}
.symptom-mid-cta__eyebrow{font-size:12px;font-weight:900;color:#2563eb;letter-spacing:.08em;margin:0 0 .5rem}
.symptom-mid-cta__title{font-size:1.25rem;font-weight:900;color:#1e3a8a;line-height:1.55;margin:0 0 .5rem}
.symptom-mid-cta__text{font-size:14px;font-weight:700;color:#475569;line-height:1.9;margin:0}
.symptom-mid-cta__actions{display:flex;flex-wrap:wrap;gap:.75rem}
.symptom-mid-cta__btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;border-radius:8px;padding:.85rem 1.15rem;font-size:14px;font-weight:900;text-decoration:none;transition:transform .2s,background .2s,border-color .2s}
.symptom-mid-cta__btn--line{background:#06C755;color:#fff}
.symptom-mid-cta__btn--tel{background:#fff;color:#1e3a8a;border:1px solid #bfdbfe}
.symptom-mid-cta__btn:hover,.symptom-mid-cta__btn:focus-visible{transform:translateY(-1px);outline:2px solid #93c5fd;outline-offset:3px}
.symptom-voices{padding:3.25rem 1rem;background:#f8fafc;border-top:1px solid #e2e8f0}
.symptom-voices__eyebrow{text-align:center;font-size:12px;font-weight:900;color:#2563eb;letter-spacing:.1em;margin:0 0 .7rem}
.symptom-voices__title{text-align:center;font-size:1.45rem;font-weight:900;color:#1e3a8a;line-height:1.55;margin:0 0 .75rem}
.symptom-voices__lead{text-align:center;font-size:14px;font-weight:700;color:#475569;line-height:1.9;margin:0 auto 2rem;max-width:42rem}
.symptom-voices__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),600px));justify-content:center;gap:2rem}
.symptom-voice-card{background:#fff;border:1px solid #dbeafe;border-radius:8px;overflow:hidden;box-shadow:0 16px 36px rgba(15,23,42,.09)}
.symptom-voice-card__image-link{display:block;background:#f1f5f9}
.symptom-voice-card__image{display:block;width:100%;height:auto}
.symptom-voice-card__body{padding:1.25rem}
.symptom-voice-card__label{font-size:11px;font-weight:900;color:#2563eb;letter-spacing:.08em;margin:0 0 .5rem}
.symptom-voice-card__rows{display:grid;gap:.75rem;margin:.85rem 0 0}
.symptom-voice-card__row{display:grid;gap:.3rem;border-top:1px solid #e2e8f0;padding-top:.75rem}
.symptom-voice-card__key{font-size:12px;font-weight:900;color:#2563eb;letter-spacing:.08em}
.symptom-voice-card__value{font-size:14px;font-weight:700;color:#334155;line-height:1.8}
.symptom-voices__note{font-size:11px;font-weight:700;color:#64748b;line-height:1.8;text-align:right;margin:1rem 0 0}
.symptom-footer{background:#0f172a;color:#cbd5e1;padding:3rem 1rem 2rem;text-align:center}
.symptom-footer__inner{max-width:860px;margin:0 auto}
.symptom-footer__logo{display:inline-block;background:#fff;border-radius:8px;padding:.7rem 1.35rem;margin-bottom:.8rem}
.symptom-footer__logo span{font-size:1.2rem;font-weight:900;color:#1e293b}
.symptom-footer__tagline{font-size:14px;font-weight:700;line-height:1.8;margin:0 0 1.4rem}
.symptom-footer__links{display:flex;flex-wrap:wrap;justify-content:center;gap:.65rem 1rem;list-style:none;margin:0 0 1.4rem;padding:0}
.symptom-footer__links a{font-size:13px;font-weight:700;color:#94a3b8;text-decoration:none;transition:color .2s}
.symptom-footer__links a:hover,.symptom-footer__links a:focus-visible{color:#60a5fa;outline:none;text-decoration:underline;text-underline-offset:4px}
.symptom-footer__note{font-size:10px;color:#64748b;font-weight:700;line-height:2;margin:0}
@media(min-width:768px){.related-articles__title{font-size:1.75rem}}
@media(min-width:768px){.symptom-mid-cta__inner{grid-template-columns:minmax(0,1fr) auto;padding:1.75rem 2rem}.symptom-mid-cta__title{font-size:1.45rem}}
@media(max-width:640px){.symptom-mid-cta__actions{flex-direction:column}.symptom-mid-cta__btn{width:100%}.symptom-voices__grid{gap:1rem}.symptom-voice-card__body{padding:1rem}.symptom-voices__note{text-align:left}}
`.trim();

const relatedArticleSliderScript = `
  <!-- RELATED_ARTICLES_SLIDER_SCRIPT_START -->
  <script>
    (() => {
      const slider = document.querySelector('[data-related-article-slider]');
      if (!slider) return;

      const track = slider.querySelector('[data-related-track]');
      const prev = slider.querySelector('[data-related-prev]');
      const next = slider.querySelector('[data-related-next]');
      const dotsRoot = slider.querySelector('[data-related-dots]');
      const cards = Array.from(slider.querySelectorAll('.related-articles-slider__card'));
      const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
      if (!track || !cards.length) return;

      const getCardStep = () => {
        const first = cards[0];
        const second = cards[1];
        if (!first) return track.clientWidth;
        if (second) return second.offsetLeft - first.offsetLeft;
        return first.getBoundingClientRect().width;
      };

      const getActiveIndex = () => {
        const target = track.scrollLeft;
        let activeIndex = 0;
        let closest = Number.POSITIVE_INFINITY;
        cards.forEach((card, index) => {
          const distance = Math.abs(card.offsetLeft - cards[0].offsetLeft - target);
          if (distance < closest) {
            closest = distance;
            activeIndex = index;
          }
        });
        return activeIndex;
      };

      const scrollToCard = (index) => {
        const card = cards[Math.max(0, Math.min(index, cards.length - 1))];
        if (!card) return;
        track.scrollTo({
          left: card.offsetLeft - cards[0].offsetLeft,
          behavior: reducedMotion ? 'auto' : 'smooth',
        });
      };

      const dots = cards.map((_, index) => {
        const dot = document.createElement('button');
        dot.type = 'button';
        dot.className = 'related-articles-slider__dot';
        dot.setAttribute('aria-label', String(index + 1) + '番目の記事へ移動');
        dot.addEventListener('click', () => scrollToCard(index));
        dotsRoot?.appendChild(dot);
        return dot;
      });

      const updateControls = () => {
        const maxScroll = Math.max(0, track.scrollWidth - track.clientWidth - 2);
        const hasOverflow = maxScroll > 1;
        const activeIndex = getActiveIndex();

        if (prev) {
          prev.disabled = !hasOverflow || track.scrollLeft <= 2;
          prev.hidden = !hasOverflow;
        }
        if (next) {
          next.disabled = !hasOverflow || track.scrollLeft >= maxScroll;
          next.hidden = !hasOverflow;
        }
        if (dotsRoot) dotsRoot.hidden = !hasOverflow || cards.length < 2;
        dots.forEach((dot, index) => {
          dot.setAttribute('aria-current', index === activeIndex ? 'true' : 'false');
        });
      };

      let scrollFrame = 0;
      track.addEventListener('scroll', () => {
        window.cancelAnimationFrame(scrollFrame);
        scrollFrame = window.requestAnimationFrame(updateControls);
      }, { passive: true });

      prev?.addEventListener('click', () => {
        track.scrollBy({ left: -getCardStep(), behavior: reducedMotion ? 'auto' : 'smooth' });
      });
      next?.addEventListener('click', () => {
        track.scrollBy({ left: getCardStep(), behavior: reducedMotion ? 'auto' : 'smooth' });
      });

      track.addEventListener('keydown', (event) => {
        if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;
        event.preventDefault();
        const direction = event.key === 'ArrowRight' ? 1 : -1;
        track.scrollBy({ left: direction * getCardStep(), behavior: reducedMotion ? 'auto' : 'smooth' });
      });

      let isDragging = false;
      let dragStartX = 0;
      let dragStartScroll = 0;
      let suppressClick = false;

      track.addEventListener('pointerdown', (event) => {
        if (event.pointerType === 'touch' || event.button !== 0) return;
        isDragging = true;
        suppressClick = false;
        dragStartX = event.clientX;
        dragStartScroll = track.scrollLeft;
        track.classList.add('is-dragging');
        track.setPointerCapture(event.pointerId);
      });

      track.addEventListener('pointermove', (event) => {
        if (!isDragging) return;
        const delta = event.clientX - dragStartX;
        if (Math.abs(delta) > 6) suppressClick = true;
        track.scrollLeft = dragStartScroll - delta;
      });

      const stopDragging = (event) => {
        if (!isDragging) return;
        isDragging = false;
        track.classList.remove('is-dragging');
        if (event.pointerId && track.hasPointerCapture(event.pointerId)) {
          track.releasePointerCapture(event.pointerId);
        }
        window.setTimeout(() => {
          suppressClick = false;
        }, 0);
      };

      track.addEventListener('pointerup', stopDragging);
      track.addEventListener('pointercancel', stopDragging);
      track.addEventListener('pointerleave', stopDragging);
      track.addEventListener('click', (event) => {
        if (!suppressClick) return;
        event.preventDefault();
        event.stopPropagation();
      }, true);

      window.addEventListener('resize', updateControls);
      updateControls();
    })();
  </script>
  <!-- RELATED_ARTICLES_SLIDER_SCRIPT_END -->
`.trim();

export async function buildBlog() {
  const [rawData, indexTemplate, postTemplate] = await Promise.all([
    fs.readFile(dataPath, "utf8"),
    fs.readFile(path.join(templatesDir, "blog-index-template.html"), "utf8"),
    fs.readFile(path.join(templatesDir, "blog-post-template.html"), "utf8")
  ]);

  const blogData = JSON.parse(rawData);
  validateBlogData(blogData);

  const categoryMap = new Map(blogData.categories.map((category) => [category.slug, category]));
  const posts = [...blogData.posts]
    .map((post) => normalizePost(post, blogData.site, categoryMap))
    .sort((a, b) => b.date.localeCompare(a.date));

  const indexHtml = renderTemplate(indexTemplate, {
    SEO_HEAD: buildIndexSeo(blogData.site),
    CSS_PATH: "assets/blog.css",
    HOME_PATH: "/",
    BLOG_PATH: "./",
    ACCESS_PATH: "/access.html",
    CONTACT_PATH: "/#access",
    PHONE: blogData.site.phone,
    PHONE_HREF: `tel:${blogData.site.phone.replace(/-/g, "")}`,
    SITE_NAME: blogData.site.name,
    SITE_SUBTITLE: blogData.site.subtitle,
    PAGE_CONTENT: buildIndexContent(blogData.site, posts, categoryMap)
  });

  await replaceDirectoryAtomically(postsDir, async (stagingDir) => {
    await fs.writeFile(path.join(stagingDir, ".gitkeep"), "", "utf8");

    for (const post of posts) {
      const postDir = path.join(stagingDir, post.slug);
      await fs.mkdir(postDir, { recursive: true });
      const relatedPosts = posts.filter((item) => item.slug !== post.slug && item.category.slug === post.category.slug).slice(0, 2);
      const postHtml = renderTemplate(postTemplate, {
        SEO_HEAD: buildPostSeo(blogData.site, post),
        CSS_PATH: "../../assets/blog.css",
        HOME_PATH: "/",
        BLOG_PATH: "../../",
        ACCESS_PATH: "/access.html",
        CONTACT_PATH: "/#access",
        PHONE: blogData.site.phone,
        PHONE_HREF: `tel:${blogData.site.phone.replace(/-/g, "")}`,
        SITE_NAME: blogData.site.name,
        SITE_SUBTITLE: blogData.site.subtitle,
        PAGE_CONTENT: buildPostContent(blogData.site, post, relatedPosts)
      });
      await fs.writeFile(path.join(postDir, "index.html"), cleanGeneratedText(postHtml), "utf8");
    }
  });

  await fs.writeFile(path.join(blogDir, "index.html"), cleanGeneratedText(indexHtml), "utf8");

  await updateSymptomPages(blogData.site, posts);
  await updateSymptomsDirectoryPage();

  await fs.writeFile(path.join(rootDir, "blog.html"), cleanGeneratedText(buildBlogRedirectHtml()), "utf8");
  await fs.writeFile(path.join(rootDir, "blog-detail.html"), cleanGeneratedText(buildLegacyDetailRedirectHtml()), "utf8");
  await updateSitemap(blogData.site, posts);

  console.log(`Generated ${posts.length} static blog post(s), updated symptom related articles, and regenerated sitemap.xml.`);
}

export async function replaceDirectoryAtomically(targetDir, populateDirectory) {
  const parentDir = path.dirname(targetDir);
  const dirName = path.basename(targetDir);
  const nonce = `${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2, 10)}`;
  const stagingDir = path.join(parentDir, `${dirName}.__staging__${nonce}`);
  const backupDir = path.join(parentDir, `${dirName}.__backup__${nonce}`);
  let backupCreated = false;

  await fs.mkdir(parentDir, { recursive: true });

  try {
    await fs.mkdir(stagingDir, { recursive: true });
    await populateDirectory(stagingDir);

    try {
      await fs.rename(targetDir, backupDir);
      backupCreated = true;
    } catch (error) {
      if (error?.code !== "ENOENT") throw error;
    }

    try {
      await fs.rename(stagingDir, targetDir);
    } catch (error) {
      if (backupCreated) {
        try {
          await fs.rename(backupDir, targetDir);
          backupCreated = false;
        } catch {
          // Preserve the backup directory on disk if rollback fails.
        }
      }
      throw error;
    }

    if (backupCreated) {
      await fs.rm(backupDir, { recursive: true, force: true });
      backupCreated = false;
    }
  } catch (error) {
    await fs.rm(stagingDir, { recursive: true, force: true }).catch(() => {});
    throw error;
  }
}

async function updateSymptomPages(site, posts) {
  const symptomFiles = await fs.readdir(symptomsDir);
  for (const fileName of symptomFiles) {
    if (!fileName.endsWith(".html")) continue;
    const baseConfig = symptomConfigs[fileName];
    const config = baseConfig ? { ...baseConfig, fileName } : null;
    if (!config) continue;

    const fullPath = path.join(symptomsDir, fileName);
    let html = await fs.readFile(fullPath, "utf8");
    html = upsertRelatedStyles(html);
    html = upsertDetailedSymptomContent(html, config);
    html = upsertSymptomPatientVoices(html, config);
    html = upsertSymptomMidCta(html, site);
    if (NOINDEX_SYMPTOM_FILES.has(fileName)) {
      html = ensureNoindexFollow(html);
    }

    const relatedPostLimit = isRelatedArticleSliderPage(fileName) ? 5 : 4;
    const matchedPosts = selectRelatedPosts(config, posts).slice(0, relatedPostLimit);
    const sectionHtml = matchedPosts.length ? buildRelatedArticlesSection(site, config, matchedPosts) : "";
    html = replaceRelatedSection(html, sectionHtml);
    html = upsertRelatedArticleSliderScript(html, config);
    html = normalizeSymptomPageDesign(html, site, config);

    await fs.writeFile(fullPath, cleanGeneratedText(html), "utf8");
  }
}

const symptomsDirectoryStyles = `
    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; font-family: "BIZ UDPGothic", "Noto Sans JP", system-ui, sans-serif; line-height: 1.8; color: #263b34; background: #fff; }
    a { color: inherit; }
    .page { min-height: 100vh; padding: 88px 18px 72px; background: #fff; }
    .symptom-directory-hero { width: min(960px, 100%); margin: 0 auto; padding: clamp(34px, 6vw, 64px) 0 clamp(48px, 7vw, 76px); border-bottom: 1px solid #dfe4dc; }
    .symptom-directory-hero__label { margin: 0 0 12px; color: #356b2f; font-size: .82rem; font-weight: 900; letter-spacing: .08em; }
    .symptom-directory-hero h1 { position: relative; margin: 0 0 26px; padding-bottom: 18px; color: #223b2d; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.35; letter-spacing: 0; }
    .symptom-directory-hero h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 52px; height: 3px; background: #356b2f; }
    .symptom-directory-hero__lead { max-width: 720px; margin: 0; color: #59635d; font-size: clamp(1rem, 2vw, 1.12rem); font-weight: 700; line-height: 1.9; }
    .symptom-directory-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
    .symptom-directory-hero__button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 18px; border: 1px solid #356b2f; border-radius: 8px; background: #356b2f; color: #fff; font-size: .94rem; font-weight: 900; text-decoration: none; }
    .symptom-directory-hero__button--secondary { background: #fff; color: #234d24; }
    .symptom-directory-hero__button:hover, .symptom-directory-hero__button:focus-visible { outline: 3px solid rgba(53,107,47,.18); outline-offset: 3px; }
    .symptom-directory { width: min(960px, 100%); margin: 0 auto; padding: clamp(58px, 8vw, 92px) 0 0; }
    .symptom-directory__heading { margin-bottom: clamp(34px, 5vw, 52px); }
    .symptom-directory__heading h2 { position: relative; margin: 0 0 18px; padding-bottom: 15px; color: #223b2d; font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.45; letter-spacing: 0; }
    .symptom-directory__heading h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 3px; background: #356b2f; }
    .symptom-directory__heading p { margin: 0; color: #59635d; font-size: .98rem; font-weight: 700; line-height: 1.85; }
    .symptom-directory__groups { columns: 2; column-gap: clamp(44px, 6vw, 72px); }
    .symptom-directory__group { display: inline-block; width: 100%; min-width: 0; margin-bottom: 34px; padding: 34px 0 6px; border-top: 1px solid #dfe4dc; break-inside: avoid; }
    .symptom-directory__group-header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 19px; }
    .symptom-directory__group-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #aebfa8; border-radius: 50%; color: #356b2f; }
    .symptom-directory__group-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
    .symptom-directory__group h3 { margin: 0 0 5px; color: #223b2d; font-size: 1.24rem; line-height: 1.45; }
    .symptom-directory__group-description { margin: 0; color: #69736c; font-size: .84rem; font-weight: 700; line-height: 1.7; }
    .symptom-directory__links { display: grid; gap: 0; border-top: 1px solid #e5e9e2; }
    .symptom-directory__link { position: relative; display: grid; gap: 4px; min-height: 76px; padding: 14px 46px 14px 4px; border-bottom: 1px solid #e5e9e2; text-decoration: none; }
    .symptom-directory__link-title { color: #234d24; font-size: .98rem; font-weight: 900; line-height: 1.5; }
    .symptom-directory__link-description { color: #69736c; font-size: .79rem; font-weight: 700; line-height: 1.65; }
    .symptom-directory__link-arrow { position: absolute; right: 4px; top: 50%; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #cbd8c6; border-radius: 50%; color: #356b2f; font-size: 20px; font-weight: 900; line-height: 1; transform: translateY(-50%); transition: background .2s, color .2s, transform .2s; }
    .symptom-directory__link:hover, .symptom-directory__link:focus-visible { background: #fafcf8; outline: 3px solid rgba(53,107,47,.15); outline-offset: 2px; }
    .symptom-directory__link:hover .symptom-directory__link-arrow, .symptom-directory__link:focus-visible .symptom-directory__link-arrow { background: #356b2f; color: #fff; transform: translateY(-50%) translateX(2px); }
    @media (max-width: 767px) {
      .page { padding: 60px 16px 94px; }
      .symptom-directory-hero { padding-top: 30px; padding-bottom: 52px; }
      .symptom-directory-hero__actions { display: grid; }
      .symptom-directory-hero__button { width: 100%; }
      .symptom-directory__groups { columns: 1; }
      .symptom-directory__group { margin-bottom: 24px; padding-top: 30px; }
      .symptom-directory__group-header { gap: 12px; }
      .symptom-directory__link { min-height: 72px; }
    }
.symptom-page-toc {
  padding: 1.75rem 0;
  background: #fffaf3;
  border-top: 1px solid #eadfce;
  border-bottom: 1px solid #eadfce;
}

.symptom-page-toc__inner {
  display: grid;
  grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}

.symptom-page-toc__heading {
  margin: 0;
  color: #223b2d;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.5;
}

.symptom-page-toc__heading::before {
  display: inline-block;
  width: 4px;
  height: 1.2em;
  margin-right: .6rem;
  border-radius: 999px;
  background: #356b2f;
  content: "";
  vertical-align: -.15em;
}

.symptom-page-toc__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.symptom-page-toc__link {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem .7rem;
  border-bottom: 1px solid #ded8cc;
  color: #365047;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
}

.symptom-page-toc__link::before {
  flex: 0 0 auto;
  color: #d58b40;
  content: "›";
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.2;
}

.symptom-page-toc__link:hover,
.symptom-page-toc__link:focus-visible {
  border-color: #8aa384;
  color: #234d24;
  outline: 2px solid rgba(53, 107, 47, .18);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .symptom-page-toc {
    padding: 1.35rem 0;
  }

  .symptom-page-toc__inner {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .symptom-page-toc__list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .symptom-page-toc__link {
    padding: .48rem .35rem;
    font-size: .82rem;
  }
}

.symptom-trust {
  padding: clamp(4rem, 8vw, 6rem) 1rem;
  border-top: 1px solid #e3e6df;
  background: #fbfaf6;
}

.symptom-trust__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.symptom-major-guide {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-left: 4px solid #d58b40;
  background: #fff;
}

.symptom-major-guide__eyebrow,
.symptom-trust__eyebrow,
.symptom-trust__review-label {
  margin: 0 0 .55rem;
  color: #356b2f;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.symptom-major-guide h2,
.symptom-trust__heading h2 {
  margin: 0;
  color: #203a30;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0;
}

.symptom-major-guide > p:not(.symptom-major-guide__eyebrow),
.symptom-trust__heading > p:last-child {
  margin: 1rem 0 0;
  color: #52615a;
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.9;
}

.symptom-major-guide ul {
  display: grid;
  gap: .65rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.symptom-major-guide li {
  position: relative;
  padding-left: 1.35rem;
  color: #52615a;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.75;
}

.symptom-major-guide li::before {
  position: absolute;
  left: 0;
  color: #d58b40;
  content: "●";
  font-size: .55rem;
  top: .55em;
}

.symptom-trust__heading {
  max-width: 760px;
}

.symptom-trust__levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #d9ded7;
  border-bottom: 1px solid #d9ded7;
}

.symptom-trust__level {
  min-width: 0;
  padding: 1.75rem;
  background: #fff;
}

.symptom-trust__level + .symptom-trust__level {
  border-left: 1px solid #d9ded7;
}

.symptom-trust__level-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
}

.symptom-trust__level-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #b9c7bd;
  border-radius: 50%;
  color: #356b2f;
}

.symptom-trust__level--urgent .symptom-trust__level-icon {
  border-color: #c9a77c;
  color: #8a572e;
}

.symptom-trust__level-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.symptom-trust__level h3 {
  margin: 0;
  color: #263b34;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.55;
}

.symptom-trust__level-heading p {
  margin: .45rem 0 0;
  color: #69736e;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.65;
}

.symptom-trust__level ul {
  display: grid;
  gap: .7rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.symptom-trust__level li {
  position: relative;
  padding-left: 1.15rem;
  color: #4e5d56;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.7;
}

.symptom-trust__level li::before {
  position: absolute;
  left: 0;
  top: .6em;
  width: 6px;
  height: 6px;
  border: 1px solid #6e8f79;
  border-radius: 50%;
  content: "";
}

.symptom-trust__review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  padding-top: .25rem;
}

.symptom-trust__reviewer,
.symptom-trust__references {
  padding-top: 1.2rem;
  border-top: 1px solid #cdd5ce;
}

.symptom-trust__review-name {
  margin: 0;
  color: #263b34;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.65;
}

.symptom-trust__review-name span {
  display: block;
  color: #5f6c66;
  font-size: .82rem;
  font-weight: 700;
}

.symptom-trust__review-date {
  margin: .55rem 0 0;
  color: #6a746f;
  font-size: .78rem;
  font-weight: 700;
}

.symptom-trust__reviewer-link,
.symptom-trust__reference {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #245b44;
  font-size: .84rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.symptom-trust__references ul {
  display: grid;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.symptom-trust__disclaimer {
  margin: 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid #92a68e;
  background: #f1f4ef;
  color: #5a665f;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.75;
}

@media (max-width: 767px) {
  .symptom-trust {
    padding: 4rem 1rem;
  }

  .symptom-trust__levels,
  .symptom-trust__review {
    grid-template-columns: 1fr;
  }

  .symptom-trust__level {
    padding: 1.35rem 1rem;
  }

  .symptom-trust__level + .symptom-trust__level {
    border-top: 1px solid #d9ded7;
    border-left: 0;
  }

  .symptom-trust__review {
    gap: 1.25rem;
  }
}

/* site-cycle-flow.css */
.symptom-cycle,
.symptom-cycle * {
  box-sizing: border-box;
}

.symptom-cycle.symptom-cycle {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  border: 1px solid #dfe4dc;
  border-radius: 16px;
  background: #faf7f0;
  padding: clamp(16px, 2.5vw, 24px);
  counter-reset: symptom-cycle-step;
}

.symptom-cycle .symptom-cycle__item {
  display: grid;
  grid-column: auto;
  grid-template-columns: 36px 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 66px;
  border: 1px solid #d5dfd2;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: #252a27;
  font-size: .9rem;
  font-weight: 900;
  line-height: 1.55;
  box-shadow: 0 4px 12px rgba(37, 42, 39, .04);
  counter-increment: symptom-cycle-step;
}

.symptom-cycle .symptom-cycle__item::before {
  content: counter(symptom-cycle-step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #356b2f;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.symptom-cycle .symptom-cycle__item svg {
  width: 22px;
  height: 22px;
  color: #356b2f;
  stroke-width: 1.7;
}

.symptom-cycle .symptom-cycle__arrow {
  display: grid;
  place-items: center;
  width: 100%;
  height: 20px;
  border: 0;
  color: #789174;
}

.symptom-cycle .symptom-cycle__arrow svg {
  width: 17px;
  height: 17px;
  transform: none;
  stroke-width: 2;
}

.symptom-cycle .symptom-cycle__loop-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 4px 0 0;
  border: 0;
  border-radius: 10px;
  background: #eef5e9;
  padding: 10px 12px;
  color: #234d24;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
}

.symptom-cycle .symptom-cycle__loop-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

@media (max-width: 767px) {
  .symptom-cycle.symptom-cycle {
    gap: 8px;
    padding: 14px;
  }

  .symptom-cycle .symptom-cycle__item {
    grid-template-columns: 34px 26px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
  }

  .symptom-cycle .symptom-cycle__item::before {
    width: 34px;
    height: 34px;
  }

  .symptom-cycle .symptom-cycle__loop-note {
    font-size: .78rem;
  }
}
