/* ==========================================================================
   theme.css — loaded after the preview's stylesheets.
   The preview's CSS files are used unchanged. This file only adds:
   1. small styles for the client's revisions (TSURUMARU_Web修正依頼書.pdf),
   2. pages the preview does not have (お問い合わせフォーム, プライバシーポリシー,
      サイトマップ, お知らせ記事),
   3. compatibility with the existing site's builder pages (お悩み別ページ).
   ========================================================================== */

/* ---------- Top: 1日3組限定 line in the main image's copy ---------- */
.homepage-page .catchphrase .ts-hero-offer {
  font-size: 16px;
  letter-spacing: 2px;
  text-orientation: upright;
}
@media (max-width: 768px) {
  .homepage-page .catchphrase .ts-hero-offer {
    font-size: .72em;
    letter-spacing: .02em;
    text-orientation: mixed;
  }
}

/* ---------- Top: 料金の目安 ---------- */
.price-table a.badge { text-decoration: none; transition: filter .2s ease; }
.price-table a.badge:hover { filter: brightness(.95); text-decoration: underline; }
.price-table td:last-child .badge { line-height: 1.6; }
.price-table .ts-row-offer .desc-cell { line-height: 1.8; }
.ts-offer-label { color: #d88100; font-weight: 700; }
.ts-offer-price {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #d88100;
  line-height: 1.5;
}

.ts-nowrap { white-space: nowrap; }
.ts-cell .badge { display: inline-block; }
@media (max-width: 768px) {
  /* Phone card layout (responsive.css): keep each cell's content as one block beside its label. */
  td > .ts-cell { display: block; text-align: right; }
  .price-table .ts-offer-price { font-size: 15px; }
}

/* ---------- 院長の写真: portrait photo in the landscape frame, keep the face in view ---------- */
.director-img-box img { object-position: center 18%; }

/* ---------- 院長名の資格 ---------- */
.ts-quals { font-size: .6em; font-weight: 500; letter-spacing: .02em; }

/* ---------- Footer: map of the new address + 駐車場14台完備 ---------- */
.ts-map-col { min-width: 0; }
.ts-map-note {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #3e663b;
}

/* 施術受付時間: on phones 午前 / 午後 sits above the time so the narrow column is not cut off. */
.ts-sp-br { display: none; }
@media (max-width: 768px) {
  .ts-sp-br { display: inline; }
  .hours-table td.time-col,
  .schedule-table td.time-slot { line-height: 1.35; }
}

/* ---------- 院内設備: 酸素ルームの利用料金（PDF） ---------- */
.ts-pdf-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #3e663b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 料金表: the client's tables (4–5 columns) in the preview's table design ---------- */
.ts-price-cols th:nth-child(n) { width: auto; }
.ts-price-cols--4 th:first-child { width: 34%; }
.ts-price-cols--5 th:first-child { width: 26%; }
.ts-price-cols--3 th:first-child { width: 42%; }
.ts-price-cols td { text-align: center; }
.ts-price-cols td:first-child { text-align: left; }
.ts-price-lead { margin: -8px 0 16px; text-align: center; }
.ts-price-first .price-value { color: #d88100; }
.ts-price-first + .price-note,
.traffic-table-card + .price-note { margin-top: 14px; }
#insurance, #first-visit, #self-pay, #option, #membership { scroll-margin-top: 110px; }

/* ---------- お問い合わせフォーム（一般のお問い合わせ用） ---------- */
.ts-form-section { background: #f7f3e9; padding: 90px 24px 100px; }
.ts-form-container { max-width: 760px; margin: 0 auto; }
.ts-form-header { text-align: center; margin-bottom: 36px; }
.ts-form-sub-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: #f09600; letter-spacing: .12em;
}
.ts-form-sub-tag::before { content: ""; width: 7px; height: 7px; background: #f09600; border-radius: 1px; }
.ts-form-title { margin: 8px 0 0; font-family: "Noto Serif JP", serif; font-size: 30px; font-weight: 600; color: #222; letter-spacing: .06em; }
.ts-form-lead { margin: 16px 0 0; font-size: 15px; line-height: 1.9; color: #555; }

.ts-contact-form { background: #fff; border-radius: 20px; padding: 40px 44px; box-shadow: 0 6px 24px rgba(0,0,0,.04); }
.ts-field { margin-bottom: 22px; }
.ts-field label { display: block; font-size: 15px; font-weight: 700; color: #333; margin-bottom: 8px; }
.ts-field input[type="text"],
.ts-field input[type="email"],
.ts-field input[type="tel"],
.ts-field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 13px 16px;
  border: 1px solid #ded7c8;
  border-radius: 10px;
  background: #fcfbf8;
  color: #333;
}
.ts-field input:focus,
.ts-field textarea:focus { outline: 2px solid rgba(240,150,0,.45); border-color: #f09600; background: #fff; }
.ts-required {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #fff; background: #e08b00; padding: 2px 8px; border-radius: 4px; vertical-align: 2px;
}
.ts-field--check label { font-weight: 500; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-field--check input { width: 18px; height: 18px; accent-color: #f09600; }
.ts-field--check a { color: #3e663b; }
.ts-form-note { font-size: 13px; color: #777; margin: 0 0 22px; }
.ts-form-submit { text-align: center; }
.ts-form-submit .btn-pill { display: inline-flex; width: auto; min-width: 280px; gap: 16px; border: 0; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; }
.ts-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ts-form-notice { border-radius: 14px; padding: 22px 26px; margin-bottom: 24px; font-size: 15px; line-height: 1.8; }
.ts-form-notice p { margin: 0; }
.ts-form-notice p + p { margin-top: 6px; }
.ts-form-notice.is-success { background: #eef5ec; border: 1px solid #b9d3b4; color: #2f4d2c; }
.ts-form-notice.is-error { background: #fff4e5; border: 1px solid #f3c27a; color: #7a4a00; }


/* ---------- Text pages (privacy, sitemap, news article) ---------- */
.ts-text-page .info-card { text-align: left; }
.ts-prose { font-size: 15px; line-height: 1.95; color: #444; }
.ts-prose h2 { font-size: 19px; font-weight: 700; color: #333; margin: 34px 0 10px; padding-left: 12px; border-left: 4px solid #f09600; line-height: 1.5; }
.ts-prose h2:first-child { margin-top: 0; }
.ts-prose p { margin: 0 0 14px; }
.ts-prose a { color: #3e663b; }
.ts-prose ul { margin: 0 0 14px; padding-left: 1.4em; }
.ts-sitemap li { margin: 4px 0; }
.ts-article__meta { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #888; margin: 0 0 8px; }
.ts-article__title { border-left: 0 !important; padding-left: 0 !important; font-size: 24px !important; margin: 0 0 24px !important; }
.ts-article__thumb img { width: 100%; height: auto; border-radius: 12px; margin-bottom: 20px; }
.ts-pagination { margin-top: 30px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ts-pagination .page-numbers { display: inline-block; min-width: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid #ded7c8; text-align: center; text-decoration: none; color: #444; }
.ts-pagination .current { background: #f09600; border-color: #f09600; color: #fff; }
.ts-empty { padding: 30px 0; color: #777; }
.page-news-single .page-cta,
.ts-text-page .page-cta { text-align: center; margin-top: 30px; }
.page-news-single .page-cta .btn-pill { display: inline-flex; width: auto; gap: 16px; }


/* ---------- Touch targets on phones (no visual change) ---------- */
@media (max-width: 1023px) {
  .pagination-dots .dot { position: relative; }
  .pagination-dots .dot::after { content: ""; position: absolute; inset: -14px; }
  .ts-sitemap li { margin: 0; }
  .ts-sitemap a { display: inline-block; padding: 10px 0; }
  .ts-field--check a { display: inline-block; padding: 8px 0; }
}
@media (max-width: 768px) {
  .ts-contact-form { padding: 26px 18px; border-radius: 14px; }
  .ts-form-section { padding: 60px 16px 70px; }
  .ts-form-title { font-size: 24px; }
}

/* ---------- Pages with no photo banner under the header ----------
   The header stays transparent with white links until the page scrolls (header-scroll.css),
   which suits the pages that open on a photo. The 404 page and the builder pages open on a
   light background, where the menu and address were unreadable, so they use the scrolled
   (white) header from the start. */
.page-error404 .site-header,
.ts-builder-page .site-header {
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(18px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
  border-bottom: 1px solid rgba(0, 0, 0, .07) !important;
  box-shadow: 0 2px 18px rgba(0, 0, 0, .06) !important;
}
.page-error404 .site-header .nav-item,
.ts-builder-page .site-header .nav-item { color: #2f4d2c !important; text-shadow: none !important; }
.page-error404 .site-header .nav-item:hover,
.page-error404 .site-header .nav-item.is-current,
.ts-builder-page .site-header .nav-item:hover,
.ts-builder-page .site-header .nav-item.is-current { color: #a86400 !important; }
.page-error404 .site-header .address-text,
.ts-builder-page .site-header .address-text { color: #4a6b47 !important; text-shadow: none !important; }
.page-error404 .site-header .dropdown-icon,
.ts-builder-page .site-header .dropdown-icon { background-color: #3e663b !important; }
.page-error404 .site-header .dropdown-icon svg,
.ts-builder-page .site-header .dropdown-icon svg { stroke: #fff !important; }
/* 404: error404.css clears the fixed header with 190px, but the shared section rhythm
   (enhance.css, 1025px and up) cut it to 80px and the 「404」 sat under the header. */
@media (min-width: 1025px) {
  .page-error404 main > .error-section { padding-top: 190px !important; }
}

/* ---------- Builder pages (お悩み別ページ and any other Elementor page) ----------
   These pages were built with Elementor / JetEngine under the Astra theme and rely on
   Astra's base styles: green headings on Astra's type scale, 1.8 line height, no default
   margins, 24px spacing between blocks, and the block-editor colour classes of Astra's
   palette. Recreated here for those pages only (body.ts-builder-page); the theme's own
   pages are not affected. Elementor's per-element styles are more specific and still win.
   The palette variables are printed by functions.php. */
.ts-builder-page .elementor { line-height: 1.8; }
.ts-builder-page .elementor h1,
.ts-builder-page .elementor h2,
.ts-builder-page .elementor h3,
.ts-builder-page .elementor h4,
.ts-builder-page .elementor h5,
.ts-builder-page .elementor h6,
.ts-builder-page .elementor p,
.ts-builder-page .elementor blockquote,
.ts-builder-page .elementor figure {
  margin-top: 0;
  margin-bottom: 0;
}
.ts-builder-page .elementor h1,
.ts-builder-page .elementor h2,
.ts-builder-page .elementor h3,
.ts-builder-page .elementor h4,
.ts-builder-page .elementor h5,
.ts-builder-page .elementor h6 {
  color: var(--ast-global-color-2);
}
.ts-builder-page .elementor h1:not(.elementor-heading-title) { font-size: 4rem; font-weight: 500; line-height: 1.4em; }
.ts-builder-page .elementor h2:not(.elementor-heading-title) { font-size: 3rem; font-weight: 500; line-height: 1.3em; }
.ts-builder-page .elementor h3:not(.elementor-heading-title) { font-size: 1.5rem; font-weight: 400; line-height: 1.5em; }
.ts-builder-page .elementor h4:not(.elementor-heading-title) { font-size: 1.25rem; font-weight: 400; line-height: 1.5em; }
.ts-builder-page .elementor h5:not(.elementor-heading-title) { font-size: 1.125rem; font-weight: 400; line-height: 1.2em; }
.ts-builder-page .elementor h6:not(.elementor-heading-title) { font-size: 1rem; font-weight: 400; line-height: 1.25em; }
.ts-builder-page .elementor-widget-heading h1.elementor-heading-title { line-height: 1.4em; }
.ts-builder-page .elementor-widget-heading h2.elementor-heading-title { line-height: 1.3em; }
.ts-builder-page .elementor-widget-heading h3.elementor-heading-title { line-height: 1.5em; }
.ts-builder-page .elementor-widget-heading h4.elementor-heading-title { line-height: 1.5em; }
.ts-builder-page .elementor-widget-heading h5.elementor-heading-title { line-height: 1.2em; }
.ts-builder-page .elementor-widget-heading h6.elementor-heading-title { line-height: 1.25em; }
.ts-builder-page .elementor .is-layout-flow > *,
.ts-builder-page .elementor .is-layout-constrained > * {
  margin-block-start: 24px;
  margin-block-end: 0;
}
.ts-builder-page .elementor .is-layout-flow > :first-child,
.ts-builder-page .elementor .is-layout-constrained > :first-child { margin-block-start: 0; }
.ts-builder-page .elementor .is-layout-flow > :last-child,
.ts-builder-page .elementor .is-layout-constrained > :last-child { margin-block-end: 0; }
@media (max-width: 921px) {
  .ts-builder-page .elementor h1:not(.elementor-heading-title) { font-size: 1.875rem; }
  .ts-builder-page .elementor h2:not(.elementor-heading-title) { font-size: 1.5625rem; }
  .ts-builder-page .elementor h3:not(.elementor-heading-title) { font-size: 1.25rem; }
}
.has-ast-global-color-0-color { color: var(--wp--preset--color--ast-global-color-0) !important; }
.has-ast-global-color-1-color { color: var(--wp--preset--color--ast-global-color-1) !important; }
.has-ast-global-color-2-color { color: var(--wp--preset--color--ast-global-color-2) !important; }
.has-ast-global-color-3-color { color: var(--wp--preset--color--ast-global-color-3) !important; }
.has-ast-global-color-4-color { color: var(--wp--preset--color--ast-global-color-4) !important; }
.has-ast-global-color-5-color { color: var(--wp--preset--color--ast-global-color-5) !important; }
.has-ast-global-color-6-color { color: var(--wp--preset--color--ast-global-color-6) !important; }
.has-ast-global-color-7-color { color: var(--wp--preset--color--ast-global-color-7) !important; }
.has-ast-global-color-8-color { color: var(--wp--preset--color--ast-global-color-8) !important; }
.has-ast-global-color-0-background-color { background-color: var(--wp--preset--color--ast-global-color-0) !important; }
.has-ast-global-color-1-background-color { background-color: var(--wp--preset--color--ast-global-color-1) !important; }
.has-ast-global-color-2-background-color { background-color: var(--wp--preset--color--ast-global-color-2) !important; }
.has-ast-global-color-3-background-color { background-color: var(--wp--preset--color--ast-global-color-3) !important; }
.has-ast-global-color-4-background-color { background-color: var(--wp--preset--color--ast-global-color-4) !important; }
.has-ast-global-color-5-background-color { background-color: var(--wp--preset--color--ast-global-color-5) !important; }
.has-ast-global-color-6-background-color { background-color: var(--wp--preset--color--ast-global-color-6) !important; }
.has-ast-global-color-7-background-color { background-color: var(--wp--preset--color--ast-global-color-7) !important; }
.has-ast-global-color-8-background-color { background-color: var(--wp--preset--color--ast-global-color-8) !important; }
.has-ast-global-color-0-border-color { border-color: var(--wp--preset--color--ast-global-color-0) !important; }
.has-ast-global-color-1-border-color { border-color: var(--wp--preset--color--ast-global-color-1) !important; }
.has-ast-global-color-2-border-color { border-color: var(--wp--preset--color--ast-global-color-2) !important; }
.has-ast-global-color-3-border-color { border-color: var(--wp--preset--color--ast-global-color-3) !important; }
.has-ast-global-color-4-border-color { border-color: var(--wp--preset--color--ast-global-color-4) !important; }
.has-ast-global-color-5-border-color { border-color: var(--wp--preset--color--ast-global-color-5) !important; }
.has-ast-global-color-6-border-color { border-color: var(--wp--preset--color--ast-global-color-6) !important; }
.has-ast-global-color-7-border-color { border-color: var(--wp--preset--color--ast-global-color-7) !important; }
.has-ast-global-color-8-border-color { border-color: var(--wp--preset--color--ast-global-color-8) !important; }

/* ==========================================================================
   Clinic photos (images/clinic/, supplied by the clinic)
   ========================================================================== */

/* ---------- Top page main visual ----------
   The clinic's key visual is light on the left (sky, mist) where the white catch copy sits,
   so a soft shade goes behind the copy; on phones the copy sits at the bottom and the crop
   centres on the director. */
.homepage-page .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .4) 0, rgba(0, 0, 0, .14) 13%, rgba(0, 0, 0, 0) 26%),
    linear-gradient(90deg, rgba(16, 38, 22, .52) 0, rgba(16, 38, 22, .24) 24%, rgba(16, 38, 22, 0) 44%);
}
/* The logo sits on the photo (the leaves of the key visual, the page banners) until the header
   turns white on scroll: a soft white halo keeps it legible on any photo. */
.site-header:not(.is-scrolled):not(.is-stuck) .brand-logo__img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .95)) drop-shadow(0 0 7px rgba(255, 255, 255, .8));
}
@media (max-width: 992px) {
  .homepage-page .hero::before {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, 0) 16%),
      linear-gradient(0deg, rgba(12, 30, 16, .66) 0, rgba(12, 30, 16, .4) 36%, rgba(12, 30, 16, 0) 62%);
  }
  .hero .hero-image,
  .homepage-page .hero-image {
    object-position: 76% 30% !important;
  }
}

/* ---------- Page banners: photo per page (wide on PC, a closer crop on phones) ---------- */
.page-content-page .hero-banner { background-image: url("../../images/clinic/banner-news.webp"); }
.page-aboutus .hero-banner { background-image: url("../../images/clinic/banner-aboutus.webp"); }
.page-facility .hero-banner { background-image: url("../../images/clinic/banner-facility.webp"); }
.page-firstvisit .hero-banner { background-image: url("../../images/clinic/banner-firstvisit.webp"); }
.page-faq .hero-banner { background-image: url("../../images/clinic/banner-faq.webp"); }
.page-news .hero-banner { background-image: url("../../images/clinic/banner-news.webp"); }
.page-contactus .hero-banner { background-image: url("../../images/clinic/banner-contactus.webp"); }
.page-pricelist .hero-banner { background-image: url("../../images/clinic/banner-pricelist.webp"); }
.page-orthopedic .hero-banner { background-image: url("../../images/clinic/banner-orthopedic.webp"); }
.page-trafficaccident .hero-banner { background-image: url("../../images/clinic/banner-trafficaccident.webp"); }
.page-homecare .hero-banner { background-image: url("../../images/clinic/banner-homevisit.webp"); }
.page-beauty .hero-banner { background-image: url("../../images/clinic/banner-beauty.webp"); }
.page-training .hero-banner { background-image: url("../../images/clinic/banner-training.webp"); }
@media (max-width: 600px) {
  .page-content-page .hero-banner { background-image: url("../../images/clinic/banner-news-sp.webp"); }
  .page-aboutus .hero-banner { background-image: url("../../images/clinic/banner-aboutus-sp.webp"); }
  .page-facility .hero-banner { background-image: url("../../images/clinic/banner-facility-sp.webp"); }
  .page-firstvisit .hero-banner { background-image: url("../../images/clinic/banner-firstvisit-sp.webp"); }
  .page-faq .hero-banner { background-image: url("../../images/clinic/banner-faq-sp.webp"); }
  .page-news .hero-banner { background-image: url("../../images/clinic/banner-news-sp.webp"); }
  .page-contactus .hero-banner { background-image: url("../../images/clinic/banner-contactus-sp.webp"); }
  .page-pricelist .hero-banner { background-image: url("../../images/clinic/banner-pricelist-sp.webp"); }
  .page-orthopedic .hero-banner { background-image: url("../../images/clinic/banner-orthopedic-sp.webp"); }
  .page-trafficaccident .hero-banner { background-image: url("../../images/clinic/banner-trafficaccident-sp.webp"); }
  .page-homecare .hero-banner { background-image: url("../../images/clinic/banner-homevisit-sp.webp"); }
  .page-beauty .hero-banner { background-image: url("../../images/clinic/banner-beauty-sp.webp"); }
  .page-training .hero-banner { background-image: url("../../images/clinic/banner-training-sp.webp"); }
}

/* ---------- Banner legibility over the clinic's photos ----------
   The preview's stock photos were airy; the clinic's photos are full of detail behind the
   title and the white menu. A soft light veil sits behind the title (left on PC, centre where
   the title is centred) and a light shade in the top-right corner behind the white menu. */
.hero-banner::before,
.page-content-page .hero-banner::after {
  background:
    linear-gradient(205deg, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, .16) 18%, rgba(0, 0, 0, 0) 34%),
    linear-gradient(90deg, rgba(250, 248, 244, .9) 0%, rgba(250, 248, 244, .72) 30%, rgba(250, 248, 244, .22) 58%, rgba(250, 248, 244, 0) 80%) !important;
}
@media (max-width: 992px) {
  .hero-banner::before,
  .page-content-page .hero-banner::after {
    background: radial-gradient(ellipse 95% 72% at 50% 60%, rgba(250, 248, 244, .82) 0%, rgba(250, 248, 244, .56) 48%, rgba(250, 248, 244, .2) 100%) !important;
  }
}
/* The two long English titles ran past the edge of a phone screen. */
@media (max-width: 600px) {
  .page-beauty .hero-banner .banner-title-en,
  .page-trafficaccident .hero-banner .banner-title-en {
    font-size: min(33px, 6.6vw) !important;
  }
}

/* 769–992px: the phone layout of the top-page hero (copy along the bottom) applies, but the copy
   stayed vertical and, with four lines, ran up past the top of the photo under the header.
   Set it horizontally there too, as on phones. */
@media (min-width: 769px) and (max-width: 992px) {
  .homepage-page .catchphrase {
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    position: absolute !important;
    z-index: 2 !important;
    top: auto !important;
    bottom: 76px !important;
    left: 40px !important;
    right: 40px !important;
    max-width: 640px !important;
    margin: 0 !important;
    font-size: 22px !important;
    line-height: 1.75 !important;
    letter-spacing: .06em !important;
  }
  .homepage-page .location-badge {
    left: 40px !important;
    right: 40px !important;
    bottom: 28px !important;
    text-align: left !important;
  }
}

/* ---------- 特殊機器: a machine without its photo yet is shown as a text card ----------
   (no empty picture frames). Once its photo is set in the Customizer it gets the photo circle. */
.facility-item--noimg {
  justify-content: flex-start;
  padding: 30px 20px 26px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(80, 60, 20, .07);
}
.facility-item-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #fbf2e3;
  color: #e28e00;
  box-shadow: 4px 0 0 #e28e00;
}
.facility-item-icon svg { width: 30px; height: 30px; }
.facility-item--noimg .facility-item-text { max-width: none; }
/* Every item a text card: four to a row on PC, the last row centred. */
.facility-grid:not(:has(> .facility-item:not(.facility-item--noimg))) {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px !important;
}
.facility-grid:not(:has(> .facility-item:not(.facility-item--noimg))) > .facility-item {
  flex: 0 1 calc((100% - 72px) / 4 - 1px);
}
@media (max-width: 868px) {
  .facility-grid:not(:has(> .facility-item:not(.facility-item--noimg))) > .facility-item {
    flex-basis: calc((100% - 48px) / 3 - 1px);
  }
}
/* Phones: one list, icon on the left. */
@media (max-width: 600px) {
  .facility-grid:not(:has(> .facility-item:not(.facility-item--noimg))) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .facility-item--noimg {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    text-align: left !important;
    padding: 18px 18px 18px 16px !important;
    border-radius: 16px;
  }
  .facility-item--noimg > :not(.facility-item-icon) { grid-column: 2; }
  .facility-item--noimg .facility-item-icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
    margin: 0;
  }
  .facility-item--noimg .facility-item-icon svg { width: 26px; height: 26px; }
  .facility-item--noimg .facility-item-title { font-size: 16px !important; margin: 3px 0 6px !important; }
  .facility-item--noimg .dotted-accent { margin: 0 0 8px !important; }
  .facility-item--noimg .facility-item-text { font-size: 14px !important; line-height: 1.75 !important; }
}
/* 院内設備 (four photos): one row of four on PC instead of three plus one left on its own. */
@media (min-width: 869px) {
  .facility-grid:has(> .facility-item:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 50px 24px !important;
  }
  .facility-grid:has(> .facility-item:nth-child(4):last-child) .facility-image-wrapper {
    width: 196px;
    height: 196px;
  }
  .facility-grid:has(> .facility-item:nth-child(4):last-child) .facility-image-wrapper::before {
    width: 187px;
    height: 196px;
    left: 9px;
  }
  .facility-grid:has(> .facility-item:nth-child(4):last-child) .facility-image-wrapper img {
    width: 191px;
    height: 196px;
  }
}
/* Tablets: the facility photos two to a row (the phone rules stack every grid in one column up to 992px). */
@media (min-width: 601px) and (max-width: 992px) {
  .page-facility .facility-grid:has(> .facility-item .facility-image-wrapper) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 44px 24px !important;
  }
}

/* PC top page: the vertical copy sits in the photo below the header, and gets smaller on shorter
   screens (laptop windows of about 600–770px) instead of running up over the logo. */
@media (min-width: 993px) {
  .homepage-page .catchphrase {
    align-self: center;
    margin-top: calc(var(--site-header-height, 98px) + 16px) !important;
    margin-bottom: 40px !important;
    font-size: min(24px, calc((max(100svh, 560px) - var(--site-header-height, 98px) - 56px) / 24.5)) !important;
    letter-spacing: .1667em !important;
  }
  .homepage-page .catchphrase .ts-hero-offer {
    font-size: .6667em;
    letter-spacing: .125em;
  }
}
/* Phones / tablets (copy set horizontally): the top copy breaks between phrases, not mid-word. */
@media (max-width: 992px) {
  .homepage-page .catchphrase .ts-phrase { display: inline-block; }
}

/* 特殊機器 (7 machines) with photos: four to a row on PC and three on tablets, the last row
   centred; two to a row on phones with smaller circles. */
.facility-grid:has(> .facility-item:nth-child(7)):has(> .facility-item:not(.facility-item--noimg)) {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px 24px !important;
}
.facility-grid:has(> .facility-item:nth-child(7)):has(> .facility-item:not(.facility-item--noimg)) > .facility-item {
  flex: 0 1 calc((100% - 72px) / 4 - 1px);
}
@media (min-width: 869px) {
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-image-wrapper {
    width: 196px;
    height: 196px;
  }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-image-wrapper::before {
    width: 187px;
    height: 196px;
    left: 9px;
  }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-image-wrapper img {
    width: 191px;
    height: 196px;
  }
}
@media (max-width: 992px) {
  .facility-grid:has(> .facility-item:nth-child(7)):has(> .facility-item:not(.facility-item--noimg)) > .facility-item {
    flex-basis: calc((100% - 48px) / 3 - 1px);
  }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-image-wrapper {
    width: min(190px, 100%) !important;
  }
}
@media (max-width: 600px) {
  .facility-grid:has(> .facility-item:nth-child(7)):has(> .facility-item:not(.facility-item--noimg)) {
    gap: 36px 14px !important;
  }
  .facility-grid:has(> .facility-item:nth-child(7)):has(> .facility-item:not(.facility-item--noimg)) > .facility-item {
    flex-basis: calc((100% - 14px) / 2 - 1px);
  }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-image-wrapper {
    width: min(150px, 100%) !important;
    margin-bottom: 16px !important;
  }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-item-title { font-size: 15px !important; }
  .facility-grid:has(> .facility-item:nth-child(7)) .facility-item-text { font-size: 13px !important; line-height: 1.7 !important; }
}

/* 美容鍼灸: the booking button's long label wraps (before 「（ホットペッパービューティー）」)
   instead of running off the screen on phones. */
.page-beauty .page-cta .btn-pill { max-width: 100%; gap: 12px; }
.page-beauty .page-cta .btn-pill .btn-label {
  white-space: normal !important;
  word-break: normal !important;
  flex: 1 1 auto !important;
  line-height: 1.5 !important;
  text-align: left;
}
.page-beauty .page-cta .btn-label .ts-nowrap { white-space: nowrap !important; }
.page-beauty .page-cta .btn-pill > :last-child { flex-shrink: 0 !important; }
@media (max-width: 768px) {
  .page-beauty .page-cta .btn-pill {
    font-size: 14px !important;
    padding: 10px 8px 10px 20px !important;
  }
}

/* PC top page: the main image has a band above the photo (hero-keyvisual-pc.webp), so the header's
   menu and address sit above the director's face; keep the photo's upper part in view. */
@media (min-width: 993px) {
  .homepage-page .hero-image { object-position: 50% 30%; }
}
