/* スマホ幅の文字サイズ上書き＋フッターの会社情報リンク。 */
.footer-meta .footer-links {
  display:flex;
  gap:20px;
  align-items:center;
}
.footer-meta .footer-links a {
  color:inherit;
  font-size:12px;
  letter-spacing:.06em;
  text-decoration:underline;
  text-underline-offset:4px;
  min-height:44px;
  display:inline-flex;
  align-items:center;
}
.footer-meta .footer-links a:focus-visible {
  outline:3px solid var(--ice);
  outline-offset:5px;
}
.contact-form__link {
  display:inline-flex;
  align-items:center;
  gap:12px;
  min-height:48px;
  padding:12px 24px;
  margin:4px 0 22px;
  border:0;
  border-radius:24px;
  background:var(--ice);
  color:var(--navy);
  text-decoration:none;
  font-size:15px;
  font-weight:700;
}
.contact-form__link > span {
  font-size:18px;
}
.contact-form__link:hover {
  background:#fff;
}
.contact-mail > .contact-form__link:focus-visible {
  outline:3px solid var(--ice);
  outline-offset:4px;
}
.contact-mail > .contact-mail__or {
  margin:0 0 8px;
  font-size:13px;
  color:var(--ice);
  opacity:.8;
}
@media (min-width:760.02px) and (max-width:1040px) {
  /* この幅ではリンクを横1行に足すと既存の「WAKAYAMA, JAPAN」・©・「ページの先頭へ」が詰まって折れる
     （900px 幅で実測）。行には入れず、ロゴの下の余白へ置いて、既存の並びとフッターの高さを変えない。 */
  /* 既存 CSS が .footer-meta を position:relative にするのは html.consultation-motion-ready の時だけ。
     動きを減らす設定・JS 無効・映像の読み込み前でもリンクがフッター内に留まるよう、ここで基準にする。 */
  .footer-meta {
    position:relative;
  }
  .footer-meta .footer-links {
    position:absolute;
    left:3.5vw;
    bottom:8px;
    gap:18px;
  }
  .footer-meta .footer-links a {
    min-height:28px;
  }
}
@media (min-width:760.02px) and (max-width:829.98px) and (max-height:600px) {
  /* 高さ 600px 以下では既存 CSS がフッターの上下余白を 18px に詰めるので、その分だけ下げる。 */
  .footer-meta .footer-links {
    bottom:2px;
  }
}
@media (min-width:829.99px) and (max-width:1040px) and (max-height:600px) {
  /* 高さ 600px 以下では既存 CSS がロゴと間隔を小さくするので、830px 以上なら横1行に収まる
     （844×390 で実測）。行の中へ戻す。 */
  .footer-meta .footer-links {
    position:static;
    gap:20px;
  }
  .footer-meta .footer-links a {
    min-height:44px;
  }
}
@media (max-width:760px) {
  @media (max-width:560px) {
    /* 縦持ちの狭い幅だけ: ロゴの行 / リンクの行 / ©と「ページの先頭へ」の行、の順に並べる。
       これより広い幅（横向きのスマホなど）ではリンクを独立の行にしない。フッターが高くなると、
       低い画面で締めの一文とフッターの間隔が 20px を割る（local-balance の検査条件）。 */
    body .footer-meta .footer-links {
      flex-basis:100%;
      order:1;
    }
    body .footer-meta > .copyright,
    body .footer-meta > .footer-top {
      order:2;
    }
  }
  /* Body copy. The extra context also beats the short-height hero rule. */
  body .opening .opening-copy .lede,
  body .services .service-text > p:not(.eyebrow),
  body .pricing-grid > div > p,
  body .contact-grid > div > p,
  body .partner-copy > p,
  body .strengths p strong,
  body .proof-fact p,
  body .proof-orbit .orbit-intro,
  body .consult-heading > p,
  body .contact-mail > p,
  body .contact-steps li,
  body .pricing tbody th,
  body .round-link {
    font-size:14px;
  }

  body .contact-mail > .contact-form__link {
    font-size:14px;
  }
  body .contact-mail > .contact-mail__or {
    font-size:12px;
  }

  body .partner-copy > .partner-promise,
  body .service-foot,
  body .service-foot a,
  body .closing small,
  body .pricing td.private-price {
    font-size:13px;
  }

  /* Explicit hero/service context beats their narrower existing selectors. */
  body .eyebrow,
  body .opening .eyebrow,
  body .service-text > .eyebrow,
  body .header .header-cta,
  body .opening-services a,
  body .contact-cta small,
  body .partner-grid figcaption span,
  body .orbit-foot p,
  body .proof__note,
  body .pricing td,
  body .pricing th small,
  body .price-note,
  body .scroll-hint > span:first-child {
    font-size:12px;
  }

  body .opening .room-credit,
  body .section-top > span,
  body .section-top > span a,
  body .header .motion,
  body .header .motion [data-motion-label],
  body .footer-meta > span,
  body .opening-index,
  body .orbit-foot small,
  body .agent-intro-photo figcaption,
  body .consult-photo figcaption,
  body .pricing td small,
  body .pricing thead th,
  body .opening-services a span,
  body .partner .strengths p span,
  body .service-art .art-tag,
  body .service-art.development-art i {
    font-size:11px;
  }

  body main p,
  body footer p,
  body .section-top > span {
    word-break:auto-phrase;
    text-wrap:pretty;
  }
  body .opening .lede,
  body .consult-heading > p,
  body .partner-copy > p,
  body .pricing-grid > div > p,
  body .contact-grid > div > p,
  body main h2,
  body footer h2,
  body main h3 {
    word-break:auto-phrase;
    text-wrap:balance;
  }

  /* The photo ends 14% above the stage bottom; the overlaid service row
     reaches 7% + 44px. Place the credit 6px inside the visible photo,
     with a paper-colored background for readability. */
  body .opening .room-credit {
    bottom:calc(max(14%, 7% + 44px) + 6px);
    right:8px;
    left:auto;
    max-width:none;
    padding:3px 8px;
    background:rgba(251,250,248,.9);
    border-radius:2px;
    white-space:nowrap;
  }

  body .opening-services a,
  body .service-foot a,
  body .section-top > span a {
    align-items:center;
    min-height:44px;
  }
  body .opening-services a,
  body .section-top > span a {
    display:inline-flex;
  }
  body .service-foot a {
    display:flex;
  }

  /* Let the six-character label determine the button's width. */
  body .header .motion {
    width:auto;
  }
  body .header .motion [data-motion-label] {
    max-width:none;
  }

  /* Long section notes may wrap instead of widening the page. */
  body .section-top {
    flex-wrap:wrap;
  }
  body .section-top > span {
    min-width:0;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  @media (max-width:360px) {
    /* The existing 360px rule reduces service eyebrows to 9px. */
    body .service-text > .eyebrow,
    body .opening-services a {
      font-size:12px;
    }
    body .opening-services a span,
    body .header .motion [data-motion-label] {
      font-size:11px;
    }
  }

  @media (max-height:480px) {
    /* 横向きの低い画面では相談映像が幅150px前後まで小さくなり、11px の出典は映像からはみ出す。
       ここだけ元の 8px に戻す（local-balance の「クレジットが実映像面の右下に収まる」検査の条件）。 */
    body .consult-photo figcaption {
      font-size:8px;
    }
  }

  @media (max-height:700px) {
    /* 文字を大きくした分、低い画面では見出しと本文の余白・行間を詰めて CTA が写真に重ならないようにする */
    body .opening h1 {
      margin:14px 0 9px;
    }
    body .opening .opening-copy .lede {
      line-height:1.75;
      margin-bottom:8px;
    }
  }
}
