/*
 * 韓国語・英語のページ（/ko/…・/en/…）だけで読み込む（inc/i18n.php）。日本語のページには影響しない。docs/design-i18n.md。
 * 日本語の見た目は、字詰めに合わせた改行（<br>）と折り返しの禁止（white-space: nowrap）で組んでいる。訳では <br> が外れ、
 * 文の長さも変わるので、はみ出す要素だけ折り返しを許し、固定の高さを中身に合わせる。
 */
/*
 * 折り返しを許す要素（2026-11-24、tools/check-i18n-layout.mjs を 1440・1024・393px で実行し、訳が1行に収まらず枠からはみ出した、
 * または折り返しの禁止で画面の外へ出た139種類）。日本語では white-space: nowrap と <br> で行を決めている。
 * ここに挙げた要素だけ折り返し、ほかは日本語と同じく1行のまま。訳を変えたら同じ確認をし、新しく出た要素をここに足す。
 */
html:lang(ko) :is(.bonding-concerns__item, .bonding-concerns__title, .bonding-features__item-title, .bonding-flow__step-title, .botox-concerns__item, .botox-concerns__note, .botox-features__text, .botox-flow__text, .botox-flow__title, .botox-gummy-smile__text, .botox-masseter__text, .botox-onestop__text, .botox-onestop__title, .botox-sessions__line, .c-link__text, .caries-flow__step-title, .ceramic-concerns__item, .ceramic-features__item-title, .ceramic-features__title, .ceramic-flow__step-title, .ceramic-flow__text, .ceramic-materials__title, .ceramic-ortho-about__title, .ceramic-ortho-concerns__item, .ceramic-ortho-concerns__title, .ceramic-ortho-features__item-title, .ceramic-ortho-flow__step-title, .ceramic-ortho-flow__text, .ceramic-ortho-flow__title, .ceramic-ortho-indications__label, .ceramic-ortho-merit__item, .ceramic-ortho-stages__title, .ceramic-ortho-why__text, .ceramic-stages__title, .ceramic-why__text, .contact-reserve__text, .counsel-price__notice, .fat-about__text, .fat-approach__text, .fat-approach__title, .fat-choice__text, .fat-choice__title, .fat-concerns__item, .fat-concerns__note, .fat-flow__title, .fat-sessions__line, .fat-sessions__title, .hyaluronic-concerns__item, .hyaluronic-duration__text, .hyaluronic-duration__title, .hyaluronic-flow__title, .hyaluronic-lead__title, .hyaluronic-onestop__text, .hyaluronic-onestop__title, .hyaluronic-why-dentist__text, .hyaluronic-why-dentist__title, .implant-bone-graft__text, .implant-comfort__text, .implant-concerns__item, .implant-features__item-title, .implant-features__text, .implant-merit__item, .implant-merit__lead, .implant-safety__text, .implant-sessions__last, .implant-stages__title, .invisalign-about__text, .invisalign-features__item-title, .invisalign-indications__text, .invisalign-indications__title, .invisalign-indications__wishes-label, .invisalign-policy__text, .laminate-concerns__item, .laminate-concerns__note, .laminate-features__heading, .laminate-features__number, .laminate-features__text, .laminate-indications__item, .laminate-merit__item, .menu-card__title, .message__name-ja, .message__role, .page-head__title, .partial-about__text, .partial-concerns__item, .partial-concerns__note, .partial-features__heading, .partial-features__number, .partial-features__text, .partial-indications__item, .partial-indications__lead, .partial-retention__text, .prevent-about__text, .prevent-comparison__value, .prevent-flow__name, .prevent-interval__text, .prevent-menu__text, .price-index__text, .site-footer__address, .site-footer__category, .site-footer__heading, .site-footer__name, .stemcell-about__text, .stemcell-about__title-note, .stemcell-concerns__item, .stemcell-concerns__note, .stemcell-onestop__text, .stemcell-onestop__title, .stemcell-position__text, .stemcell-safety__text, .stemcell-sessions__line, .summary-cta__tel-note, .summary-cta__title, .symptom-concept__title, .top-first-visit__tel-note, .top-menu__link-text, .top-symptom__text, .treatment-cta__title, .whitening-concerns__item, .whitening-concerns__note, .whitening-features__item-title, .whitening-features__text, .whitening-flow__text, .whitening-stages__title, .wire-concerns__item, .wire-concerns__note, .wire-features__heading, .wire-features__number, .wire-features__text, .wire-flow__heading, .wire-indications__wishes-label, .wire-menu__name, .wire-menu__text, .wire-support__title, .invisalign-about span, .site-footer a, .implant-sessions p, .implant-sessions span, .stemcell-about span),
html:lang(en) :is(.bonding-concerns__item, .bonding-concerns__title, .bonding-features__item-title, .bonding-flow__step-title, .botox-concerns__item, .botox-concerns__note, .botox-features__text, .botox-flow__text, .botox-flow__title, .botox-gummy-smile__text, .botox-masseter__text, .botox-onestop__text, .botox-onestop__title, .botox-sessions__line, .c-link__text, .caries-flow__step-title, .ceramic-concerns__item, .ceramic-features__item-title, .ceramic-features__title, .ceramic-flow__step-title, .ceramic-flow__text, .ceramic-materials__title, .ceramic-ortho-about__title, .ceramic-ortho-concerns__item, .ceramic-ortho-concerns__title, .ceramic-ortho-features__item-title, .ceramic-ortho-flow__step-title, .ceramic-ortho-flow__text, .ceramic-ortho-flow__title, .ceramic-ortho-indications__label, .ceramic-ortho-merit__item, .ceramic-ortho-stages__title, .ceramic-ortho-why__text, .ceramic-stages__title, .ceramic-why__text, .contact-reserve__text, .counsel-price__notice, .fat-about__text, .fat-approach__text, .fat-approach__title, .fat-choice__text, .fat-choice__title, .fat-concerns__item, .fat-concerns__note, .fat-flow__title, .fat-sessions__line, .fat-sessions__title, .hyaluronic-concerns__item, .hyaluronic-duration__text, .hyaluronic-duration__title, .hyaluronic-flow__title, .hyaluronic-lead__title, .hyaluronic-onestop__text, .hyaluronic-onestop__title, .hyaluronic-why-dentist__text, .hyaluronic-why-dentist__title, .implant-bone-graft__text, .implant-comfort__text, .implant-concerns__item, .implant-features__item-title, .implant-features__text, .implant-merit__item, .implant-merit__lead, .implant-safety__text, .implant-sessions__last, .implant-stages__title, .invisalign-about__text, .invisalign-features__item-title, .invisalign-indications__text, .invisalign-indications__title, .invisalign-indications__wishes-label, .invisalign-policy__text, .laminate-concerns__item, .laminate-concerns__note, .laminate-features__heading, .laminate-features__number, .laminate-features__text, .laminate-indications__item, .laminate-merit__item, .menu-card__title, .message__name-ja, .message__role, .page-head__title, .partial-about__text, .partial-concerns__item, .partial-concerns__note, .partial-features__heading, .partial-features__number, .partial-features__text, .partial-indications__item, .partial-indications__lead, .partial-retention__text, .prevent-about__text, .prevent-comparison__value, .prevent-flow__name, .prevent-interval__text, .prevent-menu__text, .price-index__text, .site-footer__address, .site-footer__category, .site-footer__heading, .site-footer__name, .stemcell-about__text, .stemcell-about__title-note, .stemcell-concerns__item, .stemcell-concerns__note, .stemcell-onestop__text, .stemcell-onestop__title, .stemcell-position__text, .stemcell-safety__text, .stemcell-sessions__line, .summary-cta__tel-note, .summary-cta__title, .symptom-concept__title, .top-first-visit__tel-note, .top-menu__link-text, .top-symptom__text, .treatment-cta__title, .whitening-concerns__item, .whitening-concerns__note, .whitening-features__item-title, .whitening-features__text, .whitening-flow__text, .whitening-stages__title, .wire-concerns__item, .wire-concerns__note, .wire-features__heading, .wire-features__number, .wire-features__text, .wire-flow__heading, .wire-indications__wishes-label, .wire-menu__name, .wire-menu__text, .wire-support__title, .invisalign-about span, .site-footer a, .implant-sessions p, .implant-sessions span, .stemcell-about span) {
  white-space: normal !important;
}

/* ヘッダーのナビは折り返さず、中身の幅で中央に並べる（中央寄せの枠の幅で項目が縮み、語が2行に折れていた）。 */
html:lang(ko) .site-nav,
html:lang(en) .site-nav {
  width: max-content;
}
/* セラミック矯正のページは日本語の文字の幅でナビの項目の幅を固定している（common.css の --site-nav-w）。訳では中身の幅にする。 */
html:lang(ko) .site-nav__link,
html:lang(en) .site-nav__link {
  width: auto !important;
}

/* 韓国語は語（어절）の途中で改行しない。収まらない長い語だけ折る。 */
html:lang(ko) body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 英語の長い語（固有名詞・複合語）が狭い枠からはみ出さないように折る。 */
html:lang(en) body {
  overflow-wrap: break-word;
}

/* 高さを日本語の行数で固定した文の箱（2026-11-24 の確認で、訳が2行以上になって下へはみ出した16種類）。中身に合わせる。 */
html:lang(ko) :is(.top-intro__t33, .clinic-concept__lead, .treatment-cases__tag, .caries-flow__title, .caries-flow__step-title, .treatment-cta__tel-note, .prevent-interval__title, .prevent-flow__title, .prevent-flow__name, .treatment-cta__title, .partial-concerns__title, .partial-indications__item, .whitening-notice__title, .whitening-flow__title, .contact-reserve__text, .site-footer__address),
html:lang(en) :is(.top-intro__t33, .clinic-concept__lead, .treatment-cases__tag, .caries-flow__title, .caries-flow__step-title, .treatment-cta__tel-note, .prevent-interval__title, .prevent-flow__title, .prevent-flow__name, .treatment-cta__title, .partial-concerns__title, .partial-indications__item, .whitening-notice__title, .whitening-flow__title, .contact-reserve__text, .site-footer__address) {
  height: auto !important;
}

/* TOP の症状の札の文字は flex: none（縮まない）なので、折り返しても中身の最大の幅で並び、画面の外へ出た。縮めて折り返す。 */
html:lang(ko) .top-symptom__text,
html:lang(en) .top-symptom__text {
  flex-shrink: 1;
  min-width: 0;
}

/* まとめの CTA の見出しは、字間の分の負の右余白で中央をそろえている。訳が画面幅まで広がると、その分だけ画面の外へ出るので外す。 */
html:lang(ko) .summary-cta__title,
html:lang(en) .summary-cta__title {
  margin-right: 0 !important;
}

/* 追加（2026-11-24、npm test と同じ10幅での確認）: 折り返しを許す要素 */
html:lang(ko) :is(.ceramic-ortho-features__title, .hyaluronic-concerns__note, .top-symptom__title, .top-first-visit__title, .symptom-list__link span, .prevent-flow__text, .caries-features__item-title, .caries-features-2__title, .invisalign-features-2__title, .wire-reasons__title, .invisalign-support__title, .wire-support__title, .whitening-support__title, .implant-support__title, .counsel-price__method, .invisalign-indications__chip, .wire-indications__chip, .ceramic-ortho-indications__chip, .laminate-merit__item, .c-link__text),
html:lang(en) :is(.ceramic-ortho-features__title, .hyaluronic-concerns__note, .top-symptom__title, .top-first-visit__title, .symptom-list__link span, .prevent-flow__text, .caries-features__item-title, .caries-features-2__title, .invisalign-features-2__title, .wire-reasons__title, .invisalign-support__title, .wire-support__title, .whitening-support__title, .implant-support__title, .counsel-price__method, .invisalign-indications__chip, .wire-indications__chip, .ceramic-ortho-indications__chip, .laminate-merit__item, .c-link__text) {
  white-space: normal !important;
}

/* 追加（同上）: 高さを中身に合わせる要素 */
html:lang(ko) :is(.caries-features__item-title, .invisalign-support__title, .wire-support__title, .whitening-support__title, .implant-support__title, .laminate-merit__item),
html:lang(en) :is(.caries-features__item-title, .invisalign-support__title, .wire-support__title, .whitening-support__title, .implant-support__title, .laminate-merit__item) {
  height: auto !important;
}

/* 症状のページのリンクは SP で幅を中身の最大の幅にしている（calc-size(max-content, …)）。訳では枠の幅で折り返す。 */
html:lang(ko) .symptom-list__link,
html:lang(en) .symptom-list__link {
  max-width: 100%;
  white-space: normal !important;
}
@media (max-width:1023px) {
  html:lang(ko) .symptom-list__link,
  html:lang(en) .symptom-list__link {
    width: auto !important;
  }
}

/* 予防のページの手順の説明文は高さを固定している。訳では中身に合わせる。 */
html:lang(ko) .prevent-flow__text,
html:lang(en) .prevent-flow__text {
  height: auto !important;
}

/* ワイヤー矯正のメニューのリンクは、SP でカードの中心から左右に 90px ずらして中央寄せで置く。長い訳でも隣と重ならず画面に収まる幅にする。 */
@media (max-width:1023px) {
  html:lang(ko) .wire-menu__link,
  html:lang(en) .wire-menu__link {
    max-width: 170px;
    text-align: center;
  }
}
@media (max-width:430px) {
  html:lang(ko) .wire-menu__link,
  html:lang(en) .wire-menu__link {
    max-width: 130px;
  }
}

/* SP のヘッダー（2026-11-25、開いた状態の確認で見つけた）: 医院名は折り返さない指定で、英語の名前が縮んだ枠の外へ伸びて予約のボタンの下に入っていた。
   ボタンは日本語の「WEB予約」に合わせた幅 64px で、「Book Online」の両端が切れていた。名前は枠の中で折り返し、ボタンは中身の幅にする。 */
@media (max-width:1023px) {
  html:lang(ko) .site-header .site-header__name,
  html:lang(en) .site-header .site-header__name {
    white-space: normal !important;
  }
  html:lang(ko) .site-header .site-header__reserve,
  html:lang(en) .site-header .site-header__reserve {
    width: auto !important;
    padding: 0 10px;
  }
}

/* TOP の導入（SP、2026-11-25 に「枠で切れる」の判定と画面で見つけた）。見出しは1行ずつ高さを固定していて、訳が折り返すと行が重なった。
   縦書きの3つの文は高さ 580px の枠に位置を固定して置いていて、長い訳の末尾が切れ、英語は文字が横倒しになった。
   見出しの高さを中身に合わせ、3つの文は横書きにして、日本語の読む順（短期集中で… → 天神の歯医者で… → 口元の…）に上から並べる。PC は日本語と同じ縦書き。
   日本語の3行の見出しを囲む飾りの線（お知らせのブロックから伸びる top-line--sp-column-h1）と導入の線（top-line--sp-lead・-tail）は、訳の文を横切るので出さない。 */
@media (max-width:1023px) {
  html:lang(ko) :is(.top-intro__title, .top-intro__title-line, .top-intro__title [data-editable="title-lead"]),
  html:lang(en) :is(.top-intro__title, .top-intro__title-line, .top-intro__title [data-editable="title-lead"]) {
    height: auto !important;
  }
  html:lang(ko) .top-intro__visual,
  html:lang(en) .top-intro__visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 48px 24px 0;
  }
  html:lang(ko) .top-intro__vtext,
  html:lang(en) .top-intro__vtext {
    position: relative;
    inset: auto;
    writing-mode: horizontal-tb;
    white-space: normal !important;
    line-height: 1.6;
    letter-spacing: .06em;
  }
  html:lang(ko) .top-intro__vtext--short,
  html:lang(en) .top-intro__vtext--short { order: 1; }
  html:lang(ko) .top-intro__vtext--tenjin,
  html:lang(en) .top-intro__vtext--tenjin { order: 2; }
  html:lang(ko) .top-intro__vtext--design,
  html:lang(en) .top-intro__vtext--design { order: 3; }
  /* 見出しを囲む線と縦の線（top-line--sp-lead・-tail）は日本語の文の位置に合わせて引いた飾りで、訳の文を横切るので出さない。 */
  html:lang(ko) .top-intro .top-line--sp,
  html:lang(en) .top-intro .top-line--sp,
  html:lang(ko) .top-line--sp-column-h1,
  html:lang(en) .top-line--sp-column-h1 {
    display: none;
  }
}

/* TOP の導入（PC、2026-11-25 に「箱からはみ出す」「枠で切れる」の判定と画面で見つけた）。
   見出しは1行ずつ折り返さない指定で、訳は日本語の箱（741px）より長い（韓国語 754px、英語 1082px）。見た目は飾りの枠の中に収まっているので、箱を中身の幅にするだけにする。
   英語の縦書きの3文は、英字が1字ずつ立ったまま縦に 1,500px 余り伸び、飾りの線を横切って本文の横まで届いていた。英語だけ横書きにし、日本語と同じく枠の線の左に右揃えで、
   日本語の読む順（短期集中で… → 天神の歯医者で… → 口元の…）に上から並べる。韓国語は縦書きのまま日本語と同じ範囲に収まっている。
   英語の3段落目は日本語より1行多く、動きを減らす設定（と JavaScript 未実行）では本文の枠（日本語の3段落目の下端ちょうど）で最後の行が切れていた。1行（48px）分だけ枠と導入の高さを伸ばす。
   動きのある表示（is-intro-s3）は top.js が本文の実際の下端から送る量を測るので変えない。 */
@media (min-width:1024px) {
  html:lang(ko) .top-intro__title,
  html:lang(en) .top-intro__title {
    width: auto;
  }
  html:lang(en) .top-intro__visual {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    box-sizing: border-box;
    padding: 125px 570px 0 129px;
  }
  html:lang(en) .top-intro__vtext {
    position: relative;
    inset: auto;
    max-width: 100%;
    writing-mode: horizontal-tb;
    white-space: normal !important;
    line-height: 1.5;
    letter-spacing: .06em;
    text-align: right;
  }
  html:lang(en) .top-intro__vtext--short { order: 1; }
  html:lang(en) .top-intro__vtext--tenjin { order: 2; }
  html:lang(en) .top-intro__vtext--design { order: 3; }
  /* 英語のリード文は日本語より2行多い6行で、最後の行が下の縦の線の始まりに接していた。1行（48px）上げる（写真の下端との間は日本語の 99px から 51px になる）。 */
  html:lang(en) .top-intro__text--4 { top: 11px; }
  html:lang(en) .top-intro:not(.is-intro-s3) .top-intro__inner { height: 3485px; }
  html:lang(en) .top-intro:not(.is-intro-s3) .top-intro__clip { height: 3251px; }
  html:lang(en) .top-intro:not(.is-intro-s3) .top-intro__body { height: 1912px; }
}

/* TOP のメッセージ（2026-11-25、画面で見つけた）: 引用3つ（voices）と締め4つ（closing）は縦書きで位置を固定しているため、訳では列が長くなり、
   本文や次のブロックに重なり（英語）、末尾が切れた（韓国語）。英語は文字が横倒しにもなる。PC・SP とも横書きのまとまりにし、写真と本文を避けた位置に、
   日本語の読む順（引用: 忙しくて… → どこに… → 分からない、締め: 美しさだけでなく… → 歯科医療を目指します）で並べる。 */
html:lang(ko) :is(.top-message__voices, .top-message__closing),
html:lang(en) :is(.top-message__voices, .top-message__closing) {
  inset: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: auto;
}
html:lang(ko) .top-message__voices,
html:lang(en) .top-message__voices { left: 900px; top: 160px; width: 460px; }
html:lang(ko) .top-message__closing,
html:lang(en) .top-message__closing { left: 120px; top: 1400px; width: 460px; }
html:lang(ko) .top-message__vtext,
html:lang(en) .top-message__vtext {
  position: relative;
  inset: auto;
  writing-mode: horizontal-tb;
  white-space: normal !important;
  font-size: 28px;
  line-height: 1.6;
  letter-spacing: .06em;
}
html:lang(ko) .top-message__vtext--small,
html:lang(en) .top-message__vtext--small { font-size: 16px; }
html:lang(ko) .top-message__vtext--aim,
html:lang(en) .top-message__vtext--aim { font-size: 24px; }
html:lang(ko) .top-message__vtext--voice-1,
html:lang(en) .top-message__vtext--voice-1 { order: 1; }
html:lang(ko) .top-message__vtext--voice-2,
html:lang(en) .top-message__vtext--voice-2 { order: 2; }
html:lang(ko) .top-message__vtext--voice-3,
html:lang(en) .top-message__vtext--voice-3 { order: 3; }
@media (max-width:1023px) {
  html:lang(ko) .top-message__voices,
  html:lang(en) .top-message__voices { left: 24px; top: 500px; width: calc(100% - 48px); }
  html:lang(ko) .top-message__closing,
  html:lang(en) .top-message__closing { left: 24px; top: 1000px; width: calc(100% - 48px); }
  html:lang(ko) .top-message__vtext,
  html:lang(en) .top-message__vtext { font-size: 20px; }
  html:lang(ko) .top-message__vtext--small,
  html:lang(en) .top-message__vtext--small { font-size: 14px; }
  html:lang(ko) .top-message__vtext--aim,
  html:lang(en) .top-message__vtext--aim { font-size: 18px; }
}

/* 予防のページの「歯のクリーニングとは」（PC は縦書き）: 英語は文字が横倒しになり、長い見出しが下の本文に重なった（2026-11-25、画面で確認）。
   英語の PC だけ、本文と同じ左の列の上部に横書きで置く。韓国語は縦書きのまま収まる。SP は日本語でも横書き。 */
@media (min-width:1024px) {
  html:lang(en) .prevent-about__title {
    left: 36.39px;
    top: 120px;
    width: 300px; /* 右の飾りの枠線（縦の線）より左に収める */
    writing-mode: horizontal-tb;
    white-space: normal !important;
    line-height: 1.5;
    letter-spacing: .04em;
  }
}

/* 料金のカード（医療費控除・費用、PC はマウスを乗せると説明文が出る）: 説明文はカードの中の固定の位置にあり、カードからはみ出した分は切り取られる。
   英語の長い説明文は下が切れていた（2026-11-25、文どうしの重なりの確認で見つけた）。韓国語・英語の PC では行間と字間を詰めて収める。 */
@media (min-width:1024px) {
  html:lang(ko) .common-price__card-body,
  html:lang(en) .common-price__card-body {
    font-size: 15px;
    line-height: 1.75;
    letter-spacing: .04em;
  }
}

/* TOP の医院概要の表（2026-11-25、「箱からはみ出す」の判定と画面で見つけた）。項目名の下線は1行目の上端からの位置で引いていて、訳で項目名が2行になると
   （英語の Clinic Name・Treatments Offered）行の間に線が入った。下端からの位置に直す（1行のときの位置は日本語と同じ。PC は高さ48px・線は46px、SP は高さ26px・線は31px）。
   SP の英語は項目名の列 72px に「Treatments」が収まらず 7px はみ出して内容に寄っていたので、英語の SP だけ列を 84px にする。 */
html:lang(ko) .top-medical__term-text::after,
html:lang(en) .top-medical__term-text::after {
  top: auto;
  bottom: 1px;
}
@media (max-width:1023px) {
  html:lang(ko) .top-medical__term-text::after,
  html:lang(en) .top-medical__term-text::after {
    bottom: -6px;
  }
  html:lang(en) .top-medical__row {
    grid-template-columns: 84px minmax(0, 1fr);
  }
}

/* 幹細胞培養上清液の「とは」の見出し（2026-11-25、美容の担当が画面で見つけた）: 見出しと注記（（正確なご説明））は別の編集項目で、間に空白がない。
   英語では「Supernatant?(An Accurate Explanation)」と詰まって見えるので、注記の前に空白を出す（行頭に来たときは空白はつぶれる）。 */
html:lang(en) .stemcell-about__title-note::before {
  content: "\0020";
}
